Cannot use data annotations in .net core 1.0

Like this question from the early beta days (dnx), I am trying to pass the code to .net core 1.0 rtm, and the code answers the next block that contains things like the ValidationAttribute type and other things:

using System.ComponentModel.DataAnnotations;

namespace Hl7.Fhir.Introspection
{
    [AttributeUsage(AttributeTargets.Property, Inherited = false, AllowMultiple = false)]
    public sealed class FhirElementAttribute : ValidationAttribute
    ...

How to transfer such code to dotnet 1.0 rtm core?

+4
source share
1 answer

I use unofficial Reverse Batch Search to search for classes inside new open source Microsoft packages.

You are looking System.Runtime.AttributeUsageAttributeinside the System.Runtime Package. It is available for .NET Standard 1.0and up.

EDIT: . ValidationAttribute, AttributeUsage, . search System.ComponentModel.Annotations,

+4

Source: https://habr.com/ru/post/1649198/


All Articles