I have a pgsql view which returns list of records. One field of record is represented as json and deserialised to property List<ClassA> ClassAItems
. However ClassAItems
has also List<ClassB> ClassBItems
and deserialisation doesnt not work at this level.
How to use Autquery or OrmLite is such case to process the query response so the items from ClassAItems will contain properly deserialised ClassBItems.
[Alias("vw_someview_with_json_field")]
public class ViewItem
{
public Id {get;set;} // it is properly deserialised
public List<ClassA> ClassAItems {get;set;} // hierarchical json data
}
public class ClassA {
public int Id {get;set;} // it is deserialised correctly
public List<ClassB> ClassBItems {get;set;} // <--- here is the issue, it is not deserialised
}