In my previous article, I explained:
In this article, I want go into depth about Odata regarding CRUD operation, Custom entity etc.Before going into depth, it would be better to explain about REST service.Representational state transfer (REST) is a style of software architecture for World Wide Web. The cool thing about REST is that it is not tied to any particular technology or platform. The term is often used in a looser sense to describe any simple interface which transmits domain-specific data over HTTP without an additional messaging layer such as SOAP or session tracking via HTTP cookies. A RESTFul web service is a simple web service implemented using HTTP and the principles of REST. Such a web service can be thought of as a collection of resources.The MIME type of the data is supported by the web service. This is often JSON, XML but can be anything. The set of operations are supported by the web service using HTTP methods (e.g. POST, GET, PUT or DELETE).WCF Rest ServicesWCF Rest Services are normal WCF Services that have added functionality so that they can be consumed in a RESTful manner.HTTP Verbs supported by WCF Data services are:
Let me to start with OData crud operations.I have created one OdataDemo Silverlight application. So, I am going to start with Create/Add new resource to the entity and DB.There are two ways to do CRUD operations:
Just like given below:DataServiceContext context = new DataServiceContext(new Uri("http://localhost:60259/ODataDemoService.svc/")); ODataDemoEntities ObjEntity = new ODataDemoEntities(new Uri("http://localhost:60259/ODataDemoService.svc/"));I have written code for both using an entity as well as a datacontext object.
In this way we can CRUD operations in WCF Data Service and Silverlight Client.
You need to be a premium member to use this feature. To access it, you'll have to upgrade your membership.
Become a sharper developer and jumpstart your career.
$0
$
. 00
monthly
For Basic members:
$20
For Premium members:
$45
For Elite members: