static void Main(string[] args) { //IProductService _productService = new ProductService(); IProductService _productService = new ProductServiceProxy(new ProductService()); Console.WriteLine($"Product Count {_productService.GetProduct()}"); Console.ReadLine(); }
public static void Execute() { string username = "******"; //Proxy requires the username whereas the Productservice doesn't ProductServiceProxy service = new ProductServiceProxy(username); service.AddProduct(); service.GetAll(); service.GetProduct(); }
static void Main(string[] args) { // Use db. IProductService productService = new ProductService(); PrintProducts(productService.GetAll()); // First appeal to the db. productService = new ProductServiceProxy(productService); PrintProducts(productService.GetAll()); // Now appeal to the RAM. PrintProducts(productService.GetAll()); // same with GetById... Console.ReadLine(); }