I have this method that returns obj Data, but instead of that I need to return DataSet
public static Data GetData(int id)
{
var result = new Data();
using (var context = new MyContext(false, false))
{
var query = context.Data.Include("MyTable1").Include("MyTable2").Include("MyTable3").Where(o => o.Id == id);
result = query.OrderBy(onc => onc.Data).FirstOrDefault();
}
return result;
}
I'm new to Entity Framework, any example how can I return DataSet instead of object.
Add your
Dataobject into Dataset and return it.Here is example,