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