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

Popular posts from this blog

1111. appearing after print sequence - php -

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

Ruby on Rails, ActiveRecord, Postgres, UTF-8 and ASCII-8BIT encodings -