mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-25 19:17:13 +08:00
16
src/Orchard/Data/Conventions/LazyLoadConvention.cs
Normal file
16
src/Orchard/Data/Conventions/LazyLoadConvention.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using FluentNHibernate.Conventions;
|
||||
using FluentNHibernate.Conventions.Instances;
|
||||
|
||||
namespace Orchard.Data.Conventions
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Property)]
|
||||
public class LazyLoadAttribute : Attribute {
|
||||
}
|
||||
|
||||
public class LazyLoadConvention : AttributePropertyConvention<LazyLoadAttribute> {
|
||||
protected override void Apply(LazyLoadAttribute attribute, IPropertyInstance instance) {
|
||||
instance.LazyLoad();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -147,6 +147,7 @@
|
||||
<ItemGroup>
|
||||
<Compile Include="ContentManagement\Extensions\DriverResultExtensions.cs" />
|
||||
<Compile Include="ContentManagement\Handlers\CloneContentContext.cs" />
|
||||
<Compile Include="Data\Conventions\LazyLoadConvention.cs" />
|
||||
<Compile Include="Data\MapAsRecordAttribute.cs" />
|
||||
<Compile Include="Data\Migration\Interpreters\PostgreSqlCommandInterpreter.cs" />
|
||||
<Compile Include="DisplayManagement\Descriptors\ShapePlacementStrategy\DefaultPlacementParseMatchProviders.cs" />
|
||||
|
||||
Reference in New Issue
Block a user