How to generate datatable from generic list (C#)
I wanted to add an extension method to a generic list to convert it into a datatable in order to be used as input param in a Stored Procedure
You can use a custom attribute for conversion, let’s say that for example you want to convert a bool into an int
Test it..
I also wrote this simple method that can be useful in case you want to convert a datarow (returned by a SP) into a specific object..