Hi,
in the following domain:
public class HasOneAttribute : Attribute
{
}
public abstract class Entity
{
public virtual int Id { get; set; }
}
public class User : Entity
{
public virtual string Name { get; set; }
[HasOne]
public virtual Membership Membership { get; set; }
}
public class Membership : Entity
{
public virtual string Description { get; set; }
public virtual User User { get; set; }
}
I would like the tables created to be something like
table User
{
Id int (PK),
Name varchar(255)
}
table Membership
{
Id int (PK),
Description varchar(255),
UserId int (FK)
}
I can do this using the class maps, but what I am really looking to do is use conventions or overrides to check for the attribute HasOneAttribute and make this a HasOne map rather than a References map.
Is there a simple way to do this?
Cheers
Anthony