示例#1
0
        public ProgramType UpdateProgramTypeDetails(int id, UpdateProgramTypeDto dto)
        {
            var type = _typeRepository.Find(id);

            if (type == null)
            {
                return(null);
            }
            type.ProgramScheduleId = dto.ScheduleId;
            _typeRepository.Save();
            return(type);
        }
        public IActionResult Patch(int id, [FromBody] UpdateProgramTypeDto dto)
        {
            var programType = _programTypeService.UpdateProgramTypeDetails(id, dto);

            if (programType == null)
            {
                return(NotFound());
            }

            var result = _mapper.Map <ProgramTypeDto>(programType);

            return(Ok(result));
        }