henkmollema / Dommel

CRUD operations with Dapper made simple.
MIT License
634 stars 100 forks source link

Allow inserts/updates of properties without a public setter #199

Closed henkmollema closed 4 years ago

henkmollema commented 4 years ago

This behavior changed in 367ac90a to skip readonly properties in insert/update queries. However this imposes issues with POCO's containing properties with private setters which represent columns in the database and are updated via methods. Given this it seems reasonable to support these cases and do not allow for readonly properties which have no associated database column, methods should be used in that case. Added some test coverage for these cases.

Fixes #194

codecov-io commented 4 years ago

Codecov Report

Merging #199 into master will decrease coverage by 0.05%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #199      +/-   ##
==========================================
- Coverage   83.13%   83.07%   -0.06%     
==========================================
  Files          32       32              
  Lines        1156     1152       -4     
  Branches      139      135       -4     
==========================================
- Hits          961      957       -4     
  Misses        161      161              
  Partials       34       34              
Impacted Files Coverage Δ
src/Dommel/DefaultPropertyResolver.cs 95.45% <100.00%> (+0.21%) :arrow_up:
src/Dommel/Insert.cs 100.00% <100.00%> (ø)
src/Dommel/Update.cs 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update e292785...700e987. Read the comment docs.