I’ve searched StackOverflow but still cannot understand the correct syntax to use Single, First (or default) queries.
I’m willing to make a query to catch first the translation in specific language. If there is no such translation on the db, get the first one in English.
Here is what I got so far:
locale = "ja-jp";
var items = from c in db.Contents.Include("Translation")
where c.RegionalInfo.Any(x => x.RegionId == locale)
select c;
Edit
Obs.: items is an IEnumerable
From your explanation, it sounds like you want the value if found, and if not found to use the english translation. Consider the following:
This finds the reocrds that match your locale and the english one and then sorts the results by the regionId placing the found english item at the end of the list and then takes the first record (if found). Note: I didn’t test this implementation, so make sure to check the orderby parameter to make sure it works as designed.