This file contains 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; | |
using System.Collections.Generic; | |
using System.Collections.Specialized; | |
using System.Linq; | |
using System.Threading.Tasks; | |
using Fasterflect; | |
namespace CajunCoding | |
{ |
This file contains 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
//WIP: This is an extension method for Flurl to download a Binary file direcctly into an AsyncEnumerable that that | |
// can then be iterated with deferred execution for streaming binary data without downloading all data into Memory OR | |
// needing to store in an intermediate location. | |
//TODO: | |
// - Implement IAsyncEnumerable wrapper for the Stream Reading which can then be easily chunked via Linq just as it currently is... | |
// - This method may run a quick HTTP GET for headers Only to check and confirm existence, and then return an AsynEnumerable wrapper with an internal Delegate that creates the Stream | |
// reads the bytes in buffer/chunk sizes until Zero bytes are read; this would occur inside the GetEnumerator() call... | |
// - Develop this as an Open Source (e.g. Gist) Flurl Extension method for Re-use and sharing! | |
// - Reference Flurl's DownloadFileAsync for getting a true Async stream (would happen in the Delegate when IAsyncEnumerable.GetEnumerator() is called... |
This file contains 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
Unless specifically noted in the Gist itself, all Public Gists shared in this repository by @CajunCoding may be used | |
according to MIT Licensing agreement as follows: | |
Copyright 2024 @CajunCoding/BBernard | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation | |
files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, | |
modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software | |
is furnished to do so, subject to the following conditions: |
This file contains 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.Text.Json; | |
using System.Text.Json.Nodes; | |
namespace CajunCoding | |
{ | |
public static class SystemTextJsonMergeExtensions | |
{ |
This file contains 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> |
This file contains 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.Compression; | |
using System.Linq; | |
using Microsoft.AspNetCore.Http; | |
using Microsoft.Extensions.Primitives; | |
using Microsoft.Net.Http.Headers; | |
namespace AzureFunctionsInProcessCompressionExtensions | |
{ | |
/// <summary> |
This file contains 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 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 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 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; |
NewerOlder