示例#1
0
 public async void UpdateAsync(HighSchoolDTO highSchoolDTO)
 {
     if (await _context.Database.EnsureCreatedAsync())
     {
         var highSchool = Mapper.Map <HighSchoolDTO, HighSchool>(highSchoolDTO);
         _context.HighSchools.Update(highSchool);
         await _context.SaveChangesAsync();
     }
 }
        public async Task <HighSchoolDTO> GetHighSchool([FromBody] HighSchoolDTO highSchoolDTO)
        {
            if (highSchoolDTO == null)
            {
                highSchoolDTO = new HighSchoolDTO();
            }
            var highSchool = new HighSchoolBO {
                Id = highSchoolDTO.Id
            };

            highSchool = await HighSchoolService.Get(highSchool.Id);

            return(highSchool == null ? null : new HighSchoolDTO
            {
                Id = highSchool.Id,
                Code = highSchool.Code,
                Name = highSchool.Name,
                ProvinceId = highSchool.ProvinceId,
            });
        }
 public void Update(HighSchoolDTO highSchool)
 {
     _service.UpdateAsync(highSchool);
 }