Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: ce841dadbb
Fetching contributors…

Cannot retrieve contributors at this time

47 lines (39 sloc) 1.139 kb
using System;
using MongoDB.Configuration;
using NUnit.Framework;
namespace MongoDB.UnitTests.Configuration
{
[TestFixture]
public class MongoConfigurationBuilderTests
{
private class Person
{
public Guid Id { get; set; }
public int Age { get; set; }
public string Name { get; set; }
}
[Test]
public void Test()
{
var configure = new MongoConfigurationBuilder();
configure.ConnectionString(cs =>
{
cs.Pooled = true;
});
configure.Mapping(mapping =>
{
mapping.DefaultProfile(p =>
{
p.AliasesAreCamelCased();
p.CollectionNamesAreCamelCasedAndPlural();
});
mapping.Map<Person>(m =>
{
m.CollectionName("people");
m.Member(x => x.Age).Alias("age");
m.Member(x => x.Name).Alias("name").DefaultValue("something").Ignore();
});
});
}
}
}
Jump to Line
Something went wrong with that request. Please try again.