score:1
Accepted answer
dataloadoptions dlo = new dataloadoptions();
dlo.loadwith<sniffresult>(sr => sr.address);
dlo.loadwith<sniffresult>(sr => sr.usedproxy);
dlo.loadwith<sniffresult>(sr => sr.scan);
db.loadoptions = dlo; //db is the datacontext
score:2
sniffdao dao = new sniffdao();
var test = dao.sniffresults.include(x=>x.address).where(sr.fk_scan == 3);
foreach (var one in test)
{
console.writeline(one.pk_sniffresult);
console.writeline(one.address);
}
Source: stackoverflow.com
Related Query
- LINQ query does not return child fields
- Why does not null in LINQ query still return null records?
- AsQueryable() does not return needed type in custom LINQ query using Lightswitch
- Query does not return child collections
- LINQ query does not return any results when using with where condition
- Linq query does not return data
- Dude, where's my object? or, Why does Linq not return my object?
- C# 6 null conditional operator does not work for LINQ query
- why is this linq query return a boolean and not the first result of the select?
- Why does a GC after a LINQ query free the WhereListIterator but not the Func representing the condition?
- Linq query to return a flatened list of parent child
- LINQ query for finding one item in list AND verifying list does not contain another item
- LINQ query to include fields from one row of a child table
- If a linq query returns empty does it return null?
- LINQ query Where ID does not exist as a property in a list of objects
- LINQ query does not compile when using double, float, or decimal instead of int
- Does Entity Framework query the database multiple times if I use different fields of the same Linq query at different times?
- Getting Error "Delegate 'System.Func<EntityType,int,bool> does not take 1 arguments" from Entity Framework LINQ query
- Simple LINQ select (using Entity Framework) does not return values
- Working LINQ query does not work in unit test
- Does LINQ Enumerable query return copy or reference?
- Why does my SQL query != "Some Value" not return any rows where NULL?
- Why does this LinQ query not like chars?
- Why does this Linq query return 0 for Count()?
- CosmosDb LINQ query 'any' does not work but 'count() > 0' does?
- One to Many LINQ query - Assembly does not have definition for SELECT
- LINQ to Entities does not recognize ToString using query syntax
- what does a linq query return when no results are found
- Linq query does not work when compiled
- Linq query with MongoDB works does not work as Func
More Query from same tag
- How to select a query with multiple columns and put it into variables using Entity Framework and ASP.NET?
- adding where clauses to linq query
- How to combine same result into one row after inner join in LINQ
- How do you use Models in a master page with ASP.NET MVC?
- iterating with Linq
- Linq to select objects from two lists based on content
- How to handle generic status?
- Speeding up a linq query with 40,000 rows
- Filter WhereSelectEnumerableIterator of Generic List using Linq
- Entity Framework Linq, Left Join and group with SUM and Count
- null in Linq query
- LINQ query to update property of a list
- Test Null after FirstOrDefault
- Convert IEnumerable<byte[]> to byte[]
- LINQ to Entities does not recognize the method 'Int32 Parse(System.String)' method,
- EF core 2.0 reverse engineer my model now can't query DbSets
- How can I use LINQ to find the Intersect between two properties of the same collection?
- Text File Parsing Error
- Learning LINQ: QuickSort
- Reduce Verbosity of (my) Linq List Sorting
- How to convert this TSQL into Linq Method approach
- datatable.AsEnumerable doesn't work (basic example)
- LINQ Zip all elements
- How to merge if row in table exists
- C# algorithm refactor splitting an array into 3 parts?
- C# - LINQ - Using column data in the WHERE clause of another LINQ query
- Linq extension method, how to find child in collection recursive
- How to Get XML Node from XDocument
- Find multiple index in array
- Finding duplicate records with LINQ with matching on multiple columns?