I have the following set of tables in an existing database.
Resource - ResourceID
LocalisedResource - LocalisedResourceID, ResourceID, Language, Culture, LocalisedTerm
Office - OfficeId, NameResourceId
Now I wan to query for a particular office and get back the office's name for a particular language culture combination falling back to a default language of "EN" and culture of "GB" if no entry is found for the language and culture specified.
So, something like this...
public class Office
{
public virtual int OfficeId { get; set; }
public string Name { get; set; }
}
repository.GetOffice(5 /* id */,"zh" /* language */,"cht" /* culture */);
We also want to do it for saving too...
repository.SaveOffice(office,"zh" /* language */,"cht" /* culture */);
At the moment we are doing all of our mapping in a custom written set of stored procedures using a function to pull out the correct name. This is obviously slowing us down as we have to write a lot of SPs for all our crud code.