I want to execute a stored procedure which returns three values (Email, Name, CompanyID) and get one parameter (CompanyID) but it's not working.
I have created a class with these properties and a stored procedure which returns the data. By it is showing DatabaseFacade
error.
My code is:
List<MyClass> AppUser = new List<MyClass>(); //Class with three properties
SqlParameter param1 = new SqlParameter("@CompanyID", CompanyID);
AppUser = _context.Database.SqlQuery<CC>("GetUserAndRolesForCompany", param1).ToList();
Showing this error: I have include System.Linq
'DatabaseFacade' does not contain a definition for 'SqlQuery' and no extension method 'SqlQuery' accepting a first argument of type 'DatabaseFacade' could be found (are you missing a using directive or an assembly reference?)