zzz projects Entity Framework Core EF Core
Home Articles Knowledge Base Online Examples
  • Home
  • Articles
  • Knowledge Base
  • Online Examples

Entity Framework Core - Knowledge Base (KB)

20 results in tag: lazy-loading

In Entity Framework, why isn't lazy loading working for a one-to-zero-or-one navigation property?

Consider ...Person... and ...Address... classes defined as...class Person { public int PersonId { get; set; } public virtual Address Address { get; set; } } class Address { public int PersonId { get; set; } public virtual Person Person { get; set...
ef-code-first entity-framework entity-framework-5 entity-framework-6 lazy-loading
asked by Mike

EF 6 Lazy Loading Disabled but Child Record Loads Anyway

I'm using EF6 code first. There are two tables, ...Lesson... and ...LessonSections.... The ...LessonSections... table has a foreign key to ...Lesson.Id...Here is the ...Lesson... class with none important fields removed:...public partial class Lesson { ...
c# entity-framework entity-framework-6 lazy-loading
asked by StillLearnin

Eager , Lazy and explicit loading in EF6

I have read this ...tutorial... and this ...article... but I don't understand exactly the use of each loading type....I Explain...I have this POCO :...public partial class dpc_gestion { public dpc_gestion() { this.ass_reunion_participant =...
c# entity-framework entity-framework-6 lazy-loading orm
asked by Lamloumi Afif

Entity framework Eager and Lazy load

Trying to figure out the difference between Lazy and Eager loading in entity frameowrk. Say I have the following models:...public interface IBaseEntityObject { public int Id {get; set;} } public abstract class BaseEntityObject : IBaseEntityObject {...
c# eager-loading entity-framework entity-framework-6 lazy-loading
asked by user5326354

Entity Framework Core 1.0.0 Disable Eager/Lazy Loading

Can't seem to find any mention of this for EF Core. I've found examples to disable lazy loading in prior EF versions. I have an asp.net core, MVC6, Web Api, and AngularJS site I'm working on. ...In the app, I have a table Members and a table MemberStateAc...
asp.net-core asp.net-web-api2 entity-framework-core json lazy-loading
asked by T. Lee

Entity framework 6 Lazy loading with db initiation

I am working with EF 6 and Lazy loading. ...class MainPrograme { static void Main(string[] args) { ProgramContext _dbContext = new ProgramContext(); _dbContext.Programs.Add(new Program { SecondProgram = new Sec...
.net c# entity-framework entity-framework-6 lazy-loading
asked by Thilo

EF Core Include() in Many to Many relation

The relation between ...Product... and ...Customer... is of type many-to-many (from a design point a view)....Using EF Core, we split this relation in two one-to-many relations with a third entity: ...ProductCustomer...public partial class ProductCustome...
c# ef-code-first entity-framework entity-framework-core lazy-loading
asked by alessalessio

Entity Framework is not loading the reference and collection properties lazily

I have Backpack and Book entities. Book references Backpack (one to many). I am creating an instance of Backpack and bunch of Books. So in this case backpack has bunch of books. I am saving those entities to the db. I am verifying that those got saved t...
c# entity-framework entity-framework-6 lazy-loading
asked by Dilshod

Entity Framework - restoring navigation property after detaching entities

My Entity Framework model (using EF 6.1 with ObjectContext), has lazy loading turned on, with various navigation properties....For example:...// Orders is a navigation property (collection), which, when first iterated, // loads the collection of Order ent...
.net entity-framework entity-framework-6 lazy-loading objectcontext
asked by Ross

Entity Framework 6: Disable Lazy Loading and specifically load included tables

Our current system is using Lazyloading by default (it is something I am going to be disabling but it can't be done right now)...For this basic query I want to return two tables, CustomerNote and Note....This is my query... using (var newContex...
entity-framework entity-framework-6 lazy-loading
asked by Gavin Mannion

EF Core enable Lazy Loading conditionally

I am looking for a possible way to enable Lazy Loading in my ...DbContext... but not all the time, only in specific instances when I need it. Because of issues like the N+1 queries with large datasets and JSON serialization traversing object properties an...
asp.net-core c# entity-framework-core lazy-loading
asked by Valuator

EF Core - How enable lazy loading in Entity framework core?

I've separated the Read Context from Write Now I'm going to enable LazyLoading in ReadOnlyContext by default. I also used the following method, but unfortunately it does not work....protected override void OnConfiguring(DbContextOptionsBuilder optionsBuil...
.net-core entity-framework entity-framework-core lazy-loading
asked by John

Check if lazy loading is enabled

I have the following model:...public partial class User { // other properties /// <summary> /// Gets or sets user roles /// </summary> public virtual IList<UserRole> UserRoles { get => _userRoles ?? (_userRoles = UserUserR...
c# entity-framework-core entity-framework-core-2.1 lazy-loading
asked by Oleg Sh

Lazy load in Web API Core 2.2

I am having issues with the lazy loading. I have the following dbcontext....public virtual DbSet<AccountGroupMst> AccountGroupMst {get; set;} ...I have enabled the lazy loading....services.AddDbContext<DBContext>(x => x.UseSqlServer(Confi...
c# entity-framework-core lazy-loading
asked by Suresh Kannan

How to include only specific properties of navigation property into the query by entity framework when lazy loading disabled?

LazyLoading is disabled on my project. I want to get Product which is Id = 1 with Category navigation property of it. But I need just Id and Name properties of Category. That's why I want Category navigation property to has only these two fields.Is it pos...
entity-framework entity-framework-core lazy-loading
asked by guraym

Entity framework core lazy loading not performed when inserting new instances

I have two classes:...Campaign... which references a class customer:...public class Campaign { [Key] [Required] public int id { get; set; } public int? CustomerId { get; set; } [ForeignKey("CustomerId")] public virtual Customer cus...
.net-core c# entity-framework-core lazy-loading
asked by khalil

Update Navigation Property in Entity Framework

I am a new at depth of the Entity Framework I have just wondered why Entity Framework doesn't save changes especially the navigation property although all other properties are already updated Please I want simple explanation ...This is My Service Class ...
c# entity-framework entity-framework-6 lazy-loading
asked by Peter Tharwat

Analyzing slow lazy loading in Entity Framework 6

I have a POCO class with a lazy-loaded collection, which currently takes 10 seconds to load, with about 10.000 entries; using Entity Framework 6.3 and SQL Server 2016....I realize that loading 10.000 entries takes some time, and perhaps these times are t...
c# entity-framework entity-framework-6 lazy-loading performance
asked by HugoRune

Detect lazy-load in Entity Framework Core

Entity Framework Core 3.1.2 - I have enabled ...UseLazyLoadingProxies... on my ...DbContext... to ensure data integrity, but I want to throw an exception during development if it is used....How can I execute some code every time EF Core loads a relationsh...
entity-framework-core lazy-loading
asked by Peter Morris

How to asynchronously call a relation when lazy loading with Entity Framework 6.4?

I have a project that used Entity-Framework 6.4 to access data from the database....I have the following model...public class Product { public int Id { get; set; } public string Title { get; set; } public bool Available { get; set; } // ..
async-await c# entity-framework entity-framework-6 lazy-loading
asked by user13200557

Page 1 of 1
  • 1

Prime Library

Performance

  • Entity Framework Extensions
  • Entity Framework Classic
  • Bulk Operations
  • Dapper Plus

Expression Evaluator

  • C# Eval Expression
  • SQL Eval Function
More Projects...

Related

  • EF Extensions Online Benchmark
  • WIN an EF Extensions license
  • EF6 BatchSaveChanges for only $79
Get monthly updates by subscribing to our newsletter!
SUBSCRIBE!