public async Task <IActionResult> Create([Bind("StudioId,Name")] Studio studio)
        {
            if (ModelState.IsValid)
            {
                await _studioService.AddAndSave(studio);

                return(RedirectToAction(nameof(Index)));
            }
            return(View(studio));
        }
Exemple #2
0
        public async Task AddTest()
        {
            var fakeRepository = Mock.Of <IStudioRepository>();
            var studioService  = new StudioService(fakeRepository);

            var studio = new Studio()
            {
                Name = "Test Studio"
            };
            await studioService.AddAndSave(studio);
        }