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

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -

java - JavaFX 2 slider labelFormatter not being used -