Breaking Changes. Upgrade Script in Sql directory. Deployed
This commit is contained in:
1 parent
d4cfa92848
commit
9ed5843dbd
86 files changed
+2616
-2358
No files matched your search
@@ -6,6 +6,9 @@ using FluentNHibernate.Conventions;
|
||||
using FluentNHibernate.Conventions.Instances;
|
||||
using Tanshu.Accounts.Contracts;
|
||||
using System.Reflection;
|
||||
using System.Diagnostics;
|
||||
using FluentNHibernate.Conventions.AcceptanceCriteria;
|
||||
using FluentNHibernate.Conventions.Inspections;
|
||||
|
||||
namespace Tanshu.Accounts.SqlDAO
|
||||
{
|
||||
@@ -14,29 +17,18 @@ namespace Tanshu.Accounts.SqlDAO
|
||||
public void Apply(IManyToOneInstance instance)
|
||||
{
|
||||
var property = instance.Property;
|
||||
|
||||
if (!HasAttribute(property.MemberInfo)) return;
|
||||
|
||||
Console.WriteLine("CascadeAll on {0}.{1}", property.DeclaringType.Name, property.Name);
|
||||
|
||||
if (!AttributeChecker.Cascade(property.MemberInfo)) return;
|
||||
Trace.TraceInformation("CascadeAll on {0}.{1}", property.DeclaringType.Name, property.Name);
|
||||
instance.Cascade.All();
|
||||
}
|
||||
|
||||
public void Apply(IOneToManyCollectionInstance instance)
|
||||
{
|
||||
var property = instance.Member;
|
||||
|
||||
if (!HasAttribute(property)) return;
|
||||
|
||||
Console.WriteLine("CascadeAllDeleteOrphan on {0}.{1}", property.DeclaringType.Name, property.Name);
|
||||
|
||||
if (!AttributeChecker.Cascade(property)) return;
|
||||
Trace.TraceInformation("CascadeAllDeleteOrphan on {0}.{1}", property.DeclaringType.Name, property.Name);
|
||||
instance.Cascade.AllDeleteOrphan();
|
||||
}
|
||||
|
||||
bool HasAttribute(ICustomAttributeProvider provider)
|
||||
{
|
||||
return provider.GetCustomAttributes(typeof(CascadeAttribute), false).Length == 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user