Skip to content

Instantly share code, notes, and snippets.

View BrianVallelunga's full-sized avatar

Brian Vallelunga BrianVallelunga

  • Message Digital
  • Maine
View GitHub Profile
@BrianVallelunga
BrianVallelunga / MessageScopeManager.cs
Last active March 17, 2016 14:03
Azure WebJob MessageScope solution
namespace Demo
{
using System;
using System.Collections.Concurrent;
using System.Runtime.Remoting.Messaging;
using Microsoft.Practices.Unity;
using Microsoft.ServiceBus.Messaging;
public interface IMessageScopeManager
@BrianVallelunga
BrianVallelunga / DatabaseFixture.cs
Created October 4, 2017 17:02
Snapshot support for integrated testing resets
namespace IntegrationTests
{
using System;
using System.Data.SqlClient;
using System.IO;
using Xunit;
public class DatabaseFixture : IDisposable
{
@BrianVallelunga
BrianVallelunga / CompactCosmosSerializer.fs
Last active October 24, 2020 07:14
A custom CosmosSerializer that uses the CompactUnionJsonConverter from Microsoft.FSharpLu.Json to format Cosmos DB documents in a more humane way.
type CompactCosmosSerializer() =
inherit CosmosSerializer()
let defaultEncoding = new UTF8Encoding(false, true)
let jsonSerializerSettings = new JsonSerializerSettings()
do jsonSerializerSettings.Converters <- [| CompactUnionJsonConverter(true) |]
let serializer = JsonSerializer.Create(jsonSerializerSettings)
override u.FromStream<'T>(stream: Stream): 'T =
let returnCastedStream() =