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