Below is my code snippet.
string query = $@" select name from inventory where id = @p1;
Var data=mycontext.Database.SqlQuery(query,typeid); Var returndata =data.ToDataSourceResult(request);
Here inventory is the view which contains around 262 columns and myclass is the corresponding c# class which contains the variable for view. I m getting data from db within seconds. But this ToDataSourceResult is taking very long time. Can anyone please help me on this. I cant make any changes to this view columns