You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by mm...@apache.org on 2021/07/28 00:00:18 UTC

[geode-dotnet-core-client] branch AddNonSteeltoeSample created (now bebc715)

This is an automated email from the ASF dual-hosted git repository.

mmartell pushed a change to branch AddNonSteeltoeSample
in repository https://gitbox.apache.org/repos/asf/geode-dotnet-core-client.git.


      at bebc715  GEODE-9359: Delete Steeltoe sample

This branch includes the following new commits:

     new 6594f20  GEODE-9464: Add a non-Steeltoe Asp.Net Core web app
     new ff7e02e  GEODE-9359: Add netcore-session to geode-native
     new bebc715  GEODE-9359: Delete Steeltoe sample

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


[geode-dotnet-core-client] 01/03: GEODE-9464: Add a non-Steeltoe Asp.Net Core web app

Posted by mm...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

mmartell pushed a commit to branch AddNonSteeltoeSample
in repository https://gitbox.apache.org/repos/asf/geode-dotnet-core-client.git

commit 6594f20bb85ac9c9ed6b7d94b6e48dbef3bffee7
Author: Mike Martell <mm...@pivotal.io>
AuthorDate: Tue Jul 27 16:46:00 2021 -0700

    GEODE-9464: Add a non-Steeltoe Asp.Net Core web app
---
 .../AspNetCore GeodeSession Sample.csproj          | 13 ++++
 .../Extensions/SessionExtensions.cs                | 44 +++++++++++++
 .../Middleware/HttpContextItemsMiddleware.cs       | 36 +++++++++++
 .../Models/BasicAuthInitialize.cs                  | 31 +++++++++
 .../Models/ErrorViewModel.cs                       | 11 ++++
 AspNetCore GeodeSession Sample/Pages/Error.cshtml  | 26 ++++++++
 .../Pages/Error.cshtml.cs                          | 23 +++++++
 AspNetCore GeodeSession Sample/Pages/Index.cshtml  | 72 +++++++++++++++++++++
 .../Pages/Index.cshtml.cs                          | 71 +++++++++++++++++++++
 .../Pages/Shared/_Layout.cshtml                    | 14 ++++
 .../Pages/_ViewImports.cshtml                      |  3 +
 .../Pages/_ViewStart.cshtml                        |  3 +
 AspNetCore GeodeSession Sample/Program.cs          | 17 +++++
 .../Properties/launchSettings.json                 | 28 ++++++++
 AspNetCore GeodeSession Sample/README.md           | 58 +++++++++++++++++
 .../SessionSampleNoSteeltoe.sln                    | 31 +++++++++
 AspNetCore GeodeSession Sample/Startup.cs          | 74 ++++++++++++++++++++++
 .../appsettings.Development.json                   |  9 +++
 .../appsettings.Production.json                    |  9 +++
 AspNetCore GeodeSession Sample/appsettings.json    | 17 +++++
 20 files changed, 590 insertions(+)

