Closed jasonlaw closed 1 year ago
I don't think that is supported, upsert operation (update/insert). Why don't you just before SaveChanges, run the check, if record exists - schedule update; if not - then insert
May I know how to perform the insert without the select from? It looks like the script generated always expect a "select from", eg, insert into ... select from ..., while what I need is insert into .... values ....
Btw, is there a way to schedule a non query (native sql) command ?
Insert without Select - don't quite understand. You either make NewEntity or create InsertFromSelect using Linq. Schedule native query - I do not think it's possible. But look at App events related to session, you might hook to some event around SaveChanges and code native Sql manually
I end up with NewEntity solution. Thanks!
Hi @rivantsov ,
May I know how to perform if exist then update, else insert with session schedule insert update?
Thanks.