static DefaultAggregationRepository() { if (!ContainerManager.IsRegister <IRepositoryWarehouse <ET, DAI> >()) { ContainerManager.Register <IRepositoryWarehouse <ET, DAI>, DefaultRepositoryWarehouse <ET, DAI> >(); } }
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); }
/// <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); }
/// <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> >(); } }
/// <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> >(); } }