Questions tagged [ef-core-8.0]
Use this tag for version specific questions about the 8.0 version of Entity Framework for .NET Core (including release candidates). When using this tag, please also include the more generic [entity-framework-core] tag. Also, please note that other minor versions than "0" may be more applicable.
ef-core-8.0
104
questions
1
vote
1
answer
27
views
Could not load file or assembly Microsoft.Data.SqlClient, Version=5.0.0.0 using winforms application
I am getting the following error for release whereas it does work locally.
I'm developing a Winforms application on .NET 8.0, using the Microsoft.EntityFrameworkCore.SqlServer 8.0.6 Nuget package.
The ...
0
votes
1
answer
46
views
In Entity Framework how should I limit string length to no greater than 12000 characters
I tried the obvious...
[StringLength(12000)]
public string Instructions { get; set; }
...(also tried MaxLength) but when I run add-migration I get empty Up() and Down() methods. The only impact of ...
1
vote
0
answers
47
views
EF Core is generating a GUID - even though it's marked as DatabaseGenerated
Using Oracle database-first and Oracle.EntityFrameworkCore provider 8.23. The column in question is the table's primary key with DEFAULT SYS_GUID() and type varchar(32).
The property in C# is defined ...
0
votes
1
answer
48
views
EF Core 8 code-first : join entity with custom differentiation property
Using EF Core 8, code-first, I have two entities, Student and Guardian. What I want is to have an simple way to differentiate between custodial and non-custodial relationships.
This is my Student ...
-1
votes
0
answers
74
views
Join in-memory list and DB table in .net 8
I have a code that is working in .Net 3.1 and we have upgraded to .Net 8 and as part of that I have converted Nuget package Microsoft.EntityFramework.MemoryJoin to 0.8.0 and I observed the in-memory ...
0
votes
0
answers
39
views
Creating separate table for each child entity in EF Core
I've recently stumbled into an issue in EF Core when I needed the parent entities to reference the child entities in one to many relationship. Since all parents are using the same child class and the ...
0
votes
1
answer
61
views
EF Core 8: migrations adds AlterColumn to every column, for subsequent migrations
I have an old application in .NET Core 3.1 and EF Core 3.1. I have successfully migrated to .NET 8 and EF Core 8. The migrations folder was HUGE, so I reset the migrations, deleting all records in the ...
1
vote
2
answers
77
views
Blazor two-way binding with readonly data types
I am trying to take advantage of Entity Framework Core 8's new complex properties feature for my webapp. I've made my Address model, which used to be a full entity with its own table, into a readonly ...
2
votes
1
answer
127
views
EF Core 8: execute a query and map it to a non-entity
It seems like EF Core 8 is supposed to allow raw SQL queries for unmapped types, but I'm not sure on how to use it with complex types.
For instance, suppose you have the following:
public class A
{
...
2
votes
2
answers
80
views
How can I reuse the logic in a .Include.Where() call while working with Entity Framework Core in .NET?
I am writing a database query using LINQ in .NET and I want to be able to not duplicate the code I put in my Where method calls.
I want to return Blogs that have fresh Comments, and want to filter ...
0
votes
1
answer
55
views
How to select distinct items from table by a variable and then join another table in LINQ
I have a query where I need to select distinct order numbers from a table of orders. An order number can correspond to multiple entries in the table of orders but I only want distinct orders. I.E. I ...
0
votes
2
answers
52
views
Navigation Properties with Many-to-Many Relations
With a one-to-many relation, I can use navigation properties when creating a new entity.
public class Team
{
[Key]
public Guid Guid { get; set; }
public List<Player>? Players { get; ...
1
vote
1
answer
80
views
EF Core not including schema when generating DROP INDEX command in migration
I am using Entity Framework Core with Oracle and configuring the default schema in my context using HasDefaultSchema with the schema PRODUCTMAX. Index creation works correctly, but when I try to drop ...
0
votes
0
answers
34
views
Entity Framework Core not recognising mapped user-defined function
I'm using Entity Framework Core with .NET 8 and trying to call a user-defined function from C# code.
I'm following the instructions here but have a slightly different use case. Rather than having the ...
0
votes
1
answer
41
views
EF Core, one to many relationship, one table referencing multiple tables
In attempt to reduce the number of tables in a database, I'd like to use a single table to store the same type of data for multiple reference tables: a one to many relationship several times over with ...