Beispiel #1
0
        public async Task <Guid> Create(CreateAnimeViewModel model)
        {
            var anime = new Anime()
            {
                Name        = model.Name,
                Description = model.Description,
                Poster      = model.Poster,
                Rating      = model.Rating,
                ReleaseDate = model.ReleaseDate
            };

            await this._repository.Add(anime);

            await this._repository.SaveChangesAsync();

            return(anime.Id);
        }
Beispiel #2
0
        public async Task <IActionResult> Create(CreateAnimeViewModel model)
        {
            var id = await this._animesService.Create(model);

            return(this.RedirectToAction("Details", new { id = id }));
        }
Beispiel #3
0
        public IActionResult Create()
        {
            var viewModel = new CreateAnimeViewModel();

            return(View(viewModel));
        }