I have a stored procedure I would like to convert to a linq expression. I've seen many EF examples but they don't seem very clean. I am curious if there is a better way of writing it using some DevForce tricks that would make it more efficient. I'd like to avoid selecting into a new object if I could but not necessary.
My entities are 1:1 to my SQL tables and I do have an associations between my Regions and RegionLocalizeds entities.
Input param: @LanguageTypeId uniqueidentifier = null
SELECT
r.RegionId,
r.CountryId,
Coalesce(rl.FullDescription, rDefault.FullDescription) as FullDescription,
Coalesce(rl.StandardAbbreviation, rDefault.StandardAbbreviation )as StandardAbbreviation
FROM dbo.Region r
INNER JOIN RegionLocalized rDefault ON rDefault.RegionId = r.RegionId AND rDefault.LanguageTypeId = '00000000-0000-0000-0000-000000000000'
LEFT JOIN RegionLocalized rl ON r.RegionId = rl.RegionId AND rl.LanguageTypeId = @LanguageTypeId