Hi, I've recently upgraded from 1.0RTM to 1.2 and FNH has been throwing 
"Tried to add property 'X' when already added." I've traced this down to 
overriding properties in a child class as illustrated by the following test:

public abstract class Parent
{
public virtual string Name { get; set; }
}

public class Child : Parent
{
public override string Name { get; set; }
}

[TestClass]
public class When_inheriting_from_abstract_class
{
[TestMethod]
public void it_should_allow_property_override() {
var model = AutoMap.Source(new StubTypeSource(typeof(Parent), 
typeof(Child)));

var mappings = model.BuildMappings()
.First()
.Classes.First();

Assert.AreEqual("Name", mappings.Properties.First().Name);
}
}

Is this an expected behaviour change? I've not been able to find a reference 
to this change in the release notes for 1.1 or 1.2. If it is expected is 
there a workaround to enable the old behaviour (I don't want to 
IncludeBase)?

Cheers,
Brett

-- 
You received this message because you are subscribed to the Google Groups 
"Fluent NHibernate" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/fluent-nhibernate/-/ogDosuiduA4J.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/fluent-nhibernate?hl=en.

Reply via email to