Example #1
0
        public async Task CreateBreed(CreateBreedFormViewModel breedModel)
        {
            Breed newBreed = new Breed()
            {
                Name = breedModel.Name,
            };

            context.Add(newBreed);
            await context.SaveChangesAsync();
        }
Example #2
0
        public async Task <IActionResult> Create(CreateBreedFormViewModel breedModel)
        {
            await breedService.CreateBreed(breedModel);

            return(Redirect("/Breeds/All"));
        }