#8832: Add LazyLoadConvention (#8833)
Some checks failed
Compile / Compile .NET solution (push) Has been cancelled
Compile / Compile Client-side Assets (push) Has been cancelled

This commit is contained in:
Marek Dzikiewicz
2025-04-17 13:03:42 -04:00
committed by GitHub
parent 4c463287ca
commit d310fb56e1
2 changed files with 17 additions and 0 deletions

View 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();
}
}
}

View File

@@ -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" />