Пример #1
0
        public async Task <IActionResult> CreateSongTitle(CreateSongTitleViewModel model)
        {
            if (ModelState.IsValid)
            {
                if (await _songService.CheckIfSongExistsByTitleAsync(model.Title))
                {
                    return(RedirectToAction("VerifyDuplicateTitle", new { title = model.Title }));
                }
                var id = await _songService.CreateSongCreateAsync(new SongCreate
                {
                    Title            = model.Title,
                    CreatedById      = GetUserId(),
                    LastModifiedById = GetUserId(),
                    DateCreated      = DateTime.Now,
                    DateLastModified = DateTime.Now,
                });

                return(RedirectToAction("CreateSongComposers", new { Id = id }));
            }
            return(View());
        }