public ActionResult <DailyCheckInReadDto> CreateDailyCheckIn(DailyCheckInCreateDto dailyCheckInCreateDto) { var checkInModel = _mapper.Map <DailyCheckIn>(dailyCheckInCreateDto); _checkInRepo.CreateDailyCheckIn(checkInModel); _checkInRepo.SaveChanges(); var checkInReadDto = _mapper.Map <DailyCheckInReadDto>(checkInModel); return(CreatedAtRoute(nameof(GetDailyCheckInById), new { Id = checkInReadDto.ID }, checkInReadDto)); }
public DailyCheckInCreateDtoTest() { _createDto = new DailyCheckInCreateDto() { Date = DateTime.Today, PhysicalState = PhysicalState.GOOD, MentalState = MentalState.MEH, PositiveFeelings = null, NegativeFeelings = NegativeFeelings.LONELY, UserID = 2 }; }