geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@apache.org
Subject [27/51] [partial] incubator-geode git commit: Add source for geode c++ and .net clients
Date Thu, 19 May 2016 15:14:34 GMT
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ac967000/geode-client-native/quickstart/csharp/DistributedSystem.cs
----------------------------------------------------------------------
diff --git a/geode-client-native/quickstart/csharp/DistributedSystem.cs b/geode-client-native/quickstart/csharp/DistributedSystem.cs
new file mode 100755
index 0000000..43df927
--- /dev/null
+++ b/geode-client-native/quickstart/csharp/DistributedSystem.cs
@@ -0,0 +1,113 @@
+/*
+ * The DistributedSystem QuickStart Example.
+ * This example connects to two distributed systems.
+ * This example takes the following steps:
+ *
+ * 1. Create a GemFire Cache.
+ * 2. Now it creates a Pool with poolName1.
+ * 3. Adds server(localhost:40404) to a pool factory.
+ * 4. Creates a generic region "root1" with the pool then creates a generic subregion "exampleRegion" with the pool.  
+ * 5. Put Entries (Key and Value pairs) into the Region.
+ * 6. Get Entries from the Region.
+ * 7. Invalidate an Entry in the Region.
+ * 8. Destroy an Entry in the Region.
+ * 9. Now it creates another generic region "root2" and subregion "exampleRegion" with another pool "poolName2", which connects to the server(localhost:40405).
+ * 10. Now we do put/get operations.  
+ * 11. Close the Cache.
+ *
+ */
+
+
+// Use standard namespaces
+using System;
+
+// Use the GemFire namespaces
+//using GemStone.GemFire.Cache;
+using GemStone.GemFire.Cache.Generic;
+
+namespace GemStone.GemFire.Cache.Generic.QuickStart
+{
+  // The DistributedSystem QuickStart example.
+  class DistributedSystem
+  {
+  
+    static void TestDistributedSystem(Cache cache, String hostname, int port, String poolName, String regionName)
+    {
+      //create pool factory to create the pool.
+      PoolFactory fact = PoolManager.CreateFactory();
+
+      //adding host(endpoint) in pool
+      fact.AddServer(hostname, port);
+
+      //enabling subscription on pool
+      fact.SetSubscriptionEnabled(true);
+
+      //creating pool with name "examplePool"
+      fact.Create(poolName);
+	  
+	    RegionFactory regionFactory = cache.CreateRegionFactory(RegionShortcut.CACHING_PROXY);
+
+      IRegion<string, string> region = regionFactory.SetPoolName(poolName).Create<string, string>(regionName);
+
+      Console.WriteLine("Created a generic Region.");
+
+      // Put an Entry (Key and Value pair) into the Region using the IDictionary interface.
+      region["Key1"] = "Value1";
+
+      Console.WriteLine("Put the first Entry into the Region");
+
+      // Put another Entry into the Region.
+      region["123"] = "123";
+
+      Console.WriteLine("Put the second Entry into the Region");
+
+      // Get Entries back out of the Region.
+      string result1 = region["Key1"];
+
+      Console.WriteLine("Obtained the first Entry from the Region");
+
+      string result2 = region["123"];
+
+      Console.WriteLine("Obtained the second Entry from the Region");
+
+      // Invalidate an Entry in the Region.
+      region.Invalidate("Key1");
+
+      Console.WriteLine("Invalidated the first Entry in the Region");
+
+      // Destroy an Entry in the Region using the IDictionary interface.
+      region.Remove("123");
+
+      Console.WriteLine("Destroyed the second Entry in the Region");
+    }
+  
+    static void Main(string[] args)
+    {
+      try
+      {
+        // Create a GemFire Cache.
+        CacheFactory cacheFactory = CacheFactory.CreateCacheFactory();
+
+        Cache cache = cacheFactory.SetSubscriptionEnabled(true).Create();
+
+        Console.WriteLine("Created the GemFire Cache");
+
+        //test on first distributem system
+        TestDistributedSystem(cache, "localhost", 40404, "poolName1", "exampleRegion1");
+        
+        //test on second distributed system
+        TestDistributedSystem(cache, "localhost", 40405, "poolName2", "exampleRegion2");
+
+        // Close the GemFire Cache.
+        cache.Close();
+
+        Console.WriteLine("Closed the GemFire Cache");
+      }
+      // An exception should not occur
+      catch (GemFireException gfex)
+      {
+        Console.WriteLine("DistributedSystem GemFire Exception: {0}", gfex.Message);
+      }
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ac967000/geode-client-native/quickstart/csharp/DurableClient.cs
----------------------------------------------------------------------
diff --git a/geode-client-native/quickstart/csharp/DurableClient.cs b/geode-client-native/quickstart/csharp/DurableClient.cs
new file mode 100644
index 0000000..b8cea24
--- /dev/null
+++ b/geode-client-native/quickstart/csharp/DurableClient.cs
@@ -0,0 +1,134 @@
+/*
+ * The Durable Client QuickStart Example.
+ *
+ * This example takes the following steps:
+ *
+ * 1. Create a GemFire Cache with durable client properties Programmatically.
+ * 2. Create the example generic Region programmatically.
+ * 3. Set DurableCacheListener with "AfterRegionLive" implementation to region.
+ * 4. Register Interest to region with durable option.
+ * 5. call to readyForEvent().
+ * 6. Close the Cache with keepalive options as true.
+ *
+ */
+
+// Use standard namespaces
+using System;
+
+// Use the GemFire namespace
+using GemStone.GemFire.Cache.Generic;
+
+namespace GemStone.GemFire.Cache.Generic.QuickStart
+{
+  // The DurableClient QuickStart example.
+  class DurableClientExample
+  {
+    public void RunDurableClient()
+    {
+        // Create durable client's properties using api.
+      Properties<string, string> durableProp = Properties<string, string>.Create<string, string>();
+        durableProp.Insert("durable-client-id", "DurableClientId");
+        durableProp.Insert("durable-timeout", "300");
+
+        // Create a Gemfire Cache programmatically.
+        CacheFactory cacheFactory = CacheFactory.CreateCacheFactory(durableProp);
+
+        Cache cache = cacheFactory.SetSubscriptionEnabled(true)
+                                  .Create();
+
+        Console.WriteLine("Created the GemFire Cache");
+             
+        // Create the example Region programmatically.
+        RegionFactory regionFactory = cache.CreateRegionFactory(RegionShortcut.CACHING_PROXY);
+
+        IRegion<string, string> region = regionFactory.Create<string, string>("exampleRegion");
+
+        Console.WriteLine("Created the generic Region programmatically.");            
+
+        // Plugin the CacheListener with afterRegionLive. "afterRegionLive()"  will be called 
+        // after all the queued events are recieved by client
+        AttributesMutator<string, string> attrMutator = region.AttributesMutator;
+        attrMutator.SetCacheListener(new DurableCacheListener<string, string>());
+
+        Console.WriteLine("DurableCacheListener set to region.");
+        
+        // For durable Clients, Register Intrest can be durable or non durable ( default ), 
+        // Unregister Interest APIs remain same.
+
+        string [] keys = new string[] { "Key-1" };
+        region.GetSubscriptionService().RegisterKeys(keys, true, true);
+
+        Console.WriteLine("Called Register Interest for Key-1 with isDurable as true");
+
+        //Send ready for Event message to Server( only for Durable Clients ). 
+        //Server will send queued events to client after recieving this.
+        cache.ReadyForEvents();
+    	
+        Console.WriteLine("Sent ReadyForEvents message to server");
+
+        //wait for some time to recieve events
+        System.Threading.Thread.Sleep(1000);
+
+        // Close the GemFire Cache with keepalive = true.  Server will queue events for
+        // durable registered keys and will deliver all events when client will reconnect
+        // within timeout period and send "readyForEvents()"
+        cache.Close(true);
+
+        Console.WriteLine("Closed the GemFire Cache with keepalive as true");
+    }
+
+    public void RunFeeder()
+    {
+        // Create a GemFire Cache Programmatically.
+        CacheFactory cacheFactory = CacheFactory.CreateCacheFactory();
+        Cache cache = cacheFactory.SetSubscriptionEnabled(true).Create();
+
+        Console.WriteLine("Created the GemFire Cache");
+
+        RegionFactory regionFactory = cache.CreateRegionFactory(RegionShortcut.PROXY);
+
+        // Created the Region Programmatically.
+        IRegion<string, string> region = regionFactory.Create<string, string>("exampleRegion");
+
+        Console.WriteLine("Created the Region Programmatically.");
+
+        // create two keys with value
+        string key1 = "Key-1";
+        string value1 = "Value-1";
+        region[key1] = value1;
+        string key2 = "Key-2";
+        string value2 = "Value-2";
+        region[key2] = value2;
+
+        Console.WriteLine("Created Key-1 and Key-2 in region. Durable interest was registered only for Key-1.");
+
+        // Close the GemFire Cache
+        cache.Close();
+
+        Console.WriteLine("Closed the GemFire Cache");
+
+    }
+    static void Main(string[] args)
+    {
+      try
+      {
+        DurableClientExample ex = new DurableClientExample();
+ 
+        //First Run of Durable Client
+        ex.RunDurableClient();
+
+        //Intermediate Feeder, feeding events
+        ex.RunFeeder();
+
+        //Reconnect Durable Client
+        ex.RunDurableClient();
+
+      }
+      // An exception should not occur
+      catch (GemFireException gfex)
+      {
+        Console.WriteLine("DurableClient GemFire Exception: {0}", gfex.Message);
+      }
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ac967000/geode-client-native/quickstart/csharp/Exceptions.cs
----------------------------------------------------------------------
diff --git a/geode-client-native/quickstart/csharp/Exceptions.cs b/geode-client-native/quickstart/csharp/Exceptions.cs
new file mode 100644
index 0000000..5064b7f
--- /dev/null
+++ b/geode-client-native/quickstart/csharp/Exceptions.cs
@@ -0,0 +1,124 @@
+/*
+ * The Exceptions QuickStart Example.
+ *
+ * This example takes the following steps:
+ *
+ * 1. Create CacheFactory using the user specified settings or from the gfcpp.properties file by default.
+ * 2. Create a GemFire Cache.
+ * 3. Get the example generic Regions from the Cache.
+ * 4. Perform some operations which should cause exceptions.
+ * 5. Close the Cache.
+ * 6. Put an Entry into the Region when Cache is already closed.
+ *
+ */
+
+// Use standard namespaces
+using System;
+
+// Use the GemFire namespace
+using GemStone.GemFire.Cache.Generic;
+
+namespace GemStone.GemFire.Cache.Generic.QuickStart
+{
+  // The Exceptions QuickStart example.
+  class Exceptions
+  {
+    static void Main(string[] args)
+    {
+      try
+      {
+        // Create CacheFactory using the user specified settings or from the gfcpp.properties file by default.
+        Properties<string, string> prp = Properties<string, string>.Create<string, string>();
+        prp.Insert("cache-xml-file", "XMLs/clientExceptions.xml");
+
+        CacheFactory cacheFactory = CacheFactory.CreateCacheFactory(prp);
+
+        Console.WriteLine("Created CacheFactory");
+
+        // Create a GemFire Cache with the "clientExceptions.xml" Cache XML file.
+        Cache cache = cacheFactory.SetSubscriptionEnabled(true).Create();
+
+        Console.WriteLine("Created the GemFire Cache");
+        
+        // Get the example Regions from the Cache which are declared in the Cache XML file.
+        IRegion<object, string> region = cache.GetRegion<object, string>("exampleRegion");
+        IRegion<object, string> region2 = cache.GetRegion<object, string>("exampleRegion2");
+
+        Console.WriteLine("Obtained the generic Region from the Cache");
+
+        // Put an Entry (Key and Value pair) into the Region using the IDictionary interface.
+        region["Key1"] = "Value1";
+
+        Console.WriteLine("Put the first Entry into the Region");
+
+        // Put an Entry into the Region by manually creating a Key and a Value pair.
+        int key = 123;
+        string value = "123";
+        region[key] = value;
+
+        Console.WriteLine("Put the second Entry into the Region");
+
+        // Get Entries back out of the Region.
+        string result1 = region["Key1"];
+
+        Console.WriteLine("Obtained the first Entry from the Region");
+
+        string result2 = region[key];
+
+        Console.WriteLine("Obtained the second Entry from the Region");
+
+        //Destroy exampleRegion2.
+        object userData = null;
+        region2.DestroyRegion(userData);
+        
+        try
+        {
+          // Try to Put an Entry into a destroyed Region.
+          region2["Key1"] = "Value1";
+  
+          Console.WriteLine("UNEXPECTED: Put should not have succeeded");
+        }
+        catch (RegionDestroyedException gfex)
+        {
+          Console.WriteLine("Expected RegionDestroyedException: {0}", gfex.Message);
+        }
+        
+        try
+        {
+          //Its not valid to create two instance of Cache with different settings.
+          //If the settings are the same it returns the existing Cache instance.
+          CacheFactory cacheFactory2 = CacheFactory.CreateCacheFactory(prp);
+          Cache cache1 = cacheFactory2.SetSubscriptionEnabled(true).AddServer("localhost", 40405).Create();
+
+          Console.WriteLine("UNEXPECTED: Cache create should not have succeeded");
+        }
+        catch (IllegalStateException gfex)
+        {
+          Console.WriteLine("Expected IllegalStateException: {0}", gfex.Message);
+        }
+        
+        // Close the GemFire Cache.
+        cache.Close();
+
+        Console.WriteLine("Closed the GemFire Cache");
+
+        try
+        {
+          // Put an Entry into the Region when Cache is already closed.
+          region["Key1"] = "Value1";
+  
+          Console.WriteLine("UNEXPECTED: Put should not have succeeded");
+        }
+        catch (RegionDestroyedException gfex)
+        {
+          Console.WriteLine("Expected RegionDestroyedException: {0}", gfex.Message);
+        }
+      }
+      // An exception should not occur
+      catch (GemFireException gfex)
+      {
+        Console.WriteLine("Exceptions GemFire Exception: {0}", gfex.Message);
+      }
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ac967000/geode-client-native/quickstart/csharp/ExecuteFunctions.cs
----------------------------------------------------------------------
diff --git a/geode-client-native/quickstart/csharp/ExecuteFunctions.cs b/geode-client-native/quickstart/csharp/ExecuteFunctions.cs
new file mode 100644
index 0000000..039eaf5
--- /dev/null
+++ b/geode-client-native/quickstart/csharp/ExecuteFunctions.cs
@@ -0,0 +1,151 @@
+/*
+ * The ExecuteFunction QuickStart Example.
+ *
+ * This example takes the following steps:
+ *
+ * 1. Create a GemFire Cache.
+ * 2. Get the example Region from the Cache.
+ * 3. Populate some query objects on the Region.
+ * 4. Create Execute Objects
+ * 5. Execute Functions
+ * 6. Close the Cache.
+ *
+ */
+
+// Use standard namespaces
+using System;
+
+// Use the GemFire namespace
+using GemStone.GemFire.Cache.Generic;
+using System.Collections.Generic;
+using System.Collections;
+
+namespace GemStone.GemFire.Cache.Generic.QuickStart
+{
+  // The Function Execution QuickStart example.
+
+  class ExecuteFunctions
+  {
+    private static string getFuncName = "MultiGetFunction";
+    private static string getFuncIName = "MultiGetFunctionI";
+
+    static void Main(string[] args)
+    {
+      try
+      {
+        CacheFactory cacheFactory = CacheFactory.CreateCacheFactory();
+
+        Cache cache = cacheFactory.SetSubscriptionEnabled(true).AddServer("localhost", 50505).AddServer("localhost", 40404).Create();
+
+        Console.WriteLine("Created the GemFire Cache");
+        IRegion<string, string> region = cache.CreateRegionFactory(RegionShortcut.CACHING_PROXY).Create<string, string>("partition_region");
+        Console.WriteLine("Created the Region");
+
+        region.GetSubscriptionService().RegisterAllKeys();
+
+        for (int i = 0; i < 34; i++)
+        {
+          region["KEY--" + i] = "VALUE--" + i;
+        }
+
+        object[] routingObj = new object[17];
+        int j = 0;
+        for (int i = 0; i < 34; i++)
+        {
+          if (i % 2 == 0) continue;
+          routingObj[j] = "KEY--" + i;
+          j++;
+        }
+        Console.WriteLine("routingObj count= {0}.", routingObj.Length);
+
+        bool args0 = true;
+        Boolean getResult = true;
+        //test data dependant function execution
+        //test get function with result
+        Execution<object> exc = FunctionService<object>.OnRegion<string, string>(region);
+        IResultCollector<object> rc = exc.WithArgs<bool>(args0).WithFilter<object>(routingObj).Execute(
+      getFuncName, getResult);
+        ICollection<object> executeFunctionResult = rc.GetResult();
+
+        List<object> resultList = new List<object>();
+        foreach (List<object> item in executeFunctionResult)
+        {
+
+          foreach (object subitem in item)
+          {
+            resultList.Add(subitem);
+          }
+        }
+
+        Console.WriteLine("on region: result count= {0}.", resultList.Count);
+        for (int i = 0; i < resultList.Count; i++)
+        {
+          Console.WriteLine("on region:get:result[{0}]={1}.", i, (string)resultList[i]);
+        }
+
+        getResult = true;
+        //test date independant fucntion execution on one server
+        //test get function with result
+        exc = FunctionService<object>.OnServer(cache);
+        ArrayList args1 = new ArrayList();
+        for (int i = 0; i < routingObj.Length; i++)
+        {
+          Console.WriteLine("routingObj[{0}]={1}.", i, (string)routingObj[i]);
+          args1.Add(routingObj[i]);
+        }
+        rc = exc.WithArgs<ArrayList>(args1).Execute(getFuncIName, getResult);
+        executeFunctionResult = rc.GetResult();
+        Console.WriteLine("on one server: result count= {0}.", executeFunctionResult.Count);
+        List<object> resultList1 = new List<object>();
+
+        foreach (List<object> item in executeFunctionResult)
+        {
+          foreach (object subitem in item)
+          {
+            resultList1.Add(subitem);
+          }
+        }
+        if (resultList1.Count != 17)
+          Console.WriteLine("result count check failed on one server:get:");
+        for (int i = 0; i < resultList1.Count; i++)
+        {
+          Console.WriteLine("on one server:get:result[{0}]={1}.", i, (string)resultList1[i]);
+        }
+
+        //test date independant fucntion execution on all servers
+        //test get function with result
+        exc = FunctionService<object>.OnServers(cache);
+        rc = exc.WithArgs<ArrayList>(args1).Execute(getFuncIName, getResult);
+        executeFunctionResult = rc.GetResult();
+        Console.WriteLine("on all servers: result count= {0}.", executeFunctionResult.Count);
+
+        List<object> resultList2 = new List<object>();
+
+        foreach (List<object> item in executeFunctionResult)
+        {
+          foreach (object subitem in item)
+          {
+            resultList2.Add(subitem);
+          }
+        }
+
+        if (resultList2.Count != 34)
+          Console.WriteLine("result count check failed on all servers");
+        for (int i = 0; i < resultList2.Count; i++)
+        {
+          Console.WriteLine("on all servers:result[{0}]={1}.", i, (string)resultList2[i]);
+        }
+
+        // Close the GemFire Cache.
+        cache.Close();
+
+        Console.WriteLine("Closed the GemFire Cache");
+      }
+      // An exception should not occur
+      catch (GemFireException gfex)
+      {
+        Console.WriteLine("ExecuteFunctions GemFire Exception: {0}", gfex.Message);
+      }
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ac967000/geode-client-native/quickstart/csharp/HACache.cs
----------------------------------------------------------------------
diff --git a/geode-client-native/quickstart/csharp/HACache.cs b/geode-client-native/quickstart/csharp/HACache.cs
new file mode 100644
index 0000000..38d772b
--- /dev/null
+++ b/geode-client-native/quickstart/csharp/HACache.cs
@@ -0,0 +1,114 @@
+/*
+ * The HA QuickStart Example.
+ *
+ * This example takes the following steps:
+ *
+ * 1. Connect to a GemFire Distributed System which has two cache servers.
+ * 2. Create a GemFire Cache with redundancy level = 1.
+ * 3. Get the example generic Region from the Cache.
+ * 4. Call registerKeys() on the Region.
+ * 5. Call registerRegex() on the Region.
+ * 6. Put two keys in the Region.
+ * 7. Verify that the keys are destroyed via expiration in server. 
+ * 8. Close the Cache.
+ *
+ */
+
+// Use standard namespaces
+using System;
+using System.Threading;
+
+// Use the GemFire namespace
+using GemStone.GemFire.Cache.Generic;
+
+namespace GemStone.GemFire.Cache.Generic.QuickStart
+{
+  // The HA QuickStart example.
+  class HA
+  {
+    static void Main(string[] args)
+    {
+      try
+      {
+        // Create a GemFire Cache.
+        GemStone.GemFire.Cache.Generic.CacheFactory cacheFactory = CacheFactory.CreateCacheFactory();
+
+        Cache cache = cacheFactory.Set("cache-xml-file", "XMLs/clientHACache.xml")
+                  .AddServer("localhost", 40404)
+                  .AddServer("localhost", 40405)
+                  .SetSubscriptionRedundancy(1)
+                  .SetSubscriptionEnabled(true)
+                  .Create();
+
+        Console.WriteLine("Created the GemFire Cache");
+
+        // Get the example Region from the Cache which is declared in the Cache XML file.
+        IRegion<object, int> region = cache.GetRegion<object, int>("/exampleRegion");
+
+        Console.WriteLine("Obtained the generic Region from the Cache");
+
+        // Register and Unregister Interest on Region for Some Keys.
+        object [] keys = new object[] { 123, "Key-123" };
+        region.GetSubscriptionService().RegisterKeys(keys);
+        region.GetSubscriptionService().RegisterRegex("Keys.*");
+
+        Console.WriteLine("Called RegisterKeys() and RegisterRegex()");
+
+        region[123] = 1;
+        region["Key-123"] = 2;
+        
+        Console.WriteLine("Called put() on Region");
+        
+        Console.WriteLine("Waiting for updates on keys");
+        Thread.Sleep(10000);
+        
+        int count = 0;
+
+        //try to get the entries for keys destroyed by server.
+        try
+        {
+          int value1 = region[123];
+          Console.WriteLine("UNEXPECTED: First get should not have succeeded");
+
+        }
+        catch(KeyNotFoundException){
+          Console.WriteLine("gfex.Message: Verified that key1 has been destroyed");
+          count++;
+        }
+
+        try
+        {
+          int value2 = region["Key-123"];
+          Console.WriteLine("UNEXPECTED: Second get should not have succeeded");
+        }
+        catch (KeyNotFoundException)
+        {
+          Console.WriteLine("gfex.Message: Verified that key2 has been destroyed");
+          count++;
+        }
+
+        if (count == 2) {
+          Console.WriteLine("Verified all updates");
+        }
+        else {
+          Console.WriteLine("Could not verify all updates");
+        }
+
+        region.GetSubscriptionService().UnregisterKeys(keys);
+        region.GetSubscriptionService().UnregisterRegex("Keys.*");
+    
+        Console.WriteLine("Unregistered keys");
+            
+        // Close the GemFire Cache.
+        cache.Close();
+
+        Console.WriteLine("Closed the GemFire Cache");
+      }
+      // An exception should not occur
+      catch (GemFireException gfex)
+      {
+        Console.WriteLine("HACache GemFire Exception: {0}", gfex.Message);
+      }
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ac967000/geode-client-native/quickstart/csharp/LoaderListenerWriter.cs
----------------------------------------------------------------------
diff --git a/geode-client-native/quickstart/csharp/LoaderListenerWriter.cs b/geode-client-native/quickstart/csharp/LoaderListenerWriter.cs
new file mode 100644
index 0000000..dc7e438
--- /dev/null
+++ b/geode-client-native/quickstart/csharp/LoaderListenerWriter.cs
@@ -0,0 +1,110 @@
+/*
+ * The LoaderListenerWriter QuickStart Example.
+ *
+ * This example takes the following steps:
+ *
+ *  1. Connect to a GemFire Distributed System.
+ *  2. Create a GemFire Cache.
+ *  3. Get the generic example Region from the Cache.
+ *  4. Set the generic SimpleCacheLoader, SimpleCacheListener and SimpleCacheWriter plugins on the Region.
+ *  5. Put 3 Entries into the Region.
+ *  6. Update an Entry in the Region.
+ *  7. Destroy an Entry in the Region.
+ *  8. Invalidate an Entry in the Region.
+ *  9. Get a new Entry from the Region.
+ * 10. Get the destroyed Entry from the Region.
+ * 11. Close the Cache.
+ * 12. Disconnect from the Distributed System.
+ *
+ */
+
+// Use standard namespaces
+using System;
+
+// Use the GemFire namespace
+using GemStone.GemFire.Cache.Generic;
+
+namespace GemStone.GemFire.Cache.Generic.QuickStart
+{
+  // The LoaderListenerWriter QuickStart example.
+  class LoaderListenerWriter
+  {
+    static void Main(string[] args)
+    {
+      try
+      {
+        // Create a GemFire Cache.
+        CacheFactory cacheFactory = CacheFactory.CreateCacheFactory();
+
+        Cache cache = cacheFactory.Set("cache-xml-file", "XMLs/clientLoaderListenerWriter.xml")
+                                  .SetSubscriptionEnabled(true)
+                                  .Create();
+
+        Console.WriteLine("Created the GemFire Cache");
+
+        // Get the example Region from the Cache which is declared in the Cache XML file.
+        IRegion<string, string> region = cache.GetRegion<string, string>("/exampleRegion");
+
+        Console.WriteLine("Obtained the generic Region from the Cache");
+
+        // Plugin the SimpleCacheLoader, SimpleCacheListener and SimpleCacheWrite to the Region.
+        AttributesMutator<string, string> attrMutator = region.AttributesMutator;
+        attrMutator.SetCacheLoader(new SimpleCacheLoader<string, string>());
+        attrMutator.SetCacheListener(new SimpleCacheListener<string, string>());
+        attrMutator.SetCacheWriter(new SimpleCacheWriter<string, string>());
+
+        Console.WriteLine("Attached the simple generic plugins on the Region");
+
+        // The following operations should cause the plugins to print the events.
+
+        // Put 3 Entries into the Region using the IDictionary interface.
+        region["Key1"] = "Value1";
+        region["Key2"] = "Value2";
+        region["Key3"] = "Value3";
+
+        Console.WriteLine("Put 3 Entries into the Region");
+
+        // Update Key3.
+        region["Key3"] = "Value3-Updated";
+
+        // Destroy Key3 using the IDictionary interface.
+        region.Remove("Key3");
+
+        // Invalidate Key2.
+        region.Invalidate("Key2");
+
+        string value = null;
+        
+        try
+        {
+          // Get a new Key.
+          value = region["Key4"];
+        }
+        catch (KeyNotFoundException knfex)
+        {
+          Console.WriteLine("Got expected KeyNotFoundException: {0}", knfex.Message);
+        }
+        
+        try
+        {
+          // Get a destroyed Key.
+          value = region["Key3"];
+        }
+        catch (KeyNotFoundException knfex)
+        {
+          Console.WriteLine("Got expected KeyNotFoundException: {0}", knfex.Message);
+        }
+
+        // Close the GemFire Cache.
+        cache.Close();
+
+        Console.WriteLine("Closed the GemFire Cache");
+      }
+      // An exception should not occur
+      catch (GemFireException gfex)
+      {
+        Console.WriteLine("LoaderListenerWriter GemFire Exception: {0}", gfex.Message);
+      }
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ac967000/geode-client-native/quickstart/csharp/MultiuserSecurity.cs
----------------------------------------------------------------------
diff --git a/geode-client-native/quickstart/csharp/MultiuserSecurity.cs b/geode-client-native/quickstart/csharp/MultiuserSecurity.cs
new file mode 100755
index 0000000..08b1ecc
--- /dev/null
+++ b/geode-client-native/quickstart/csharp/MultiuserSecurity.cs
@@ -0,0 +1,181 @@
+/*
+ * The MultiuserSecurityExample QuickStart Example.
+ *
+ * This example takes the following steps:
+ *
+ * 1. Create a GemFire Cache with multiuser enabled.
+ * 2. Creates userCache using user "root". Who is authorized to do get and put operations.
+ * 3. Creates userCache using user "writer2". Who is authorized to do only put operation. It tries to do get operation and gets NotAuthorizedException.
+ * 4.  Close the Cache.
+ *
+ */
+
+// Use standard namespaces
+using System;
+
+// Use the GemFire namespace
+using GemStone.GemFire.Cache.Generic;
+using System.Collections.Generic;
+using System.Collections;
+namespace GemStone.GemFire.Cache.Generic.QuickStart
+{
+  // The MultiuserSecurityExample QuickStart example.
+  class MultiuserSecurityExample
+  {
+    private static string getFuncIName = "MultiGetFunctionI";
+
+    public void RunMultiuserSecurityExample()
+    {
+      // Create client's Authentication Intializer and Credentials using api ( Same can be set to gfcpp.properties & comment following code ).
+      Properties<string, string> secProp = Properties<string, string>.Create<string, string>();
+
+      //By setting this property client will send credential in encrypted form.
+      //to do this one need to setup OpenSSL.
+      //secProp.Insert("security-client-dhalgo", "Blowfish:128");
+
+      // Connect to the GemFire Distributed System using the settings from the gfcpp.properties file by default.
+      // Create a GemFire Cache.
+      CacheFactory cacheFactory = CacheFactory.CreateCacheFactory(null);
+
+      Cache cache = cacheFactory.SetMultiuserAuthentication(true).Create();
+
+      Console.WriteLine("Created the GemFire Cache");
+
+      RegionFactory regionFactory = cache.CreateRegionFactory(RegionShortcut.PROXY);
+
+      IRegion<string, string> region = regionFactory.Create<string, string>("partition_region");
+
+      Console.WriteLine("Created the Region Programmatically.");
+
+      runWithUserRoot(cache);
+      runWithUserWriter(cache);
+
+      cache.Close();
+
+      Console.WriteLine("Client disconnected from the GemFire Distributed System");
+    }
+    
+    void runWithUserRoot(Cache cache)
+    {
+      Console.WriteLine("Created the Region Programmatically. 0");
+      //user "root" 's credential
+      Properties<string, object> credentials = Properties<string, object>.Create<string, object>();
+      //user = "root" has permission to do put/get both  
+      credentials.Insert("security-username", "root");
+      credentials.Insert("security-password", "root");
+
+      Console.WriteLine("Created the Region Programmatically. 1");
+      // Create user cache by passing credentials
+      IRegionService userCache1 = cache.CreateAuthenticatedView(credentials);
+
+      Console.WriteLine("Created the Region Programmatically. 2");
+      // Create region using usercache
+      IRegion<string, string> userRegion1 = userCache1.GetRegion<string, string>("partition_region");
+
+      //doing operation on behalf of user "root"
+      userRegion1["key-1"] = "val-1";
+
+      string result = userRegion1["key-1"];
+
+      //to execute function on server
+      Execution<object> exc = FunctionService<object>.OnServer(userCache1);
+
+      bool getResult = true;
+      ArrayList args1 = new ArrayList();
+      args1.Add("key-1");
+
+      IResultCollector<object> rc = exc.WithArgs<ArrayList>(args1).Execute(
+      getFuncIName, getResult);
+      ICollection<object> executeFunctionResult = rc.GetResult();
+      Console.WriteLine("on one server: result count= {0}.", executeFunctionResult.Count);
+
+      List<object> resultList1 = new List<object>();    
+      foreach (List<object> item in executeFunctionResult)
+      {
+        foreach (object subitem in item)
+        {
+          resultList1.Add(subitem);
+        }
+      }
+
+      for (int i = 0; i < resultList1.Count; i++)
+      {
+        Console.WriteLine("on one server:get:result[{0}]={1}.", i, (string)resultList1[i]);
+      }
+
+      //to execute Query
+
+      // Get the QueryService from the Cache.
+      QueryService<string, string> qrySvc = userCache1.GetQueryService<string, string>();
+
+      Console.WriteLine("Got the QueryService from the user Cache");
+
+      // Execute a Query which returns a ResultSet.    
+      Query<string> qry = qrySvc.NewQuery("SELECT DISTINCT * FROM /partition_region");
+      ISelectResults<string> results = qry.Execute();
+
+      Console.WriteLine("ResultSet Query returned {0} rows", results.Size);
+
+      userCache1.Close();
+
+      Console.WriteLine("User root done put/get ops successfully");
+    }
+    
+    void runWithUserWriter(Cache cache)
+    {
+      //user "writer2" 's credential
+      Properties<string, object> credentials = Properties<string, object>.Create<string, object>();
+      //user = "writer2" has permission to do put ops only  
+      credentials.Insert("security-username", "writer2");
+      credentials.Insert("security-password", "writer2");
+
+      // Create user cache by passing credentials
+      IRegionService userCache2 = cache.CreateAuthenticatedView(credentials);
+
+      // Create region using usercache
+      IRegion<string, string> userRegion2 = userCache2.GetRegion<string, string>("partition_region");
+
+      bool exceptiongot = false;
+
+      try
+      {
+        //"writer2" trying to do get operation on region, it should get NotAuthorized exception
+        string res = userRegion2["key-1"];
+      }
+      catch (NotAuthorizedException ex)
+      {
+        Console.WriteLine("Got expected UnAuthorizedException: {0}", ex.Message);
+        exceptiongot = true;
+      }
+
+      if (exceptiongot == false)
+      {
+        Console.WriteLine("Example FAILED: Did not get expected NotAuthorizedException");
+      }
+      else
+      {
+        Console.WriteLine("User writer2 got expected while doing get operation.");
+      }
+
+      //close the user cache
+      userCache2.Close();
+    }
+    
+    static void Main(string[] args)
+    {
+      try
+      {
+        MultiuserSecurityExample ex = new MultiuserSecurityExample();
+
+        //Run Security Client
+        ex.RunMultiuserSecurityExample();
+
+      }
+      // An exception should not occur
+      catch (GemFireException gfex)
+      {
+        Console.WriteLine("FAILED: MultiuserSecurityExample GemFire Exception: {0}", gfex.Message);
+      }
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ac967000/geode-client-native/quickstart/csharp/PdxInstance.cs
----------------------------------------------------------------------
diff --git a/geode-client-native/quickstart/csharp/PdxInstance.cs b/geode-client-native/quickstart/csharp/PdxInstance.cs
new file mode 100755
index 0000000..9c54429
--- /dev/null
+++ b/geode-client-native/quickstart/csharp/PdxInstance.cs
@@ -0,0 +1,120 @@
+/*
+ * The PdxInstance QuickStart Example.
+ * This example takes the following steps:
+ *
+ * This example shows IPdxInstanceFactory and IPdxInstance usage. 
+ *
+ * 1. Create a GemFire Cache.
+ * 2. Creates the PdxInstanceFactory for Person class.
+ * 3. Then creates instance of PdxInstance
+ * 4. It does put.
+ * 5. Then it does get and access it fields.
+ * 6. Close the Cache.
+ *
+ */
+// Use standard namespaces
+using System;
+using System.Reflection;
+// Use the GemFire namespace
+using GemStone.GemFire.Cache.Generic;
+
+
+namespace GemStone.GemFire.Cache.Generic.QuickStart
+{
+  public class Person
+  {
+    private string name;
+    //this is the only field used on server to create hashcode and use in equals method
+    [PdxIdentityField]
+    private int id;
+    private int age;
+    
+    public Person() { }
+
+    public Person(string name, int id, int age)
+    {
+      this.name = name;
+      this.id = id;
+      this.age = age;
+    }
+    
+    #region Public Properties
+    public string Name
+    {
+      get { return name; }
+    }
+    public int ID
+    {
+      get { return id; }
+    }
+    public int Age
+    {
+      get { return age; }
+    }
+    #endregion
+  }   
+  // The PdxInstance QuickStart example.
+  class PdxInstance
+  {
+    static void Main(string[] args)
+    {
+      try
+      {
+
+        CacheFactory cacheFactory = CacheFactory.CreateCacheFactory();
+
+        Console.WriteLine("Connected to the GemFire Distributed System");
+
+        // Create a GemFire Cache with the "clientPdxRemoteQuery.xml" Cache XML file.
+        // Set SetPdxReadSerialized to true to access PdxInstance
+        Cache cache = cacheFactory.Set("cache-xml-file", "XMLs/clientPdxInstance.xml").Create();
+
+        Console.WriteLine("Created the GemFire Cache");
+
+        // Get the example Region from the Cache which is declared in the Cache XML file.
+        IRegion<string, IPdxInstance> region = cache.GetRegion<string, IPdxInstance>("Person");
+
+        Console.WriteLine("Obtained the Region from the Cache");
+
+        Person p = new Person("Jack", 7, 21);
+        
+        //PdxInstanceFactory for Person class
+        IPdxInstanceFactory pif = cache.CreatePdxInstanceFactory("Person");
+        
+        pif.WriteString("name", p.Name);
+        pif.WriteInt("id", p.ID);
+        pif.MarkIdentityField("id");
+        pif.WriteInt("age", p.Age);
+        
+        IPdxInstance pdxInstance = pif.Create();
+        
+        Console.WriteLine("Created PdxInstance for Person class");
+        
+        region["Key1"] = pdxInstance;
+
+        Console.WriteLine("Populated PdxInstance Object");
+
+        IPdxInstance retPdxInstance = region["Key1"];
+
+        if((int)retPdxInstance.GetField("id") == p.ID
+             && (int)retPdxInstance.GetField("age") == p.Age
+               && (string)retPdxInstance.GetField("name") == p.Name 
+                 && retPdxInstance.IsIdentityField("id") == true)
+           Console.WriteLine("PdxInstance returns all fields value expected");
+        else
+           Console.WriteLine("PdxInstance doesn't returns all fields value expected");
+        
+        // Close the GemFire Cache.
+        cache.Close();
+
+        Console.WriteLine("Closed the GemFire Cache");
+
+      }
+      // An exception should not occur
+      catch (GemFireException gfex)
+      {
+        Console.WriteLine("PdxInstance GemFire Exception: {0}", gfex.Message);
+      }
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ac967000/geode-client-native/quickstart/csharp/PdxRemoteQuery.cs
----------------------------------------------------------------------
diff --git a/geode-client-native/quickstart/csharp/PdxRemoteQuery.cs b/geode-client-native/quickstart/csharp/PdxRemoteQuery.cs
new file mode 100644
index 0000000..25e7752
--- /dev/null
+++ b/geode-client-native/quickstart/csharp/PdxRemoteQuery.cs
@@ -0,0 +1,125 @@
+/*
+ * The PdxRemoteQuery QuickStart Example.
+ * This example takes the following steps:
+ *
+ * This example shows IPdxSerializable usage with remote query. It can query .NET objects without having corresponding java classes at server.
+ * Look PortfolioPdx.cs and PositionPdx.cs to know more.
+ *
+ * 1. Create a GemFire Cache.
+ * 2. Get the example Region from the Cache.
+ * 3. Populate some query Pdx objects on the Region.
+ * 4. Get the pool, get the Query Service from Pool. Pool is define in clientPdxRemoteQuery.xml. 
+ * 5. Execute a query that returns a Result Set.
+ * 6. Execute a query that returns a Struct Set.
+ * 7. Execute the region shortcut/convenience query methods.
+ * 8. Close the Cache.
+ *
+ */
+// Use standard namespaces
+using System;
+
+// Use the GemFire namespace
+using GemStone.GemFire.Cache.Generic;
+
+// Use the "Tests" namespace for the query objects.
+using PdxTests;
+
+namespace GemStone.GemFire.Cache.Generic.QuickStart
+{
+  // The PdxRemoteQuery QuickStart example.
+  class PdxRemoteQuery
+  {
+    static void Main(string[] args)
+    {
+      try
+      {
+
+        CacheFactory cacheFactory = CacheFactory.CreateCacheFactory();
+
+        Console.WriteLine("Connected to the GemFire Distributed System");
+
+        // Create a GemFire Cache with the "clientPdxRemoteQuery.xml" Cache XML file.
+        Cache cache = cacheFactory.Set("cache-xml-file", "XMLs/clientPdxRemoteQuery.xml").Create();
+
+        Console.WriteLine("Created the GemFire Cache");
+
+        // Get the example Region from the Cache which is declared in the Cache XML file.
+        IRegion<string, PortfolioPdx> region = cache.GetRegion<string, PortfolioPdx>("Portfolios");
+
+        Console.WriteLine("Obtained the Region from the Cache");
+
+        // Register our Serializable/Cacheable Query objects, viz. Portfolio and Position.
+        Serializable.RegisterPdxType(PortfolioPdx.CreateDeserializable);
+        Serializable.RegisterPdxType(PositionPdx.CreateDeserializable);
+
+        Console.WriteLine("Registered Serializable Query Objects");
+
+        // Populate the Region with some PortfolioPdx objects.
+        PortfolioPdx port1 = new PortfolioPdx(1 /*ID*/, 10 /*size*/);
+        PortfolioPdx port2 = new PortfolioPdx(2 /*ID*/, 20 /*size*/);
+        PortfolioPdx port3 = new PortfolioPdx(3 /*ID*/, 30 /*size*/);
+        region["Key1"] = port1;
+        region["Key2"] = port2;
+        region["Key3"] = port3;
+
+        Console.WriteLine("Populated some PortfolioPdx Objects");
+
+        //find the pool
+        Pool pool = PoolManager.Find("examplePool");
+
+        // Get the QueryService from the pool
+        QueryService<string, PortfolioPdx> qrySvc = pool.GetQueryService<string, PortfolioPdx>();
+
+        Console.WriteLine("Got the QueryService from the Pool");
+
+        // Execute a Query which returns a ResultSet.    
+        Query<PortfolioPdx> qry = qrySvc.NewQuery("SELECT DISTINCT * FROM /Portfolios");
+        ISelectResults<PortfolioPdx> results = qry.Execute();
+
+        Console.WriteLine("ResultSet Query returned {0} rows", results.Size);
+
+        // Execute a Query which returns a StructSet.
+        QueryService<string, Struct> qrySvc1 = pool.GetQueryService<string, Struct>();
+        Query<Struct> qry1 = qrySvc1.NewQuery("SELECT DISTINCT id, status FROM /Portfolios WHERE id > 1");
+        ISelectResults<Struct> results1 = qry1.Execute();
+
+        Console.WriteLine("StructSet Query returned {0} rows", results1.Size);
+
+        // Iterate through the rows of the query result.
+        int rowCount = 0;
+        foreach (Struct si in results1)
+        {
+          rowCount++;
+          Console.WriteLine("Row {0} Column 1 is named {1}, value is {2}", rowCount, si.Set.GetFieldName(0), si[0].ToString());
+          Console.WriteLine("Row {0} Column 2 is named {1}, value is {2}", rowCount, si.Set.GetFieldName(1), si[1].ToString());
+        }
+
+        // Execute a Region Shortcut Query (convenience method).
+        results = region.Query<PortfolioPdx>("id = 2");
+
+        Console.WriteLine("Region Query returned {0} rows", results.Size);
+
+        // Execute the Region selectValue() API.
+        object result = region.SelectValue("id = 3");
+
+        Console.WriteLine("Region selectValue() returned an item:\n {0}", result.ToString());
+
+        // Execute the Region existsValue() API.
+        bool existsValue = region.ExistsValue("id = 4");
+
+        Console.WriteLine("Region existsValue() returned {0}", existsValue ? "true" : "false");
+
+        // Close the GemFire Cache.
+        cache.Close();
+
+        Console.WriteLine("Closed the GemFire Cache");
+
+      }
+      // An exception should not occur
+      catch (GemFireException gfex)
+      {
+        Console.WriteLine("PdxRemoteQuery GemFire Exception: {0}", gfex.Message);
+      }
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ac967000/geode-client-native/quickstart/csharp/PdxSerializer.cs
----------------------------------------------------------------------
diff --git a/geode-client-native/quickstart/csharp/PdxSerializer.cs b/geode-client-native/quickstart/csharp/PdxSerializer.cs
new file mode 100755
index 0000000..d932c09
--- /dev/null
+++ b/geode-client-native/quickstart/csharp/PdxSerializer.cs
@@ -0,0 +1,233 @@
+/*
+ * The PdxSerializer QuickStart Example.
+ * This example takes the following steps:
+ *
+ * This example shows IPdxSerializer usage. 
+ * We have used inbuilt ReflectionBasedAutoSerializer as IPdxSerializer. ReflectionBasedAutoSerializer class implements the IPdxSerializer interface
+ * This auto serializer uses reflection to serialize and de-serialize class members.
+ * User can use PdxIdentityField attribute on member fields to define field as identity field.
+ * ReflectionBasedAutoSerializer will use this attribute to set field as identity field for Pdx data.
+ *
+ * AutoSerializerEx class extends the ReflectionBasedAutoSerializer class and override WriteTransform and ReadTransform methods.
+ * In this method it handles serialization of .NET decimal type and Guid type.
+ * 
+ * PdxTypeMapper class demonstrates that how app can map .NET types to pdx types(java types)
+ * 
+ * Domain class should have default constructor(zero-arg).
+ *
+ * After that test demonstrartes query on .NET objects without having corresponding java classes at server.
+ *
+ * 1. Create a GemFire Cache.
+ * 2. Get the Person from the Cache.
+ * 3. Populate some query Person objects on the Region.
+ * 4. Get the pool, get the Query Service from Pool. Pool is define in clientPdxRemoteQuery.xml. 
+ * 5. Execute a query that returns a Result Set.
+ * 6. Execute a query that returns a Struct Set.
+ * 7. Execute the region shortcut/convenience query methods.
+ * 8. Close the Cache.
+ *
+ */
+// Use standard namespaces
+using System;
+using System.Reflection;
+// Use the GemFire namespace
+using GemStone.GemFire.Cache.Generic;
+
+
+namespace GemStone.GemFire.Cache.Generic.QuickStart
+{
+  public class Person
+  {
+    private string name;
+    //this is the only field used on server to create hashcode and use in equals method
+    [PdxIdentityField]
+    private int id;
+    private int age;
+    //private decimal salary;
+    private Guid guid = Guid.NewGuid();
+
+    public Person() { }
+
+    public Person(string name, int id, int age)
+    {
+      this.name = name;
+      this.id = id;
+      this.age = age;
+      //this.salary = 217773.12321M;
+    }
+    #region Public Properties
+    public string Name
+    {
+      get { return name; }
+    }
+    public int ID
+    {
+      get { return id; }
+    }
+    public int Age
+    {
+      get { return age; }
+    }
+    #endregion
+  }
+  
+  //This demonstrates, how to extend ReflectionBasedAutoSerializer
+  public class AutoSerializerEx : ReflectionBasedAutoSerializer
+  {
+    public override object WriteTransform(FieldInfo fi, Type type, object originalValue)
+    {
+      if (fi.FieldType.Equals(Type.GetType("System.Guid")))
+      {
+        return originalValue.ToString();
+      }
+      else if (fi.FieldType.Equals(Type.GetType("System.Decimal")))
+      {
+        return originalValue.ToString();
+      }
+      else
+        return base.WriteTransform(fi, type, originalValue);
+    }
+    
+    public override object ReadTransform(FieldInfo fi, Type type, object serializeValue)
+    {
+      if (fi.FieldType.Equals(Type.GetType("System.Guid")))
+      {
+        Guid g = new Guid((string)serializeValue);
+        return g;
+      }
+      else if (fi.FieldType.Equals(Type.GetType("System.Decimal")))
+      {
+        return Convert.ToDecimal((string)serializeValue);
+      }
+      else
+        return base.ReadTransform(fi, type, serializeValue);
+    }
+    
+    public override FieldType GetFieldType(FieldInfo fi, Type type)
+    {
+      if (fi.FieldType.Equals(Type.GetType("System.Guid")) || fi.FieldType.Equals(Type.GetType("System.Decimal")))
+        return FieldType.STRING;
+      return base.GetFieldType(fi, type);
+    }
+    
+    public override bool IsIdentityField(FieldInfo fi, Type type)
+    {
+      if (fi.Name == "_identityField")
+        return true;
+      return base.IsIdentityField(fi, type);
+    }
+    public override string GetFieldName(FieldInfo fi, Type type)
+    {
+      if (fi.Name == "_nameChange")
+        return fi.Name + "NewName";
+
+      return fi.Name ;
+    }
+
+    public override bool IsFieldIncluded(FieldInfo fi, Type type)
+    {
+      if (fi.Name == "_notInclude")
+        return false;
+      return base.IsFieldIncluded(fi, type);
+    }
+  }
+  
+  //This demonstrates, how to map .NET type to pdx type or java type
+  public class PdxTypeMapper : IPdxTypeMapper
+  { 
+    public string ToPdxTypeName(string localTypeName)
+    {
+      return "pdx_" + localTypeName;
+    }
+
+    public string FromPdxTypeName(string pdxTypeName)
+    {
+      return pdxTypeName.Substring(4);//need to extract "pdx_"
+    }
+  }
+  
+  // The PdxRemoteQuery QuickStart example.
+  class PdxSerializer
+  {
+    static void Main(string[] args)
+    {
+      try
+      {
+
+        CacheFactory cacheFactory = CacheFactory.CreateCacheFactory();
+
+        Console.WriteLine("Connected to the GemFire Distributed System");
+
+        // Create a GemFire Cache with the "clientPdxRemoteQuery.xml" Cache XML file.
+        Cache cache = cacheFactory.Set("cache-xml-file", "XMLs/clientPdxSerializer.xml").Create();
+
+        Console.WriteLine("Created the GemFire Cache");
+
+        // Get the example Region from the Cache which is declared in the Cache XML file.
+        IRegion<string, Person> region = cache.GetRegion<string, Person>("Person");
+
+        Console.WriteLine("Obtained the Region from the Cache");
+
+        //to map .net type tp pdx type or java type
+        Serializable.SetPdxTypeMapper(new PdxTypeMapper());
+        
+        // Register inbuilt reflection based autoserializer to serialize the domain types(Person class) as pdx format
+        Serializable.RegisterPdxSerializer(new AutoSerializerEx());
+        Console.WriteLine("Registered Person Query Objects");
+
+        // Populate the Region with some PortfolioPdx objects.
+        Person p1 = new Person("John", 1 /*ID*/, 23 /*age*/);
+        Person p2 = new Person("Jack", 2 /*ID*/, 20 /*age*/);
+        Person p3 = new Person("Tony", 3 /*ID*/, 35 /*age*/);
+        
+        region["Key1"] = p1;
+        region["Key2"] = p2;
+        region["Key3"] = p3;
+
+        Console.WriteLine("Populated some Person Objects");
+
+        //find the pool
+        Pool pool = PoolManager.Find("examplePool");
+
+        // Get the QueryService from the pool
+        QueryService<string, Person> qrySvc = pool.GetQueryService<string, Person>();
+
+        Console.WriteLine("Got the QueryService from the Pool");
+
+        // Execute a Query which returns a ResultSet.    
+        Query<Person> qry = qrySvc.NewQuery("SELECT DISTINCT * FROM /Person");
+        ISelectResults<Person> results = qry.Execute();
+
+        Console.WriteLine("ResultSet Query returned {0} rows", results.Size);
+
+        // Execute a Query which returns a StructSet.
+        QueryService<string, Struct> qrySvc1 = pool.GetQueryService<string, Struct>();
+        Query<Struct> qry1 = qrySvc1.NewQuery("SELECT name, age FROM /Person WHERE id = 1");
+        ISelectResults<Struct> results1 = qry1.Execute();
+
+        Console.WriteLine("StructSet Query returned {0} rows", results1.Size);
+
+        // Iterate through the rows of the query result.
+        int rowCount = 0;
+        foreach (Struct si in results1)
+        {
+          rowCount++;
+          Console.WriteLine("Row {0} Column 1 is named {1}, value is {2}", rowCount, si.Set.GetFieldName(0), si[0].ToString());
+          Console.WriteLine("Row {0} Column 2 is named {1}, value is {2}", rowCount, si.Set.GetFieldName(1), si[1].ToString());
+        }
+
+        
+        // Close the GemFire Cache.
+        cache.Close();
+
+        Console.WriteLine("Closed the GemFire Cache");
+
+      }
+      // An exception should not occur
+      catch (GemFireException gfex)
+      {
+        Console.WriteLine("PdxSerializer GemFire Exception: {0}", gfex.Message);
+      }
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ac967000/geode-client-native/quickstart/csharp/PoolCqQuery.cs
----------------------------------------------------------------------
diff --git a/geode-client-native/quickstart/csharp/PoolCqQuery.cs b/geode-client-native/quickstart/csharp/PoolCqQuery.cs
new file mode 100755
index 0000000..a6f20aa
--- /dev/null
+++ b/geode-client-native/quickstart/csharp/PoolCqQuery.cs
@@ -0,0 +1,174 @@
+/*
+ * The Pool Continuous Query QuickStart Example.
+ *
+ * This example takes the following steps:
+ *
+ * 1. Create CacheFactory using the user specified properties or from the gfcpp.properties file by default.
+ * 2. Create a GemFire Cache.
+ * 3. Get the Portfolios Region from the Pool.
+ * 4. Populate some query objects on the Region.
+ * 5. Get the Query Service from cache.
+ * 6. Register a cqQuery listener
+ * 7. Execute a cqQuery with initial Results
+ * 8. Close the Cache.
+ *
+ */
+
+// Use standard namespaces
+using System;
+
+// Use the GemFire namespace
+using GemStone.GemFire.Cache.Generic;
+
+// Use the "Tests" namespace for the query objects.
+using GemStone.GemFire.Cache.Tests.NewAPI;
+
+namespace GemStone.GemFire.Cache.Generic.QuickStart
+{
+  // The PoolCqQuery QuickStart example.
+
+  //User Listener
+  public class MyCqListener<TKey, TResult> : ICqListener<TKey, TResult>
+  {
+    public virtual void OnEvent(CqEvent<TKey, TResult> ev)
+    {
+      Portfolio val = ev.getNewValue() as  Portfolio;
+      TKey key = ev.getKey();
+      CqOperationType opType = ev.getQueryOperation();
+      string opStr = "DESTROY";
+      if(opType == CqOperationType.OP_TYPE_CREATE)
+         opStr = "CREATE";
+      else if(opType == CqOperationType.OP_TYPE_UPDATE)
+         opStr = "UPDATE";
+      Console.WriteLine("MyCqListener::OnEvent called with key {0}, value ({1},{2}), op {3}.", key, val.ID, val.Pkid,opStr);
+    }
+    public virtual void OnError(CqEvent<TKey, TResult> ev)
+    {
+      Console.WriteLine("MyCqListener::OnError called");
+    }
+    public virtual void Close()
+    {
+      Console.WriteLine("MyCqListener::close called");
+    }
+  }
+  class ContinuousQuery
+  {
+    static void Main(string[] args)
+    {
+      try
+      {
+        //Create CacheFactory using the user specified properties or from the gfcpp.properties file by default.
+        Properties<string, string> prp = Properties<string, string>.Create<string, string>();
+        prp.Insert("cache-xml-file", "XMLs/clientPoolCqQuery.xml");
+        CacheFactory cacheFactory = CacheFactory.CreateCacheFactory(prp);
+
+        Console.WriteLine("Created CacheFactory");
+
+        // Create a GemFire Cache with the "clientPoolCqQuery.xml" Cache XML file.
+        Cache cache = cacheFactory.Create();
+
+        Console.WriteLine("Created the GemFire Cache");
+
+        // Get the Portfolios Region from the Cache which is declared in the Cache XML file.
+        IRegion<string, Portfolio> region = cache.GetRegion<string, Portfolio>("Portfolios");
+
+        Console.WriteLine("Obtained the Region from the Cache");
+
+        // Register our Serializable/Cacheable Query objects, viz. Portfolio and Position.
+        Serializable.RegisterTypeGeneric(Portfolio.CreateDeserializable);
+        Serializable.RegisterTypeGeneric(Position.CreateDeserializable);
+
+        Console.WriteLine("Registered Serializable Query Objects");
+
+        // Populate the Region with some Portfolio objects.
+        Portfolio port1 = new Portfolio(1 /*ID*/, 10 /*size*/);
+        Portfolio port2 = new Portfolio(2 /*ID*/, 20 /*size*/);
+        Portfolio port3 = new Portfolio(3 /*ID*/, 30 /*size*/);
+        region["Key1"] = port1;
+        region["Key2"] = port2;
+        region["Key3"] = port3;
+
+        Console.WriteLine("Populated some Portfolio Objects");
+
+        Pool pp = PoolManager.Find("examplePool");
+
+        // Get the QueryService from the Pool
+        QueryService<string, object> qrySvc = pp.GetQueryService<string, object>();
+
+        Console.WriteLine("Got the QueryService from the Cache");
+
+	    //create CqAttributes with listener
+        CqAttributesFactory<string, object> cqFac = new CqAttributesFactory<string, object>();
+        ICqListener<string, object> cqLstner = new MyCqListener<string, object>();
+        cqFac.AddCqListener(cqLstner);
+        CqAttributes<string, object> cqAttr = cqFac.Create();
+
+	    //create a new cqQuery
+        CqQuery<string, object> qry = qrySvc.NewCq("MyCq", "select * from /Portfolios" + "  p where p.ID!=2", cqAttr, false);
+
+        // Execute a CqQuery with Initial Results
+        ICqResults<object> results = qry.ExecuteWithInitialResults(); 
+
+        Console.WriteLine("ResultSet Query returned {0} rows", results.Size);
+	    //make changes to generate cq events
+        region["Key2"] = port1;
+        region["Key3"] = port2;
+        region["Key1"] = port3;
+
+        SelectResultsIterator<object> iter = results.GetIterator();
+
+        while (iter.HasNext)
+        {
+          object  item = iter.Next();
+         
+          if (item != null)
+          {
+            Struct st = item as Struct;
+            string key = st["key"] as string;;
+            Console.WriteLine("Got key " + key);
+            Portfolio port = st["value"] as Portfolio;
+            if (port == null)
+            {
+              Position pos = st["value"] as Position;
+              if (pos == null)
+              {
+                string cs = st["value"] as string;
+                if (cs == null)
+                {
+                  Console.WriteLine("Query got other/unknown object.");
+                }
+                else
+                {
+                  Console.WriteLine("Query got string : {0}.", cs);
+                }
+              }
+              else
+              {
+                Console.WriteLine("Query got Position object with secId {0}, shares {1}.", pos.SecId, pos.SharesOutstanding);
+              }
+            }
+            else
+            {
+              Console.WriteLine("Query got Portfolio object with ID {0}, pkid {1}.", port.ID, port.Pkid);
+            }
+          }
+        }
+	//Stop the cq
+        qry.Stop();
+
+	//Close the cq
+        qry.Close();
+
+        // Close the GemFire Cache.
+        cache.Close();
+
+        Console.WriteLine("Closed the GemFire Cache");
+      }
+      // An exception should not occur
+      catch (GemFireException gfex)
+      {
+        Console.WriteLine("PoolCqQuery GemFire Exception: {0}", gfex.Message);
+      }
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ac967000/geode-client-native/quickstart/csharp/PoolRemoteQuery.cs
----------------------------------------------------------------------
diff --git a/geode-client-native/quickstart/csharp/PoolRemoteQuery.cs b/geode-client-native/quickstart/csharp/PoolRemoteQuery.cs
new file mode 100755
index 0000000..433b323
--- /dev/null
+++ b/geode-client-native/quickstart/csharp/PoolRemoteQuery.cs
@@ -0,0 +1,123 @@
+/*
+ * The PoolRemoteQuery QuickStart Example.
+ * This examples creates pool using locator.
+ * This example takes the following steps:
+ *
+ * 1. Create a GemFire Cache.
+ * 2. Get the example Region from the Cache.
+ * 3. Populate some query objects on the Region.
+ * 4. Get the pool, get the Query Service from Pool. Pool is define in clientRemoteQueryWithPool.xml. Pool has locator to get the server. Apart from that pool is bind to server group "ServerGroup1".
+ * 5. Execute a query that returns a Result Set.
+ * 6. Execute a query that returns a Struct Set.
+ * 7. Execute the region shortcut/convenience query methods.
+ * 8. Close the Cache.
+ *
+ */
+// Use standard namespaces
+using System;
+
+// Use the GemFire namespace
+using GemStone.GemFire.Cache.Generic;
+
+// Use the "Tests" namespace for the query objects.
+using GemStone.GemFire.Cache.Tests.NewAPI;
+
+namespace GemStone.GemFire.Cache.Generic.QuickStart
+{
+  // The PoolRemoteQuery QuickStart example.
+  class PoolRemoteQuery
+  {
+    static void Main(string[] args)
+    {
+      try
+      {
+
+        CacheFactory cacheFactory = CacheFactory.CreateCacheFactory();
+       
+        Console.WriteLine("Connected to the GemFire Distributed System");
+
+        // Create a GemFire Cache with the "clientPoolRemoteQuery.xml" Cache XML file.
+        Cache cache = cacheFactory.Set("cache-xml-file", "XMLs/clientPoolRemoteQuery.xml").Create();
+
+        Console.WriteLine("Created the GemFire Cache");
+
+        // Get the example Region from the Cache which is declared in the Cache XML file.
+        IRegion<string, Portfolio> region = cache.GetRegion<string, Portfolio>("Portfolios");
+
+        Console.WriteLine("Obtained the Region from the Cache");
+        
+        // Register our Serializable/Cacheable Query objects, viz. Portfolio and Position.
+        Serializable.RegisterTypeGeneric(Portfolio.CreateDeserializable);
+        Serializable.RegisterTypeGeneric(Position.CreateDeserializable);
+
+        Console.WriteLine("Registered Serializable Query Objects");
+
+        // Populate the Region with some Portfolio objects.
+        Portfolio port1 = new Portfolio(1 /*ID*/, 10 /*size*/);
+        Portfolio port2 = new Portfolio(2 /*ID*/, 20 /*size*/);
+        Portfolio port3 = new Portfolio(3 /*ID*/, 30 /*size*/);
+        region["Key1"] = port1;
+        region["Key2"] = port2;
+        region["Key3"] = port3;
+
+        Console.WriteLine("Populated some Portfolio Objects");
+
+        //find the pool
+        Pool pool = PoolManager.Find("examplePool");
+
+        // Get the QueryService from the pool
+        QueryService<string, Portfolio> qrySvc = pool.GetQueryService<string, Portfolio>();
+
+        Console.WriteLine("Got the QueryService from the Pool");
+
+        // Execute a Query which returns a ResultSet.    
+        Query<Portfolio> qry = qrySvc.NewQuery("SELECT DISTINCT * FROM /Portfolios");
+        ISelectResults<Portfolio> results = qry.Execute();
+
+        Console.WriteLine("ResultSet Query returned {0} rows", results.Size);
+
+        // Execute a Query which returns a StructSet.
+        QueryService<string, Struct> qrySvc1 = pool.GetQueryService<string, Struct>();
+        Query<Struct> qry1 = qrySvc1.NewQuery("SELECT DISTINCT ID, status FROM /Portfolios WHERE ID > 1");
+        ISelectResults<Struct> results1 = qry1.Execute();
+
+        Console.WriteLine("StructSet Query returned {0} rows", results1.Size);
+
+        // Iterate through the rows of the query result.
+        int rowCount = 0;
+        foreach (Struct si in results1)
+        {
+          rowCount++;
+          Console.WriteLine("Row {0} Column 1 is named {1}, value is {2}", rowCount, si.Set.GetFieldName(0), si[0].ToString());
+          Console.WriteLine("Row {0} Column 2 is named {1}, value is {2}", rowCount, si.Set.GetFieldName(1), si[1].ToString());
+        }
+
+        // Execute a Region Shortcut Query (convenience method).
+        results = region.Query<Portfolio>("ID = 2");
+
+        Console.WriteLine("Region Query returned {0} rows", results.Size);
+
+        // Execute the Region selectValue() API.
+        object result = region.SelectValue("ID = 3");
+
+        Console.WriteLine("Region selectValue() returned an item:\n {0}", result.ToString());
+
+        // Execute the Region existsValue() API.
+        bool existsValue = region.ExistsValue("ID = 4");
+
+        Console.WriteLine("Region existsValue() returned {0}", existsValue ? "true" : "false");
+
+        // Close the GemFire Cache.
+        cache.Close();
+
+        Console.WriteLine("Closed the GemFire Cache");
+
+      }
+      // An exception should not occur
+      catch (GemFireException gfex)
+      {
+        Console.WriteLine("PoolRemoteQuery GemFire Exception: {0}", gfex.Message);
+      }
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ac967000/geode-client-native/quickstart/csharp/PoolWithEndpoints.cs
----------------------------------------------------------------------
diff --git a/geode-client-native/quickstart/csharp/PoolWithEndpoints.cs b/geode-client-native/quickstart/csharp/PoolWithEndpoints.cs
new file mode 100755
index 0000000..abfcdfd
--- /dev/null
+++ b/geode-client-native/quickstart/csharp/PoolWithEndpoints.cs
@@ -0,0 +1,99 @@
+/*
+ * The PoolWithEndpoints QuickStart Example.
+ *
+ * This example takes the following steps:
+ *
+ * 1. Create CacheFactory using the settings from the gfcpp.properties file by default.
+ * 2. Create a GemFire Cache.
+ * 3. Create Poolfactory with endpoint and then create pool using poolfactory.
+ * 4. Create a Example Region programmatically.
+ * 5. Put Entries (Key and Value pairs) into the Region.
+ * 6. Get Entries from the Region.
+ * 7. Invalidate an Entry in the Region.
+ * 8. Destroy an Entry in the Region.
+ * 9. Close the Cache.
+ *
+ */
+
+// Use standard namespaces
+using System;
+
+// Use the GemFire namespace
+using GemStone.GemFire.Cache.Generic;
+
+namespace GemStone.GemFire.Cache.Generic.QuickStart
+{
+  // The PoolWithEndpoints QuickStart example.
+  class PoolWithEndpoints
+  {
+    static void Main(string[] args)
+    {
+      try
+      {
+        // Create CacheFactory using the settings from the gfcpp.properties file by default.
+        CacheFactory cacheFactory = CacheFactory.CreateCacheFactory();
+
+        Console.WriteLine("Created CacheFactory");
+
+        // Create a GemFire Cache.
+        Cache cache = cacheFactory.SetSubscriptionEnabled(true).Create();
+
+        Console.WriteLine("Created the GemFire Cache");
+
+        //Create Poolfactory with endpoint and then create pool using poolfactory.
+        PoolFactory pfact = PoolManager.CreateFactory();
+        Pool pptr = pfact.AddServer("localhost", 40404).Create("examplePool");
+
+        RegionFactory regionFactory = cache.CreateRegionFactory(RegionShortcut.CACHING_PROXY);
+
+        Console.WriteLine("Created the Regionfactory");
+
+        // Create the example Region programmatically.
+        IRegion<string, string> region = regionFactory.SetPoolName("examplePool").Create<string, string>("exampleRegion");
+
+        Console.WriteLine("Created the Region Programmatically");
+
+        // Put an Entry (Key and Value pair) into the Region using the direct/shortcut method.
+        region["Key1"] = "Value1";
+
+        Console.WriteLine("Put the first Entry into the Region");
+
+        // Put an Entry into the Region by manually creating a Key and a Value pair.
+        string key = "key-123";
+        string value = "val-123";
+        region[key] = value;
+
+        Console.WriteLine("Put the second Entry into the Region");
+
+        // Get Entries back out of the Region.
+        string result1 = region["Key1"];
+
+        Console.WriteLine("Obtained the first Entry from the Region");
+
+        string result2 = region[key];
+
+        Console.WriteLine("Obtained the second Entry from the Region");
+
+        // Invalidate an Entry in the Region.
+        region.Invalidate("Key1");
+
+        Console.WriteLine("Invalidated the first Entry in the Region");
+
+        // Destroy an Entry in the Region.
+        region.Remove(key);
+
+        Console.WriteLine("Destroyed the second Entry in the Region");
+
+        // Close the GemFire Cache.
+        cache.Close();
+
+        Console.WriteLine("Closed the GemFire Cache");
+      }
+      // An exception should not occur
+      catch (GemFireException gfex)
+      {
+        Console.WriteLine("PoolWithEndpoints GemFire Exception: {0}", gfex.Message);
+      }
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ac967000/geode-client-native/quickstart/csharp/PutAllGetAllOperations.cs
----------------------------------------------------------------------
diff --git a/geode-client-native/quickstart/csharp/PutAllGetAllOperations.cs b/geode-client-native/quickstart/csharp/PutAllGetAllOperations.cs
new file mode 100644
index 0000000..d511ed5
--- /dev/null
+++ b/geode-client-native/quickstart/csharp/PutAllGetAllOperations.cs
@@ -0,0 +1,78 @@
+/*
+ * The PutAllGetAllOperations QuickStart Example.
+ *
+ * This example takes the following steps:
+ *
+ * 1. Create a GemFire Cache using CacheFactory. By default it will connect to "localhost" at port 40404".
+ * 2. Create a Example Region.
+ * 3. PutAll Entries (Key and Value pairs) into the Region.
+ * 4. GetAll Entries from the Region.
+ * 5. Close the Cache.
+ *
+ */
+
+// Use standard namespaces
+using System;
+using System.Collections.Generic;
+
+// Use the GemFire namespace
+using GemStone.GemFire.Cache.Generic;
+
+namespace GemStone.GemFire.Cache.Generic.QuickStart
+{
+  // The PutAllGetAllOperations QuickStart example.
+  class PutAllGetAllOperations
+  {
+    static void Main(string[] args)
+    {
+      try
+      {
+        //Create a GemFire Cache using CacheFactory. By default it will connect to "localhost" at port 40404".
+        Cache cache = CacheFactory.CreateCacheFactory().Create();
+
+        Console.WriteLine("Created the GemFire Cache");
+
+        //Set Attributes for the region.
+        RegionFactory regionFactory = cache.CreateRegionFactory(RegionShortcut.CACHING_PROXY);
+
+        //Create exampleRegion
+        IRegion<int, string> region = regionFactory.Create<int, string>("exampleRegion");
+        
+        Console.WriteLine("Created exampleRegion");
+
+        // PutAll Entries (Key and Value pairs) into the Region.
+        Dictionary<int, string> entryMap = new Dictionary<int, string>();
+        for (Int32 item = 0; item < 100; item++)
+        {
+          int key = item;
+          string value = item.ToString();
+          entryMap.Add(key, value);
+        }
+        region.PutAll(entryMap);
+        Console.WriteLine("PutAll 100 entries into the Region");
+        
+        //GetAll Entries back out of the Region
+        List<int> keys  = new List<int>();
+        for (int item = 0; item < 100; item++)
+        {
+          int key = item;
+          keys.Add(key);
+        }
+        Dictionary<int, string> values = new Dictionary<int, string>();
+        region.GetAll(keys.ToArray(), values, null, true);
+
+        Console.WriteLine("Obtained 100 entries from the Region");
+
+        // Close the GemFire Cache.
+        cache.Close();
+
+        Console.WriteLine("Closed the GemFire Cache");
+      }
+      // An exception should not occur
+      catch (GemFireException gfex)
+      {
+        Console.WriteLine("PutAllGetAllOperations GemFire Exception: {0}", gfex.Message);
+      }
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ac967000/geode-client-native/quickstart/csharp/RefIDExample.cs
----------------------------------------------------------------------
diff --git a/geode-client-native/quickstart/csharp/RefIDExample.cs b/geode-client-native/quickstart/csharp/RefIDExample.cs
new file mode 100644
index 0000000..eb385ab
--- /dev/null
+++ b/geode-client-native/quickstart/csharp/RefIDExample.cs
@@ -0,0 +1,103 @@
+/*
+ * The RefIDExample QuickStart Example.
+ * This example creates two pools through XML and sets region attributes using refid.
+ * This example takes the following steps:
+ *
+ * 1. Create a GemFire Cache.
+ * 2. Now it creates 2 Pools with the names poolName1, poolName2 respectively.
+ * 3. Sets the region attribute using refid.
+ * 4. Gets the region "root1" with poolName1, and region "root2" with poolName2.
+ * 5. Check for the region attribute set through refid.
+ * 6. Put Entries (Key and Value pairs) into both the Regions.
+ * 7. Get Entries from the Regions.
+ * 8. Invalidate an Entry in both the Regions.
+ * 9. Destroy an Entry in both the Regions.
+ * 10. Close the Cache.
+ *
+ */
+
+// Use standard namespaces
+using System;
+
+// Use the GemFire namespace
+using GemStone.GemFire.Cache.Generic;
+
+namespace GemStone.GemFire.Cache.Generic.QuickStart
+{
+  // The RefIDExample QuickStart example.
+  class RefIDExample
+  {
+    static void Main(string[] args)
+    {
+      try
+      {
+        Properties<string, string> prop = Properties<string, string>.Create<string, string>();
+        prop.Insert("cache-xml-file", "XMLs/clientRefIDExample.xml");
+        CacheFactory cacheFactory = CacheFactory.CreateCacheFactory(prop);
+        Cache cache = cacheFactory.Create();
+
+        Console.WriteLine("Created the GemFire Cache");
+
+        // Get the Regions from the Cache which is declared in the Cache XML file.
+        IRegion<string, string> region1 = cache.GetRegion<string, string>("root1");
+
+        Console.WriteLine("Obtained the root1 Region from the Cache");
+
+        IRegion<string, string> region2 = cache.GetRegion<string, string>("root2");
+
+        Console.WriteLine("Obtained the root2 Region from the Cache");
+
+        Console.WriteLine("For region root1 cachingEnabled is {0} ", region1.Attributes.CachingEnabled);
+
+        Console.WriteLine("For region root2 cachingEnabled is {0} ", region2.Attributes.CachingEnabled);
+
+        // Put an Entry (Key and Value pair) into the Region using the direct/shortcut method.
+        region1["Key1"] = "Value1";
+        region2["Key1"] = "Value1";
+
+        Console.WriteLine("Put the first Entries into both the Regions");
+
+        // Put an Entry into the Region by manually creating a Key and a Value pair.
+        string key = "123";
+        string value = "123";
+        region1[key] = value;
+        region2[key] = value;
+
+        Console.WriteLine("Put the second Entries into both the Regions.");
+
+        // Get Entries back out of the Region.
+        string result1 = region1["Key1"];
+        string result2 = region2["Key1"];
+
+        Console.WriteLine("Obtained the first Entry from both the Regions");
+
+        result1 = region1[key];
+        result2 = region2[key];
+
+        Console.WriteLine("Obtained the second Entry from both the Regions");
+
+        // Invalidate an Entry in the Region.
+        region1.Invalidate("Key1");
+        region2.Invalidate("Key1");
+
+        Console.WriteLine("Invalidated the first Entry in both the Regions.");
+
+        // Destroy an Entry in the Region.
+        region1.Remove(key);
+        region2.Remove(key);
+
+        Console.WriteLine("Destroyed the second Entry in both the Regions");
+
+        // Close the GemFire Cache.
+        cache.Close();
+
+        Console.WriteLine("Closed the GemFire Cache");        
+      }
+      // An exception should not occur
+      catch (GemFireException gfex)
+      {
+        Console.WriteLine("RefIDExample GemFire Exception: {0}", gfex.Message);
+      }
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ac967000/geode-client-native/quickstart/csharp/RegisterInterest.cs
----------------------------------------------------------------------
diff --git a/geode-client-native/quickstart/csharp/RegisterInterest.cs b/geode-client-native/quickstart/csharp/RegisterInterest.cs
new file mode 100644
index 0000000..53d194a
--- /dev/null
+++ b/geode-client-native/quickstart/csharp/RegisterInterest.cs
@@ -0,0 +1,103 @@
+/*
+ * The RegisterInterest QuickStart Example.
+ *
+ * This example takes the following steps:
+ *
+ * 1. Create CacheFactory using the user specified properties or from the gfcpp.properties file by default.
+ * 2. Create a GemFire Cache.
+ * 3. Get the example Region from the Cache.
+ * 4. Call registerAllKeys() and unregisterAllKeys() on the Region.
+ * 5. Call registerKeys() and unregisterKeys() on the Region.
+ * 6. Call registerRegex() and unregisterRegex() on the Region.
+ * 7. Close the Cache.
+ *
+ */
+// Use standard namespaces
+using System;
+using System.Collections.Generic;
+
+// Use the GemFire namespace
+using GemStone.GemFire.Cache.Generic;
+
+namespace GemStone.GemFire.Cache.Generic.QuickStart
+{
+  // The RegisterInterest QuickStart example.
+  class RegisterInterest
+  {
+    static void Main(string[] args)
+    {
+      try
+      {
+        //Create CacheFactory using the user specified properties or from the gfcpp.properties file by default.
+        Properties<string, string> prp = Properties<string, string>.Create<string, string>();
+        prp.Insert("cache-xml-file", "XMLs/clientRegisterInterest.xml");
+        CacheFactory cacheFactory = CacheFactory.CreateCacheFactory(prp);
+
+        Console.WriteLine("Created CacheFactory");
+
+        // Create a GemFire Cache with the "clientRegisterInterest.xml" Cache XML file.
+        Cache cache = cacheFactory.Create();
+
+        Console.WriteLine("Created the GemFire Cache");
+
+        // Get the example Region from the Cache which is declared in the Cache XML file.
+        IRegion<string, string> region = cache.GetRegion<string, string>("exampleRegion");
+
+        Console.WriteLine("Obtained the Region from the Cache");
+
+        // Register and Unregister Interest on Region for All Keys.
+        region.GetSubscriptionService().RegisterAllKeys();
+        region.GetSubscriptionService().UnregisterAllKeys();
+
+        Console.WriteLine("Called RegisterAllKeys() and UnregisterAllKeys()");
+
+        // Register and Unregister Interest on Region for Some Keys.
+        ICollection<string> keys = new List<string>();
+        keys.Add("123");
+        keys.Add("Key-123");
+
+        region.GetSubscriptionService().RegisterKeys(keys);
+        region.GetSubscriptionService().UnregisterKeys(keys);
+
+        Console.WriteLine("Called RegisterKeys() and UnregisterKeys()");
+
+        // Register and Unregister Interest on Region for Keys matching a Regular Expression.
+        region.GetSubscriptionService().RegisterRegex("Keys-*");
+        region.GetSubscriptionService().UnregisterRegex("Keys-*");
+
+        Console.WriteLine("Called RegisterRegex() and UnregisterRegex()");
+
+        //Register Interest on Region for All Keys with getInitialValues to populate the cache with values of all keys from the server.
+        region.GetSubscriptionService().RegisterAllKeys(false, null, true); // Where the 3rd argument is getInitialValues.
+        //Unregister Interest on Region for All Keys.
+        region.GetSubscriptionService().UnregisterAllKeys();
+
+        Console.WriteLine("Called RegisterAllKeys() and UnregisterAllKeys() with getInitialValues argument");
+    
+        //Register Interest on Region for Some Keys with getInitialValues.
+        region.GetSubscriptionService().RegisterKeys(keys, false, true); // Where the 3rd argument is getInitialValues.
+
+        //Unregister Interest on Region for Some Keys.
+        region.GetSubscriptionService().UnregisterKeys(keys);
+
+        Console.WriteLine("Called RegisterKeys() and UnregisterKeys() with getInitialValues argument");
+        
+        //Register and Unregister Interest on Region for Keys matching a Regular Expression with getInitialValues.
+        region.GetSubscriptionService().RegisterRegex("Keys-*", false, null, true);
+        region.GetSubscriptionService().UnregisterRegex("Keys-*");
+
+        Console.WriteLine("Called RegisterRegex() and UnregisterRegex() with getInitialValues argument");
+        
+        // Close the GemFire Cache.
+        cache.Close();
+
+        Console.WriteLine("Closed the GemFire Cache");
+      }
+      // An exception should not occur
+      catch (GemFireException gfex)
+      {
+        Console.WriteLine("RegisterInterest GemFire Exception: {0}", gfex.Message);
+      }
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ac967000/geode-client-native/quickstart/csharp/RemoteQuery.cs
----------------------------------------------------------------------
diff --git a/geode-client-native/quickstart/csharp/RemoteQuery.cs b/geode-client-native/quickstart/csharp/RemoteQuery.cs
new file mode 100644
index 0000000..4c1e3dd
--- /dev/null
+++ b/geode-client-native/quickstart/csharp/RemoteQuery.cs
@@ -0,0 +1,142 @@
+/*
+ * The RemoteQuery QuickStart Example.
+ *
+ * This example takes the following steps:
+ *
+ * 1. Create a GemFire Cache Programmatically.
+ * 2. Create the example Region Programmatically.
+ * 3. Populate some query objects on the Region.
+ * 4. Execute a query that returns a Result Set.
+ * 5. Execute a query that returns a Struct Set.
+ * 6. Execute the region shortcut/convenience query methods.
+ * 7. Close the Cache.
+ *
+ */
+
+// Use standard namespaces
+using System;
+
+// Use the GemFire namespace
+using GemStone.GemFire.Cache.Generic;
+
+// Use the "Tests" namespace for the query objects.
+using GemStone.GemFire.Cache.Tests.NewAPI;
+
+namespace GemStone.GemFire.Cache.Generic.QuickStart
+{
+  // The RemoteQuery QuickStart example.
+  class RemoteQuery
+  {
+    static void Main(string[] args)
+    {
+      try
+      {
+        // Create a GemFire Cache Programmatically.
+        CacheFactory cacheFactory = CacheFactory.CreateCacheFactory();
+        Cache cache = cacheFactory.SetSubscriptionEnabled(true).Create();
+
+        Console.WriteLine("Created the GemFire Cache");
+
+        RegionFactory regionFactory = cache.CreateRegionFactory(RegionShortcut.CACHING_PROXY);
+
+        // Create the example Region programmatically.
+        IRegion<string, Portfolio> region = regionFactory.Create<string, Portfolio>("Portfolios");
+
+        Console.WriteLine("Created the Region Programmatically.");    
+
+        // Register our Serializable/Cacheable Query objects, viz. Portfolio and Position.
+        Serializable.RegisterTypeGeneric(Portfolio.CreateDeserializable);
+        Serializable.RegisterTypeGeneric(Position.CreateDeserializable);
+
+        Console.WriteLine("Registered Serializable Query Objects");
+
+        // Populate the Region with some Portfolio objects.
+        Portfolio port1 = new Portfolio(1 /*ID*/, 10 /*size*/);
+        Portfolio port2 = new Portfolio(2 /*ID*/, 20 /*size*/);
+        Portfolio port3 = new Portfolio(3 /*ID*/, 30 /*size*/);
+        region["Key1"] = port1;
+        region["Key2"] = port2;
+        region["Key3"] = port3;
+
+        Console.WriteLine("Populated some Portfolio Objects");
+
+        // Get the QueryService from the Cache.
+        QueryService<string, Portfolio> qrySvc = cache.GetQueryService<string, Portfolio>();
+
+        Console.WriteLine("Got the QueryService from the Cache");
+
+        // Execute a Query which returns a ResultSet.    
+        Query<Portfolio> qry = qrySvc.NewQuery("SELECT DISTINCT * FROM /Portfolios");
+        ISelectResults<Portfolio> results = qry.Execute();
+
+        Console.WriteLine("ResultSet Query returned {0} rows", results.Size);
+
+        // Execute a Query which returns a StructSet.
+        QueryService<string, Struct> qrySvc1 = cache.GetQueryService<string, Struct>();
+        Query<Struct> qry1 = qrySvc1.NewQuery("SELECT DISTINCT ID, status FROM /Portfolios WHERE ID > 1");
+        ISelectResults<Struct> results1 = qry1.Execute();
+
+        Console.WriteLine("StructSet Query returned {0} rows", results1.Size);
+
+        // Iterate through the rows of the query result.
+        int rowCount = 0;
+        foreach (Struct si in results1)
+        {
+          rowCount++;
+          Console.WriteLine("Row {0} Column 1 is named {1}, value is {2}", rowCount, si.Set.GetFieldName(0), si[0].ToString());
+          Console.WriteLine("Row {0} Column 2 is named {1}, value is {2}", rowCount, si.Set.GetFieldName(0), si[1].ToString());
+        }
+
+        // Execute a Region Shortcut Query (convenience method).
+        results = region.Query<Portfolio>("ID = 2");
+
+        Console.WriteLine("Region Query returned {0} rows", results.Size);
+
+        // Execute the Region selectValue() API.
+        object result = region.SelectValue("ID = 3");
+
+        Console.WriteLine("Region selectValue() returned an item:\n {0}", result.ToString());
+
+        // Execute the Region existsValue() API.
+        bool existsValue = region.ExistsValue("ID = 4");
+
+        Console.WriteLine("Region existsValue() returned {0}", existsValue ? "true" : "false");
+
+        //Execute the parameterized query
+        //Populate the parameter list (paramList) for the query.
+        //TODO:remove once query service is generic
+        QueryService<string, Struct> pqrySvc = cache.GetQueryService<string, Struct>();
+
+        Query<Struct> pquery = pqrySvc.NewQuery("SELECT DISTINCT ID, status FROM /Portfolios WHERE ID > $1 and status=$2");
+
+        object[] paramList = new object[2];
+        paramList[0] = 1; //param-1
+        paramList[1] = "active"; //param-2
+
+        ISelectResults<Struct> pqresults = pquery.Execute(paramList);
+
+        Console.WriteLine("Parameterized Query returned {0} rows", pqresults.Size);
+
+        // Iterate through the rows of the query result.
+        rowCount = 0;
+        foreach (Struct st in pqresults)
+        {
+          rowCount++;
+          Console.WriteLine("Row {0} Column 1 is named {1}, value is {2}", rowCount, st.Set.GetFieldName(0), st[0].ToString());
+          Console.WriteLine("Row {0} Column 2 is named {1}, value is {2}", rowCount, st.Set.GetFieldName(0), st[1].ToString());
+        }
+        
+        // Close the GemFire Cache.
+        cache.Close();
+
+        Console.WriteLine("Closed the GemFire Cache");
+        
+      }
+      // An exception should not occur
+      catch (GemFireException gfex)
+      {
+        Console.WriteLine("RemoteQuery GemFire Exception: {0}", gfex.Message);
+      }
+    }
+  }
+}


Mime
View raw message