Quantcast
Channel: Entity Framework
Viewing all articles
Browse latest Browse all 10318

Commented Issue: DisplayAttribute Name property called instead of GetName [988]

$
0
0
At line 15 of class System.Data.Entity.Utilities.ValidationContextExtensions.cs, you are using the property Name instead of calling the method GetName to get a localized string of the display name. This means that the ResourceType of the DisplayAttribute is ignored and will return the name of the resource instead of the localized resource.

Now: var displayName = displayAttribute == null ? null : displayAttribute.Name;
Should be: var displayName = displayAttribute == null ? null : displayAttribute.GetName();


Comments: Fixed in aed057e32bce by Marc Brooks committed by ajcvickers Fixed work item 988. Now calls DisplayAttribute.GetName()instead of accessing .Name property so localization works.

Viewing all articles
Browse latest Browse all 10318

Trending Articles