public XrmService(DynamicsConnectionSettings connectionSettings, string solution, TelemetryWrapper telemetry, Action <string> report) { try { m_progress = report; m_telemetry = telemetry; m_solution = solution; m_service = new Lazy <IOrganizationService>(() => { var crmServiceClient = new CrmServiceClient(connectionSettings.ToString()); IOrganizationService service = crmServiceClient as IOrganizationService; if (service == null) { throw new NullReferenceException("Unable to instantiate IOrganizationService"); } return(service); }); } catch (Exception exception) { m_progress?.Invoke($"[ERROR] => {exception.Message}"); m_telemetry.TrackExceptionWithCustomMetrics(exception); } }
public DeployConfigurationModel() { DynamicsSettings = new DynamicsConnectionSettings(); }