public async Task <User> CreateUser(User user) { user.Password = BCrypt.Net.BCrypt.HashPassword(user.Password); _context.Users.Add(user); await _context.SaveChangesAsync(); return(user); }
public async Task <Designation> CreateDesignation(Designation designation) { designation.Code = "DES" + designation.Name; _context.Designations.Add(designation); await _context.SaveChangesAsync(); return(designation); }
public async Task <Employee> CreateEmployee(Employee user) { user.Password = BCrypt.Net.BCrypt.HashPassword(user.Password); _context.Employees.Add(user); await _context.SaveChangesAsync(); return(user); }
public async Task <Department> CreateDepartment(Department department) { department.Code = "DEP" + department.Name; _context.Departments.Add(department); await _context.SaveChangesAsync(); return(department); }