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
public enum MyEnum
{
X = 0,
Y = 1,
}
public class MyGroup
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.None)]
public long MyId;
public MyEnum en;
}
MyGroup is marked as having an int conversion in model builder launch context:
The following upsert command yields the following SQL: INSERT INTO "my_table" AS "T" () VALUES () ON CONFLICT ("my_id") DO UPDATE SET "en" = $1
Columns and values are left empty, which I believe is a bug.
var myGroup = new MyGroup
{
MyId = 1,
en = MyEnum.X,
};
_dbContext.MyGroups.Upsert(myGroup).WhenMatched(group =>
new MyGroup
{
en = myGroup.en,
}).Run();
If I try using the 2 parameter WhenMatched method, I get a different error:
_dbContext.MyGroups.Upsert(myGroup).WhenMatched((dbGroup, insGroup) =>
new MyGroup
{
en = insGroup.en,
}).Run();
I get the error This type of expression is not currently supported: insGroup. Simplify the expression, or try a different one .See https://go.flexlabs.org/upsert.expressions for more details
The text was updated successfully, but these errors were encountered:
With definition of
MyGroup
is marked as having anint
conversion in model builder launch context:The following upsert command yields the following SQL:
INSERT INTO "my_table" AS "T" () VALUES () ON CONFLICT ("my_id") DO UPDATE SET "en" = $1
Columns and values are left empty, which I believe is a bug.
If I try using the 2 parameter
WhenMatched
method, I get a different error:I get the error
This type of expression is not currently supported: insGroup. Simplify the expression, or try a different one .See https://go.flexlabs.org/upsert.expressions for more details
The text was updated successfully, but these errors were encountered: