On many WPF or WinForms applications, when it comes to display data into a table, we are using DataTable class. Recently, I worked on a ASP.NET MVC Backend, where my source was a DataTable and I had to return an IEnumerable
<T> to be consumed by a mobile app using Swagger and NSwag Studio. I wanted something simple and efficient to convert my table into an IEnumerable, I had that line of code in mind: myTable[“Users”].ToEnumerable
And here is my custom implementation, let’s start with how to use it:
The implementation of this class is available on my GitHub.
Entrepreneur and Enthusiastic Developer.