I have the below SQL which works just fine:
SELECT Message, CreateDate, AccountId, AlertTypeId
SELECT TOP (100) PERCENT Status, CreateDate, AccountId,
(SELECT 10 AS Expr1) AS AlertTypeId
WHERE AccountId = PassedInParameter
ORDER BY CreateDate DESC
I have been going about trying to convert the above into a LINQ method and am having problems with return types.
As the above SQL illustrates, I am querying two distinct LINQ tables - Alerts and StatusUpdates -
and then attempting to perform a Union on them. In order to do the union in LINQ, I have to have agreeing types. So, I
am using "var" to make the results of "alerts" and "updates" generic before the union.
public IList GetStatusUpdatesAsAlertsByAccountId<T>(Int32 accountId)
using (WorkbookDataContext dc = _conn.GetCont
View Complete Post