views:

526

answers:

2

Hi, I am getting exception mapping a private property.This is the situation: I have this in Entity.cs: privat int m_Inactive;

and in EntityMap.cs I have :

Map(x => Reveal.Property("m_Inactive")).ColumnName ("INACTIVE");

But I get this error: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentException: Not a member access

What could be the reason?

Thanks. Silvia

+5  A: 

If you follow the examples on the wiki you'll see that you're supposed to use Map(Reveal.Property<YourEntity>("m_Inactive")).

James Gregory
The link is outdated. The updated one is:http://wiki.fluentnhibernate.org/Fluent_mapping_private_propertiesandhttp://wiki.fluentnhibernate.org/Mapping_a_collection_that_uses_a_private_backing_field
sumek
I've recently moved servers and had forgot to re-create the url redirects. Thanks for reminding me! Both the old and the new link are working now.
James Gregory
A: 

T first I tried this way: Map(Reveal.Property("m_Inactive")) but it is not compilable and the message is "the name "Reveal" doesn't exist in the current context."

Your syntax is wrong, you need to specify the entity. See my code.
James Gregory