Interface IXrmContext
Traditionally, business logic methods are tightly coupled to their caller. They typically have parameters that include an org service and also an object that allows for logging such as the tracing service or an Azure logger. Such code cannot easily be called from another context.
IXrmContext is an interface that provides access to org services and a generic logging interface. Using this interface allows business logic code with logging to be written once and called from plugins, console apps, unit tests, Azure, etc.
An immediately obvious benefit of using IXrmContext: you can develop and test a complex plugin almost entirely locally because you can execute your business logic from a console app!
See the IXrmContext article for more details.
Namespace: Hsl.Xrm.Sdk
Assembly: Hsl.Xrm.Sdk.Core.dll
Syntax
public interface IXrmContext
Properties
InitiatingUserOrgService
Declaration
IOrganizationService InitiatingUserOrgService { get; }
Property Value
Type | Description |
---|---|
Microsoft.Xrm.Sdk.IOrganizationService |
Logger
Declaration
IHslLogger Logger { get; }
Property Value
Type | Description |
---|---|
Hsl.Logging.IHslLogger |
OrgService
Declaration
IOrganizationService OrgService { get; }
Property Value
Type | Description |
---|---|
Microsoft.Xrm.Sdk.IOrganizationService |
SystemOrgService
Declaration
IOrganizationService SystemOrgService { get; }
Property Value
Type | Description |
---|---|
Microsoft.Xrm.Sdk.IOrganizationService |