Using the Domain Service Wizard

[ This document was written for WCF Services Version 1 Service Pack 2 and might not be up to date Please see Release Notes or Changelog for a list of changes since WCF RIA Services ]
The Add New Domain Service Class dialog box is used to add a DomainService object that is used to expose data in a server project from a Data Access Layer (DAL), such as Entity framework or LINQ to SQL.
To access the Add New Domain Service Class dialog box, right-click the server project in the Solution Explorer, select Add and New Item to bring up the Add New Item dialog box.
From the Web category of the Installed Templates pane of the dialog box, select the Domain Service Class, click Add, and the Add New Domain Service Class wizard appears.
See the Walkthrough: Creating a Open Ria Services Solution for the scenario in which this dialog box is used with the AdventureWorksLT2008 database.

UI Elements

This section contains descriptions of the elements contained in this dialog box.
  • Domain service class name Names the instance of the DomainService class. This is read-only property and the name cannot be changed here.
  • Enable client access Check this if you want to expose the DomainService to your client. This box is checked by default. Checking this box is what causes Open Ria Services to generate domain context for a domain service and entities it contains on the client.
  • Expose OData endpoint Check this if you want the services to expose an additional endpoint using the OData Protocol. This adds an OData endpoint to the \ section of the web.config file and marks the parameterless query methods you expose via OData as being the default. This exposes your domain service as an OData feed.
  • Available DataContext/Objectcontext classes Use this to select the DAL, such as Entity Framework or LINQ to SQL. The LINQ to SQL option is available only if you have the Open Ria Services Toolkit installed. You can also select the \ option if you want to customize the DAL access from your domain service class. For details on using this option with POCO-defined entities, see How to: Create a Domain Service that uses POCO-defined Entities.
  • Entities Use this check list to select the entities from the data source that the domain service will make available to the client.
  • Enable editing Check the relevant boxes to indicate which entities selected can be edited. Checking this box will generate CUD (Create, Update, and Delete) methods for the selected entities.
  • Generate associated classes for metadata Check this box if you want to generate a partial class that has all the properties of the selected model listed. The user can then apply Validation/Display attributes to these properties.