public void FindProductsByCategory(Category category) { InitializeCollection(); if (category == null) return; foreach (var product in _repository.GetProductsByCategory(category)) { Products.Add(product); } }
public CategoryChangedMessage(Category category) { Category = category; }
public IEnumerable<Product> GetProductsByCategory(Category category) { return CreateContext().Query<Product>("SELECT * FROM Products WHERE CategoryID = @CategoryID", new { category.CategoryID }); }