diff --git a/AspNetCore GeodeSession Sample/AspNetCore GeodeSession Sample.csproj b/AspNetCore GeodeSession Sample/AspNetCore GeodeSession Sample.csproj
new file mode 100644
index 0000000..a3ed1f8
--- /dev/null
+++ b/AspNetCore GeodeSession Sample/AspNetCore GeodeSession Sample.csproj	
@@ -0,0 +1,13 @@
+<Project Sdk="Microsoft.NET.Sdk.Web">
+
+  <PropertyGroup>
+    <TargetFramework>netcoreapp3.1</TargetFramework>
+    <Platforms>AnyCPU;x64;x86</Platforms>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <ProjectReference Include="..\NetCore.Session\NetCore.Session.csproj" />
+  </ItemGroup>
+
+
+</Project>
diff --git a/AspNetCore GeodeSession Sample/Extensions/SessionExtensions.cs b/AspNetCore GeodeSession Sample/Extensions/SessionExtensions.cs
new file mode 100644
index 0000000..8b5035e
--- /dev/null
+++ b/AspNetCore GeodeSession Sample/Extensions/SessionExtensions.cs	
@@ -0,0 +1,44 @@
+using System.Text.Json;
+using Microsoft.AspNetCore.Http;
+
+namespace Web.Extensions
+{
+    #region snippet1
+    public static class SessionExtensions
+    {
+        public static void Set<T>(this ISession session, string key, T value)
+        {
+            session.SetString(key, JsonSerializer.Serialize(value));
+        }
+
+        public static T Get<T>(this ISession session, string key)
+        {
+            var value = session.GetString(key);
+            return value == null ? default : JsonSerializer.Deserialize<T>(value);
+        }
+    }
+    #endregion      
+}
+
+namespace Web.Extensions2
+{
+    // Alternate approach
+
+    public static class SessionExtensions
+    {
+        public static void Set<T>(this ISession session, string key, T value)
+        {
+            session.SetString(key, JsonSerializer.Serialize(value));
+        }
+
+        public static bool TryGet<T>(this ISession session, string key, out T value)
+        {
+            var state = session.GetString(key);
+            value = default;
+            if (state == null)
+                return false;
+            value = JsonSerializer.Deserialize<T>(state);
+            return true;
+        }
+    }
+}
\ No newline at end of file
diff --git a/AspNetCore GeodeSession Sample/Middleware/HttpContextItemsMiddleware.cs b/AspNetCore GeodeSession Sample/Middleware/HttpContextItemsMiddleware.cs
new file mode 100644
index 0000000..6a8597c
--- /dev/null
+++ b/AspNetCore GeodeSession Sample/Middleware/HttpContextItemsMiddleware.cs	
@@ -0,0 +1,36 @@
+using System;
+using System.Threading.Tasks;
+using Microsoft.AspNetCore.Builder;
+using Microsoft.AspNetCore.Http;
+
+namespace SessionSample.Middleware
+{
+    #region snippet1
+    public class HttpContextItemsMiddleware
+    {
+        private readonly RequestDelegate _next;
+        public static readonly object HttpContextItemsMiddlewareKey = new Object();
+
+        public HttpContextItemsMiddleware(RequestDelegate next)
+        {
+            _next = next;
+        }
+
+        public async Task Invoke(HttpContext httpContext)
+        {
+            httpContext.Items[HttpContextItemsMiddlewareKey] = "K-9";
+
+            await _next(httpContext);
+        }
+    }
+
+    public static class HttpContextItemsMiddlewareExtensions
+    {
+        public static IApplicationBuilder 
+            UseHttpContextItemsMiddleware(this IApplicationBuilder app)
+        {
+            return app.UseMiddleware<HttpContextItemsMiddleware>();
+        }
+    }
+    #endregion
+}
diff --git a/AspNetCore GeodeSession Sample/Models/BasicAuthInitialize.cs b/AspNetCore GeodeSession Sample/Models/BasicAuthInitialize.cs
new file mode 100644
index 0000000..c1b2a71
--- /dev/null
+++ b/AspNetCore GeodeSession Sample/Models/BasicAuthInitialize.cs	
@@ -0,0 +1,31 @@
+using Apache.Geode.NetCore;
+using System;
+using System.Collections.Generic;
+
+namespace GemFireSessionState.Models
+{
+  public class BasicAuthInitialize : IAuthInitialize
+  {
+    private string _username;
+    private string _password;
+
+    public BasicAuthInitialize(string username, string password)
+    {
+      _username = username;
+      _password = password;
+    }
+
+    public void Close()
+    {
+    }
+
+    public Dictionary<string, string> GetCredentials()
+    {
+      Console.WriteLine("SimpleAuthInitialize::GetCredentials called");
+      var credentials = new Dictionary<string, string>();
+      credentials.Add("security-username", "root");
+      credentials.Add("security-password", "root-password");
+      return credentials;
+    }
+  }
+}
\ No newline at end of file
diff --git a/AspNetCore GeodeSession Sample/Models/ErrorViewModel.cs b/AspNetCore GeodeSession Sample/Models/ErrorViewModel.cs
new file mode 100644
index 0000000..e67efeb
--- /dev/null
+++ b/AspNetCore GeodeSession Sample/Models/ErrorViewModel.cs	
@@ -0,0 +1,11 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+
+namespace SessionSample.Models
+{
+  public class ErrorViewModel
+  {
+  }
+}
diff --git a/AspNetCore GeodeSession Sample/Pages/Error.cshtml b/AspNetCore GeodeSession Sample/Pages/Error.cshtml
new file mode 100644
index 0000000..6f92b95
--- /dev/null
+++ b/AspNetCore GeodeSession Sample/Pages/Error.cshtml	
@@ -0,0 +1,26 @@
+@page
+@model ErrorModel
+@{
+    ViewData["Title"] = "Error";
+}
+
+<h1 class="text-danger">Error.</h1>
+<h2 class="text-danger">An error occurred while processing your request.</h2>
+
+@if (Model.ShowRequestId)
+{
+    <p>
+        <strong>Request ID:</strong> <code>@Model.RequestId</code>
+    </p>
+}
+
+<h3>Development Mode</h3>
+<p>
+    Swapping to the <strong>Development</strong> environment displays detailed information about the error that occurred.
+</p>
+<p>
+    <strong>The Development environment shouldn't be enabled for deployed applications.</strong>
+    It can result in displaying sensitive information from exceptions to end users.
+    For local debugging, enable the <strong>Development</strong> environment by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong>
+    and restarting the app.
+</p>
diff --git a/AspNetCore GeodeSession Sample/Pages/Error.cshtml.cs b/AspNetCore GeodeSession Sample/Pages/Error.cshtml.cs
new file mode 100644
index 0000000..3951f71
--- /dev/null
+++ b/AspNetCore GeodeSession Sample/Pages/Error.cshtml.cs	
@@ -0,0 +1,23 @@
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Linq;
+using System.Threading.Tasks;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.AspNetCore.Mvc.RazorPages;
+
+namespace SessionSample.Pages
+{
+    [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
+    public class ErrorModel : PageModel
+    {
+        public string RequestId { get; set; }
+
+        public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
+
+        public void OnGet()
+        {
+            RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier;
+        }
+    }
+}
diff --git a/AspNetCore GeodeSession Sample/Pages/Index.cshtml b/AspNetCore GeodeSession Sample/Pages/Index.cshtml
new file mode 100644
index 0000000..21346af
--- /dev/null
+++ b/AspNetCore GeodeSession Sample/Pages/Index.cshtml	
@@ -0,0 +1,72 @@
+@page
+@using Microsoft.AspNetCore.Http
+@model IndexModel
+@{
+    ViewData["Title"] = "Asp.Net Core Session Sample";
+}
+
+<h1>@ViewData["Title"]</h1>
+
+<h2>State management</h2>
+
+<div class="row">
+    <div class="col-md-8">
+        <form method="post">
+            <div class="panel panel-default">
+                <div class="panel-heading">
+                    <button type="submit" asp-page-handler="ChangeAge" class="pull-right btn btn-danger">Change Age</button>
+                    <h3 class="panel-title" style="line-height:2.1">Name and Age</h3>
+                </div>
+                <div class="panel-body">
+                    <p>The name and age are stored in session. Select the <span style="font-weight:bold">Change Age</span> 
+                    button to update the session to a new random age value.</p>
+                    <p>Session values by the model with 
+                    <code>@@Model.&lt;PropertyName&gt;</code>:</p>
+                    <p><b>Name:</b> @Model.SessionInfo_Name <b>Age:</b> @Model.SessionInfo_Age</p>
+                    <hr>
+                    <p>Session values direct </p>
+                     <p><b>Name:</b> @HttpContext.Session.GetString(IndexModel.SessionKeyName) 
+                    <b>Age:</b> 
+                    @HttpContext.Session.GetInt32(IndexModel.SessionKeyAge).ToString()</p>
+                </div>
+            </div>
+        </form>
+    </div>
+</div>
+
+<div class="row">
+    <div class="col-md-8">
+        <div class="panel panel-default">
+            <div class="panel-heading">
+                <h3 class="panel-title">HttpContext.Items Middleware Value</h3>
+            </div>
+            <div class="panel-body">
+                <p>The middleware value is set into the <code>HttpContext.Items</code> collection by 
+                the <code>HttpContextItemsMiddleware</code> before Razor Pages processes the request. 
+                The value is retreived by the page and displayed.</p>
+                <p>Value: @Model.SessionInfo_MiddlewareValue</p>
+            </div>
+        </div>
+    </div>
+</div>
+
+<div class="row">
+    <div class="col-md-8">
+        <form method="post">
+            <div class="panel panel-default">
+                <div class="panel-heading clearfix">
+                    <button type="submit" asp-page-handler="UpdateSessionDate" class="pull-right btn btn-danger">Update Session Time</button>
+                    <a href="/" class="pull-right btn btn-danger" style="margin-right:5px">Reload Page (No Update)</a>
+                    <h3 class="panel-title" style="line-height:2.1">Session Time</h3>
+                </div>
+                <div class="panel-body">
+                    <p>The session time is stored in session. Select the <span style="font-weight:bold">
+                        Reload Page (No Update)</span> button to display the current time and the time stored in session.
+                    Select the <span style="font-weight:bold">Update Session Time</span> button to store the current time in session.</p>
+                    <p>Current Time: @Model.SessionInfo_CurrentTime</p>
+                    <p>Session Time: @Model.SessionInfo_SessionTime</p>
+                </div>
+            </div>
+        </form>
+    </div>
+</div>
diff --git a/AspNetCore GeodeSession Sample/Pages/Index.cshtml.cs b/AspNetCore GeodeSession Sample/Pages/Index.cshtml.cs
new file mode 100644
index 0000000..83a5896
--- /dev/null
+++ b/AspNetCore GeodeSession Sample/Pages/Index.cshtml.cs	
@@ -0,0 +1,71 @@
+using System;
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.AspNetCore.Mvc.RazorPages;
+using SessionSample.Middleware;
+using Web.Extensions;
+
+namespace SessionSample.Pages
+{
+    public class IndexModel : PageModel
+    {
+        public const string SessionKeyName = "_Name";
+        public const string SessionKeyAge = "_Age";
+        const string SessionKeyTime = "_Time";
+
+        public string SessionInfo_Name { get; private set; }
+        public string SessionInfo_Age { get; private set; }
+        public string SessionInfo_CurrentTime { get; private set; }
+        public string SessionInfo_SessionTime { get; private set; }
+        public string SessionInfo_MiddlewareValue { get; private set; }
+
+        public void OnGet()
+        {
+            // Requires: using Microsoft.AspNetCore.Http;
+            if (string.IsNullOrEmpty(HttpContext.Session.GetString(SessionKeyName)))
+            {
+                HttpContext.Session.SetString(SessionKeyName, "The Doctor");
+                HttpContext.Session.SetInt32(SessionKeyAge, 35);
+            }
+
+            var name = HttpContext.Session.GetString(SessionKeyName);
+            var age = HttpContext.Session.GetInt32(SessionKeyAge);
+            SessionInfo_Name = name;
+            SessionInfo_Age = age.ToString();
+
+            var currentTime = DateTime.Now;
+
+            // Requires SessionExtensions from sample download.
+            if (HttpContext.Session.Get<DateTime>(SessionKeyTime) == default)
+            {
+                HttpContext.Session.Set<DateTime>(SessionKeyTime, currentTime);
+            }
+
+            SessionInfo_CurrentTime = currentTime.ToString("H:mm:ss tt");
+            SessionInfo_SessionTime = HttpContext.Session.Get<DateTime>(SessionKeyTime)
+                .ToString("H:mm:ss tt");
+
+            HttpContext.Items
+                .TryGetValue(HttpContextItemsMiddleware.HttpContextItemsMiddlewareKey, 
+                    out var middlewareSetValue);
+            SessionInfo_MiddlewareValue = 
+                middlewareSetValue?.ToString() ?? "Middleware value not set!";
+        }
+
+        public IActionResult OnPostUpdateSessionDate()
+        {
+            HttpContext.Session.Set<DateTime>(SessionKeyTime, DateTime.Now);
+
+            return RedirectToPage();
+        }
+
+        public IActionResult OnPostChangeAge()
+        {
+            var r = new Random();
+
+            HttpContext.Session.SetInt32(SessionKeyAge, r.Next(35, 65));
+
+            return RedirectToPage();
+        }
+    }
+}
diff --git a/AspNetCore GeodeSession Sample/Pages/Shared/_Layout.cshtml b/AspNetCore GeodeSession Sample/Pages/Shared/_Layout.cshtml
new file mode 100644
index 0000000..b761491
--- /dev/null
+++ b/AspNetCore GeodeSession Sample/Pages/Shared/_Layout.cshtml	
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="utf-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>@ViewData["Title"]</title>
+    <style>body{margin:0;padding-bottom:20px;font-family:"Helvetica Neue", Helvetica, Arial, sans-serif;font-size:14px;line-height:1.42857143;color:#333;background-color:#fff;}h1{font-size:24px;margin:.67em 0;}pre{overflow:auto;}code,pre{font-family:monospace, monospace;font-size:1em;}button,input{margin:0;font:inherit;color:inherit;}button{overflow:visible;}button{text-transform:none;}input{line-height:normal;}{box-sizing:border-box;}:before,*:after{box-sizing:border-box;}input,button{f [...]
+</head>
+<body>
+    <div class="container body-content">
+        @RenderBody()
+    </div>
+</body>
+</html>
diff --git a/AspNetCore GeodeSession Sample/Pages/_ViewImports.cshtml b/AspNetCore GeodeSession Sample/Pages/_ViewImports.cshtml
new file mode 100644
index 0000000..f22da06
--- /dev/null
+++ b/AspNetCore GeodeSession Sample/Pages/_ViewImports.cshtml	
@@ -0,0 +1,3 @@
+@using SessionSample
+@namespace SessionSample.Pages
+@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
diff --git a/AspNetCore GeodeSession Sample/Pages/_ViewStart.cshtml b/AspNetCore GeodeSession Sample/Pages/_ViewStart.cshtml
new file mode 100644
index 0000000..a5f1004
--- /dev/null
+++ b/AspNetCore GeodeSession Sample/Pages/_ViewStart.cshtml	
@@ -0,0 +1,3 @@
+@{
+    Layout = "_Layout";
+}
diff --git a/AspNetCore GeodeSession Sample/Program.cs b/AspNetCore GeodeSession Sample/Program.cs
new file mode 100644
index 0000000..6ab590d
--- /dev/null
+++ b/AspNetCore GeodeSession Sample/Program.cs	
@@ -0,0 +1,17 @@
+using Microsoft.AspNetCore;
+using Microsoft.AspNetCore.Hosting;
+
+namespace SessionSample
+{
+    public class Program
+    {
+        public static void Main(string[] args)
+        {
+            CreateWebHostBuilder(args).Build().Run();
+        }
+
+        public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
+            WebHost.CreateDefaultBuilder(args)
+                .UseStartup<Startup>();
+    }
+}
diff --git a/AspNetCore GeodeSession Sample/Properties/launchSettings.json b/AspNetCore GeodeSession Sample/Properties/launchSettings.json
new file mode 100644
index 0000000..4ebabb5
--- /dev/null
+++ b/AspNetCore GeodeSession Sample/Properties/launchSettings.json	
@@ -0,0 +1,28 @@
+{
+  "iisSettings": {
+    "windowsAuthentication": false,
+    "anonymousAuthentication": true,
+    "iisExpress": {
+      "applicationUrl": "http://localhost:50795/",
+      "sslPort": 44315
+    }
+  },
+  "profiles": {
+    "IIS Express": {
+      "commandName": "IISExpress",
+      "launchBrowser": true,
+      "environmentVariables": {
+        "ASPNETCORE_ENVIRONMENT": "Development"
+      },
+      "nativeDebugging": true
+    },
+    "SessionSample": {
+      "commandName": "Project",
+      "launchBrowser": true,
+      "environmentVariables": {
+        "ASPNETCORE_ENVIRONMENT": "Development"
+      },
+      "applicationUrl": "https://localhost:5001;http://localhost:5000"
+    }
+  }
+}
\ No newline at end of file
diff --git a/AspNetCore GeodeSession Sample/README.md b/AspNetCore GeodeSession Sample/README.md
new file mode 100644
index 0000000..38b0a9b
--- /dev/null
+++ b/AspNetCore GeodeSession Sample/README.md	
@@ -0,0 +1,58 @@
+You can configure GeodeDistributedCache as a distributed cache for your ASP.NET Core application using either of the options described below.
+
+---
+NetCore-Session provides the AddGeodeDistributedCache() extension method on IServiceCollection, which requires just an Apache Geode region name and any optional configurations to store the sessions. 
+
+There are two methods to specify configurations:
+1. Through your application in Startup.cs or
+2. In JSON format in Appsettings.json of your application.
+   
+## Method 1: Specifying Configurations In Startup.cs
+
+The AddGeodeSessionStateCache() method is an extension of the AddDistributedCache() method provided by ASP.NET Core. This method takes configuration settings in Startup.cs of your application, or reads them from the specified JSON file.
+
+Add the following method and options in Startup.cs of your application:
+
+```c#
+public void ConfigureServices(IServiceCollection services)
+{
+    //Add framework services
+    services.AddMvc();
+
+    services.AddGeodeSessionStateCache(configuration =>
+    {
+        configuration.RegionName = "geodeSessionState";
+    });
+}
+```
+
+## Method 2: Specifying Configurations In appsettings.json
+You can also specify the configuration in JSON format using the appsettings.json file for your application. Using this method, you can refer to the configurations by providing the name of the section containing JSON format configurations in Startup.cs.
+
+appsettings.json:
+
+```json
+{
+  "AppSettings": {
+    "SiteTitle": "ASP.NET Core SessionState Sample App"
+  },
+
+  "GeodeSessionStateCache": {
+    "RegionName": "geodeSessionState",
+    "Host": "localhost",
+    "Port": 10334
+  }
+}
+```
+
+The ConfigureServices member of the Startup class can be used as follows to retrieve the GeodeSessionStateCache settings from the JSON file:
+
+```c#
+public void ConfigureServices(IServiceCollection services)
+{
+  ...
+  services.Configure<GeodeSessionStateCacheOptions>(
+    Configuration.GetSection("GeodeSessionStateCache"));
+  ...
+}
+```
diff --git a/AspNetCore GeodeSession Sample/SessionSampleNoSteeltoe.sln b/AspNetCore GeodeSession Sample/SessionSampleNoSteeltoe.sln
new file mode 100644
index 0000000..4f6c0fb
--- /dev/null
+++ b/AspNetCore GeodeSession Sample/SessionSampleNoSteeltoe.sln	
@@ -0,0 +1,31 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.30028.174
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SessionSample", "SessionSample.csproj", "{0073CD89-8ED5-42DC-8C0F-88036A11AE91}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Any CPU = Debug|Any CPU
+		Debug|x64 = Debug|x64
+		Release|Any CPU = Release|Any CPU
+		Release|x64 = Release|x64
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{0073CD89-8ED5-42DC-8C0F-88036A11AE91}.Debug|Any CPU.ActiveCfg = Debug|x64
+		{0073CD89-8ED5-42DC-8C0F-88036A11AE91}.Debug|Any CPU.Build.0 = Debug|x64
+		{0073CD89-8ED5-42DC-8C0F-88036A11AE91}.Debug|x64.ActiveCfg = Debug|x64
+		{0073CD89-8ED5-42DC-8C0F-88036A11AE91}.Debug|x64.Build.0 = Debug|x64
+		{0073CD89-8ED5-42DC-8C0F-88036A11AE91}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{0073CD89-8ED5-42DC-8C0F-88036A11AE91}.Release|Any CPU.Build.0 = Release|Any CPU
+		{0073CD89-8ED5-42DC-8C0F-88036A11AE91}.Release|x64.ActiveCfg = Release|x64
+		{0073CD89-8ED5-42DC-8C0F-88036A11AE91}.Release|x64.Build.0 = Release|x64
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+	GlobalSection(ExtensibilityGlobals) = postSolution
+		SolutionGuid = {EA7D931C-E9EA-4F8A-B4EA-18C5322FC048}
+	EndGlobalSection
+EndGlobal
diff --git a/AspNetCore GeodeSession Sample/Startup.cs b/AspNetCore GeodeSession Sample/Startup.cs
new file mode 100644
index 0000000..1d4b4b4
--- /dev/null
+++ b/AspNetCore GeodeSession Sample/Startup.cs	
@@ -0,0 +1,74 @@
+using Apache.Geode.Session;
+using Microsoft.AspNetCore.Builder;
+using Microsoft.AspNetCore.Hosting;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.DependencyInjection;
+using Microsoft.Extensions.Logging;
+using Microsoft.Extensions.Hosting;
+using SessionSample.Middleware;
+using Microsoft.Extensions.Caching.Distributed;
+using System;
+
+namespace SessionSample
+{
+    public class Startup
+    {
+        public Startup(IConfiguration configuration)
+        {
+            Configuration = configuration;
+        }
+
+        public IConfiguration Configuration { get; }
+        public ILoggerFactory LoggerFactory { get; }
+
+        public void ConfigureServices(IServiceCollection services)
+        {
+            services.Add(ServiceDescriptor.Singleton<IDistributedCache, GeodeSessionStateCache>());
+
+            services.AddSession(options =>
+            {
+                options.IdleTimeout = TimeSpan.FromSeconds(5);
+                options.Cookie.HttpOnly = true;
+                options.Cookie.IsEssential = true;
+            });
+
+            // Configure Method 1: Using extension method:
+            services.AddGeodeSessionStateCache(configuration =>
+            {
+                configuration.Host = "localhost";
+                configuration.Port = 10334;
+                configuration.RegionName = "geodeSessionState";
+            });
+
+            // Configure Method 2: Using appsettings.json:
+            //services.Configure<GeodeSessionStateCacheOptions>(
+            //    Configuration.GetSection("GeodeSessionStateCache"));
+
+            services.AddControllersWithViews();
+            services.AddRazorPages();
+        }
+
+        public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
+        {
+            if (env.IsDevelopment())
+            {
+                app.UseDeveloperExceptionPage();
+            }
+            else
+            {
+                app.UseExceptionHandler("/Home/Error");
+                app.UseHsts();
+            }
+
+            app.UseStaticFiles();
+            app.UseRouting();
+            app.UseHttpContextItemsMiddleware();
+            app.UseSession();
+            app.UseEndpoints(endpoints =>
+            {
+                endpoints.MapDefaultControllerRoute();
+                endpoints.MapRazorPages();
+            });
+        }
+    }
+}
diff --git a/AspNetCore GeodeSession Sample/appsettings.Development.json b/AspNetCore GeodeSession Sample/appsettings.Development.json
new file mode 100644
index 0000000..0623a3f
--- /dev/null
+++ b/AspNetCore GeodeSession Sample/appsettings.Development.json	
@@ -0,0 +1,9 @@
+{
+  "Logging": {
+    "LogLevel": {
+      "Default": "Debug",
+      "System": "Information",
+      "Microsoft": "Information"
+    }
+  }
+}
diff --git a/AspNetCore GeodeSession Sample/appsettings.Production.json b/AspNetCore GeodeSession Sample/appsettings.Production.json
new file mode 100644
index 0000000..8af1e1f
--- /dev/null
+++ b/AspNetCore GeodeSession Sample/appsettings.Production.json	
@@ -0,0 +1,9 @@
+{
+  "Logging": {
+    "LogLevel": {
+      "Default": "Error",
+      "System": "Information",
+      "Microsoft": "Information"
+    }
+  }
+}
diff --git a/AspNetCore GeodeSession Sample/appsettings.json b/AspNetCore GeodeSession Sample/appsettings.json
new file mode 100644
index 0000000..956bfab
--- /dev/null
+++ b/AspNetCore GeodeSession Sample/appsettings.json	
@@ -0,0 +1,17 @@
+{
+  "Logging": {
+	"LogLevel": {
+	  "Default": "Warning"
+	}
+  },
+  "AllowedHosts": "*",
+  "AppSettings": {
+	"SiteTitle": "ASP.NET Core SessionState Sample App"
+  },
+
+  "GeodeSessionStateCache": {
+	"RegionName": "geodeSessionState",
+	"Host": "localhost",
+	"Port": 10334
+  }
+}

[geode-dotnet-core-client] 03/03: GEODE-9359: Delete Steeltoe sample

Posted by mm...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

mmartell pushed a commit to branch AddNonSteeltoeSample
in repository https://gitbox.apache.org/repos/asf/geode-dotnet-core-client.git

commit bebc71500e0b987117970b3faa22878b4f310516
Author: Mike Martell <mm...@pivotal.io>
AuthorDate: Tue Jul 27 16:58:53 2021 -0700

    GEODE-9359: Delete Steeltoe sample
---
 SessionSample/Extensions/SessionExtensions.cs      |  44 ------------
 .../Middleware/HttpContextItemsMiddleware.cs       |  36 ----------
 SessionSample/Models/BasicAuthInitialize.cs        |  31 --------
 SessionSample/Models/ErrorViewModel.cs             |  11 ---
 SessionSample/Pages/Error.cshtml                   |  26 -------
 SessionSample/Pages/Error.cshtml.cs                |  23 ------
 SessionSample/Pages/Index.cshtml                   |  72 -------------------
 SessionSample/Pages/Index.cshtml.cs                |  77 --------------------
 SessionSample/Pages/Shared/_Layout.cshtml          |  14 ----
 SessionSample/Pages/_ViewImports.cshtml            |   3 -
 SessionSample/Pages/_ViewStart.cshtml              |   3 -
 SessionSample/Program.cs                           |  17 -----
 SessionSample/Properties/launchSettings.json       |  28 --------
 SessionSample/SessionSample.csproj                 |  21 ------
 SessionSample/SessionSample.csproj.user            |   6 --
 SessionSample/SessionSample.sln                    |  31 --------
 SessionSample/Startup.cs                           |  79 ---------------------
 SessionSample/appsettings.Development.json         |   9 ---
 SessionSample/appsettings.Production.json          |   9 ---
 SessionSample/appsettings.json                     |   8 ---
 SessionSample/statArchive-19444.gfs                | Bin 10402 -> 0 bytes
 SessionSample/statArchive-20992.gfs                | Bin 7654 -> 0 bytes
 SessionSample/statArchive-23496.gfs                | Bin 14196 -> 0 bytes
 SessionSample/statArchive-23824.gfs                | Bin 67316 -> 0 bytes
 SessionSample/statArchive-25408.gfs                | Bin 10608 -> 0 bytes
 SessionSample/statArchive-4448.gfs                 | Bin 60278 -> 0 bytes
 26 files changed, 548 deletions(-)

diff --git a/SessionSample/Extensions/SessionExtensions.cs b/SessionSample/Extensions/SessionExtensions.cs
deleted file mode 100644
index 8b5035e..0000000
--- a/SessionSample/Extensions/SessionExtensions.cs
+++ /dev/null
@@ -1,44 +0,0 @@
-using System.Text.Json;
-using Microsoft.AspNetCore.Http;
-
-namespace Web.Extensions
-{
-    #region snippet1
-    public static class SessionExtensions
-    {
-        public static void Set<T>(this ISession session, string key, T value)
-        {
-            session.SetString(key, JsonSerializer.Serialize(value));
-        }
-
-        public static T Get<T>(this ISession session, string key)
-        {
-            var value = session.GetString(key);
-            return value == null ? default : JsonSerializer.Deserialize<T>(value);
-        }
-    }
-    #endregion      
-}
-
-namespace Web.Extensions2
-{
-    // Alternate approach
-
-    public static class SessionExtensions
-    {
-        public static void Set<T>(this ISession session, string key, T value)
-        {
-            session.SetString(key, JsonSerializer.Serialize(value));
-        }
-
-        public static bool TryGet<T>(this ISession session, string key, out T value)
-        {
-            var state = session.GetString(key);
-            value = default;
-            if (state == null)
-                return false;
-            value = JsonSerializer.Deserialize<T>(state);
-            return true;
-        }
-    }
-}
\ No newline at end of file
diff --git a/SessionSample/Middleware/HttpContextItemsMiddleware.cs b/SessionSample/Middleware/HttpContextItemsMiddleware.cs
deleted file mode 100644
index 6a8597c..0000000
--- a/SessionSample/Middleware/HttpContextItemsMiddleware.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-using System;
-using System.Threading.Tasks;
-using Microsoft.AspNetCore.Builder;
-using Microsoft.AspNetCore.Http;
-
-namespace SessionSample.Middleware
-{
-    #region snippet1
-    public class HttpContextItemsMiddleware
-    {
-        private readonly RequestDelegate _next;
-        public static readonly object HttpContextItemsMiddlewareKey = new Object();
-
-        public HttpContextItemsMiddleware(RequestDelegate next)
-        {
-            _next = next;
-        }
-
-        public async Task Invoke(HttpContext httpContext)
-        {
-            httpContext.Items[HttpContextItemsMiddlewareKey] = "K-9";
-
-            await _next(httpContext);
-        }
-    }
-
-    public static class HttpContextItemsMiddlewareExtensions
-    {
-        public static IApplicationBuilder 
-            UseHttpContextItemsMiddleware(this IApplicationBuilder app)
-        {
-            return app.UseMiddleware<HttpContextItemsMiddleware>();
-        }
-    }
-    #endregion
-}
diff --git a/SessionSample/Models/BasicAuthInitialize.cs b/SessionSample/Models/BasicAuthInitialize.cs
deleted file mode 100644
index c1b2a71..0000000
--- a/SessionSample/Models/BasicAuthInitialize.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-using Apache.Geode.NetCore;
-using System;
-using System.Collections.Generic;
-
-namespace GemFireSessionState.Models
-{
-  public class BasicAuthInitialize : IAuthInitialize
-  {
-    private string _username;
-    private string _password;
-
-    public BasicAuthInitialize(string username, string password)
-    {
-      _username = username;
-      _password = password;
-    }
-
-    public void Close()
-    {
-    }
-
-    public Dictionary<string, string> GetCredentials()
-    {
-      Console.WriteLine("SimpleAuthInitialize::GetCredentials called");
-      var credentials = new Dictionary<string, string>();
-      credentials.Add("security-username", "root");
-      credentials.Add("security-password", "root-password");
-      return credentials;
-    }
-  }
-}
\ No newline at end of file
diff --git a/SessionSample/Models/ErrorViewModel.cs b/SessionSample/Models/ErrorViewModel.cs
deleted file mode 100644
index e67efeb..0000000
--- a/SessionSample/Models/ErrorViewModel.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Threading.Tasks;
-
-namespace SessionSample.Models
-{
-  public class ErrorViewModel
-  {
-  }
-}
diff --git a/SessionSample/Pages/Error.cshtml b/SessionSample/Pages/Error.cshtml
deleted file mode 100644
index 6f92b95..0000000
--- a/SessionSample/Pages/Error.cshtml
+++ /dev/null
@@ -1,26 +0,0 @@
-@page
-@model ErrorModel
-@{
-    ViewData["Title"] = "Error";
-}
-
-<h1 class="text-danger">Error.</h1>
-<h2 class="text-danger">An error occurred while processing your request.</h2>
-
-@if (Model.ShowRequestId)
-{
-    <p>
-        <strong>Request ID:</strong> <code>@Model.RequestId</code>
-    </p>
-}
-
-<h3>Development Mode</h3>
-<p>
-    Swapping to the <strong>Development</strong> environment displays detailed information about the error that occurred.
-</p>
-<p>
-    <strong>The Development environment shouldn't be enabled for deployed applications.</strong>
-    It can result in displaying sensitive information from exceptions to end users.
-    For local debugging, enable the <strong>Development</strong> environment by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong>
-    and restarting the app.
-</p>
diff --git a/SessionSample/Pages/Error.cshtml.cs b/SessionSample/Pages/Error.cshtml.cs
deleted file mode 100644
index 3951f71..0000000
--- a/SessionSample/Pages/Error.cshtml.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.Linq;
-using System.Threading.Tasks;
-using Microsoft.AspNetCore.Mvc;
-using Microsoft.AspNetCore.Mvc.RazorPages;
-
-namespace SessionSample.Pages
-{
-    [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
-    public class ErrorModel : PageModel
-    {
-        public string RequestId { get; set; }
-
-        public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
-
-        public void OnGet()
-        {
-            RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier;
-        }
-    }
-}
diff --git a/SessionSample/Pages/Index.cshtml b/SessionSample/Pages/Index.cshtml
deleted file mode 100644
index 3e2c92f..0000000
--- a/SessionSample/Pages/Index.cshtml
+++ /dev/null
@@ -1,72 +0,0 @@
-@page
-@using Microsoft.AspNetCore.Http
-@model IndexModel
-@{
-    ViewData["Title"] = "Session Sample";
-}
-
-<h1>@ViewData["Title"]</h1>
-
-<h2>State management</h2>
-
-<div class="row">
-    <div class="col-md-8">
-        <form method="post">
-            <div class="panel panel-default">
-                <div class="panel-heading">
-                    <button type="submit" asp-page-handler="ChangeAge" class="pull-right btn btn-danger">Change Age</button>
-                    <h3 class="panel-title" style="line-height:2.1">Name and Age</h3>
-                </div>
-                <div class="panel-body">
-                    <p>The name and age are stored in session. Select the <span style="font-weight:bold">Change Age</span> 
-                    button to update the session to a new random age value.</p>
-                    <p>Session values by the model with 
-                    <code>@@Model.&lt;PropertyName&gt;</code>:</p>
-                    <p><b>Name:</b> @Model.SessionInfo_Name <b>Age:</b> @Model.SessionInfo_Age</p>
-                    <hr>
-                    <p>Session values direct </p>
-                     <p><b>Name:</b> @HttpContext.Session.GetString(IndexModel.SessionKeyName) 
-                    <b>Age:</b> 
-                    @HttpContext.Session.GetInt32(IndexModel.SessionKeyAge).ToString()</p>
-                </div>
-            </div>
-        </form>
-    </div>
-</div>
-
-<div class="row">
-    <div class="col-md-8">
-        <div class="panel panel-default">
-            <div class="panel-heading">
-                <h3 class="panel-title">HttpContext.Items Middleware Value</h3>
-            </div>
-            <div class="panel-body">
-                <p>The middleware value is set into the <code>HttpContext.Items</code> collection by 
-                the <code>HttpContextItemsMiddleware</code> before Razor Pages processes the request. 
-                The value is retreived by the page and displayed.</p>
-                <p>Value: @Model.SessionInfo_MiddlewareValue</p>
-            </div>
-        </div>
-    </div>
-</div>
-
-<div class="row">
-    <div class="col-md-8">
-        <form method="post">
-            <div class="panel panel-default">
-                <div class="panel-heading clearfix">
-                    <button type="submit" asp-page-handler="UpdateSessionDate" class="pull-right btn btn-danger">Update Session Time</button>
-                    <a href="/" class="pull-right btn btn-danger" style="margin-right:5px">Reload Page (No Update)</a>
-                    <h3 class="panel-title" style="line-height:2.1">Session Time</h3>
-                </div>
-                <div class="panel-body">
-                    <p>The session time is stored in session. Select the <span style="font-weight:bold">
-                        Reload Page (No Update)</span> button to display the current time and the time stored in session.
-                    Select the <span style="font-weight:bold">Update Session Time</span> button to store the current time in session.</p>
-                    <p>Current Time: @Model.SessionInfo_CurrentTime</p>
-                    <p>Session Time: @Model.SessionInfo_SessionTime</p>
-                </div>
-            </div>
-        </form>
-    </div>
-</div>
diff --git a/SessionSample/Pages/Index.cshtml.cs b/SessionSample/Pages/Index.cshtml.cs
deleted file mode 100644
index 59bf24a..0000000
--- a/SessionSample/Pages/Index.cshtml.cs
+++ /dev/null
@@ -1,77 +0,0 @@
-using System;
-using Microsoft.AspNetCore.Http;
-using Microsoft.AspNetCore.Mvc;
-using Microsoft.AspNetCore.Mvc.RazorPages;
-using SessionSample.Middleware;
-using Web.Extensions;
-
-namespace SessionSample.Pages
-{
-    #region snippet1
-    public class IndexModel : PageModel
-    {
-        public const string SessionKeyName = "_Name";
-        public const string SessionKeyAge = "_Age";
-        const string SessionKeyTime = "_Time";
-
-        public string SessionInfo_Name { get; private set; }
-        public string SessionInfo_Age { get; private set; }
-        public string SessionInfo_CurrentTime { get; private set; }
-        public string SessionInfo_SessionTime { get; private set; }
-        public string SessionInfo_MiddlewareValue { get; private set; }
-
-        public void OnGet()
-        {
-            // Requires: using Microsoft.AspNetCore.Http;
-            if (string.IsNullOrEmpty(HttpContext.Session.GetString(SessionKeyName)))
-            {
-                HttpContext.Session.SetString(SessionKeyName, "The Doctor");
-                HttpContext.Session.SetInt32(SessionKeyAge, 773);
-            }
-
-            var name = HttpContext.Session.GetString(SessionKeyName);
-            var age = HttpContext.Session.GetInt32(SessionKeyAge);
-    #endregion
-            SessionInfo_Name = name;
-            SessionInfo_Age = age.ToString();
-
-            var currentTime = DateTime.Now;
-
-            #region snippet2
-            // Requires SessionExtensions from sample download.
-            if (HttpContext.Session.Get<DateTime>(SessionKeyTime) == default)
-            {
-                HttpContext.Session.Set<DateTime>(SessionKeyTime, currentTime);
-            }
-            #endregion
-
-            SessionInfo_CurrentTime = currentTime.ToString("H:mm:ss tt");
-            SessionInfo_SessionTime = HttpContext.Session.Get<DateTime>(SessionKeyTime)
-                .ToString("H:mm:ss tt");
-
-            #region snippet3
-            HttpContext.Items
-                .TryGetValue(HttpContextItemsMiddleware.HttpContextItemsMiddlewareKey, 
-                    out var middlewareSetValue);
-            SessionInfo_MiddlewareValue = 
-                middlewareSetValue?.ToString() ?? "Middleware value not set!";
-            #endregion
-        }
-
-        public IActionResult OnPostUpdateSessionDate()
-        {
-            HttpContext.Session.Set<DateTime>(SessionKeyTime, DateTime.Now);
-
-            return RedirectToPage();
-        }
-
-        public IActionResult OnPostChangeAge()
-        {
-            var r = new Random();
-
-            HttpContext.Session.SetInt32(SessionKeyAge, r.Next(500, 1000));
-
-            return RedirectToPage();
-        }
-    }
-}
diff --git a/SessionSample/Pages/Shared/_Layout.cshtml b/SessionSample/Pages/Shared/_Layout.cshtml
deleted file mode 100644
index b761491..0000000
--- a/SessionSample/Pages/Shared/_Layout.cshtml
+++ /dev/null
@@ -1,14 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
-    <meta charset="utf-8">
-    <meta name="viewport" content="width=device-width, initial-scale=1.0">
-    <title>@ViewData["Title"]</title>
-    <style>body{margin:0;padding-bottom:20px;font-family:"Helvetica Neue", Helvetica, Arial, sans-serif;font-size:14px;line-height:1.42857143;color:#333;background-color:#fff;}h1{font-size:24px;margin:.67em 0;}pre{overflow:auto;}code,pre{font-family:monospace, monospace;font-size:1em;}button,input{margin:0;font:inherit;color:inherit;}button{overflow:visible;}button{text-transform:none;}input{line-height:normal;}{box-sizing:border-box;}:before,*:after{box-sizing:border-box;}input,button{f [...]
-</head>
-<body>
-    <div class="container body-content">
-        @RenderBody()
-    </div>
-</body>
-</html>
diff --git a/SessionSample/Pages/_ViewImports.cshtml b/SessionSample/Pages/_ViewImports.cshtml
deleted file mode 100644
index f22da06..0000000
--- a/SessionSample/Pages/_ViewImports.cshtml
+++ /dev/null
@@ -1,3 +0,0 @@
-@using SessionSample
-@namespace SessionSample.Pages
-@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
diff --git a/SessionSample/Pages/_ViewStart.cshtml b/SessionSample/Pages/_ViewStart.cshtml
deleted file mode 100644
index a5f1004..0000000
--- a/SessionSample/Pages/_ViewStart.cshtml
+++ /dev/null
@@ -1,3 +0,0 @@
-@{
-    Layout = "_Layout";
-}
diff --git a/SessionSample/Program.cs b/SessionSample/Program.cs
deleted file mode 100644
index 6ab590d..0000000
--- a/SessionSample/Program.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-using Microsoft.AspNetCore;
-using Microsoft.AspNetCore.Hosting;
-
-namespace SessionSample
-{
-    public class Program
-    {
-        public static void Main(string[] args)
-        {
-            CreateWebHostBuilder(args).Build().Run();
-        }
-
-        public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
-            WebHost.CreateDefaultBuilder(args)
-                .UseStartup<Startup>();
-    }
-}
diff --git a/SessionSample/Properties/launchSettings.json b/SessionSample/Properties/launchSettings.json
deleted file mode 100644
index 4ebabb5..0000000
--- a/SessionSample/Properties/launchSettings.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
-  "iisSettings": {
-    "windowsAuthentication": false,
-    "anonymousAuthentication": true,
-    "iisExpress": {
-      "applicationUrl": "http://localhost:50795/",
-      "sslPort": 44315
-    }
-  },
-  "profiles": {
-    "IIS Express": {
-      "commandName": "IISExpress",
-      "launchBrowser": true,
-      "environmentVariables": {
-        "ASPNETCORE_ENVIRONMENT": "Development"
-      },
-      "nativeDebugging": true
-    },
-    "SessionSample": {
-      "commandName": "Project",
-      "launchBrowser": true,
-      "environmentVariables": {
-        "ASPNETCORE_ENVIRONMENT": "Development"
-      },
-      "applicationUrl": "https://localhost:5001;http://localhost:5000"
-    }
-  }
-}
\ No newline at end of file
diff --git a/SessionSample/SessionSample.csproj b/SessionSample/SessionSample.csproj
deleted file mode 100644
index bf84de8..0000000
--- a/SessionSample/SessionSample.csproj
+++ /dev/null
@@ -1,21 +0,0 @@
-<Project Sdk="Microsoft.NET.Sdk.Web">
-
-  <PropertyGroup>
-    <TargetFramework>netcoreapp3.1</TargetFramework>
-    <Platforms>AnyCPU;x64;x86</Platforms>
-  </PropertyGroup>
-
-  <ItemGroup>
-    <PackageReference Include="Steeltoe.Common" Version="3.0.0-m2" />
-    <PackageReference Include="Steeltoe.Common.Abstractions" Version="3.0.0-m2" />
-    <PackageReference Include="Steeltoe.Common.Hosting" Version="3.0.0-m2" />
-    <PackageReference Include="Steeltoe.ConnectorCore" Version="3.0.0-gemfire" />
-    <PackageReference Include="Steeltoe.Extensions.Configuration.CloudFoundryBase" Version="3.0.0-m2" />
-  </ItemGroup>
-
-  <ItemGroup>
-    <ProjectReference Include="..\NetCore.Session\NetCore.Session.csproj" />
-  </ItemGroup>
-
-
-</Project>
diff --git a/SessionSample/SessionSample.csproj.user b/SessionSample/SessionSample.csproj.user
deleted file mode 100644
index cff74a9..0000000
--- a/SessionSample/SessionSample.csproj.user
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup>
-    <ActiveDebugProfile>IIS Express</ActiveDebugProfile>
-  </PropertyGroup>
-</Project>
\ No newline at end of file
diff --git a/SessionSample/SessionSample.sln b/SessionSample/SessionSample.sln
deleted file mode 100644
index 4f6c0fb..0000000
--- a/SessionSample/SessionSample.sln
+++ /dev/null
@@ -1,31 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Version 16
-VisualStudioVersion = 16.0.30028.174
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SessionSample", "SessionSample.csproj", "{0073CD89-8ED5-42DC-8C0F-88036A11AE91}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug|Any CPU = Debug|Any CPU
-		Debug|x64 = Debug|x64
-		Release|Any CPU = Release|Any CPU
-		Release|x64 = Release|x64
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{0073CD89-8ED5-42DC-8C0F-88036A11AE91}.Debug|Any CPU.ActiveCfg = Debug|x64
-		{0073CD89-8ED5-42DC-8C0F-88036A11AE91}.Debug|Any CPU.Build.0 = Debug|x64
-		{0073CD89-8ED5-42DC-8C0F-88036A11AE91}.Debug|x64.ActiveCfg = Debug|x64
-		{0073CD89-8ED5-42DC-8C0F-88036A11AE91}.Debug|x64.Build.0 = Debug|x64
-		{0073CD89-8ED5-42DC-8C0F-88036A11AE91}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{0073CD89-8ED5-42DC-8C0F-88036A11AE91}.Release|Any CPU.Build.0 = Release|Any CPU
-		{0073CD89-8ED5-42DC-8C0F-88036A11AE91}.Release|x64.ActiveCfg = Release|x64
-		{0073CD89-8ED5-42DC-8C0F-88036A11AE91}.Release|x64.Build.0 = Release|x64
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-	GlobalSection(ExtensibilityGlobals) = postSolution
-		SolutionGuid = {EA7D931C-E9EA-4F8A-B4EA-18C5322FC048}
-	EndGlobalSection
-EndGlobal
diff --git a/SessionSample/Startup.cs b/SessionSample/Startup.cs
deleted file mode 100644
index 7cf7c36..0000000
--- a/SessionSample/Startup.cs
+++ /dev/null
@@ -1,79 +0,0 @@
-using GemFireSessionState.Models;
-using Apache.Geode.Session;
-using Steeltoe.Connector.GemFire;
-using Microsoft.AspNetCore.Builder;
-using Microsoft.AspNetCore.Hosting;
-using Microsoft.Extensions.Configuration;
-using Microsoft.Extensions.DependencyInjection;
-using Microsoft.Extensions.Logging;
-using Microsoft.Extensions.Hosting;
-using SessionSample.Middleware;
-using Microsoft.Extensions.Caching.Distributed;
-using System;
-using Apache.Geode.NetCore;
-
-namespace SessionSample
-{
-    #region snippet1
-    public class Startup
-    {
-        public Startup(IConfiguration configuration)
-        {
-            Configuration = configuration;
-        }
-
-        public IConfiguration Configuration { get; }
-        public ILoggerFactory LoggerFactory { get; }
-
-        public void ConfigureServices(IServiceCollection services)
-        {
-          services.AddGemFireConnection(Configuration, typeof(BasicAuthInitialize), loggerFactory: LoggerFactory);
-
-          // TODO: Don't hardcode region name here
-          services.AddSingleton<IDistributedCache>((isp) => new SessionStateCache(isp.GetRequiredService<Cache>(), "SteeltoeDemo", isp.GetService<ILogger<SessionStateCache>>()));
-
-          services.AddSession(options =>
-            {
-                options.IdleTimeout = TimeSpan.FromSeconds(5);
-                options.Cookie.HttpOnly = true;
-                options.Cookie.IsEssential = true;
-            });
-
-           services.AddControllersWithViews();
-           services.AddRazorPages();
-        }
-
-        public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
-        {
-            if (env.IsDevelopment())
-            {
-                app.UseDeveloperExceptionPage();
-            }
-            else
-            {
-                app.UseExceptionHandler("/Home/Error");
-                app.UseHsts();
-            }
-            app.UseHttpsRedirection();
-            app.UseStaticFiles();
-            app.UseCookiePolicy();
-
-
-            app.UseHttpContextItemsMiddleware();
-
-            app.UseRouting();
-
-            //app.UseAuthentication();
-            //app.UseAuthorization();
-
-            app.UseSession();
-
-            app.UseEndpoints(endpoints =>
-            {
-                endpoints.MapDefaultControllerRoute();
-                endpoints.MapRazorPages();
-            });
-    }
-  }
-    #endregion
-}
diff --git a/SessionSample/appsettings.Development.json b/SessionSample/appsettings.Development.json
deleted file mode 100644
index 0623a3f..0000000
--- a/SessionSample/appsettings.Development.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
-  "Logging": {
-    "LogLevel": {
-      "Default": "Debug",
-      "System": "Information",
-      "Microsoft": "Information"
-    }
-  }
-}
diff --git a/SessionSample/appsettings.Production.json b/SessionSample/appsettings.Production.json
deleted file mode 100644
index 8af1e1f..0000000
--- a/SessionSample/appsettings.Production.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
-  "Logging": {
-    "LogLevel": {
-      "Default": "Error",
-      "System": "Information",
-      "Microsoft": "Information"
-    }
-  }
-}
diff --git a/SessionSample/appsettings.json b/SessionSample/appsettings.json
deleted file mode 100644
index b7c4ed9..0000000
--- a/SessionSample/appsettings.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
-  "Logging": {
-    "LogLevel": {
-      "Default": "Warning"
-    }
-  },
-  "AllowedHosts": "*"
-}
diff --git a/SessionSample/statArchive-19444.gfs b/SessionSample/statArchive-19444.gfs
deleted file mode 100644
index e772c0e..0000000
Binary files a/SessionSample/statArchive-19444.gfs and /dev/null differ
diff --git a/SessionSample/statArchive-20992.gfs b/SessionSample/statArchive-20992.gfs
deleted file mode 100644
index c9a0640..0000000
Binary files a/SessionSample/statArchive-20992.gfs and /dev/null differ
diff --git a/SessionSample/statArchive-23496.gfs b/SessionSample/statArchive-23496.gfs
deleted file mode 100644
index b9f9ba5..0000000
Binary files a/SessionSample/statArchive-23496.gfs and /dev/null differ
diff --git a/SessionSample/statArchive-23824.gfs b/SessionSample/statArchive-23824.gfs
deleted file mode 100644
index 5122e73..0000000
Binary files a/SessionSample/statArchive-23824.gfs and /dev/null differ
diff --git a/SessionSample/statArchive-25408.gfs b/SessionSample/statArchive-25408.gfs
deleted file mode 100644
index a3b462c..0000000
Binary files a/SessionSample/statArchive-25408.gfs and /dev/null differ
diff --git a/SessionSample/statArchive-4448.gfs b/SessionSample/statArchive-4448.gfs
deleted file mode 100644
index 79aeda7..0000000
Binary files a/SessionSample/statArchive-4448.gfs and /dev/null differ

