mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Formatiing class
--HG-- branch : NH3
This commit is contained in:
@@ -4,37 +4,30 @@ using FluentNHibernate.Conventions.AcceptanceCriteria;
|
|||||||
using FluentNHibernate.Conventions.Inspections;
|
using FluentNHibernate.Conventions.Inspections;
|
||||||
using FluentNHibernate.Conventions.Instances;
|
using FluentNHibernate.Conventions.Instances;
|
||||||
|
|
||||||
namespace Orchard.Data.Conventions
|
namespace Orchard.Data.Conventions {
|
||||||
{
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This attribute is used to mark relationships which need to be eagerly fetched with the parent object,
|
/// This attribute is used to mark relationships which need to be eagerly fetched with the parent object,
|
||||||
/// thus defining an aggregate in terms of DDD
|
/// thus defining an aggregate in terms of DDD
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class AggregateAttribute : Attribute
|
public class AggregateAttribute : Attribute {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class ReferenceConvention : IReferenceConvention, IReferenceConventionAcceptance, IHasManyConvention, IHasManyConventionAcceptance
|
public class ReferenceConvention : IReferenceConvention, IReferenceConventionAcceptance, IHasManyConvention, IHasManyConventionAcceptance {
|
||||||
{
|
public void Apply(IManyToOneInstance instance) {
|
||||||
public void Apply(IManyToOneInstance instance)
|
|
||||||
{
|
|
||||||
instance.Fetch.Join();
|
instance.Fetch.Join();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Accept(IAcceptanceCriteria<IManyToOneInspector> criteria)
|
public void Accept(IAcceptanceCriteria<IManyToOneInspector> criteria) {
|
||||||
{
|
|
||||||
// todo
|
// todo
|
||||||
// criteria.Expect(x => x.Property != null && x.Property.IsDefined(typeof(AggregateAttribute), false));
|
// criteria.Expect(x => x.Property != null && x.Property.IsDefined(typeof(AggregateAttribute), false));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Apply(IOneToManyCollectionInstance instance)
|
public void Apply(IOneToManyCollectionInstance instance) {
|
||||||
{
|
|
||||||
instance.Fetch.Select();
|
instance.Fetch.Select();
|
||||||
instance.Cache.NonStrictReadWrite();
|
instance.Cache.NonStrictReadWrite();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Accept(IAcceptanceCriteria<IOneToManyCollectionInspector> criteria)
|
public void Accept(IAcceptanceCriteria<IOneToManyCollectionInspector> criteria) {
|
||||||
{
|
|
||||||
criteria.Expect(x => x.Member != null && x.Member.IsDefined(typeof(AggregateAttribute), false));
|
criteria.Expect(x => x.Member != null && x.Member.IsDefined(typeof(AggregateAttribute), false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user