LINQ support in Enterprise Library Data Access Application Block

孤人 提交于 2019-12-24 03:10:13

问题


Is LINQ support available in the Data Access Application Block.


回答1:


I guess the answer is outdated, 5.0 version has support for linq. The following scenarios are supported:

  • Using a DataReader to retrieve multiple rows of data
  • Using a DataSet to retrieve multiple rows of data
  • Executing a command and retrieving the output parameters
  • Executing a command and retrieving a single-value item
  • Performing multiple operations within a transaction
  • Updating a database with data contained in a DataSet object
  • Retrieving XML data from a SQL Server database
  • Querying the data returned using client-side techniques such as LINQ
  • Performing asynchronous data access with a callback handler or Lambda expression

Look here: http://msdn.microsoft.com/en-us/library/ff664416%28v=pandp.50%29.aspx




回答2:


It doesn't include a LINQ provider, if that's what you're asking.

Suggest looking at the list of Key Scenarios that are expedited by using the block:

  • Using a DbDataReader to Retrieve Multiple Rows. This scenario illustrates how you can use the ExecuteReader method to retrieve multiple rows of data from a database for display in tabulated form—without explicitly caching the data, using a DataSet object to manipulate it, or passing it to other components within your application. In other words, it illustrates how to display the results as quickly as possible.
  • Using a DataSet to Retrieve Multiple Rows. This scenario illustrates how you can use the ExecuteDataSet method to pass data between the components and the tiers of a multi-tier application. The data consists of one or more data tables and, optionally, the relationships that link the tables together.
  • Executing a Command and Accessing Output Parameters. This scenario illustrates how you can use the ExecuteNonQuery method to retrieve a single row that contains multiple column values.
  • Executing a Command and Accessing a Single-Item Result. This scenario illustrates how you can use the ExecuteScalar method to perform a single-item lookup.
  • Performing Multiple Updates Within a Transaction. This scenario illustrates how you can use the ExecuteNonQuery method from within a transaction to perform multiple operations against a database, where it is essential that either all operations succeed or none succeed.
  • Using a DataSet to Update a Database. This scenario illustrates how, after changing a DataSet object, you can use the UpdateDataSet method to update the database and make your changes permanent.
  • Retrieving Multiple Rows As XML. This scenario illustrates how you can use the ExecuteXmlReader method to retrieve data from a SQL Server and have that data returned in XML format.


来源:https://stackoverflow.com/questions/2370206/linq-support-in-enterprise-library-data-access-application-block

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!