Here is a multilang table design. Is it possible to add a method for my CategoryText model to give me the CatName for a specific langID. LangID will be chosen by the customer and set in Session variable.
EXAMPLE :I would like to get the category name like this
var a = _db.Categories.Single(a=> a.AreaTypeID == 2);
string CatName = a.CategoryTexts.GetCatName();
Languages
LangID PK
LangName nvarchar(100)
Category
CatID Pk
IsActive Bit
CategoryText
CatID FK
CatName nvarchar(200)
LangID Int
Language
LangID | LangName
1 | English
2 | French
Here is my database structure.
Category
CatID | IsActive
1 | True
2 | True
3 | True
CategoryText
CatID | CatName | LangID
1 | Car |1
1 | Auto |2
2 | Chat |2
3 | Plane | 1
3 | Avion | 2
Thanks
1 Answer