다음을 통해 공유


OrganizationServiceContext 클래스

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.

네임스페이스: Microsoft.Xrm.Sdk.Client
어셈블리: Microsoft.Xrm.Sdk(Microsoft.Xrm.Sdk.dll에 있음)

구문

‘선언
<SuppressMessageAttribute("Microsoft.Security", "CA9881:ClassesShouldBeSealed", Justification:="This class is used as base by crmsvcutil")> _
<SuppressMessageAttribute("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling")> _
Public Class OrganizationServiceContext
    Implements IDisposable
[SuppressMessageAttribute("Microsoft.Security", "CA9881:ClassesShouldBeSealed", Justification="This class is used as base by crmsvcutil")] 
[SuppressMessageAttribute("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling")] 
public class OrganizationServiceContext : IDisposable

설명

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 .NET LINQ(Language-Integrated Query) 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.

상속 계층

System.Object
  Microsoft.Xrm.Sdk.Client.OrganizationServiceContext

스레드 보안

이 형식의 공용 정적(Visual Basic에서는 Shared) 구성원은 스레드로부터 안전합니다. 인스턴스 구성원은 스레드로부터 안전하지 않을 수 있습니다.

플랫폼

Development Platforms

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

Target Platforms

Windows Server 2008,Windows Server 2012,Windows 7

참고 항목

참조

OrganizationServiceContext 구성원
Microsoft.Xrm.Sdk.Client 네임스페이스

기타 리소스

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.
© 2015 Microsoft. All rights reserved.