This is an automated email from the ASF dual-hosted git repository. ptupitsyn pushed a commit to branch ignite-11525 in repository https://gitbox.apache.org/repos/asf/ignite.git
The following commit(s) were added to refs/heads/ignite-11525 by this push: new fd6c35f Fixing examples - thin client fd6c35f is described below commit fd6c35f5d9d3fb1878e228689758e1f6974f72f6 Author: Pavel Tupitsyn <ptupit...@apache.org> AuthorDate: Fri Apr 5 15:14:44 2019 +0300 Fixing examples - thin client --- .../ThinClient/ThinClientSqlExample.cs | 37 +++++----------------- 1 file changed, 8 insertions(+), 29 deletions(-) diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/ThinClient/ThinClientSqlExample.cs b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/ThinClient/ThinClientSqlExample.cs index c46c850..70b5176 100644 --- a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/ThinClient/ThinClientSqlExample.cs +++ b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/ThinClient/ThinClientSqlExample.cs @@ -72,12 +72,9 @@ namespace Apache.Ignite.Examples.ThinClient // Populate cache with sample data entries. PopulateCache(cache); - // Run SQL example. - SqlQueryExample(cache); + // Run examples. + SqlExample(cache); LinqExample(cache); - - // Run SQL fields query example. - SqlFieldsQueryExample(cache); LinqFieldsExample(cache); } @@ -87,20 +84,18 @@ namespace Apache.Ignite.Examples.ThinClient } /// <summary> - /// Queries employees that have provided ZIP code in address. + /// Queries names and salaries for all employees. /// </summary> /// <param name="cache">Cache.</param> - private static void SqlQueryExample(ICacheClient<int, Employee> cache) + private static void SqlExample(ICacheClient<int, Employee> cache) { - const int zip = 94109; - - var qry = cache.Query(new SqlQuery(typeof(Employee), "zip = ?", zip)); + var qry = cache.Query(new SqlFieldsQuery("select name, salary from Employee")); Console.WriteLine(); - Console.WriteLine(">>> Employees with zipcode {0} (SQL):", zip); + Console.WriteLine(">>> Employee names and their salaries (SQL):"); - foreach (var entry in qry) - Console.WriteLine(">>> " + entry.Value); + foreach (var row in qry) + Console.WriteLine(">>> [Name=" + row[0] + ", salary=" + row[1] + ']'); } /// <summary> @@ -125,22 +120,6 @@ namespace Apache.Ignite.Examples.ThinClient Console.WriteLine(">>> " + qry.ToCacheQueryable().GetFieldsQuery().Sql); } - - /// <summary> - /// Queries names and salaries for all employees. - /// </summary> - /// <param name="cache">Cache.</param> - private static void SqlFieldsQueryExample(ICacheClient<int, Employee> cache) - { - var qry = cache.Query(new SqlFieldsQuery("select name, salary from Employee")); - - Console.WriteLine(); - Console.WriteLine(">>> Employee names and their salaries (SQL):"); - - foreach (var row in qry) - Console.WriteLine(">>> [Name=" + row[0] + ", salary=" + row[1] + ']'); - } - /// <summary> /// Queries names and salaries for all employees. /// </summary>