Skip to content

Instantly share code, notes, and snippets.

View gist:ada01ee0143be490190e6902baf398ab
### Keybase proof
I hereby claim:
* I am craiggwilson on github.
* I am craiggwilson (https://keybase.io/craiggwilson) on keybase.
* I have a public key ASDp-7lyxO0yZL_glhFEloFdSE0WddVr8uo0LFHwsT30EAo
To claim this, I am signing this object:
View gist:7f4fca009c55ce7feb540073f740fd53
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using MongoDB.Bson;
using MongoDB.Bson.IO;
using MongoDB.Bson.Serialization;
using MongoDB.Bson.Serialization.Attributes;
View gist:f7145d6b00beaf9d0bdb
using MongoDB.Bson;
using MongoDB.Driver;
using MongoDB.Bson.Serialization.Attributes;
class Entity
{
public ObjectId Id { get; set; }
public string Prop1 { get; set; }
public List<EmbeddedEntity> Embeds { get; set; }
View QuickTest.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MongoDB.Bson;
using MongoDB.Bson.Serialization;
using NUnit.Framework;
namespace MongoDB.BsonUnitTests.DefaultSerializer.GGTests
{
@craiggwilson
craiggwilson / gist:5536920
Created May 7, 2013
Testing .NET MongoDB Driver Replica Set Failover
View gist:5536920
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Threading;
using MongoDB.Bson;
using MongoDB.Bson.IO;
using MongoDB.Bson.Serialization;
View gist:5503913
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MongoDB.Bson;
using MongoDB.Driver;
using MongoDB.Driver.Builders;
namespace TestSlowGetMore
@craiggwilson
craiggwilson / gist:5217295
Created Mar 21, 2013
Convention to automatically persist string identifiers as ObjectId's in MongoDB.
View gist:5217295
using System.Diagnostics;
using MongoDB.Bson;
using MongoDB.Bson.Serialization;
using MongoDB.Bson.Serialization.Conventions;
using MongoDB.Bson.Serialization.IdGenerators;
using MongoDB.Driver;
namespace ConsoleApplication1
{
class Program