[geode-dotnet-core-client] 02/03: GEODE-9359: Add netcore-session to geode-native

Posted by mm...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

mmartell pushed a commit to branch AddNonSteeltoeSample
in repository https://gitbox.apache.org/repos/asf/geode-dotnet-core-client.git

commit ff7e02e9a58767bcf24a43b77f9c1a873f6c6c82
Author: Mike Martell <mm...@pivotal.io>
AuthorDate: Tue Jul 27 16:52:33 2021 -0700

    GEODE-9359: Add netcore-session to geode-native
---
 .../NetCore.Session.IntegrationTests.csproj        |  0
 .../Properties/launchSettings.json                 |  0
 .../SessionStateIntegrationTests.cs                | 10 ++---
 .../NetCore.Session.Tests.csproj                   |  0
 .../SessionStateCacheTests.cs                      |  0
 .../GeodeCacheServiceCollectionExtensions.cs       | 28 +++++++++++++
 NetCore.Session/GeodeSessionStateCacheOptions.cs   | 16 ++++++++
 NetCore.Session/NetCoreSessionState.cs             | 46 +++++++++++++---------
 geode-dotnet-core.sln                              | 46 +++++++++++++++++-----
 9 files changed, 113 insertions(+), 33 deletions(-)

diff --git a/Session.IntegrationTests/NetCore.Session.IntegrationTests.csproj b/NetCore.Session.IntegrationTests/NetCore.Session.IntegrationTests.csproj
similarity index 100%
rename from Session.IntegrationTests/NetCore.Session.IntegrationTests.csproj
rename to NetCore.Session.IntegrationTests/NetCore.Session.IntegrationTests.csproj
diff --git a/Session.IntegrationTests/Properties/launchSettings.json b/NetCore.Session.IntegrationTests/Properties/launchSettings.json
similarity index 100%
rename from Session.IntegrationTests/Properties/launchSettings.json
rename to NetCore.Session.IntegrationTests/Properties/launchSettings.json
diff --git a/Session.IntegrationTests/SessionStateIntegrationTests.cs b/NetCore.Session.IntegrationTests/SessionStateIntegrationTests.cs
similarity index 94%
rename from Session.IntegrationTests/SessionStateIntegrationTests.cs
rename to NetCore.Session.IntegrationTests/SessionStateIntegrationTests.cs
index 52538df..eafb590 100644
--- a/Session.IntegrationTests/SessionStateIntegrationTests.cs
+++ b/NetCore.Session.IntegrationTests/SessionStateIntegrationTests.cs
@@ -24,7 +24,7 @@ namespace Apache.Geode.Session.IntegrationTests
             using var poolFactory = cache.PoolFactory.AddLocator("localhost", 10334);
             using var pool = poolFactory.CreatePool("myPool");
 
