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)); }
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 }); }