Nice examples of using .NET 4 dynamic keyword with Linq?

前端 未结 3 1251
青春惊慌失措
青春惊慌失措 2021-02-01 06:47

So I Just got a recommendation from Amazon for LINQ to Objects Using C# 4.0: Using and Extending LINQ to Objects and Parallel LINQ (PLINQ).

It says that the book introdu

3条回答
  •  一向
    一向 (楼主)
    2021-02-01 07:16

    What I've done that gets me the result is this, but I would think there is a better way.

     using (SqlConnection connection = new SqlConnection(this.Connection.ConnectionString))
    {
      connection.Open();
    
      SqlCommand command = new SqlCommand(query, connection);
      SqlDataReader reader = command.ExecuteReader();
    
      reader.Cast().AsQueryable().Dump();      
    }
    

提交回复
热议问题