与早期beta(dnx)天的this question一样,我正在尝试将代码移植到.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?
答案 0 :(得分:4)
我使用非官方的Reverse Package Search来搜索新的Microsoft开源软件包中的类。
您正在寻找System.Runtime.AttributeUsageAttribute
内System.Runtime套餐。它适用于.NET Standard 1.0
及以上。
编辑:
抱歉。您问的是ValidationAttribute
,而不是AttributeUsage
,我的不好。反向包search指向System.ComponentModel.Annotations,