How do I return an IEnumerable<> using ADO.NET?

Viewed 6410

I've been using Dapper and with my current project I'm going to have to use ADO.NET. My question is how do I return an IEnumerable using ADO.NET? Here is what I have using Dapper. Can someone help me with converting this to do the same but with ADO?

public IEnumerable<Favorites> GetFavorites()
{
    using (SqlConnection sqlConnection = new SqlConnection(connString))
    {
        sqlConnection.Open();
        var work = sqlConnection.Query<Favorites>("Select * from favorites");
        return work;
    }
}
2 Answers
Related