/// <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);
        }
Ejemplo n.º 2
0
 public Task <bool> AddEmployee(Employee employee)
 {
     try
     {
         var addemp = _empDbContext.Employees.Add(employee);
         _empDbContext.SaveChangesAsync();
     }
     catch
     {
         return(Task.FromResult(false));
     }
     return(Task.FromResult(true));
 }
Ejemplo n.º 3
0
        public async Task postAsync([FromBody] Employee value)

        {
            _context.Employees.Add(value);
            await _context.SaveChangesAsync();
        }