Open
Description
It would be really helpful for composite keys when key properties are also exposed in Entity for convenience. Something like:
public class CompositeId
{
public int Key1 {get;set;}
public int Key2 {get;set;}
}
public class Entity
{
public virtual CompositeId Id { get; set; } = new CompositeId();
// This property doesn't require entity initialization.
// But there is no way to tell NHibernate that
public virtual int Key1
{
get => Id.Key1;
set => Id.Key1 = value;
}
public virtual int Key2
{
get => Id.Key2;
set => Id.Key2 = value;
}
}
Or when Id
property is accessed via interface with different name (see #2184)