Exemple #1
0
        public async Task <ActionResult <Shifts> > Post([FromBody] Shifts shift)
        {
            try
            {
                shift.ShiftID = Guid.NewGuid();
                await shiftRepo.CreateAsync(shift);

                return(CreatedAtRoute("GetDepartmentByID",
                                      new
                {
                    id = shift.ShiftID
                },
                                      shift));
            }
            catch (Exception)
            {
                return(BadRequest());
            }
        }