c# - PetaPoco Query View Always Returns NULLS -
i have below view in sql server represented using petapoco in c# application:
/// <summary> rep level keys. </summary> [tablename("vxpatreplevelkeys")] [explicitcolumns] public partial class vxpatreplevelkeys : dbo.record<vxpatreplevelkeys> { /// <summary> gets or sets replevelkey. </summary> public string replevelkey { get; set; } }
however, when attempt select view using:
var result = _database.fetch<xpat.vxpatreplevelkeys>("select * vxpatreplevelkeys").orderby(x => x.replevelkey); var asstrings = result.select(x => x.replevelkey).tolist();
i list of null values. asstrings
has 33 items in list, being null. however, when run above view myself, 33 non-null results.
i'm new petapoco (tbh, i'm not sure if petapoco related issue) , have inherited application, i'm attempting add new view appreciated.
if use [explicitcolumns]
attribute, must use [column]
attribute on each property
[column] public string replevelkey { get; set; }
Comments
Post a Comment