Posted with : Studying, Entity Framework, WCF

Working with WCF Data Service

This post will drive you to create WCF Data Service and how to use it in your client application. A Windows Console application will be created to comsume the service by using its proxy. For Web application, it can be called by activating URL with HTTP method.

##Creating a WCF Data Service

The WCF Data Service requires us to have a entity model, actually it is a DbContext class.

After updated, it looks like below (in my case the class is TestingModelContainer)

_config.yml

Now viewing the service on a browser it looks like this, default format applied is Atom

_config.yml

##Consuming the service using OData syntax

Suppose your database has below data and you also use FF browser

_config.yml

List all categories

_config.yml

Filtering data

This case I want to list all categories with Id > 5

_config.yml

References

Written on September 25, 2015

Tags