This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections.Concurrent; | |
| using System.Collections.Generic; | |
| using System.IO; | |
| using System.Linq; | |
| namespace System.Reflection.AttributeSearch | |
| { | |
| /// <summary> | |
| /// BBernard |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections.Concurrent; | |
| public class SimpleLazyCacheHelper<T> where T: class | |
| { | |
| private readonly ConcurrentDictionary<string, Lazy<T>> _cache = new ConcurrentDictionary<string, Lazy<T>>(); | |
| [Obsolete("This method adds existing values to the cache, but it's best to use GetOrAddToCache() to facilitate a self-populating cache (especially in a Web environment)")] | |
| public void AddToCache(string key, T value) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #************************************************************************************************** | |
| #COPY All Secrets from Source KeyVault to Destination (with ContentType) | |
| #Originally Inspired by the StackOverflow post here: https://stackoverflow.com/a/55618194/7293142 | |
| # To Use: https://docs.microsoft.com/en-us/powershell/azure/install-az-ps | |
| # 1) Ensure you have permission to execute in PowerShell: | |
| # Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser | |
| # 2) Install Azure "Az" Modeule: | |
| # Install-Module -Name Az -Scope CurrentUser -Repository PSGallery -Force | |
| #************************************************************************************************** | |
| Param( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Security.Cryptography; | |
| using System.Text; | |
| namespace CajunCoding.PKCE | |
| { | |
| /// <summary> | |
| /// BBernard / CajunCoding | |
| /// A simple class to generate Proof Key for Code Exchange (PKCE) codes to be used in the Authorization code authentication flow. | |
| /// |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.IO; | |
| using Newtonsoft.Json.Linq; | |
| namespace CajunCoding.Configuration | |
| { | |
| public static class LocalSettingsEnvironmentReader | |
| { | |
| /// <summary> | |
| /// BBernard |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.Runtime.CompilerServices; | |
| using System.Threading.Tasks; | |
| namespace CajunCoding | |
| { | |
| /// <summary> | |
| /// Greatly Simplified lightweight wrapper class to support improved code readability and management of | |
| /// Async methods used in combination with Lazy<T> wrapper for thread safe lazy loading from a Func value factory! | |
| /// Based on Original blogs here: | |
| /// https://blogs.msdn.microsoft.com/pfxteam/2011/01/15/asynclazyt/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Threading.Channels; | |
| using System.Threading; | |
| using System.Threading.Tasks; | |
| using System.Runtime.CompilerServices; | |
| namespace CajunCoding.Async | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using HotChocolate.Execution.Instrumentation; | |
| using HotChocolate.Execution; | |
| using System; | |
| using System.Diagnostics; | |
| using System.Linq; | |
| using Aeg.Common.CSharp.CustomExtensions; | |
| using Microsoft.Extensions.Logging; | |
| using Microsoft.Extensions.DependencyInjection; | |
| using GraphQL.HotChocolate.AzureFunctions.Authorization; | |
| using System.Security.Claims; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Linq; | |
| using System.Security.Cryptography; | |
| using System.Text; | |
| namespace CajunCoding.HMAC | |
| { | |
| /// <summary> | |
| /// BBernard / CajunCoding | |
| /// A simple class to generate HMAC codes (hash-based message authentication code) to be used for signing and validating |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Globalization; | |
| using System.Linq; | |
| namespace CajunCoding | |
| { | |
| /// <summary> | |
| /// Simple helper to find and convert RegionInfo details using two or three letter Country Codes. | |
| /// NOTE: Inspired but fully rewritten from the Gist: https://gist.github.com/BenjaminAdams/277928c7ad291ea7aea8 | |
| /// </summary> |
OlderNewer