I use Linq To Sql Join Query in DAL layer, How can I define a return List<T>
automatically for the LinqToSql Join method?
Nowadays, I have to manually define a List<CustomViewType>
for each LinqToSql Join method's return value.
Is that possible to define a List<T>
like the following code :
public static List<T> GetJoinList()
{
List<T> list = new List<T>();
list = from c in customers
join o in orders on o.customerid equals c.customerid
select new { CustomerID = c.CustomerId, OrderDate = o.OrderDate } ;
return list.ToList() ;
}
In fact, what I mean is that how can I pass the lists of anonymous types from DAL layer to BLL layer ?