示例#1
0
        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);
        }
示例#2
0
 public RegStatusService(ICrmConnection crmConnection)
 {
     this.crmConnection = crmConnection;
 }
示例#3
0
 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;
 }
示例#10
0
 public CrmServiceLogic(ICrmConnection crmConnection)
 {
     CrmConnection = crmConnection;
 }