DisplayAttribute.Name vs DisplayAttribute.GetName()

DisplayAttribute.Name vs DisplayAttribute.GetName()

Old forum URL: forums.lhotka.net/forums/t/9404.aspx


nelis posted on Thursday, August 19, 2010

In GetFriendlyNameFromAttributes, did you use DisplayAtribute.Name on purpose? Thereby skipping it's localization features?

RockfordLhotka replied on Saturday, August 21, 2010

That's probably a bug, I've added it to the list: http://www.lhotka.net/cslabugs/edit_bug.aspx?id=830

 

nelis replied on Tuesday, March 01, 2011

I saw this one was fixed.

However, only the first culture requesting an instance of the business object is getting the proper property labels cached in FriendlyName...

I guess PropertyInfo should keep a Func to obtain the proper value

JonnyBee replied on Wednesday, March 02, 2011

Hi,

We have discussed changing the PropertyInfo to "not" set the PropertyInfo member variable for FriendlyName when running on Server (ExecutionLocation = Server) and always read the possibly translated friendly name from DisplayAttribute, unless it was specisifed as part of RegisterProperty.

There may be performance issues when running on client (and server) as this field may be called quite often by the business rule subsystem.

 

nelis replied on Wednesday, March 02, 2011

That's the intended solution? I do not witness this in the source code of 4.1.0

JonnyBee replied on Wednesday, March 02, 2011

I didn't say that this is implemented.

It has been discussed as a possible solution, not concluded and not implemented.

Copyright (c) Marimer LLC