Skip to content

Instantly share code, notes, and snippets.

@DmitrySikorsky
Created July 13, 2019 09:15
Show Gist options
  • Save DmitrySikorsky/a7f9771ad4e444bfded74a2307ef74d3 to your computer and use it in GitHub Desktop.
Save DmitrySikorsky/a7f9771ad4e444bfded74a2307ef74d3 to your computer and use it in GitHub Desktop.
public IEnumerable<LocalizedBook> GetAll(string cultureCode)
{
return (from b in this.storage.Books
join lName in this.storage.Localizations on b.NameId equals lName.LocalizationSetId
join lDescription in this.storage.Localizations on b.DescriptionId equals lDescription.LocalizationSetId
join lAuthor in this.storage.Localizations on b.AuthorId equals lAuthor.LocalizationSetId
where lName.CultureCode == cultureCode && lDescription.CultureCode == cultureCode && lAuthor.CultureCode == cultureCode
select new LocalizedBook()
{
Id = b.Id,
Name = lName.Value,
Description = lDescription.Value,
Author = lAuthor.Value,
Year = b.Year
}).ToList();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment