public async Task <IActionResult> Create([Bind("DirectorId,Name")] Director director)
        {
            if (ModelState.IsValid)
            {
                await _directorService.AddAndSave(director);

                return(RedirectToAction(nameof(Index)));
            }
            return(View(director));
        }
예제 #2
0
        public async Task AddTest()
        {
            var fakeRepository  = Mock.Of <IDirectorRepository>();
            var directorService = new DirectorService(fakeRepository);

            var director = new Director()
            {
                Name = "Test Director"
            };
            await directorService.AddAndSave(director);
        }