Ejemplo n.º 1
0
        public async Task <Employee> AddEmployee(Employee employee)
        {
            var result = await dbContext.AddAsync(employee);

            await dbContext.SaveChangesAsync();

            return(result.Entity);
        }
Ejemplo n.º 2
0
        public async Task <User> AddUser(User user)
        {
            //var result = await dbContext.AddAsync(user);
            //await dbContext.SaveChangesAsync();
            //return result.Entity;

            var result = await dbContext.Users.AddAsync(user);

            await dbContext.SaveChangesAsync();

            return(result.Entity);
        }