I just started moving all my ado.net code from the asp.net pages to repo's and created dto's for each table (manually), but now I don't know what is a good efficient way to convert a sqldatareader to a list of my dto objects?
For example sake, my dto is Customer.
I am using webforms and I am NOT using an ORM. I would like to start slow and work my way up there.
You defenitly should look at Massive - this simple wrapper over ADO.NET
Usually the pattern looks something like:
Here a short example on how you can retrieve your data using a data reader:
If a table column is nullable then check
reader.IsDBNull
before retrieving the data.