public async Task <IResult> InsertAsync(NewhouseDto newhouseDto) { var newhouseModel = this._mapper.Map <NewhouseModel>(newhouseDto); newhouseModel.UpdateTime = DateTime.Now; return(await this._newhouseRepository.InsertAsync(newhouseModel)); }
public async Task <NewhouseDto> CovertAsync(Newhouse591Dto newhouse591Dto) { if (newhouse591Dto is null) { throw new ArgumentNullException(nameof(newhouse591Dto)); } var newhouseDto = new NewhouseDto() { Hid = newhouse591Dto.Hid, BuildName = newhouse591Dto.BuildName, HighPinPrice = newhouse591Dto.PinPrice.ToDoubleList().MaxOrDefault(), LowPinPrice = newhouse591Dto.PinPrice.ToDoubleList().MinOrDefault(), HighPrice = newhouse591Dto.Price.ToIntList().MaxOrDefault(), LowPrice = newhouse591Dto.Price.ToIntList().MinOrDefault(), Info = newhouse591Dto.Info, County = await this._countyDistrictService.GetCountyName(newhouse591Dto.Address), District = await this._countyDistrictService.GetDistrictName(newhouse591Dto.Address) }; return(newhouseDto); }