public virtual async Task CreateRentsaleinfo(CreateRentsaleinfoInput input) { var rentsaleinfo = input.MapTo <Rentsaleinfo>(); rentsaleinfo.IsSale = true; //rentsaleinfo.IsShow = true; rentsaleinfo.Summary = input.Content.Length > 50 ? input.Content.Substring(0, 50) : input.Content; if (input.Images != null && input.Images.Count > 0) { rentsaleinfo.Thumbnail = input.Images[0]; } var dataid = await _rentsaleinfoRepository.InsertAndGetIdAsync(rentsaleinfo); _detailManager.Save(DetailType.Rentsaleinfo, dataid, input.Content); if (input.Images != null) { foreach (var image in input.Images) { RentsaleinfoImage rentsaleinfoImage = new RentsaleinfoImage(); rentsaleinfoImage.RentsaleinfoId = dataid; rentsaleinfoImage.Image = image; await _rentsaleinfoImageRepository.InsertAsync(rentsaleinfoImage); } } }
public async Task CreateRentsaleinfo(CreateRentsaleinfoInput input) { var rentsaleinfo = input.MapTo <Rentsaleinfo>(); rentsaleinfo.Source = RentsaleinfoSource.Admin; rentsaleinfo.IsSale = true; rentsaleinfo.IsShow = true; var dataid = await _rentsaleinfoRepository.InsertAndGetIdAsync(rentsaleinfo); _detailManager.Save(DetailType.Rentsaleinfo, dataid, input.Content); }