Esempio n. 1
0
        public async Task <IActionResult> AddCampaign(AddCampaignViewModel addCampaignViewModel)
        {
            if (ModelState.IsValid)
            {
                var currentUser = await userManager.GetUserAsync(HttpContext.User);

                var campaignId = await campaignService.AddCampaignAsync(addCampaignViewModel, currentUser);

                return(RedirectToAction(nameof(CampaignController.CampaignInfo), "Campaign", new { campaignId }));
            }

            return(View(addCampaignViewModel));
        }