Skip to content

Instantly share code, notes, and snippets.

@amarwadi
Created January 27, 2018 18:55
Show Gist options
  • Save amarwadi/e13d6c6e9034df814a0ab04624c47bd0 to your computer and use it in GitHub Desktop.
Save amarwadi/e13d6c6e9034df814a0ab04624c47bd0 to your computer and use it in GitHub Desktop.
Installment Class Mappings using Bson Mappers
public class InstallmentMap
{
public void Map()
{
BsonClassMap.RegisterClassMap<Installment>(map =>
{
map.AutoMap();
map.SetIgnoreExtraElements(true);
map.MapIdMember(x => x.Id);
map.MapMember(x => x.Title).SetIsRequired(true);
map.MapMember(x => x.InstallmentFrequencyInDays).SetIsRequired(true);
map.MapMember(x => x.DownPayment).SetIsRequired(true);
map.MapMember(x => x.TotalInstallments).SetIsRequired(true);
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment