public async Task <ActionResult <LeavesTypes> > PostLeavesTypes(LeavesTypes leavesType) { _context.LeavesTypes.Add(leavesType); await _context.SaveChangesAsync(); return(CreatedAtAction("GetLeaveTypes", new { id = leavesType.ID }, leavesType)); }
public async Task <IActionResult> PutLeavesType(int id, LeavesTypes leavesTypes) { if (id != leavesTypes.ID) { return(BadRequest()); } _context.Entry(leavesTypes).State = EntityState.Modified; await _context.SaveChangesAsync(); return(NoContent()); }
private void RetrieveData() { var leavesTypes = _leaveService.GetAllLeavesTypes(); foreach (var leaveType in leavesTypes) { LeavesTypes.Add(leaveType); } var users = _userService.GetBasicUsers(); foreach (var user in users) { Users.Add(user); } }