public async Task <IActionResult> PutLeaveDefinition([FromRoute] int id, [FromBody] LeaveDefinition leaveDefinition)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != leaveDefinition.AutoId)
            {
                return(BadRequest());
            }

            _context.Entry(leaveDefinition).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!LeaveDefinitionExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
        public async Task <IActionResult> PostLeaveDefinition([FromBody] LeaveDefinition leaveDefinition)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            _context.LeaveDefinition.Add(leaveDefinition);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetLeaveDefinition", new { id = leaveDefinition.AutoId }, leaveDefinition));
        }