LinqToEntitiesDomainService(TContext) Class

WCF RIA Services

[WCF RIA Services Version 1 Service Pack 2 is compatible with either .NET framework 4 or .NET Framework 4.5, and with either Silverlight 4 or Silverlight 5.]

Provides a base class for domain services operating on LINQ to Entities data models.


Namespace:  System.ServiceModel.DomainServices.EntityFramework
Assembly:  System.ServiceModel.DomainServices.EntityFramework (in System.ServiceModel.DomainServices.EntityFramework.dll)

type LinqToEntitiesDomainService<'TContext when 'TContext : new() and ObjectContext> =  
        inherit DomainService

Type Parameters


The type of the LINQ to Entities ObjectContext.

The LinqToEntitiesDomainService(TContext) type exposes the following members.

Protected methodLinqToEntitiesDomainService(TContext)Initializes a new instance of the LinqToEntitiesDomainService(TContext) class.

Protected propertyAuthorizationContextGets or sets the optional template AuthorizationContext to use for IsAuthorized. (Inherited from DomainService.)
Protected propertyChangeSetGets the current ChangeSet. (Inherited from DomainService.)
Protected propertyObjectContextGets the ObjectContext for this LinqToEntitiesDomainService(TContext).
Protected propertyServiceContextGets the active DomainServiceContext for this DomainService. (Inherited from DomainService.)
Protected propertyServiceDescriptionGets the DomainServiceDescription for this DomainService. (Inherited from DomainService.)
Protected propertyValidationContextGets or sets the optional ValidationContext to use for all validation operations invoked by the DomainService. (Inherited from DomainService.)

Protected methodAuthorizeChangeSetReturns a value that indicates the whether the user is authorized to submit the specified ChangeSet. (Inherited from DomainService.)
Protected methodCount(T)(IQueryable(T))Returns the number of rows in the specified IQueryable object. (Overrides DomainService.Count(T)(IQueryable(T)).)
Protected methodCount(T)(IQueryable(T))Returns the number of rows in an IQueryable. (Inherited from DomainService.)
Protected methodCreateObjectContextCreates and returns the ObjectContext instance that will be used by this provider.
Public methodDispose()Releases all resources used by the current instance of the DomainService class. (Inherited from DomainService.)
Protected methodDispose(Boolean)Releases all resources used by the LinqToEntitiesDomainService(TContext). (Overrides DomainService.Dispose(Boolean).)
Public methodEquals (Inherited from Object.)
Protected methodExecuteChangeSetInvokes the DomainOperationEntry for each operation in the ChangeSet. (Inherited from DomainService.)
Protected methodFinalize (Inherited from Object.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Public methodInitializeInitializes the domain service. (Overrides DomainService.Initialize(DomainServiceContext).)
Public methodInvokeInvokes the specified operation. (Inherited from DomainService.)
Public methodIsAuthorizedRequests authorization for the specified DomainOperationEntry. (Inherited from DomainService.)
Protected methodMemberwiseClone (Inherited from Object.)
Protected methodOnErrorCalled whenever an unrecoverable error occurs during the processing of a DomainService operation. (Inherited from DomainService.)
Protected methodPersistChangeSetFinalizes changes after all the operations in the ChangeSet have been invoked. (Overrides DomainService.PersistChangeSet().)
Public methodQueryPerforms the query operation indicated by the specified QueryDescription. (Inherited from DomainService.)
Protected methodResolveConflictsResolves the conflicts when the submit fails due to optimistic concurrency conflicts.
Public methodSubmitPerforms the operations indicated by the specified ChangeSet by invoking each of the corresponding domain operations. (Inherited from DomainService.)
Public methodToString (Inherited from Object.)
Protected methodValidateChangeSetValidates the whole ChangeSet before calling ExecuteChangeSet. (Inherited from DomainService.)

You create domain service classes that derive from the LinqToEntitiesDomainService(TContext) class when you expose LINQ to Entities types. When you use the Add New Domain Service Class dialog box to create a domain service that exposes LINQ to Entities types, the dialog box automatically creates a class that derives from LinqToEntitiesDomainService(TContext). The class is created with methods that provide a starting point for implementing business logic in your application. A query method is included in the class. If you select the Enable Edit check box, insert, update, and delete methods are included. You should add methods or customize the existing methods to meet the requirement of your application.

You use the ObjectContext property to access the object that facilitates interacting with entity data objects.

The following example shows a domain service that derives from LinqToEntitiesDomainService(TContext). It contains methods for querying, updating, and deleting data.

No code example is currently available or this language may not be supported.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.