Hi, I have this scenario:
public class Survey : EntityBase
{
public virtual string Name { get; set; }
}
public class Response : EntityBase
{
public virtual string Name { get; set; }
public virtual Survey Survey { get; set; }
}
public class SurveyMap : ClassMap<Survey>
{
public SurveyMap()
{
this.Id(e => e.Id);
this.Map(e => e.Name);
}
}
public class ResponseMap : ClassMap<Response>
{
public ResponseMap()
{
this.Id(e => e.Id);
this.Map(e => e.Name);
this.References(e => e.Survey);
}
}
I want responses to be deleted automatically when I delete surveys, how to I configure this using Fluent NHibernate.
Thanks!