diff --git a/src/Orchard/Data/Conventions/AggregateAttribute.cs b/src/Orchard/Data/Conventions/AggregateAttribute.cs index 723ede2d4..d183a38c5 100644 --- a/src/Orchard/Data/Conventions/AggregateAttribute.cs +++ b/src/Orchard/Data/Conventions/AggregateAttribute.cs @@ -4,37 +4,30 @@ using FluentNHibernate.Conventions.AcceptanceCriteria; using FluentNHibernate.Conventions.Inspections; using FluentNHibernate.Conventions.Instances; -namespace Orchard.Data.Conventions -{ +namespace Orchard.Data.Conventions { /// /// 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 /// - public class AggregateAttribute : Attribute - { + public class AggregateAttribute : Attribute { } - public class ReferenceConvention : IReferenceConvention, IReferenceConventionAcceptance, IHasManyConvention, IHasManyConventionAcceptance - { - public void Apply(IManyToOneInstance instance) - { + public class ReferenceConvention : IReferenceConvention, IReferenceConventionAcceptance, IHasManyConvention, IHasManyConventionAcceptance { + public void Apply(IManyToOneInstance instance) { instance.Fetch.Join(); } - public void Accept(IAcceptanceCriteria criteria) - { + public void Accept(IAcceptanceCriteria criteria) { // todo // 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.Cache.NonStrictReadWrite(); } - public void Accept(IAcceptanceCriteria criteria) - { + public void Accept(IAcceptanceCriteria criteria) { criteria.Expect(x => x.Member != null && x.Member.IsDefined(typeof(AggregateAttribute), false)); } }