Service Generation Outcome
This article is relevant to entity models that utilize the deprecated Visual Studio integration of Telerik Data Access. The current documentation of the Data Access framework is available here.
The WCF RIA Wizard allows you to generate WCF RIA Services based on Telerik Data Access. This topic discusses the changes that the wizard will make to your project.
References
The wizard adds a reference to the Telerik.OpenAccess.RIA.Extensions.dll assembly.
Generated Files
The wizard generates a new domain service class.
To see the OpenAccessDomainService.generated.vb file in VB projects, use the Show All Files command from the Solution Explorer toolbar.
The OpenAccessDomainService.generated.cs file should have the following characteristics:
-
The DomainService class should derive from the OpenAccessDomainService<T> class which is an abstract base class in the Telerik.OpenAccess.Ria.Extensions.dll assembly.
[EnableClientAccess()] public partial class DomainService : OpenAccessDomainService<EntitiesModel> { public DomainService() : base() { } }
<EnableClientAccess()> _ Partial Public Class DomainService Inherits OpenAccessDomainService(Of EntitiesModel) End Class
The generic base class is bound to the OpenAccessContext class (e.g. EntitiesModel).
- The DomainService class is marked with the EnableClientAccessAttribute attribute to indicate that it is visible to the client tier.
-
Query methods named GetEntity (e.g. GetCustomers). This methods return every item without any filtering or sorting.
public IQueryable<Customer> GetCustomers() { return this.DataContext.Customers; }
Public Function GetCustomers() As IQueryable(Of Customer) Return Me.DataContext.Customers End Function
-
Methods InsertEntity, DeleteEntity, UpdateEntity are generated, respectively for inserting, deleting and updating entities. For example:
public void DeleteCustomers(Customer customer) { // This is a callback method. The actual Delete is performed internally. } public void UpdateCustomers(Customer customer) { // This is a callback method. The actual Update is performed internally. } public void InsertCustomers(Customer customer) { // This is a callback method. The actual Insert is performed internally. }
Public Sub DeleteCustomers(ByVal _customer As Customer) 'This is a callback method. The actual Delete is performed internally. End Sub Public Sub UpdateCustomers(ByVal _customer As Customer) 'This is a callback method. The actual Update is performed internally. End Sub Public Sub InsertCustomers(ByVal _customer As Customer) 'This is a callback method. The actual Insert is performed internally. End Sub
Next Steps
To learn how to integrate Telerik Data Access with WCF RIA and Silverlight, check out the Silverlight and WCF RIA quickstart section.