示例#1
0
 static DefaultAggregationRepository()
 {
     if (!ContainerManager.IsRegister <IRepositoryWarehouse <ET, DAI> >())
     {
         ContainerManager.Register <IRepositoryWarehouse <ET, DAI>, DefaultRepositoryWarehouse <ET, DAI> >();
     }
 }
示例#2
0
 static MessageManager()
 {
     if (!ContainerManager.IsRegister <IMessageProvider>())
     {
         ContainerManager.Register <IMessageProvider, DefaultMessageProvider>();
     }
     InitKeywordMatchRegex();
 }
        /// <summary>
        /// Gets session configuration
        /// </summary>
        /// <returns>Return session configuration</returns>
        public static SessionConfiguration GetSessionConfiguration()
        {
            SessionConfiguration sessionConfiguration = null;

            if (ContainerManager.IsRegister <IOptions <SessionConfiguration> >())
            {
                sessionConfiguration = ContainerManager.Resolve <IOptions <SessionConfiguration> >()?.Value;
            }
            if (sessionConfiguration == null)
            {
                sessionConfiguration = new SessionConfiguration();
            }
            return(sessionConfiguration);
        }
示例#4
0
        /// <summary>
        /// 获取session配置
        /// </summary>
        /// <returns></returns>
        public static SessionConfig GetSessionConfig()
        {
            SessionConfig sessionConfig = null;

            if (ContainerManager.IsRegister <IOptions <SessionConfig> >())
            {
                sessionConfig = ContainerManager.Resolve <IOptions <SessionConfig> >()?.Value;
            }
            if (sessionConfig == null)
            {
                sessionConfig = new SessionConfig();
            }
            return(sessionConfig);
        }
示例#5
0
 /// <summary>
 /// Register default warehouse
 /// </summary>
 internal static void RegisterDefaultWarehouse <TEntity, TDataAccess>() where TEntity : BaseEntity <TEntity>, new() where TDataAccess : IDataAccess <TEntity>
 {
     if (ContainerManager.IsRegister <IRepositoryWarehouse <TEntity, TDataAccess> >())
     {
         return;
     }
     if (devDebug)
     {
         ContainerManager.Register <IRepositoryWarehouse <TEntity, TDataAccess>, DebugRepositoryWarehouse <TEntity, TDataAccess> >();
     }
     else
     {
         ContainerManager.Register <IRepositoryWarehouse <TEntity, TDataAccess>, DefaultRepositoryWarehouse <TEntity, TDataAccess> >();
     }
 }
示例#6
0
 /// <summary>
 /// register default warehouse
 /// </summary>
 internal static void RegisterDefaultWarehouse <ET, DAI>() where ET : BaseEntity <ET> where DAI : IDataAccess <ET>
 {
     if (ContainerManager.IsRegister <IRepositoryWarehouse <ET, DAI> >())
     {
         return;
     }
     if (devDebug)
     {
         ContainerManager.Register <IRepositoryWarehouse <ET, DAI>, DebugRepositoryWarehouse <ET, DAI> >();
     }
     else
     {
         ContainerManager.Register <IRepositoryWarehouse <ET, DAI>, DefaultRepositoryWarehouse <ET, DAI> >();
     }
 }