Search code examples
c#nhibernate

using fluent nhibernate, is there anyway to have a private property mapped


i have a field that i want to map as it links to a column in the database but i don't want any external class to access this field directly from my code (its only used in private calculations).

is this possible to have a field that i can map but it private using fluent nhibernate??


Solution

  • Yes it is possible. You can use the Reveal.Member static methods to map a private or hidden property

    Map(Reveal.Member<string>("privateProperty"))