I read about querying database using the entity framework
var result = _dbContext.SqlQuery<string>(sql, someParamSqlParameter).ToList();
What if i wanted multiple columns to be returned how could i write that type of query. I tried this code but it gives some sql schema mapping error
var result = clsGlobalObjectRefrances.SchoolSoulController.Stt.Database.SqlQuery<LocalAccGroups>(sqlQuery).ToList();
var sqlQuery = "Select GroupId,GroupName,Level from cte_AccGroups";
Where LocalAccGroups is a class i created
class LocalAccGroups
{
public decimal GroupId { get; set; }
public string GroupName { get; set; }
int Level { get; set; }
}
Thanxxx in Advance
publicin your class