c# - EntityFramework SqlQuery ToList() -
why getting error on query? have used format in other projects without issue.
var history = db.database.sqlquery<referralhistory>("dbo.getreferralhistory @quoteguid, @username", new sqlparameter("@quoteguid", quoteguid), new sqlparameter("@username", username)) .tolist(); it doesn't tolist().
severity code description project file line error cs1061 'dbrawsqlquery' not contain definition 'tolist' , no extension method 'tolist' accepting first argument of type 'dbrawsqlquery' found (are missing using directive or assembly reference?)
i want results of stored procedure fill list<> of object type, matches output results of stored procedure.
i missing system.linq namespace. creating simple test application , including system.linq
db.database.sqlquery<class1>("storedproc_test @foo", new sqlparameter("@foo", foo) ).tolist(); compiles fine. removing system.linq gives error getting.
Comments
Post a Comment