-            using var ssCache = new SessionStateCache(cache, _regionName);
+            using var ssCache = new GeodeSessionStateCache(cache, _regionName);
 
             var options = new DistributedCacheEntryOptions();
             DateTime localTime = DateTime.Now.AddDays(1);
@@ -48,7 +48,7 @@ namespace Apache.Geode.Session.IntegrationTests
             using PoolFactory poolFactory = cache.PoolFactory.AddLocator("localhost", 10334);
             using var pool = poolFactory.CreatePool("myPool");
 
-            using var ssCache = new SessionStateCache(cache, _regionName);
+            using var ssCache = new GeodeSessionStateCache(cache, _regionName);
 
             var options = new DistributedCacheEntryOptions();
             int numSeconds = 20;
@@ -81,7 +81,7 @@ namespace Apache.Geode.Session.IntegrationTests
             using var cache = (Cache)cacheFactory.CreateCache();
             PoolFactory poolFactory = cache.PoolFactory;
 
-            using var ssCache = new SessionStateCache(cache, _regionName);
+            using var ssCache = new GeodeSessionStateCache(cache, _regionName);
 
             var options = new DistributedCacheEntryOptions();
             options.AbsoluteExpiration = DateTime.Now.AddSeconds(5);
@@ -102,7 +102,7 @@ namespace Apache.Geode.Session.IntegrationTests
             using var poolFactory = cache.PoolFactory.AddLocator("localhost", 10334);
             using var pool = poolFactory.CreatePool("myPool");
 
