Example #1
0
        static void Main(string[] args)
        {
            IRepository repo = new Repository();
            Product product = new Product(5, 55.5m, "kalipso", "djolan");
            Product product2 = new Product(6, 55.6m, "kalipso", "djolan");
            Product product3 = new Product(7, 55.5m, "kalipso", "djolan");
            Product product4 = new Product(8, 55.5m, "kalipso", "djolan");

            repo.Add(product);
            repo.Add(product2);
            repo.Add(product3);
            repo.Add(product4);

            var productsByTitle = repo.FindByTitle("kalipso");
            var productsBySupplierAndPriceRange = repo.FindBySupplierAndPriceRange("djolan", 55.5m, 55.6m);
            var productByTitleAndPriceRange = repo.FindByTitleAndPriceRange("kalipso", 55.5m, 55.6m);
            var productByPriceRange = repo.FindByPriceRange(55.5m, 55.6m);
            var productsByTitleAndPrice = repo.FindByTitleAndPrice("kalipso", 55.5m);
            var productsBySupplierAndPrice = repo.FindBySupplierAndPrice("djolan", 55.5m);

            bool isSuccessfullyRemoved = repo.Remove(product.Id);
        }