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
public class TolerantStringEnumConverter<TEnum> : JsonConverter<TEnum> | |
{ | |
const string DefaultIndex = "0"; | |
const string DefaultEnumNone = "None"; | |
public override TEnum Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) | |
{ | |
bool isNullable = IsNullableType(typeToConvert); | |
Type enumType = GetEnumType(typeToConvert); |
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
public static class StringExtension | |
{ | |
public static bool IsBase64(this string value) | |
{ | |
string pattern = @"^([A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}==)?$"; | |
Regex rg = new Regex(pattern); | |
return rg.IsMatch(value); | |
} | |
public static string Base64Decode(this string value, bool returnSameValueIsNotBase64 = false) |
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
<system.webServer> | |
<security> | |
<requestFiltering> | |
<requestLimits maxAllowedContentLength="1073741824" /> | |
</requestFiltering> | |
</security> | |
</system.webServer> |
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 Microsoft.ServiceBus.Messaging; | |
using System; | |
using System.Configuration; | |
namespace RecoverDeadLetterQueuesGeneric | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ |
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
XmlSerializer serializer = new XmlSerializer(typeof(MetadataFile)); | |
MemoryStream memoryStream = new MemoryStream(); | |
//Configuration remove tag omit-xml-declaration | |
XmlWriterSettings settings = new XmlWriterSettings(); | |
settings.OmitXmlDeclaration = true; | |
XmlWriter writer = XmlWriter.Create(memoryStream, settings); | |
//Remove namespace | |
StringWriter stringWriter = new StringWriter(); |
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
db.movement.insert({ | |
"lot": "00467", | |
"production": true, | |
"files": [{ | |
"extension": ".txt", | |
"name": "test1", | |
"size": 5811 | |
}, | |
{ | |
"extension": ".csv", |