public ICollection <ProductOptionDto> HandleQuery(GetProductOptionsForProductQuery forProductQuery) { return(_dbContext.GetSet <ProductOption>().Include(h => h.Product) .Where(x => x.Product.Id.Equals(forProductQuery.ProductId)).Select(p => new ProductOptionDto { Id = p.Id, Description = p.Description, Name = p.Name, ProductId = p.Product.Id }).ToList()); }
public ICollection <ProductOptionDto> GetOptions([FromUri] GetProductOptionsForProductQuery forProductQuery) { return(_getproductOptionsQueryHandler.HandleQuery(forProductQuery)); }