Localized tables and Entity Framework
Posted
by Pyttroll
on Stack Overflow
See other posts from Stack Overflow
or by Pyttroll
Published on 2009-11-03T15:27:48Z
Indexed on
2010/06/18
9:13 UTC
Read the original article
Hit count: 308
Hi all,
I have a scenario where I need to localized values of objects in my database.
Let's say you have an application that can create animals, if the user is english the value of the "Name" property of an animal would be entered as "Cat" in the UI whereas it would be entered as "Chat" in french.
The animal culture table would contain 2 records pointing to the same animal in the parent table.
When reading values back, if the value of "Name" does not exist in the user culture the default value (value the object was originally created with) would be used. The following diagrams demonstrate how the data is stored in SQL:
I'm trying to map this schema to an object model using the Entity Framework, I'm a bit confused as to what the best way to approach the problem.
Is EF appropriate for this? Should I used EF4?
This EF model will be used by .NET RIA Services.
Thanks,
Pierre-Yves Troel
Ayuda Media Systems
© Stack Overflow or respective owner