public IActionResult Put(int id, [FromBody] TimeSlotViewModel value) { //ignore the end date for now value.EndDatetime = value.BeginDatetime.AddHours(1).AddMinutes(-1); var updated = _mapper.Map <TimeSlotViewModel, TimeSlot>(value); var response = _timeSlots.Update(id, updated); return(StatusCode((int)HttpStatusCode.OK, _mapper.Map <TimeSlot, TimeSlotViewModel>(response))); }