Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

28 lines (25 sloc) 0.923 kb
using FluentNHibernate.Conventions;
using FluentNHibernate.Conventions.Instances;
namespace Examples.FirstAutomappedProject
{
/// <summary>
/// This is a convention that will be applied to all entities in your application. What this particular
/// convention does is to specify that many-to-one, one-to-many, and many-to-many relationships will all
/// have their Cascade option set to All.
/// </summary>
class CascadeConvention : IReferenceConvention, IHasManyConvention, IHasManyToManyConvention
{
public void Apply(IManyToOneInstance instance)
{
instance.Cascade.All();
}
public void Apply(IOneToManyCollectionInstance instance)
{
instance.Cascade.All();
}
public void Apply(IManyToManyCollectionInstance instance)
{
instance.Cascade.All();
}
}
}
Jump to Line
Something went wrong with that request. Please try again.