Comments (9)
My initial thought is that there's some aspect of your entity model that isn't supported correctly by this library. There's so much possible variation in models that exist in the wild, it's hard to cover every scenario with the simple model used in our unit tests. However it's very much my intent to cover any model that EF supports. While the unit tests also don't cover loading from edmx files, there's very little code that's unique to that and to the best of my knowledge, it should be working.
Can you provide your edmx file or anything that might be unique about your model? Is this something that just started happening with newer versions?
from lazyentitygraph.
This happened as well when I tried the 1.x version a few months ago.
I can't share my edmx file, but I will make some time to see if I can reproduce the problem with a smaller edmx file that I can share.
from lazyentitygraph.
I recreated the problem with a small sample database and the default settings to generate the edmx off of the database. Everything is default.
Below is my edmx (as a txt so it would upload to github).
from lazyentitygraph.
Thanks David, yes, easy to reproduce. I haven't used edmx much, but it seems like the ClrType attribute is missing from the tool generated files, though it can be added manually to the xml and it's present in the cached edmx that the code first approach generates. I was hoping that the process of resolving a type when loading the model would add the custom attributes to the metadata, but that does not appear to be the case.
I'll have to look into some other approaches, but it doesn't looks like edmx is functional right now.
from lazyentitygraph.
@alexfoxgill do you happen to remember any details from when you built the EDMX support in LazyEntityGraph? It tests out ok with an EDMX from the code first tests, but not with one build using the Visual Studio tooling. Maybe the tooling changed, or this isn't something that's being commonly used?
from lazyentitygraph.
Here's the SO post I used to get the CLR type from an EntityType https://stackoverflow.com/questions/22999330/mapping-from-iedmentity-to-clr - looks like EF6 might have made some changes (the EDMX stuff was written against EF5), perhaps this answer might help
from lazyentitygraph.
Thanks Alex, that helps a lot.
from lazyentitygraph.
Ran into the same issue. Any plans to fix this bug?
from lazyentitygraph.
@ika-microsoft Unfortunately it's a little bigger than just a bug, it looks like there's a new metadata model in EF6 and moving to that will fix this. I believe it's similar, but less well documented, to the metadata model in EF Core, so it should be a similar implementation.
I don't personally use EDMX, so I haven't gotten around to taking a deeper look at this.
from lazyentitygraph.
Related Issues (20)
- can't add created object to DBSet HOT 2
- Add EntityFrameworkCore support HOT 3
- any way to intercept the automatic entity creation process ? HOT 1
- Navigating to property changes parent properties HOT 3
- Caching metadata per context not safe in EFCore HOT 1
- Cannot add entity back to database HOT 3
- Exception when accessing collection property if it is defined in base class HOT 5
- Need a .NET standard 2.1 port of LazyEntityGraph.EntityFramework package, please HOT 1
- [EF Core] 3.x breaking change: "Method not found: [...] IProperty.get_ClrType()" HOT 3
- Does not work with EF.Core 3. if you don't explicitly add a reference to Microsoft.EntityFrameworkCore.InMemory 3 HOT 3
- System.Reflection.TargetException: 'Non-static method requires a target.' when setting navigation property to null HOT 1
- InvalidOperationException if a context has foreign keys upon multiple columns HOT 1
- Split testing utilities
- Having a base abstract migration breaks loading metadata from code first context
- Support one sided navigation properties HOT 1
- Add support for .Net6.0 HOT 3
- Add support for .Net7.0
- Incompatible with Moq 4.18.1
- Any port to .net standard available or intended? HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lazyentitygraph.