Custom development

The FuseIT.S4D.DynamicsConnector library may be referenced from custom code to make Dynamics 365 API requests directly.

Service factory

The S4D service factory is required to resolve necessary services. In the Sitecore implementation this is provided by a singleton:

// Get the Sitecore S4D service factory instance. IServiceFactory serviceFactory = FuseIT.S4D.WebToDynamics.S4DService.Instance;

In standalone implementations this should be created, e.g. using dependency injection in .Net Core:

// Add an S4D IServiceFactory service. services.AddSingleton<IServiceFactory, ServiceFactory<NoCache, ConsoleLogger, NoSettings, NoLicenseFileSource>>();

You will note the generic type parameters, which allow you to provide your own implementations to integrate S4D with your application:

  • FuseIT.S4D.DynamicsConnector.Cache.IObjectCache for temporary caching of sessions. The provided NoCache implementation disables caching.

  • FuseIT.S4D.DynamicsConnector.Logging.ILogger for log message output. The provided ConsoleLogger performs basic output using Console.WriteLine().

  • FuseIT.S4D.DynamicsConnector.Settings.ISettings for retrieving config settings, e.g. metadata file location.

  • FuseIT.S4D.DynamicsConnector.Licensing.ILicenseSourceFile for locating the S4D license XML file.

Sitecore-specific implementations of these interfaces offer full integration when used with the Sitecore connector.