Is it possible to “HACK” or get EF4 to handle CultureInfo and Localization ?
public class Group
{
prop string Name ( is Lanague specific )
prop Group Prant
prop int Id
}
I need the EF4 entity framework to store the Name property witch is marked as a language property.
I also need the framework to map the name property again when retrieving the object for a specific language.
The reason for that, is that I don’t want all the Language/Culture translations to be loaded for the object.
If all translations are loaded, then it can be a huge load from the DB.
I was thinking, that the language table was per Entity, like
public class Group_language
{
prop int id
prop string language
prop string propertyname
prop string translatedValue
}
Is it posible to all of this, and how will my configuration look like ?
Any ideas are welcome.
In case of EDMX it could be probably possible to map this with query view or mapped database view (manual modification of EDMX) but you will still need original tables mapped as well and you will need stored procedures for insert, update and delete because query views are read only. You will also need to to expose language on the
Groupentity (otherwise there are not enough information for stored procedures to do insert/update/delete).It is advanced “logic” whereas build in EF mechanisms are for basic mapping without any data driven logic (except TPH inheritance and conditional mapping). Here you want single property to be mapped from another table based on some logic = you must implement it yourselves and EF will not help you too much.