I created a library targeting the .net standard 1.4. The library contains my domain model (POCOs). I want to decorate my classes with the MetadataType and the dataannotations attributes. I installed the System.ComponentModel.Annotations but the MetaDataTypeAttribute is absent. I tried to install the Microsoft.Aspnet.Mvc package but is not compatible with .net standard 1.4. Can any body tell me, how can i do to inherit the dataAnnotations defined in my interfaces in a library targeting .net standard 1.4 ? Thanks.
MetadataTypeAttribute
- along with BindableTypeAttribute
and ScaffoldTableAttribute
- is not part of any version of .NET Standard (<= 2.0) and also not available on .NET Core so you cannot currently use it in a .NET Standard project and you cannot load a .NET Framework library into .NET Core 2.0 that uses it.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.