ADO. NET data service is a new feature in. NET Framework 3.5. It is also a WCF Service. However, it is characteristic that all methods of WCF can be automatically implemented based on a model.
The following link is useful (mainly to make it more intuitive and easy to understand). If you are interested, follow the exercises.
Http://kb.cnblogs.com/page/43963? Page = 1
Let me talk about my personal summary.
1.The emergence of ADO. NET data service has its inevitability.
In. Net 3.5, Microsoft continuously launched the LINQ to SQL and ADO. NET Entity Framework, both of which are used as data models. Of course, they can be used in clients. However, in terms of architecture, it is not very suitable for direct use on the client, but should be used hierarchically.
So, if you want to layer, do you want to create a web service or a WCF Service? This is a correct idea, but the problem that comes with it is that operations on data models such as EF are strange. If each method needs to be implemented independently and then made public, it is obviously time-consuming and labor-consuming. At the same time, EF models cannot be directly accessed remotely.
So it gave birth to ADO. NET data service. That's how you understand it,It is actually a WCF Service, but it is an automatically implemented WCF Service. It is implemented based on a data model (it can be LINQ to SQL or ADO. NET Entity Framework)
2. Main Features
ADO. NET data service is an important step Microsoft has taken in terms of rest. For more information about rest, see my other blog: http://www.cnblogs.com/chenxizhang/archive/2009/04/24/1442553.html
Note that rest is a design style andNoA standard. Rest is generally based on existing popular protocols and standards such as HTTP, Uri, and XML and HTML.
Resources are specified by Uris.
- Operations on resources include obtaining, creating, modifying, and deleting resources. These operations correspond to the get, post, put, and delete methods provided by HTTP.
- You can operate resources by operating on the resource table.
The expression of resources is XML or HTML, depending on whether the reader is a machine or a person, whether it is a customer software that consumes Web Services or a Web browser. It can also be any other format.
That is to say, the way to access ADO. NET data service may be intuitive, and it can even be accessed directly according to the URL
Dataservice supports URL-Based Access
Format
Http: // [url]/[servicename]/[entityname]/[navigationoptions]? [Queryoptions]
URL: the URL of the Data Service
Servicename: name of the Data Service
Entityname: entity name or service method name
Navigationoptions: query the association settings in Entity
Queryoptions: Query options
For more information about the syntax, see the description here.
Http://kb.cnblogs.com/page/43963? Page = 5
3. host environment of ADO. NET data service
We all know that WCF requires a host environment. So ADO. NET data service can, or in what environment does the host need?
The answer is: Ado. NET data service needs to host ASP. NET applications.Program. No special configuration is required.
4. How to perform authentication for ADO. NET data service
For entity or method authorization, the followingCodeImplemented
However, such entities cannot be associated with users.
User authentication and authorization for using the service remains to be studied. Although it is a WCF Service, it is actually different from other standard services. This part is not very clear about how to do it.