示例#1
0
        public async Task <ActionResult <CreateDistrict> > PostRegion(CreateDistrict DistrictDto)
        {
            var district = _mapper.Map <District>(DistrictDto);
            var result   = await _districtsService.Add(district);

            return(CreatedAtAction("GetDistrict", new { id = result.Id }, result));
        }
示例#2
0
 public District Post([FromBody] District district)
 {
     _districtsService.Add(district);
     return(district);
 }