-            using var ssCache = new SessionStateCache(cache, _regionName);
+            using var ssCache = new GeodeSessionStateCache(cache, _regionName);
 
             var options = new DistributedCacheEntryOptions();
             DateTime localTime = DateTime.Now.AddDays(1);
@@ -129,7 +129,7 @@ namespace Apache.Geode.Session.IntegrationTests
             using var poolFactory = cache.PoolFactory.AddLocator("localhost", 10334);
             using var pool = poolFactory.CreatePool("myPool");
 
-            using var ssCache = new SessionStateCache(cache, _regionName);
+            using var ssCache = new GeodeSessionStateCache(cache, _regionName);
 
             var options = new DistributedCacheEntryOptions();
             DateTime localTime = DateTime.Now.AddDays(1);
diff --git a/Session.Tests/NetCore.Session.Tests.csproj b/NetCore.Session.Tests/NetCore.Session.Tests.csproj
similarity index 100%
rename from Session.Tests/NetCore.Session.Tests.csproj
rename to NetCore.Session.Tests/NetCore.Session.Tests.csproj
diff --git a/Session.Tests/SessionStateCacheTests.cs b/NetCore.Session.Tests/SessionStateCacheTests.cs
similarity index 100%
rename from Session.Tests/SessionStateCacheTests.cs
rename to NetCore.Session.Tests/SessionStateCacheTests.cs
diff --git a/NetCore.Session/GeodeCacheServiceCollectionExtensions.cs b/NetCore.Session/GeodeCacheServiceCollectionExtensions.cs
new file mode 100644
index 0000000..19f0f54
--- /dev/null
+++ b/NetCore.Session/GeodeCacheServiceCollectionExtensions.cs
@@ -0,0 +1,28 @@
+using System;
+using Microsoft.Extensions.Caching.Distributed;
+using Microsoft.Extensions.DependencyInjection;
+
+namespace Apache.Geode.Session
+{
+    public static class GeodeCacheServiceCollectionExtensions
+    {
+        public static IServiceCollection AddGeodeSessionStateCache(this IServiceCollection services, Action<GeodeSessionStateCacheOptions> setupAction)
+        {
+            if (services == null)
+            {
+                throw new ArgumentNullException(nameof(services));
+            }
+
+            if (setupAction == null)
+            {
+                throw new ArgumentNullException(nameof(setupAction));
+            }
+
+            services.AddOptions();
+            services.Add(ServiceDescriptor.Singleton<IDistributedCache, GeodeSessionStateCache>());
+            services.Configure(setupAction);
+
+            return services;
+        }
+    }
+}
diff --git a/NetCore.Session/GeodeSessionStateCacheOptions.cs b/NetCore.Session/GeodeSessionStateCacheOptions.cs
new file mode 100644
index 0000000..aecf7e6
--- /dev/null
+++ b/NetCore.Session/GeodeSessionStateCacheOptions.cs
@@ -0,0 +1,16 @@
+using Microsoft.Extensions.Options;
+
+namespace Apache.Geode.Session
+{
+    public class GeodeSessionStateCacheOptions : IOptions<GeodeSessionStateCacheOptions>
+    {
+        public string RegionName { get; set; }
+        public string Host { get; set; }
+        public int Port { get; set; }
+
+        GeodeSessionStateCacheOptions IOptions<GeodeSessionStateCacheOptions>.Value
+        {
+            get { return this; }
+        }
+    }
+}
diff --git a/NetCore.Session/NetCoreSessionState.cs b/NetCore.Session/NetCoreSessionState.cs
index 0f39ae0..df4f8c8 100644
--- a/NetCore.Session/NetCoreSessionState.cs
+++ b/NetCore.Session/NetCoreSessionState.cs
@@ -1,21 +1,22 @@
 using Apache.Geode.NetCore;
 using Microsoft.Extensions.Caching.Distributed;
 using Microsoft.Extensions.Logging;
