I have the following dummy code, but the idea is to return a generic class
public static var getSeaOf(string user) { var periodsSettings = from p in sea where p.add_by == new Guid(user) select new { p.id, p.name }; return var; }
I read here - How to return an anonymous type from a C # method that uses LINQ to SQL , the best solution for this case is to create a class to return the type.
But my question is: if I have hundreds of such functions, does this mean that I need to have hundreds of classes?
I hope there is a more general solution, thanks for your help !!
Release
I look
Silverlight - LinqToEntities - How to return anonymous types
But I can not specify the class name in select new, how does the article do this?
public static IEnumerable<retSea> getBskSeasonsOf(string user) { var periodsSettings = from p in sea where p.add_by == new Guid(user) select new retSea { p.id, p.name }; return periodsSettings; }
roncansan
source share