I am learning about the POCOs and while I like a lot of the concepts, I think I am not quite getting it.
I have a problem like the following:
I have one sproc which returns multiple columns and values against these columns which dynamically build inside the sproc based on certain conditions.
e.g based on the input, one of the below result should return,
1)
Id -- Name -- Age
1 Peter 25
2 Janit 53
2)
Id -- Provider Name -- Provider Type
5 C. A hospital
I cant create class for these dynamic columns, therefore I fetch records using dynamic object and POCO DB.
List<dynamic> list = db.fetch<dynamic>(sql);
Problem occurs when somebody else call the function with different parameter then result keeps the column information for first call of POCO and result for desire one.
Id -- Name -- Age
5 C. A hospital
this discrepancy causing runtime error.
Can you please help me to resolve this issue? or how can I define class for this kind of scenario?
Hope I explained my problem in detail manner.