private DBContext dbContext = new DBContext();
public List<UserAccess> GetOfficerNamesByOfficeTypeId(int officeTypeId)
{
var officeId = new SqlParameter { ParameterName = "OfficerTypeId", Value = officeTypeId };
using (var dbContext = new DBContext())
{
var userAccess = dbContext.Database.SqlQuery<UserAccess>("exec USP_GetAllOfficerDetails_OfficerType @OfficerTypeId ", officeId).ToList<UserAccess>();
return userAccess.ToList();
}
}
No comments:
Post a Comment