コード例 #1
0
        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));
        }
コード例 #2
0
 public DailyCheckInCreateDtoTest()
 {
     _createDto = new DailyCheckInCreateDto()
     {
         Date             = DateTime.Today,
         PhysicalState    = PhysicalState.GOOD,
         MentalState      = MentalState.MEH,
         PositiveFeelings = null,
         NegativeFeelings = NegativeFeelings.LONELY,
         UserID           = 2
     };
 }