Skip to content

Instantly share code, notes, and snippets.

@schotime
Created June 13, 2013 01:04
Show Gist options
  • Save schotime/5770461 to your computer and use it in GitHub Desktop.
Save schotime/5770461 to your computer and use it in GitHub Desktop.
My Postgresql conventions
var conventions = FluentMappingConfiguration.Scan(scanner =>
{
scanner.Assembly(typeof(User).Assembly);
scanner.IncludeTypes(x=>x.Namespace.StartsWith(typeof(User).Namespace));
scanner.TablesNamed(x => Inflector.MakePlural(x.Name).BreakUpCamelCaseUsing("_").ToLower());
scanner.Columns.Named(x => x.Name.BreakUpCamelCaseUsing("_").ToLower());
scanner.PrimaryKeysNamed(x => x.Name.BreakUpCamelCaseUsing("_").ToLower() + "_id");
scanner.OverrideMappingsWith(new OverrideMappings());
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment