public async Task <IActionResult> Add(ConsultationAddViewModel consultAddModel)
        {
            if (!this.ModelState.IsValid)
            {
                return(this.Redirect("/"));
            }
            await this.consultationService.AddAsync(consultAddModel);

            return(this.Redirect("/"));
        }
示例#2
0
        public async Task AddAsync(ConsultationAddViewModel consultAddModel)
        {
            await this.db.Consultations.AddAsync(this.mapper.Map <Consultation>(consultAddModel));

            await this.db.SaveChangesAsync();
        }