static Client CreateClientMock(LogInterceptor logInterceptor) { Console.WriteLine("This demo uses mock data on current setup. But it might connect to a real service using proper data provider."); Console.WriteLine(); IDataProvider dataProvider = new MockDataProvider(); return(Client.Create(dataProvider, new[] { logInterceptor })); }
static void Main(string[] args) { LogInterceptor logInterceptor = new LogInterceptor( query => Console.WriteLine("Querying: " + query), bytesCount => { Console.WriteLine("-------------------"); Console.WriteLine("Data retrieved: " + bytesCount); }); Client client = CreateClientMock(logInterceptor); MainProducts(client); MainCategories(client); /*Task.Run(async ()=> * { * await MainProductsAsync(client); * await MainCategoriesAsync(client); * }).GetAwaiter().GetResult();*/ }