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.
<PackageVersion Include="CoreData.LazyLoadGenerator" Version="2.2.2" />
                    
Directory.Packages.props
<PackageReference Include="CoreData.LazyLoadGenerator" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version 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.
#:package CoreData.LazyLoadGenerator@2.2.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=CoreData.LazyLoadGenerator&version=2.2.2
                    
Install as a Cake Addin
#tool nuget:?package=CoreData.LazyLoadGenerator&version=2.2.2
                    
Install as a Cake Tool

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 206 4/9/2024
2.2.1 265 9/15/2023
2.2.0 241 9/15/2023
1.1.0 214 7/29/2023