示例#1
0
        public async Task EditAsync(EditTruckAdViewModel inputModel)
        {
            var truckAd = AutoMapperConfig.MapperInstance.Map <TruckAd>(inputModel);

            this.truckAdsRepository.Update(truckAd);
            await this.truckAdsRepository.SaveChangesAsync();
        }
示例#2
0
        public async Task <IActionResult> Edit(EditTruckAdViewModel inputModel)
        {
            if (!this.ModelState.IsValid)
            {
                return(this.View(inputModel));
            }

            await this.truckAdsService.EditAsync(inputModel);

            return(this.RedirectToAction("MyTruckAds"));
        }