How can I ignore properties of a component using Fluent Nhibernate's AutoPersistenceModel?

Posted by Jason on Stack Overflow See other posts from Stack Overflow or by Jason
Published on 2010-04-20T16:07:08Z Indexed on 2010/05/07 6:48 UTC
Read the original article Hit count: 231

Filed under:

I am using Fluent NHibernate AutoMappings to map my entities, including a few component objects. One of the component objects includes a property like the following:

public string Value 
{ 
  set _value = value; 
}

This causes an NHibernate.PropertyNotFoundException: "Could not find a getter for property 'Value'..."

I want to ignore this property.

I tried creating an IAutoMappingOverride for the component class but I couldn't use AutoMapping<>.IgnoreProperty(x => x.Value) for the same reason. "The property or indexer 'MyComponent.Value' cannot be used in this context because it lacks the get accessor"

I've also looked at IComponentConvention but can't see anyway of altering the mappings with this convention.

Any help would be appreciated...

Thanks

© Stack Overflow or respective owner

Related posts about fluent-nhibernate