I am using PetaPoco/NPoco in my project. The database schema I am working with was not thought our very well and therefore I can't directly bind the POCO to my wpf mvvm view (which is what I used to be able to do when I was also creating the database schema). I am considering two possible solutions to this problem:
- Add unmapped properties to the POCO
- Create a wrapper for the pocos with a reference to the poco
Does a proven pattern exist for this problem?
You can manipulate the PetaPoco maps as you wish using
ExplicitColumns
to map to a different named column. You can also useResultColumn
for properties that you wish to grab from the DB for not update/insert. Finally, you can also use unmapped properties for extra work not related to the DB.