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:
- add unmapped properties poco
- 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
Post a Comment