The below code shows how to expose a RESTful service
[ServiceContract] interface IStock { [OperationContract] [WebGet] int GetStock(string StockId); }
By adding the WebGetAttribute, we can define a service as REST based service that can be accessible using HTTP GET operation.