Here are a couple of options:
- Look at using another context to implement your MaterializationRepositories and have it backed by an in memory database such as Effort, if that's still working nowadays.
- Re-implement the 'Include' functionality yourself on the Materialization. The Expression can be broken down to find the type of the navigation property. Using naming conventions you can work out what foreign key property you need to interrogate to get the correct identifier. To find the target repository you could use reflection over the Materialization looking for the public property of type IEnumerable of the type of the navigation property. As long as you knew the name of the primary key of the target entity (by convention, say) you could then use the foreign key value to find it.
If you have a small number of entity types you'd probably be better off having some kind of switch statement and do some of it manually rather than via reflection.
Apologies that this isn't a fully worked through implementation, but I hope it leads in the right direction.
- LINQ Source Code Available
- .NET 4 Code Contracts: "requires unproven: source != null"
- How do I mimic the functionality of IQueryable<T>.Include(Expression<Func<T,TProperty>> path) in my custom collection?
- creating Linq to sqlite dbml from DbLinq source code
- is it possible to mimic the functionality of ms-access with c#?
- source code for LINQ 101 samples
- List or Array of String Contain specific word in Html Source Code
- c# Linq or code to extract groups from a single list of source data
- Convert string to int in one line of code using LINQ
- Code equivalent to the 'let' keyword in chained LINQ extension method calls
- Value cannot be null. Parameter name: source
- Linq code to select one item
- C# - code to order by a property using the property name as a string
- How do I find the text within a div in the source of a web page using C#
- Roslyn failed to compile code
- Entity-framework code is slow when using Include() many times
- The data source does not support server-side data paging
- How are people unit testing code that uses Linq to SQL
- Entity Framework, Code First and Full Text Search
- What does this C# code with an "arrow" mean and how is it called?
- How to resolve Value cannot be null. Parameter name: source in linq?
- The source contains no DataRows
- Could not find an implementation of the query pattern for source type 'System.Data.Entity.DbSet'
- How to count the number of code lines in a C# solution, without comments and empty lines, and other redundant stuff, etc?
- Is there an IEnumerable implementation that only iterates over it's source (e.g. LINQ) once?
- Entity Framework 6 Code First Custom Functions
- LINQ query to perform a projection, skipping or wrapping exceptions where source throws on IEnumerable.GetNext()
- Is it possible to express this code in LINQ?
- I am wondering about the state of connection and impact on code performance by 'yield' while iterating over data reader object
- This code returns distinct values. However, what I want is to return a strongly typed collection as opposed to an anonymous type
- Problems understanding LINQ syntax. returned error
- LINQ to SQL filter by List<int>
- C# Linq search inside object linked property
- Select each int in array
- IQueryable Confusion
- Converting SQL to LINQ: Rolling Average
- Join two lists of different length
- Linq Groupby multiple columns with the same name (An anonymous type cannot have multiple properties with the same name)
- How to parametrize a query in Entity Framework?
- 3 Table LINQ query with a where clause
- IQueryable<T>.Contains Expression Tree with Expression parameter
- How to check if a string is doesn't equal all of these?
- Linq complex queries C#
- Mongodb C# query nested document
- LINQ Lambda Summing NULL
- Linq to SQL: Partial matching strings using contains on an array of strings
- Correct Linq conversion from C# to Vb.net
- Join + IEqualityComparer<T> and HashCode
- How to append more rows to a Linq list after the condition is met
- Filter xml using xpath and linq (price with decimal separator and thousands separator spanish) VB. NET