📒
OpenRiaServices
  • Start
  • Prerequisites for Open Ria Services
    • Walkthrough: Installing and Configuring SQL Server 2008 R2 Express with Advanced Services
    • Walkthrough: Installing the AdventureWorks OLTP and LT sample databases
  • Creating Open Ria Services Solutions
    • Walkthrough: Taking a Tour of Open Ria Services
    • Walkthrough: Creating a Open Ria Services Solution
    • Walkthrough: Creating a Open Ria Service with the Code First Approach
    • Walkthrough: Using the Silverlight Business Application Template
    • Walkthrough: Creating a Open Ria Services Class Library
    • Walkthrough: Localizing a Business Application
    • How to: Create a Domain Service that uses POCO-defined Entities
    • How to: Add or Remove a Open Ria Services Link
    • Using the Domain Service Wizard
  • Building Secure Applications with Open Ria Services
  • Deploying and Localizing a Open Ria Services Solutions
    • Troubleshooting the Deployment of a Open Ria Services Solution
    • Troubleshooting the Deployment of a Open Ria Services Solution
    • Walkthrough: Localizing a Business Application
  • Middle Tier
    • Domain Services
      • Walkthrough: Adding Query Methods
      • How to: Add Business Logic to the Domain Service
      • How to: Create a Domain Service that uses POCO-defined Entities
      • How to: Use HTTPS with a Domain Service
    • Data
      • Compositional Hierarchies
      • Presentation Models
      • Inheritance in Data Models
      • Complex Types
      • Shared Entities
      • Walkthrough: Sharing Entities between Multiple Domain Services
      • How to: Add Metadata Classes
      • How to: Validate Data
      • Managing Data Concurrency
    • Shared Code
      • How to: Share Code through Source Files
      • Walkthrough: Creating a Open Ria Services Class Library
  • Silverlight Clients
    • Client Code Generation
    • DomainContext and Operations
    • DomainDataSource
    • Error Handling on the Client
    • Customizing Generated Code
      • How to: Add Computed Properties on the Client
  • Accessing non-Silverlight Clients
    • ASP.NET Clients
    • Walkthrough: Using the Domain Service in ASP.NET Applications
  • Authentication, Roles, and Profiles
    • How to: Enable Authentication in Open Ria Services
    • How to: Enable Roles in Open Ria Services
    • How to: Enable Profiles in Open Ria Services
    • How to: Create a Custom Authorization Attribute
    • Walkthrough: Using Authentication Service with Silverlight Business Application
    • Walkthrough: Using Authentication Service with Silverlight Navigation Application
  • End-to-EndScenarios
    • Walkthrough: Retrieving and Displaying Data From a Domain Service
    • Walkthrough: Editing Data From a Domain Service
    • Walkthrough: Displaying Data in a Silverlight Business Application
    • Walkthrough: Displaying Related Data in a Silverlight Business Application
Powered by GitBook
On this page
  • Using DomainContext
  • Presenting and Modifying Data
  • Customizing Generated Code
  • See Also
  • Concepts

Was this helpful?

Silverlight Clients

PreviousHow to: Share Code through Source FilesNextClient Code Generation

Last updated 4 years ago

Was this helpful?

[ This document was written for WCF Services Version 1 Service Pack 2 and might not be up to date Please see or for a list of changes since WCF RIA Services ]

Using Open Ria Services, you can create a Silverlight client that is aware of the application logic on the middle tier when interacting with data. You can provide a user interface for viewing and editing data that applies validation rules before submitting the data modifications. Your Silverlight controls will utilize classes that are automatically generated from code in the middle tier. This topic introduces how Silverlight clients use domain context, work with data, and customize generated code.

Using DomainContext

A class is generated for each domain service in the middle-tier project that exposes an entity object. The domain context class contains query and modification methods that communicate with the corresponding domain operation on the domain service. When you call a query method on a domain context class in your Silverlight application, the query method calls the corresponding method on the domain service that returns the requested data. The methods on the domain context are executed asynchronously so the user interface is not blocked while loading data.

For more information, see .

Presenting and Modifying Data

You use Silverlight controls, such as the DataGrid control, to present the data retrieved through the domain context. You bind the control to the results of the query. For more information, see

You can update, insert, and delete data through Silverlight controls when those operations are exposed on the domain service. When you call data modification operations on a domain service, the data from the Silverlight client is processed by middle-tier logic to ensure the business rules are applied to the modification. For more information, see .

You can also use the control to interact with the data from a domain service. The enables you to use declarative syntax to specify paging, sorting, grouping, and filtering of the data. For more information, see .

Customizing Generated Code

To customize the generated code, you should not modify the files in the Generated_Code folder because these files will be overwritten when the client project is rebuilt. Instead, Open Ria Services enables you to customize the code that is generated for the client project by providing partial methods on the domain context and entity proxy classes. You implement these partial methods to add computed properties on the client project or to add customized logic that is executed when particular actions are performed. The generated partial methods are invoked at run time only if you have implemented the partial method.

  • For more information, see and .

See Also

Concepts

Release Notes
Changelog
DomainContext
DomainContext and Operations
Walkthrough: Retrieving and Displaying Data From a Domain Service
Walkthrough: Editing Data From a Domain Service
DomainDataSource
DomainDataSource
DomainDataSource
Client Code Generation
Customizing Generated Code
Building Secure Applications with Open Ria Services