示例#1
0
        public async Task <SessionTaskDateDTO> Edit(SessionTaskDateDTO dto)
        {
            var entity = dto.MapTo <TSessionTaskDate>();
            await sessionTaskDateRepository.Edit(entity, Session);

            return(entity.MapTo <SessionTaskDateDTO>());
        }
        public async Task <IActionResult> PutSessionTaskDate(SessionTaskDateDTO sessionTaskDateDto)
        {
            var sessionTaskDate = await sessionTaskDateService.Edit(sessionTaskDateDto);

            if (sessionTaskDate == null)
            {
                return(BadRequest());
            }

            return(Ok(sessionTaskDate));
        }
        public async Task <ActionResult <SessionTaskDateDTO> > PostSessionTaskDate(SessionTaskDateDTO sessionTaskDateDto)
        {
            try
            {
                var sessionTaskDate = await sessionTaskDateService.Edit(sessionTaskDateDto);

                return(Ok(sessionTaskDate));
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.Message));
            }
        }