/// <summary> /// 通过自定义数据链接符,连接数据库 /// </summary> /// <param name="connectionString">数据库连接字符串</param> /// <param name="db">数据库类型</param> /// <param name="commandTimeout">SQL执行超时时间</param> /// <param name="dataVer">数据库版本(针对不同的数据库版本的优化)</param> protected DbContext(string connectionString, eumDbType db = eumDbType.SqlServer, int commandTimeout = 30, string dataVer = null) { _contextConnection = new ContextConnection(connectionString, db, commandTimeout, dataVer); // 实例化子类中,所有Set属性 ContextSetTypeCacheManger.Cache(this.GetType()).Item2(this); }
private ContextConnection LookupContextConnection(IComponentContext componentContext, Type contextType) { var contextSettings = componentContext.ResolveOptional <ContextSettings>() ?? new ContextSettings(); ContextConnection connection = contextSettings.Connections? .FirstOrDefault(c => c.ContextName == contextType.Name); if (connection == null) { throw new InvalidOperationException( $"Context connection could not be found for the following entity context type: {contextType}."); } return(connection); }
protected override async UniTask OnContextActivate(IContext context) { var graphAsset = await subGraph.LoadAssetTaskAsync(LifeTime); var parent = GraphData.Root; var graph = Object.Instantiate(graphAsset.gameObject, parent) .DestroyWith(LifeTime) .GetComponent <UniGraph>(); var connection = new ContextConnection(); connection.Connect(context).AddTo(LifeTime); await LaunchGraph(graph, connection); Complete(); }
protected override void UpdateCommands(List <ILifeTimeCommand> nodeCommands) { base.UpdateCommands(nodeCommands); _contextConnection = _contextConnection ?? new ContextConnection(); LifeTime.AddDispose(_contextConnection); var outPort = UniTask.FromResult <IContext>(PortPair.OutputPort); var contextSource = UniTask.FromResult <IContext>(_contextConnection); var bindContextToOutput = new MessageBroadcastCommand(_contextConnection, PortPair.OutputPort); //register all Context Sources Data into target context asset var registerDataSourceIntoContext = new RegisterDataSourceCommand(contextSource, _dataSources); //Register context to output port var contextToOutputPortCommand = new DataSourceTaskCommand <IContext>(contextSource, outPort); var contextContainerBindCommand = new ParentContextContainerBindCommand(_contextConnection, _parentContextContainer); nodeCommands.Add(bindContextToOutput); nodeCommands.Add(registerDataSourceIntoContext); nodeCommands.Add(contextToOutputPortCommand); nodeCommands.Add(contextContainerBindCommand); }
public ApplicationUserStore(ContextConnection context) : base(context) { }
public GubernatorialResultRepository(ContextConnection contextConnection) { _contextConnection = contextConnection; }
public ElectionRepository(ContextConnection contextConnection) : base(contextConnection) { }
public WomenRepResultRepository(ContextConnection contextConnection) { _contextConnection = contextConnection; }
public CountyRepository(ContextConnection contextConnection, IRegionRepository regionRepository) : base(contextConnection) { _regionRepository = regionRepository; }
public PollingCentreRepository(ContextConnection contextConnection, IWardRepository wardRepository) : base(contextConnection) { _wardRepository = wardRepository; }
public SettingsRepository(ContextConnection contextConnection) : base(contextConnection) { }
public UserRepository(ContextConnection contextConnection) : base(contextConnection) { }
public McaResultRepository(ContextConnection contextConnection) { _contextConnection = contextConnection; }
public BaseRepository(ContextConnection contextConnection) { ConnectionString = contextConnection.VtsConnectionString; }
public ReferendumResultRepository(ContextConnection contextConnection) { _contextConnection = contextConnection; }
public CandidateRepository(ContextConnection contextConnection, IPoliticalPartyRepository politicalPartyRepository, IRaceRepository raceRepository) : base(contextConnection) { _politicalPartyRepository = politicalPartyRepository; _raceRepository = raceRepository; }
public PoliticalPartyRepository(ContextConnection contextConnection) : base(contextConnection) { }
public SingleStateToken() { _context = new ContextConnection(); }
public RaceRepository(ContextConnection contextConnection, IElectionRepository electionRepository) : base(contextConnection) { _electionRepository = electionRepository; }
public ConstituencyRepository(ContextConnection contextConnection, ICountyRepository countyRepository) : base(contextConnection) { _countyRepository = countyRepository; }
public ContextConnection Init() { return(dbContext ?? (dbContext = new Context())); }
public PresidentialResultRepository(ContextConnection contextConnection) { _contextConnection = contextConnection; }