public async Task <IActionResult> Add(IndexClientsInputModel model) { if (!this.ModelState.IsValid) { return(this.View()); } await this.clientsService.CreateAsync(model); return(this.Redirect("/Clients/All")); }
public async Task CreateAsync(IndexClientsInputModel model) { var client = new Client { Name = model.Name, ImageUrl = model.ImageUrl, }; await this.clientRepository.AddAsync(client); await this.clientRepository.SaveChangesAsync(); }