-
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
ef.core 7 support #263
ef.core 7 support #263
Conversation
5835913
to
88a81a7
Compare
@@ -14,8 +14,8 @@ | |||
<projectUrl>https://github.com/linq2db/linq2db.EntityFrameworkCore</projectUrl> | |||
<license type="file">MIT-LICENSE.txt</license> | |||
<dependencies> | |||
<group targetFramework=".NETStandard2.1"> | |||
<dependency id="Microsoft.EntityFrameworkCore.Relational" version="5.0.17" /> | |||
<group targetFramework="net6.0"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
net7.0. ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -600,19 +599,19 @@ string PrepareExpressionText(Expression? expr) | |||
{ | |||
// Handling NpgSql's PostgresBinaryExpression | |||
|
|||
var left = newExpression.GetType().GetProperty("Left")?.GetValue(newExpression) as Expression; | |||
var right = newExpression.GetType().GetProperty("Right")?.GetValue(newExpression) as Expression; | |||
var left = (Expression)newExpression.GetType().GetProperty("Left")?.GetValue(newExpression)!; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exception? I don't think so.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expression
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean this code will throw exception.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
class SqlExpression: Expression {...}
@@ -278,7 +277,7 @@ static DataType DbTypeToDataType(DbType dbType) | |||
{ | |||
(T)(Attribute)new ColumnAttribute | |||
{ | |||
Name = prop.GetColumnName(storeObjectId!.Value), | |||
Name = storeObjectId != null ? prop.GetColumnName(storeObjectId.Value) : null, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
storeObjectId is not value type anymore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is, but there were assumption that GetStoreObjectIdentifier will return non-null value. I'm not sure it is always true, so I've replaced code a bit to treat it as nullable value to avoid NRE
Fix #262
master
branch updated to ef.core 7 (was v5). v5 moved to separate branchPomelo.EntityFrameworkCore.MySql
doesn't have v7 support yet Upgrade to EF Core 7.0.0 PomeloFoundation/Pomelo.EntityFrameworkCore.MySql#1717Code based on v6 version, so there is more changes than expected due to fact that master had v5