I have an entity Person:
public class Person
{
public virtual int Id {get; set; }
public virtual string FirstName { get; set; }
public virtual string MiddleName { get; set; }
public virtual string LastName { get; set; }
}
with the mappings:
public class PersonMap
{
public PersonMap()
{
Table(TABLE_NAME);
Id( x => x.Id);
Map(x => x.FirstName).Not.Nullable();
Map(x => x.LastName).Not.Nullable();
Map(x => x.MiddleName).Not.Nullable();
}
}
There are some stuations where I would like Nhibernate to return a dictionary instead of the entity:
IDictionary<string,string> person = session.Get(id);//????
string firstName = person["FirstName"];
Is this possible to without adding a different mapping?