コード例 #1
0
ファイル: CollegeDto.cs プロジェクト: ouyh18ctc/LteTools
 public CollegeDto(CollegeInfo info, IEnumerable<Town> towns)
 {
     info.CloneProperties(this);
     Town town = towns.FirstOrDefault(x => x.Id == info.TownId);
     if (town != null)
     {
         CityName = town.CityName;
         DistrictName = town.DistrictName;
         TownName = town.TownName;
     }
 }
コード例 #2
0
 private void UpdateRegion(int id, double area, string message, CollegeInfo info, RegionType type)
 {
     CollegeRegion region = _repository.GetRegion(id);
     if (region == null)
     {
         info.CollegeRegion = new CollegeRegion
         {
             Area = area,
             Info = message,
             RegionType = type
         };
     }
     else
     {
         region.Area = area;
         region.Info = message;
         region.RegionType = type;
     }
 }