Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var myData = from a in db.MyTable
- where a.MyValue == "A"
- select new
- {
- a.Key,
- a.MyValue
- };
- public ??? GetSomeData()
- {
- // my Linq query
- }
- var myData = from a in db.MyTable
- where a.MyValue == "A"
- select new MyType
- {
- Key = a.Key,
- Value = a.MyValue
- };
- public IQueryable GetSomeData()
- public class MyType {Key{get;set;} Value{get;set}}
- public IQueryable<T> GetSomeData<T>() where T : MyType, new()
- { return from a in db.MyTable
- where a.MyValue == "A"
- select new T {Key=a.Key,Value=a.MyValue};
- }
Add Comment
Please, Sign In to add comment