Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }