CoreData.LazyLoadGenerator 2.2.2

dotnet add package CoreData.LazyLoadGenerator --version 2.2.2
NuGet\Install-Package CoreData.LazyLoadGenerator -Version 2.2.2
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="CoreData.LazyLoadGenerator" Version="2.2.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add CoreData.LazyLoadGenerator --version 2.2.2
#r "nuget: CoreData.LazyLoadGenerator, 2.2.2"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install CoreData.LazyLoadGenerator as a Cake Addin
#addin nuget:?package=CoreData.LazyLoadGenerator&version=2.2.2

// Install CoreData.LazyLoadGenerator as a Cake Tool
#tool nuget:?package=CoreData.LazyLoadGenerator&version=2.2.2

CoreData.LazyLoadGenerator

Source generator to generate EF lazy load ctor for lazy loading of navigation properties.

Usage

Add [GenerateLazyLoad] attribute to your partial class.

namespace Sample;

[GenerateLazyLoad]
public partial class Person
{
    public string Name { get; set; } = null!;
}

to generate

#nullable enable

namespace Sample
{
    partial class Person
    {
        public Person()
        {
        }

        private Person(Action<object, string> lazyLoader) : this()
        {
            LazyLoader = lazyLoader;
        }

        protected Action<object, string>? LazyLoader { get; set; }
    }
}

Add [GenerateLazyLoadWithoutDefaultCtor] attribute to your partial class.

namespace Sample;

[GenerateLazyLoadWithoutDefaultCtor]
public partial class Person
{
    public string Name { get; set; } = null!;
}

to generate

#nullable enable

namespace Sample
{
    partial class Person
    {
        private Person(Action<object, string> lazyLoader) : this()
        {
            LazyLoader = lazyLoader;
        }

        protected Action<object, string>? LazyLoader { get; set; }
    }
}
There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.2.2 121 4/9/2024
2.2.1 200 9/15/2023
2.2.0 179 9/15/2023
1.1.0 153 7/29/2023