Search code examples
nhibernatefluent-nhibernatenhibernate-configuration

How to set default access to field.camelcase-underscore using Fluent NHibernate?


would like to set this convention up globally if possible.


Solution

  • You need a convention, of which there are some shortcuts for the common scenarios. Specifically, there's a DefaultAccess shortcut, with a CamelCaseField(prefix) method.

    .Conventions.Add(
      DefaultAccess.CamelCaseField(CamelCasePrefix.Underscore)
    );