I am new to fluent NHibernate. Now I face one problem with mapping composite keys. Can anyone point out the URL or sample please?
if this is your first class
public class EntityMap : ClassMap
{
public EntityMap()
{
UseCompositeId()
.WithKeyProperty(x => x.Something)
.WithReferenceProperty(x => x.SomethingElse);
}
}
here is the second with a reference on Entity
public class SecondEntityMap : ClassMap
{
public SecondEntityMap()
{
Id(x => x.Id);
....
References(x => x.EntityProperty)
.WithColumns("Something", "SomethingElse")
.LazyLoad()
.Cascade.None()
.NotFound.Ignore()
.FetchType.Join();
}
}