private IEnumerable <ProductViewModel> GetAssignedBrandProducts(Guid brandId) { var brand = _brandQueries.GetBrandOrNull(brandId); var productIds = brand.Products.Select(x => x.ProductId); return(ProductViewModel.BuildFromIds(_gameQueries, productIds)); }
public JsonResult GetAllowedBrandProducts(Guid brandId) { var brand = _brandQueries.GetBrand(brandId); var productIds = brand.Products.Select(x => x.ProductId); var products = ProductViewModel.BuildFromIds(_gameQueries, productIds); return(Json(products.ToArray(), JsonRequestBehavior.AllowGet)); }