MetadataTypeAttribute not available in DNX Core 5.0

I want to use the MetaDatatType attribute in an MVC6 project, and it is not yet available. I am using 7.0.0-rc1-final, so it should be the last.

Does anyone know if there is another assembly? I get an error message. MetadataType namespace type or name could not be found.

+4
source share
2 answers

After some searches, it seems this attribute is not available in MVC 6. You can use it in full DNX, but it is not available in DNX Core.

Of course, you can decorate your code with

#if DNXCORE50
...
#endif

DNX, , , . , DisplayName(Name = "...") ( , Required ..).

IMHO, Provider , , vNext. (), , .

EDIT: ModelMetadataType MetadataType. Microsoft.AspNet.Mvc.Core. , , , Microsoft.AspNet.Mvc.DataAnnotations.

, Fluent Data Annotations (Fluent MetadataProvider) . : ModelMetadata.Attributes .

+2

. Asp.NET MVC 5, Asp.Net Core 1.0 (Full Framework 4.6.1). (Framework 4.6.1), ​​dataaccess telerik. MetadataTypeAttribute - , !. - . , ?

ModelMetadataTypeAttribute MetadataTypeAttribute Microsoft.AspNetCore.Mvc.Core. ( ) Display (...), DisplayName (...), . , ( ) .

MetadataTypeAttribute buddy !

, , Microsoft Asp.Net, DLL.

PD: Microsoft.AspNetCore.Mvc.DataAnnotations

0

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


All Articles