Formatiing class

--HG--
branch : NH3
This commit is contained in:
Sebastien Ros
2012-07-13 10:45:30 -07:00
parent a2d45df199
commit 5ed0af8243
@@ -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));
} }
} }