Adding the Domain Service Class

To make the data model consumable from clients, you need to implement your business logic. In WCF RIA Services-based applications, this is accomplished by implementing a Domain Service Class. Such kinds of classes inherit from LinqToEntitiesDomainService(Of T) and expose queries and methods for performing CRUD (Create/Read/Update/Delete) operations and can contain other custom logic. To add one, right-click the Services folder and select Add New Item. In the Add New Item dialog, select the Domain Service Class template and name it OrdersDomainService.vb. The goal is to provide logic for accessing the Orders entity set (see Figure 39.11).

Figure 39.11 The item template for adding a domain service class.

At this ...

Get Visual Basic® 2010 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.