I have the class filter.cs with this attributes:
public virtual int Id { get; set; }
public virtual Attribute Attribute { get; set; }
public virtual Int16 Type { get; set; }
public virtual string FilterValue { get; set; }
public virtual ReportConfiguration ReportConfiguration { get; set; }
Attribute and ReportConfiguration are a Foreign Key.
I made this mapping:
Id(a => a.Id).UnsavedValue(0).GeneratedBy.Identity();
Map(a => a.Type);
Map(a => a.FilterValue);
References(x => x.ReportConfiguration).Column("IdReportConfiguration").Not.LazyLoad();
References(x => x.Attribute).Column("IdAttribute").Not.LazyLoad();
In addition, I have a Repository class for example with the method:
public int Create(Filter F)
{
int FilterId = 0;
Transactional(session =>
{
FilterId = (int)session.Save(F);
});
return FilterId;
}
And when I did the Unit Test of Create(Filter F)
it produced an exception:
No persister for: ....Filter.cs
I think the mapping is not correct.
Any idea?
Thanks and best regards.