+using Microsoft.Extensions.Options;
 using System;
 using System.Threading;
 using System.Threading.Tasks;
 
 namespace Apache.Geode.Session
 {
-    public class SessionStateValue
+    public class GeodeSessionStateValue
     {
         DateTime _lastAccessTimeUtc;
         DateTime _expirationTimeUtc = DateTime.MinValue;
         TimeSpan _spanUntilStale = TimeSpan.Zero;
         private byte[] _value;
 
-        public SessionStateValue() { }
-        public SessionStateValue(byte[] value)
+        public GeodeSessionStateValue() { }
+        public GeodeSessionStateValue(byte[] value)
         {
             FromByteArray(value);
         }
@@ -88,32 +89,41 @@ namespace Apache.Geode.Session
         }
     }
 
-    public class SessionStateCache : GeodeNativeObject, IDistributedCache
+    public class GeodeSessionStateCache : GeodeNativeObject, IDistributedCache
     {
-        private readonly Cache _cache;
-        private ILogger<SessionStateCache> _logger;
+        private readonly IGeodeCache _cache;
+        private ILogger<GeodeSessionStateCache> _logger;
         private static Region _region;
         private string _regionName;
         private readonly SemaphoreSlim _connectLock = new SemaphoreSlim(initialCount: 1, maxCount: 1);
 
-        public SessionStateCache(Cache cache, string regionName, ILogger<SessionStateCache> logger = null)
-        {
-            _regionName = regionName ?? throw new ArgumentNullException(regionName);
-            _cache = cache ?? throw new ArgumentNullException(nameof(cache));
-            _logger = logger;
+        public GeodeSessionStateCache(IOptions<GeodeSessionStateCacheOptions> optionsAccessor) {
+
+            var host = optionsAccessor.Value.Host;
+            var port = optionsAccessor.Value.Port;
+            _regionName = optionsAccessor.Value.RegionName;
+
+            _cache = CacheFactory.Create()
+                .SetProperty("log-level", "none")
+                .CreateCache();
+
+            _cache.PoolManager
+                .CreatePoolFactory()
+                .AddLocator(host, port)
+                .CreatePool("pool");
 
-            _cache.PoolFactory.AddLocator("localhost", 10334);
-            using var pool = _cache.PoolFactory.CreatePool("pool");
+            var regionFactory = _cache.CreateRegionFactory(RegionShortcut.Proxy);
+            _region = regionFactory.CreateRegion(_regionName);
         }
 
         // Returns the SessionStateValue for key, or null if key doesn't exist
-        public SessionStateValue GetValueForKey(string key)
+        public GeodeSessionStateValue GetValueForKey(string key)
         {
             byte[] cacheValue = _region.GetByteArray(key);
 
             if (cacheValue != null)
             {
-                return new SessionStateValue(cacheValue);
+                return new GeodeSessionStateValue(cacheValue);
             }
             else
                 return null;
@@ -129,7 +139,7 @@ namespace Apache.Geode.Session
             Connect();
 
             // Check for nonexistent key
-            SessionStateValue ssValue = GetValueForKey(key);
+            GeodeSessionStateValue ssValue = GetValueForKey(key);
             if (ssValue == null)
                 return null;
 
@@ -178,7 +188,7 @@ namespace Apache.Geode.Session
             Connect();
 
             // Check for nonexistent key
-            SessionStateValue ssValue = GetValueForKey(key);
+            GeodeSessionStateValue ssValue = GetValueForKey(key);
             if (ssValue == null)
                 return;
 
@@ -263,7 +273,7 @@ namespace Apache.Geode.Session
 
             Connect();
 
-            SessionStateValue ssValue = new SessionStateValue();
+            GeodeSessionStateValue ssValue = new GeodeSessionStateValue();
             ssValue.Value = value;
 
             DateTime nowUtc = DateTime.UtcNow;
diff --git a/geode-dotnet-core.sln b/geode-dotnet-core.sln
index 2f1a398..0ede2ac 100644
--- a/geode-dotnet-core.sln
+++ b/geode-dotnet-core.sln
@@ -15,64 +15,90 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NetCore.Session.Tests", "Se
 EndProject
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NetCore.Session.IntegrationTests", "Session.IntegrationTests\NetCore.Session.IntegrationTests.csproj", "{742B4109-544E-492E-86AC-DC1E0FCCA596}"
 EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SessionSample", "SessionSample\SessionSample.csproj", "{6D0D1D93-917E-48EE-977C-16F65DB982BE}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AspNetCore GeodeSession Sample", "AspNetCore GeodeSession Sample\AspNetCore GeodeSession Sample.csproj", "{0EB901F7-293F-41A3-B1A3-A8C831CCAD85}"
 EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
 		Debug|x64 = Debug|x64
+		Debug|x86 = Debug|x86
 		Release|Any CPU = Release|Any CPU
 		Release|x64 = Release|x64
+		Release|x86 = Release|x86
 	EndGlobalSection
 	GlobalSection(ProjectConfigurationPlatforms) = postSolution
 		{09ABBCE7-B217-43F1-A51B-CC5BDCD8EE98}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{09ABBCE7-B217-43F1-A51B-CC5BDCD8EE98}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{09ABBCE7-B217-43F1-A51B-CC5BDCD8EE98}.Debug|x64.ActiveCfg = Debug|x64
 		{09ABBCE7-B217-43F1-A51B-CC5BDCD8EE98}.Debug|x64.Build.0 = Debug|x64
+		{09ABBCE7-B217-43F1-A51B-CC5BDCD8EE98}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{09ABBCE7-B217-43F1-A51B-CC5BDCD8EE98}.Debug|x86.Build.0 = Debug|Any CPU
 		{09ABBCE7-B217-43F1-A51B-CC5BDCD8EE98}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{09ABBCE7-B217-43F1-A51B-CC5BDCD8EE98}.Release|Any CPU.Build.0 = Release|Any CPU
 		{09ABBCE7-B217-43F1-A51B-CC5BDCD8EE98}.Release|x64.ActiveCfg = Release|Any CPU
 		{09ABBCE7-B217-43F1-A51B-CC5BDCD8EE98}.Release|x64.Build.0 = Release|Any CPU
+		{09ABBCE7-B217-43F1-A51B-CC5BDCD8EE98}.Release|x86.ActiveCfg = Release|Any CPU
+		{09ABBCE7-B217-43F1-A51B-CC5BDCD8EE98}.Release|x86.Build.0 = Release|Any CPU
 		{501DEA7E-8985-42A8-8BC9-C073E1B6DFE0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{501DEA7E-8985-42A8-8BC9-C073E1B6DFE0}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{501DEA7E-8985-42A8-8BC9-C073E1B6DFE0}.Debug|x64.ActiveCfg = Debug|x64
 		{501DEA7E-8985-42A8-8BC9-C073E1B6DFE0}.Debug|x64.Build.0 = Debug|x64
+		{501DEA7E-8985-42A8-8BC9-C073E1B6DFE0}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{501DEA7E-8985-42A8-8BC9-C073E1B6DFE0}.Debug|x86.Build.0 = Debug|Any CPU
 		{501DEA7E-8985-42A8-8BC9-C073E1B6DFE0}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{501DEA7E-8985-42A8-8BC9-C073E1B6DFE0}.Release|Any CPU.Build.0 = Release|Any CPU
 		{501DEA7E-8985-42A8-8BC9-C073E1B6DFE0}.Release|x64.ActiveCfg = Release|Any CPU
 		{501DEA7E-8985-42A8-8BC9-C073E1B6DFE0}.Release|x64.Build.0 = Release|Any CPU
+		{501DEA7E-8985-42A8-8BC9-C073E1B6DFE0}.Release|x86.ActiveCfg = Release|Any CPU
+		{501DEA7E-8985-42A8-8BC9-C073E1B6DFE0}.Release|x86.Build.0 = Release|Any CPU
 		{CC1FEC64-9AD6-4A69-ADF2-038CF67A8590}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{CC1FEC64-9AD6-4A69-ADF2-038CF67A8590}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{CC1FEC64-9AD6-4A69-ADF2-038CF67A8590}.Debug|x64.ActiveCfg = Debug|x64
 		{CC1FEC64-9AD6-4A69-ADF2-038CF67A8590}.Debug|x64.Build.0 = Debug|x64
+		{CC1FEC64-9AD6-4A69-ADF2-038CF67A8590}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{CC1FEC64-9AD6-4A69-ADF2-038CF67A8590}.Debug|x86.Build.0 = Debug|Any CPU
 		{CC1FEC64-9AD6-4A69-ADF2-038CF67A8590}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{CC1FEC64-9AD6-4A69-ADF2-038CF67A8590}.Release|Any CPU.Build.0 = Release|Any CPU
 		{CC1FEC64-9AD6-4A69-ADF2-038CF67A8590}.Release|x64.ActiveCfg = Release|Any CPU
 		{CC1FEC64-9AD6-4A69-ADF2-038CF67A8590}.Release|x64.Build.0 = Release|Any CPU
+		{CC1FEC64-9AD6-4A69-ADF2-038CF67A8590}.Release|x86.ActiveCfg = Release|Any CPU
+		{CC1FEC64-9AD6-4A69-ADF2-038CF67A8590}.Release|x86.Build.0 = Release|Any CPU
 		{C107D019-3B4F-403D-9040-ECB6E86C44E9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{C107D019-3B4F-403D-9040-ECB6E86C44E9}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{C107D019-3B4F-403D-9040-ECB6E86C44E9}.Debug|x64.ActiveCfg = Debug|x64
 		{C107D019-3B4F-403D-9040-ECB6E86C44E9}.Debug|x64.Build.0 = Debug|x64
+		{C107D019-3B4F-403D-9040-ECB6E86C44E9}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{C107D019-3B4F-403D-9040-ECB6E86C44E9}.Debug|x86.Build.0 = Debug|Any CPU
 		{C107D019-3B4F-403D-9040-ECB6E86C44E9}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{C107D019-3B4F-403D-9040-ECB6E86C44E9}.Release|Any CPU.Build.0 = Release|Any CPU
 		{C107D019-3B4F-403D-9040-ECB6E86C44E9}.Release|x64.ActiveCfg = Release|Any CPU
 		{C107D019-3B4F-403D-9040-ECB6E86C44E9}.Release|x64.Build.0 = Release|Any CPU
+		{C107D019-3B4F-403D-9040-ECB6E86C44E9}.Release|x86.ActiveCfg = Release|Any CPU
+		{C107D019-3B4F-403D-9040-ECB6E86C44E9}.Release|x86.Build.0 = Release|Any CPU
 		{742B4109-544E-492E-86AC-DC1E0FCCA596}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{742B4109-544E-492E-86AC-DC1E0FCCA596}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{742B4109-544E-492E-86AC-DC1E0FCCA596}.Debug|x64.ActiveCfg = Debug|x64
 		{742B4109-544E-492E-86AC-DC1E0FCCA596}.Debug|x64.Build.0 = Debug|x64
+		{742B4109-544E-492E-86AC-DC1E0FCCA596}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{742B4109-544E-492E-86AC-DC1E0FCCA596}.Debug|x86.Build.0 = Debug|Any CPU
 		{742B4109-544E-492E-86AC-DC1E0FCCA596}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{742B4109-544E-492E-86AC-DC1E0FCCA596}.Release|Any CPU.Build.0 = Release|Any CPU
 		{742B4109-544E-492E-86AC-DC1E0FCCA596}.Release|x64.ActiveCfg = Release|Any CPU
 		{742B4109-544E-492E-86AC-DC1E0FCCA596}.Release|x64.Build.0 = Release|Any CPU
-		{6D0D1D93-917E-48EE-977C-16F65DB982BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{6D0D1D93-917E-48EE-977C-16F65DB982BE}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{6D0D1D93-917E-48EE-977C-16F65DB982BE}.Debug|x64.ActiveCfg = Debug|x64
-		{6D0D1D93-917E-48EE-977C-16F65DB982BE}.Debug|x64.Build.0 = Debug|x64
-		{6D0D1D93-917E-48EE-977C-16F65DB982BE}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{6D0D1D93-917E-48EE-977C-16F65DB982BE}.Release|Any CPU.Build.0 = Release|Any CPU
-		{6D0D1D93-917E-48EE-977C-16F65DB982BE}.Release|x64.ActiveCfg = Release|x64
-		{6D0D1D93-917E-48EE-977C-16F65DB982BE}.Release|x64.Build.0 = Release|x64
+		{742B4109-544E-492E-86AC-DC1E0FCCA596}.Release|x86.ActiveCfg = Release|Any CPU
+		{742B4109-544E-492E-86AC-DC1E0FCCA596}.Release|x86.Build.0 = Release|Any CPU
+		{0EB901F7-293F-41A3-B1A3-A8C831CCAD85}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{0EB901F7-293F-41A3-B1A3-A8C831CCAD85}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{0EB901F7-293F-41A3-B1A3-A8C831CCAD85}.Debug|x64.ActiveCfg = Debug|x64
+		{0EB901F7-293F-41A3-B1A3-A8C831CCAD85}.Debug|x64.Build.0 = Debug|x64
+		{0EB901F7-293F-41A3-B1A3-A8C831CCAD85}.Debug|x86.ActiveCfg = Debug|x86
+		{0EB901F7-293F-41A3-B1A3-A8C831CCAD85}.Debug|x86.Build.0 = Debug|x86
+		{0EB901F7-293F-41A3-B1A3-A8C831CCAD85}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{0EB901F7-293F-41A3-B1A3-A8C831CCAD85}.Release|Any CPU.Build.0 = Release|Any CPU
+		{0EB901F7-293F-41A3-B1A3-A8C831CCAD85}.Release|x64.ActiveCfg = Release|x64
+		{0EB901F7-293F-41A3-B1A3-A8C831CCAD85}.Release|x64.Build.0 = Release|x64
+		{0EB901F7-293F-41A3-B1A3-A8C831CCAD85}.Release|x86.ActiveCfg = Release|x86
+		{0EB901F7-293F-41A3-B1A3-A8C831CCAD85}.Release|x86.Build.0 = Release|x86
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
@@ -81,7 +107,7 @@ Global
 		{CC1FEC64-9AD6-4A69-ADF2-038CF67A8590} = {38D87C7D-D5FE-43B8-80CC-1CE70167FB69}
 		{C107D019-3B4F-403D-9040-ECB6E86C44E9} = {38D87C7D-D5FE-43B8-80CC-1CE70167FB69}
 		{742B4109-544E-492E-86AC-DC1E0FCCA596} = {38D87C7D-D5FE-43B8-80CC-1CE70167FB69}
-		{6D0D1D93-917E-48EE-977C-16F65DB982BE} = {38D87C7D-D5FE-43B8-80CC-1CE70167FB69}
+		{0EB901F7-293F-41A3-B1A3-A8C831CCAD85} = {38D87C7D-D5FE-43B8-80CC-1CE70167FB69}
 	EndGlobalSection
 	GlobalSection(ExtensibilityGlobals) = postSolution
 		SolutionGuid = {B30A49F0-1C96-4D6C-A222-0088B1D7FBBE}