Dynamic resultset with dapper on 3.5

c#-3.0 dapper micro-orm

Question

I've got a store procedure call returning a recordset whith field unknown in advance. For some interop reason I need to make it working on 3.5, so I don't have any dynamic support. Is there some built-in solution in dapper? I did not find any by myself. If there is no such a solution, does it make sense ( and does it work ) to create on the fly a type exposing the property I would fetch ? EDIT I managed to add a completely external solution ( without tweaking the original codebase ) by creating a dynamic object in c# 3.0. Here is the extension dapper code and here the factory for the dynamic object.

Accepted Answer

Well, actually the dynamic support in dapper is implemented via ExpandoObject, which is basically just a dictionary. It would be pretty simple to tweak the existing code to return IDictionary<string,object> instead of dynamic in the case of 3.5




Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why