public async Task <IEnumerable <Employee> > EmployeesList() { //string connectionString = ConfigurationManager.ConnectionStrings["sampledbconnection"].ConnectionString; List <Employee> employees = new List <Employee>(); using (var context = new sampledbcontext()) { employees = await context.Employee.ToListAsync(); } return(employees); }
public async Task <IEnumerable <Users> > UsersList() { //string connectionString = ConfigurationManager.ConnectionStrings["sampledbconnection"].ConnectionString; List <Users> users = new List <Users>(); using (var context = new sampledbcontext()) { users = await context.Users.ToListAsync(); } return(users); }