Get metadata Schema Name return null value from dbcontext with UseInMemoryDatabase.
See original GitHub issueI need to get some metadata from my entities and columns like MaxLenght, DefaultValue, Keys, isView, IsNull, etc.
Include your code
var options = new DbContextOptionsBuilder().UseInMemoryDatabase(Guid.NewGuid().ToString()).Options;
var context = new Adventureworks2019fullContext(options);
var entity = context.Model.FindEntityType("Person");
var schema = entity.GetSchema();
schema always return null
Include provider and version information
EF Core version: 6 Database provider: (e.g. Microsoft.EntityFrameworkCore.SqlServer) Target framework: (e.g. .NET 6.0) Operating system: IDE: (e.g. Visual Studio 2022 Preview 2.1)
Issue Analytics
- State:
- Created 2 years ago
- Comments:15 (7 by maintainers)
Top Results From Across the Web
C# dbcontext keeps returning null although data is ...
When I hit the endpoint using a get request with the appropriate language argument e.g. nl , I keep on getting null on...
Read more >Breaking changes in EF Core 6.0
Complete list of breaking changes introduced in Entity Framework Core 6.0.
Read more >Entity Framework Core 2 for the Enterprise
var entity = new Product(); // ID property has null value instead of 0. Now lets create a new Product in database:.
Read more >Using OData with ASP.NET Core Web API
In this article, we will learn how to implement support for the OData standard in our ASP.NET Core Web API services.
Read more >Untitled
Ef core dbcontext get table name WebA DbContext instance represents a session with the ... Get metadata Schema Name return null value from...
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 Free
Top 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
The concept of a schema has no meaning in InMemory database - it’s a relational concept; this is why the attribute isn’t even processed by EF Core when using InMemory.
ok, thank you very much for your support.
Best Regards.