/// <summary> /// This is method /// </summary> /// <param name="employee"></param> /// <returns></returns> public Task <int> AddEmployee(Model_Of_Employee employee) { empDbContext.Employees.Add(employee); var result = empDbContext.SaveChangesAsync(); return(result); }
public Task <bool> AddEmployee(Employee employee) { try { var addemp = _empDbContext.Employees.Add(employee); _empDbContext.SaveChangesAsync(); } catch { return(Task.FromResult(false)); } return(Task.FromResult(true)); }
public async Task postAsync([FromBody] Employee value) { _context.Employees.Add(value); await _context.SaveChangesAsync(); }