0
votes

I want to run the sp in the database. but sql query gives reference error. It doesn't suggest anything as a using instead.

code:

var allUsersAndCountry = context.Database.SqlQuery<ListTaskViewModel>("SP_GetAllUserForCountry @UserName, @CountryID", sqlparameters.ToArray());

error:

Severity Code Description Project File Line Suppression State Error CS1061 'DatabaseFacade' does not contain a definition for 'SqlQuery' and no accessible extension method 'SqlQuery' accepting a first argument of type 'DatabaseFacade' could be found (are you missing a using directive or an assembly reference?) DAL C:\Users\bfindik\Desktop\Gorev\Backend\DAL\Concrete\TaskRepository.cs 18 Active