I’m using FluentNHibernate but NHibernate XML will do.
Say I have this model
public User
{
public User()
{
ProfilePicture = new Picture();
}
public Guid Id { get; private set; }
public Picture ProfilePicture { get; set; }
}
public Picture
{
int width;
int height;
}
How do I tell NHibernate how to store and retrive the ProfilePicture?
I know in Fluent its like
Map(x => x.ProfilePicture);
but that doesnt work.
If User and ProfilePicture come from two different tables then you should use References:
If you need to specify the column name it’s (e.g.)
There are several other examples for different use cases in the documentation.
If ProfilePicture is stored in the User table then you would map it as a Component: