JP.MVC.Helpers 0.9.6-alpha

This is a prerelease version of JP.MVC.Helpers.
dotnet add package JP.MVC.Helpers --version 0.9.6-alpha                
NuGet\Install-Package JP.MVC.Helpers -Version 0.9.6-alpha                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="JP.MVC.Helpers" Version="0.9.6-alpha" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add JP.MVC.Helpers --version 0.9.6-alpha                
#r "nuget: JP.MVC.Helpers, 0.9.6-alpha"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install JP.MVC.Helpers as a Cake Addin
#addin nuget:?package=JP.MVC.Helpers&version=0.9.6-alpha&prerelease

// Install JP.MVC.Helpers as a Cake Tool
#tool nuget:?package=JP.MVC.Helpers&version=0.9.6-alpha&prerelease                

JP.MVC.Helpers README

The following readme will explain the latest updates to this library and provide a brief usage guide for CookieManager and CACHelper.

Latest updates in 0.9.6.0-alpha

  1. Removed CookieHelper class This has been phased out of this version. If you still need it, it is available in 0.9.5.0. CookieManager is the new cookie class to use.
  2. Changes to CookieManager class This class has been updated to better handle updating of an existing cookie. Should no longer find an issue with updating cookies.
  3. Renamed Library Renamed the library to "JP.MVC.Helpers" to match name of NuGet package.

To update your project, replace all instances of the following:

using WDS_Helper;

to

using JP.MVC.Helpers;

----------------------------------

Usage Examples

To use any of the helper classes, you'll need to reference the library with:

using JP.MVC.Helpers;

CookieManager

The following examples use "localhost" as the domain for testing. Replace this value in the CookieStore call to use whatever domain you wish.

Dictionary<string, string> values = new Dictionary<string, string>();
values.Add("c1key", "cookie 1 value");
values.Add("c2key", "cookie 2 value");
CookieManager.CookieStore("SiteCookie", "localhost", values, DateTime.Now.AddDays(1), false, false);

----------------------------------

var temp = CookieManager.GetFromCookieStore("SiteCookie", "c1key");

----------------------------------

if(CookieManager.CookieExist("SiteCookie", "c1key"))

----------------------------------

CookieManager.RemoveCookie("SiteCookie", "c1key", "localhost");

----------------------------------

CACHelper

Initialize CACHelper

public static CACHelper cachelper = new CACHelper();
cachelper.isLocal = true;
cachelper.mockSubjectLine = "C = US, O = Developer, OU = Dev, OU = PKI, OU = USA, CN = Developer.Test.J.1234567890"

or

public static CACHelper cachelper = new CACHelper() { isLocal = true, mockSubjectLine = "C = US, O = Developer, OU = Dev, OU = PKI, OU = USA, CN = Developer.Test.J.1234567890"};

----------------------------------

CACParameter

CACHelper has an enum property called CACParameter that allows you to obtain data from the Common Access Card/Client Certificate

public enum CACParameter
    {
        /// <summary>
        /// Entire "Subject" line from currently selected Common Access Card/Client Certificate.
        /// </summary>
        AllData,
        /// <summary>
        /// Gets full name from currently selected Common Access Card/Client Certificate.
        /// </summary>
        FullName,
        /// <summary>
        /// Gets first name from currently selected Common Access Card/Client Certificate.
        /// </summary>
        FirstName,
        /// <summary>
        /// Gets last name from currently selected Common Access Card/Client Certificate.
        /// </summary>
        LastName,
        /// <summary>
        /// Gets middle initial from currently selected Common Access Card/Client Certificate.
        /// </summary>
        MiddleInitial,
        /// <summary>
        /// Concatenates first and last name from currently selected Common Access Card/Client Certificate.
        /// </summary>
        FirstAndLast,
        /// <summary>
        /// Gets CAC ID (EDIPI) from currently selected Common Access Card/Client Certificate.
        /// </summary>
        CACIdentifier
    }

----------------------------------

Retrieve CAC Parameter

cachelper.GetCACInfo(CACHelper.CACParameter.CACIdentifier)
Product Compatible and additional computed target framework versions.
.NET Framework net461 is compatible.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 is compatible.  net48 is compatible.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.9.6-alpha 215 10/18/2021
0.9.5-alpha 156 10/14/2021
0.9.4-alpha 156 10/14/2021