Ejemplo n.º 1
0
        public async Task <ActionResult> Create(CreateWatchlistRequest model)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }

            var saveResult = await _watchlistService.CreateOrMergeWatchlistAsync(model);

            if (saveResult.IsError)
            {
                ModelState.AddModelError("", "There was an error trying to create this watchlist");
                return(View(model));
            }

            return(RedirectToAction("Index", new { saved = true }));
        }