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
I'm kind of a Postgresql newbie here. Not sure if this is a bug or not.
Scenario:
table Author {ID, AuthorName, BirthYear}
table Books {ID, AuthorID, BookName, PublishYear}
in EF Models
there would be a "public virtual Author Author {get;set;}" statement.
in the past when I use EF for MSSQL
I would do
_book.Author=_author;
db.Authors.Add(_author);
db.Books.Add(_book);
then _book.AuthorID would be automatically filled with ID value of newly added _author record
yet in Postgresql
I find that the same behavior would cause two _author record inserted to the table, with different ID value.
I'm not sure whether there's any way to fix it?
The text was updated successfully, but these errors were encountered:
I'm kind of a Postgresql newbie here. Not sure if this is a bug or not.
Scenario:
table Author {ID, AuthorName, BirthYear}
table Books {ID, AuthorID, BookName, PublishYear}
in EF Models
there would be a "public virtual Author Author {get;set;}" statement.
in the past when I use EF for MSSQL
I would do
_book.Author=_author;
db.Authors.Add(_author);
db.Books.Add(_book);
then _book.AuthorID would be automatically filled with ID value of newly added _author record
yet in Postgresql
I find that the same behavior would cause two _author record inserted to the table, with different ID value.
I'm not sure whether there's any way to fix it?
The text was updated successfully, but these errors were encountered: