Clase de OrganizationServiceContext
Se aplica a: CRM 2015 on-prem, CRM Online
Represents the runtime context of the data service that is used to track Microsoft Dynamics CRM entities and that sends and receives entities from the server.
Espacio de nombres: Microsoft.Xrm.Sdk.Client
Ensamblado: Microsoft.Xrm.Sdk (en Microsoft.Xrm.Sdk.dll)
Sintaxis
'Declaración
<SuppressMessageAttribute("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling")> _
<SuppressMessageAttribute("Microsoft.Security", "CA9881:ClassesShouldBeSealed", Justification:="This class is used as base by crmsvcutil")> _
Public Class OrganizationServiceContext
Implements IDisposable
[SuppressMessageAttribute("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling")]
[SuppressMessageAttribute("Microsoft.Security", "CA9881:ClassesShouldBeSealed", Justification="This class is used as base by crmsvcutil")]
public class OrganizationServiceContext : IDisposable
Comentarios
The organization service context class maintains state on the client between interactions with the Microsoft Dynamics CRM Web service to support features such as change management. This class also manages identities and tracks changes to Microsoft Dynamics CRM data. The organization service context class implements the IQueryable interface and a Consulta integrada del lenguaje .NET (LINQ) query provider so you can write LINQ queries against Microsoft Dynamics CRM data.
Objects tracked by the organization service context are instances of entity types that represent data in Microsoft Dynamics CRM. You can designate actions to be performed on these objects and the service context tracks the changes. When the SaveChanges method is called, the service context instructs Microsoft Dynamics CRM to generate commands to create, update or delete the entities the tracked objects represent.
The code generation tool (CrmSvcUtil.exe) can be used to create a custom instance of the OrganizationServiceContext class. This class includes customizations and provides helper properties and methods for working with entities.
Several enumerations are used with the OrganizationServiceContext class. The MergeOption enumeration indicates how changes are applied to Microsoft Dynamics CRM data. The SaveChangesOptions enumeration determines how changes are managed by the service context if an error occurs.
Jerarquía heredada
System.Object
Microsoft.Xrm.Sdk.Client.OrganizationServiceContext
Seguridad de hilo
Los miembros estáticos públicos (Shared en Visual Basic) de este tipo son seguros para el hilo. No se garantiza que los miembros de instancia sean seguros para el hilo.
Plataformas
Plataformas de desarrollo
Windows Vista, Windows Server 2003 y
Plataformas de destino
Windows Vista,Windows XP
Vea también
Referencia
Miembros de OrganizationServiceContext
Espacio de nombres de Microsoft.Xrm.Sdk.Client
Otros recursos
Create Early-Bound Entity Classes with the Code Generation Tool (CrmSvcUtil.exe)
Use the Early Bound Entity Classes for Create, Update, and Delete
Use the Early Bound Entity Classes to Add or Update Associations Between Related Records
Sample: Use the Organization Service Context
Send comments about this topic to Microsoft.
© 2014 Microsoft Corporation. All rights reserved.