Dzoukr / Dapper.FSharp

Lightweight F# extension for StackOverflow Dapper with support for MSSQL, MySQL, PostgreSQL, and SQLite
MIT License
374 stars 35 forks source link

v3.0.0: Partial updates do not work with an anonymous record #50

Closed katatunix closed 3 years ago

katatunix commented 3 years ago

I've just updated to v3.0.0 however partial updates do not work with an anonymous record. The set statement always requires the Entity type not the anonymous record.

katatunix commented 3 years ago

No worry, I switched to use setColumn and it works. It is more type-safe :D

Dzoukr commented 3 years ago

Oh, good to hear. In case you find something missing in v3 docs, please feel free to send a PR. 🙏

JordanMarr commented 3 years ago

It looks like the update example in the docs still shows the old anonymous records update, but it should be changed to use the new style instead:


             update {
                for p in personsView do
                setColumn p.LastName "UPDATED"
                where (p.Position = 2)
            } |> crud.UpdateAsync