public static void RegisterTypes(IUnityContainer container) { #region CRMConnection ICrmConnection _crmConnection = null; container.RegisterType <ICrmConnection>(new ContainerControlledLifetimeManager(), new InjectionFactory(c => { if (_crmConnection == null) { _crmConnection = new CrmConnection(); _crmConnection.ConnectToCrm(WebConfigurationManager.ConnectionStrings["CrmAccess"] .ConnectionString); } return(_crmConnection); })); #endregion container.RegisterType <ICrmServiceLogic, CrmServiceLogic>(); GlobalConfiguration.Configuration.DependencyResolver = new UnityDependencyResolver(container); }
public RegStatusService(ICrmConnection crmConnection) { this.crmConnection = crmConnection; }
public AccountService(ICrmConnection connection) { this.service = connection.Connect(); }
public RegistrationService(ICrmConnection crmConnection, IRegStatusService regStatusService) { this.crmConnection = crmConnection; this.regStatusService = regStatusService; }
public CaseService(ICrmConnection crmConnection) { this.crmConnection = crmConnection; }
public EmailService(ICrmConnection crmConnection) { this.crmConnection = crmConnection; }
public ContactService(ICrmConnection connection) { this.service = connection.Connect(); }
public ContactService(ICrmConnection crmConnection, IRegStatusService regStatusService) { this.crm = crmConnection; this.regStatusService = regStatusService; }
public SystemRuleService(ICrmConnection crmConnection) { this.crmConnection = crmConnection; }
public CrmServiceLogic(ICrmConnection crmConnection) { CrmConnection = crmConnection; }