🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

CoreData.LazyLoadGenerator

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

CoreData.LazyLoadGenerator

Source generator to generate EF lazy load ctor

2.2.2
NuGet
Version published
Maintainers
1
Created
Source

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; }
    }
}

Keywords

FAQs

Package last updated on 09 Apr 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts