You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you have a VO using HasConversion like below, you need to do expressions in EF like x => x.Email == "thing" instead of x => x.Email.Value == "thing" vs using OwnsOne where you would always use the full path.
builder.Property(x =>x.Email).HasConversion(x =>x.Value, x =>newEmailAddress(x)).HasColumnName("email").IsRequired(false);builder.OwnsOne(x =>x.Email, opts =>{opts.Property(x =>x.Value).HasColumnName("email");}).Navigation(x =>x.Email).IsRequired();
so ideally, the parser defaults to using the whole path, but if you pass a config object, the parser respects the path you give, so this:
i started looking at this and found i can tack something like this into LeftExprParser , but then the type isn't recognized in CreateRightExpr when it calls TypeConversionFunctions, but you do need to know the type to do it right (e.g. if it's a guid or whatever)
// Check if the nested property has a child propertyif(nestedPropertyExpressionisMemberExpressionmemberExpression&&memberExpression.ExpressionisMemberExpressionparentExpression){returnparentExpression;}
I think to make this work, i need to add a HasConversion() extension myself that essentially mimics the EF core method?
The text was updated successfully, but these errors were encountered:
Problem
When you have a VO using HasConversion like below, you need to do expressions in EF like
x => x.Email == "thing"
instead ofx => x.Email.Value == "thing"
vs usingOwnsOne
where you would always use the full path.so ideally, the parser defaults to using the whole path, but if you pass a config object, the parser respects the path you give, so this:
would really resolve to
x => x.Email == "thing"
i started looking at this and found i can tack something like this into
LeftExprParser
, but then the type isn't recognized inCreateRightExpr
when it callsTypeConversionFunctions
, but you do need to know the type to do it right (e.g. if it's a guid or whatever)I think to make this work, i need to add a
HasConversion()
extension myself that essentially mimics the EF core method?The text was updated successfully, but these errors were encountered: