public async Task <IActionResult> AddProducts(Activity activity, IEnumerable <Product> products) { var productIds = from p in products where p != null select p.Id; if (products.Count() == 0) { return(RedirectToAction(nameof(ActivityController.Products), new { Id = activity.Id })); } await _activityService.AddProductsAsync(activity.Id, productIds, User.GetUsername()); return(RedirectToAction(nameof(ActivityController.Products), new { Id = activity.Id })); }