예제 #1
0
        public async Task <MajorsDTO> Get([FromBody] MajorsDTO MajorsDTO)
        {
            if (!ModelState.IsValid)
            {
                throw new MessageException(ModelState);
            }
            var majors = await MajorsService.Get(MajorsDTO.Id);

            return(majors == null ? null : new MajorsDTO(majors));
        }
예제 #2
0
        public async Task <MajorsDTO> Get([FromBody] MajorsDTO MajorsDTO)
        {
            if (MajorsDTO == null)
            {
                MajorsDTO = new MajorsDTO();
            }

            Majors majors = ConvertDTOtoBO(MajorsDTO);

            majors = await MajorsService.Get(majors.Id);

            return(majors == null ? null : new MajorsDTO()
            {
                Id = majors.Id,
                Code = majors.Code,
                Name = majors.Name,
                Errors = majors.Errors
            });
        }