c# - PetaPoco/NPoco - calculated properties in poco -


i using petapoco/npoco in project. database schema working not thought our , therefore can't directly bind poco wpf mvvm view (which used able when creating database schema). considering 2 possible solutions problem:

  1. add unmapped properties poco
  2. create wrapper pocos reference poco

does proven pattern exist problem?

you can manipulate petapoco maps wish using explicitcolumns map different named column. can use resultcolumn properties wish grab db not update/insert. finally, can use unmapped properties work not related db.

namespace site.models {     [tablename("hotel")]     [primarykey("hotelid")]     [explicitcolumns]     public class hotel {         [petapoco.column("hotelid")]         public int hotelid { get; set; }          [petapoco.column("hotelclaseid")]         public int? hotelclaseid { get; set; }          [resultcolumn]         public string hotelclase { get; set; }          [required]         [petapoco.column("nombre")]                     public string nombre { get; set; }          .... 

Comments

Popular posts from this blog

java - How to Configure JAXRS and Spring With Annotations -

visual studio - TFS will not accept changes I've made to a Java project -

php - Create image in codeigniter on the fly -