Building a RESTful WCF service in this way is quite easy and you don’t need rely on any item templates. Just start with a blank asp.net web application project in Visual Studio. The web.config file is virtually empty:
1: < configuration >
2: < system.web >
3: < compilation debug ="true" targetFramework ="4.0" />
4: </ system.web >
5: </ configuration >
Next just add a regular C# class - for this example, I call mine PersonService and it will have basic CRUD operations. Typically we create interfaces in WCF to define our ServiceContract and operations like this:
1:
[ServiceContract]
2: interface IPersonService
3:
{
4:
[OperationContract]
5: Person GetPerson(string id);
6:
7:
[OperationContract]
8:
Person InsertPerson(Person person);
9:
10:
[OperationContract]
11: Person UpdatePerson(string id, Person person);
12:
13:
[OperationContract]
14: void DeletePerson(string id);