-
Notifications
You must be signed in to change notification settings - Fork 229
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
Error: Postgresexception 428C9 cannot insert a non default value into column id #3422
Comments
Hi, However, I keep getting error 428C9. |
@FatmaSedaOZYURT can you please submit a minimal, runnable code sample that shows the problem? |
Hi @roji,
|
@FatmaSedaOZYURT that's not a minimal, runnable code sample - it's a fragment that's missing important information such as your model configuration. Please try to put together a minimal console program that triggers the error, and post that here. |
Hi, thank you for your interest @roji . I wonder when the locked context will be opened. 👀 |
Hi,
I develope my project on VisualStudio with c# and postgresql by using EF codefirst.
When data is created on table, sometimes I got this error: Postgresexception 428C9 cannot insert a non default value into column id.
My class is :
public class MyClass { public long Id; public string Name { get; set; } public string LastName { get; set; } }
And my builder is :
model.Entity<MyClass>().Property(b => b.Id).UseIdentityAlwaysColumn();
And later I done migration section. My table is created.
Without seting an Id, that is, with the default value, I filled other values.
Like this:
{ "Name" : "test", "LastName" : "test1" }
But I have 428C9 error.
What can I do this problem?
The text was updated successfully, but these errors were encountered: