[英]Unable to use data annotations in .net core 1.0
就像早期beta(dnx)天的這個問題一樣,我試圖將代碼移植到.net core 1.0 rtm,代碼回復下面的單元,其中包含ValidationAttribute類型和其他內容:
using System.ComponentModel.DataAnnotations;
namespace Hl7.Fhir.Introspection
{
[AttributeUsage(AttributeTargets.Property, Inherited = false, AllowMultiple = false)]
public sealed class FhirElementAttribute : ValidationAttribute
...
如何將此類代碼移植到dotnet core 1.0 rtm?
我使用非官方的反向包搜索來搜索新的Microsoft開源包中的類。
您正在尋找System.Runtime.AttributeUsageAttribute
內System.Runtime包。 它適用於.NET Standard 1.0
及更高版本。
編輯:抱歉。 你問的是ValidationAttribute
,而不是AttributeUsage
,我的不好。 反向包搜索指向System.ComponentModel.Annotations ,
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.