RadControls version
|
2013.3.1015.40 |
.NET version |
4.0 |
Visual Studio version |
|
programming language |
C# |
browser support |
all browsers supported by RadControls
|
PROJECT DESCRIPTION
This code library shows how you can create Wcf service to expose an existing data base data or custom class data. Let me give you the basic steps for implementing both scenarios:
Using entity model of an existing data base:
- Create a ADO.NET Entity model and select the data base file and the tables you want to map
- Create a WCF data service. Please use the [JSONPSupportBehavior] attribute when the requests need to be cross domain.
- Please use the NorthWind entities as shown:
- In the InitializeService method please set which entity set to expose. In this case this the Employees:
2. Using custom class data is pretty similar:
- Create a class that represents your custom data in this case – Continent class
- Create a ContinentContext class to return IQueryable<Continent>
- In the InitializeService method please set which entity set to expose. In this case this the Continents:
The following resouorces might be helpful: