sapiens/SqlFu

Upsert sample?

Closed this issue · 3 comments

I dont know how to do an upsert nor select table where i have the following code dynamic list is a dynamic object from a linq query:

        var cnx = @"host=localhost;port=5432;database=db1;user id=postgres;   password=testing";
        var sql = new SqlFuConnection(cnx, DbEngine.PostgreSQL);
        sql.Upsert(dynamiclist);

How i can do it right?
Thank you.

I don't think Upsert works with lists

Then how i can do to work

Try it the old fashioned way, try to update rows then do inserts when the update returns 0. But I think you can't use any strongly typed helpers, dynamic is supported only for queries (mapping to).