Examples of WCF Data service

Source: Internet
Author: User
Tags config

In order to get through the data platform of client, network and mobile phone, we studied the rest interface architecture for eight days.

The first is WCF rest, which understands rest and WCF rest. Detailed theoretical knowledge WCF REST----Theory preparation work

followed by practical applications, using WCF Data Service, detailed theoretical knowledge WCF data Service----theory preparation

There are many examples of creating WCF Data service online including MSDN.

The first step is to build a Web application

The second step is to add a ado.net Entity Data model, as shown in the following figure:

Then establish the entity model data, connect the corresponding database, the following figure:

More Wonderful content: http://www.bianceng.cnhttp://www.bianceng.cn/Programming/net/

Generated by Wizard.

The third step is to add the WCF Data Service, as shown in the following figure:

Add the appropriate code at the prompt location as follows:

TODO: Set rules to indicate which entity sets and service operations are visible, updatable, and so on.
//Example:
//CONFIG. Setentitysetaccessrule ("Myentityset", entitysetrights.allread);
Config. Setserviceoperationaccessrule ("Myserviceoperation", Serviceoperationrights.all);
     
Config. Setentitysetaccessrule ("*", entitysetrights.allread);
Config. Setserviceoperationaccessrule ("*", serviceoperationrights.all);
Config. Dataservicebehavior.maxprotocolversion = Dataserviceprotocolversion.v2;

Then right-click in the browser to see the style information in the atompub format.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.