In my MVVM program I have a Model class (say MyModel) from which I have an instance of reading from the database (using Entity Framework). When retrieving the o
I use postgres database:
CREATE TABLE public."Table" (
"Id" integer NOT NULL DEFAULT nextval('"Table_Id_seq"'::regclass),
...
No one of mentioned methods do not work in my case. I use secondly:
Table table = _context.Table.AsNoTracking().Select(s => new Table {
// some properties, exept id
}).FirstOrDefault();
_context.Table.Add(table);
await _context.SaveChangesAsync();