Industry and other data-centric applications can be created in Silverlight, but processing data in Silverlight is not an easy task, since Silverlight includes many tools for processing data and supporting Web services and XML. However, these tools represent only the most basic part of data access across firewalls.
Common data access policies are implemented using Web service and client LINQ, and if you are modifying existing Web service endpoints to harden your Silverlight applications, then I recommend that you use this approach. But if you are using Silverlight to create a new Web Service, there is no need to do so.
For a typical Web service layer, you implement a traditional data access policy (Custom business object, LINQ to SQL, Entity Framework, nhibernate, etc.) on the server to expose data objects through Web service, web Service is just the gateway under the data Access policy.
But to turn on full data connectivity, you have to map four data operations (create, read, update, delete) to the Web service method, and here is a simple service contract that supports the product class, and note that I use C # in this article.
Example 1 service Contract for Product Web service
[ServiceContract]
public interface ICustomerService
{
[OperationContract]
List GetAllProducts();
[OperationContract]
Product GetProduct(int productID);
[OperationContract]
List GetAllProductsWithCategories();
[OperationContract]
Product SaveProduct(Product productToSave);
[OperationContract]
void DeleteProduct(Product productToDelete);
}
Creating a set of services to handle an application's complete data model can be quite time-consuming, as shown in this example, the operation of special features can lead to a very bloated web service, in other words, the Web service will have new requirements and operations to increase, even including operations that are not part of the core business domain.
In Example 1 you see that the getallproductswithcategories operation is used by default to retrieve the product and the taxonomy. Even if you add a sort, filtering and paging mechanism to this simple example you should not be surprised if there is a simple way to support data operations (such as queries, sorting, filtering, etc.) without having to manually build these mechanisms every time it will be very appealing, ado.net Data service is born for this.