WCF Data Services 5.0 and EF 4.3 code first

Source: Internet
Author: User

WCF Data Services 5.0 was released in April 9 and supports odata V3 protocol. Earlier versions of WCF data services were released with. Net FX 4.0. This time, the installation package is provided separately for download. This version has several good features. For details, seeArticleBytes.

The new feature is mainly used to support enhancements in Open Data Protocol (odata) Version 3. The following are some interesting features:

    • Vocabulary (vocabularies)-annotation, which mainly provides richer descriptions for data published using odata (for example, type verification/range/display related metadata );
    • Action providers: a method for injecting behavior by describing URIs in data. Users can send requests to these URIs to initiate some operations. This feature also works in Entity Framework;
    • 16 new spatial primitives (spatial primitives)-it allows the client to perform operations on geospatial data in filtering, projection, and sorting clauses;
    • Odatalib now supports serialization and deserialization of all odata loads;
    • Edmlib -- Build the Service's EDM for odata serialization/deserialization, including supporting annotation;
    • Supports any/all queries (join is not supported currently ).

EF 4.3 supports code first very well. For how to combine code first with WCF data service in EF 4.3, refer to http://msdn.microsoft.com/zh-cn/library/hh527719. This articleCodeAfter a simple correction, you can run it.

Namespace customerdataservices
{
Public class customerdataservice: dataservice <customerordercontext>
{
Public static void initializeservice (dataserviceconfiguration config)
{
Config. setentitysetaccessrule ("*", entitysetrights. allread );
Config. setentitysetaccessrule ("customers", entitysetrights. allread | entitysetrights. writemerge );
// Config. setentitysetaccessrule ("edmmetadatas", entitysetrights. None );
Config. useverboseerrors = true;
Config. dataservicebehavior. maxprotocolversion = dataserviceprotocolversion. V3;
}
}
}

Entity Framework 2010 and WCF Data Service 4.0 in Visual Studio 4.0

WCF Data Services Action provider for Entity Framework

Related Article

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.