This project is read-only.


DisplayAttribute Name property called instead of GetName


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();
Closed Jan 21, 2014 at 7:04 PM by BriceLambson


RoMiller wrote Apr 4, 2013 at 5:23 PM

EF Team Triage: We should look at this scenario and also the other attributes to see if there are other similar things we should be doing.
Taking into account where we are in the EF6 release along with the size and the impact of this feature our team is not planning to implement it in EF6. Therefore, we are moving it to the Future release to reconsider in the next release.
This does not exclude someone from outside the EF team contributing this feature into the EF6 release.

lpperras wrote Apr 5, 2013 at 2:27 PM

When you say someone from outside the EF Team, can it be anyone forking the source code and applying the changes? I am willing to look deeper in EF for globalization in the Framework to make sure scenarios are covered with any attribute that comes from the Framework, but I want to know what are the chances that this code is integrated in EF6. This is a big show stopper for us right now. I don't want to have a custom build of EF in our app and would prefer to have the final bits.


lpperras wrote Apr 15, 2013 at 7:07 PM

Nice thanks!

ajcvickers wrote Apr 17, 2013 at 12:06 AM

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.

BriceLambson wrote Jan 20, 2014 at 8:18 PM

Fixed in changeset aed057e32bce6089b579b658a1726d15b9c498da