-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[bug]Issue with linq2db in dotnet 7 ef core model with nullable fields #340
Comments
If you add |
ok, i removed it from projection but its the same |
public new bool? IsActive { get; set; } = true; How it is mapped to database? |
using fluent api of ef core 7.0.10
the thing is its working ok if i remove ToLinqToDB. |
found it, in some place it was overriden by .IsRequired() it worked for ef core but gave error in linqtodb conversion, looks like linq2db is more strict. |
Post your model classes. Base class and this one with |
Hi, sorry for late reply have been stuck in this project upgrade so hardly getting any time, the problem still persists as i have explained above, here is the model classes:
my code is divide in many different modules, so there is a lot of abstract classes. Anyways the issue is due to nullable type handling that much i can tell. |
Please add BaseEntity |
base entity is same as the above base entity just without nulls and extra cluttering
|
hi, were you able to find any solution to this issue? i am mostly stuck with union queries that were working previously like this one error it works individually but when I union it with some other table I get this error Sequence 'value(LinqToDB.EntityFrameworkCore.LinqToDBForEFToolsDataConnection).GetTable().TagQuery("query called for Images") Note: Using AsSplitQuery made it work, i didnt had to do that before as i am simply copying old code from dotnet 5 to 7. |
Why are you redefining those properties, and why are they virtual in the first place? Do you realize what |
i am using these base classes in other places too, where i have to override these properties (old database structure is not same for all tables some are using int some guid some long, it a pain but it is what it is). |
hi i think this is a possible bug, can you check this query:
but if i add :
i am getting following error:
Expression 'x.IsActive' is not a Field.
its defined in model as
public new bool? IsActive { get; set; } = true;
full stacktrace:
please check linq2db.efcore version 7.5.0
The text was updated successfully, but these errors were encountered: