LoadWith makes queries for each entity
See original GitHub issueclass Directory
{
public long Id { get; set;}
public string Path { get; set;}
public IEnumerable<File> Files { get; set;}
}
class File
{
public long Id { get; set;}
public long DirectoryId { get; set; }
public string Name { get; set; }
public Directory Directory { get; set; }
}
db.Directory.LoadWith(d => d.files)
Fails with exception “Multiple queries are not allowed. Set the ‘LinqToDB.Common.Configuration.Linq.AllowMultipleQuery’ flag to ‘true’ to allow multiple queries.”
If set AllowMultipleQuery to true, it generates query for each directory entry,
May be it could be done with one query?
Issue Analytics
- State:
- Created 8 years ago
- Comments:24 (17 by maintainers)
Top Results From Across the Web
Linq2SQl eager load with multiple DataLoadOptions
Be careful, DataLoadOptions creates some very inefficient queries. – Chad Moran. Mar 13, 2009 at 21:01. Thanks, ...
Read more >Loading Related Entities - EF6
For example, the queries below will load blogs and all the posts related to ... Entity namespace so make sure you are using...
Read more >LINQ to SQL Tricks: Building Efficient Queries that Include ...
Using the LoadWith() data option we can hint LINQ to SQL that every time entity X is being requested its child entity Y...
Read more >Constraints With LoadWith when Loading multiple 1:n ...
Looking at the query sent to the database, you can confirm that there was not ... Example below shows separate database calls made...
Read more >LINQ to SQL Gotcha #1: Unexpected LoadWith Behaviour
When you want to eager load an entity's associated data you need to set ... this will still generate one query with JOIN...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
PLease open new issue with query and model