C# MySqlDataReader – “one line” function to return a row as an instance of a class.

MySql in C# is rather painless using the MySQL Connector for .net, but one thing it is missing is a no-frills, no extra requirements, no pre-defined ERD return a row as an instance of a class function. Coming from a PHP background, I love the PDO function fetchObject(), it’s just right there and you get an object you can handle. I really wanted this functionality in my code to not only make it easier to read, but also make types easier to manage when returned from MySQL – why do I need to call GetString() or GetInt() when I can … Continue reading