Example #1
0
        public async Task <IActionResult> Add(IndexClientsInputModel model)
        {
            if (!this.ModelState.IsValid)
            {
                return(this.View());
            }

            await this.clientsService.CreateAsync(model);

            return(this.Redirect("/Clients/All"));
        }
Example #2
0
        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();
        }