/// <summary>
 /// 
 /// </summary>
 /// <param name="connectionString"></param>
 /// <param name="mappings"></param>
 /// <param name="logger"></param>
 /// <param name="contextConfiguration"></param>
 /// <param name="typesConfigured"></param>
 public AggregateConfiguration(string connectionString, IMappingConfiguration[] mappings, ILog logger,
                               IContextConfiguration contextConfiguration, params Type[] typesConfigured)
 {
     ConnectionString = connectionString;
     Mappings = mappings;
     Logger = logger ?? new NoOpLogger();
     ContextConfiguration = contextConfiguration ?? new DefaultContextConfiguration();
     TypesConfigured = typesConfigured;
 }
예제 #2
0
        public MemoryContext(IContextConfiguration configuration) : base(configuration)
        {
            _storeSet = new Dictionary <Type, object>();
            _storeSet.Add(typeof(UserModel), new List <UserModel>());
            _storeSet.Add(typeof(ListModel), new List <ListModel>());
            _storeSet.Add(typeof(ListItemModel), new List <ListItemModel>());

            _userRepository     = new UserRepository(this);
            _listRepository     = new ListRepository(this);
            _listItemRepository = new ListItemRepository(this);

            _nextIds = new Dictionary <Type, int>();
            _nextIds.Add(typeof(UserModel), 1);
            _nextIds.Add(typeof(ListModel), 1);
            _nextIds.Add(typeof(ListItemModel), 1);
        }
예제 #3
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app,
                              IHostingEnvironment env,
                              IContextConfiguration context)
        {
            context.Migrate();

            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseExceptionHandler("/Home/Error");
            }
            app.UseMvc();
            app.UseStaticFiles();
        }
예제 #4
0
 /// <summary>
 /// Creates a repository factory for the supplied list of domains
 /// </summary>
 public RepositoryFactory(string connectionString, IMappingConfiguration mappings, IContextConfiguration contextConfig, ILog logger)
 {
     _connectionString = connectionString;
     _mappings         = mappings;
     _contextConfig    = contextConfig;
     _logger           = logger;
 }
예제 #5
0
 /// <summary>
 /// Creates a repository factory for the supplied list of domains
 /// </summary>
 public RepositoryFactory(string connectionString, IMappingConfiguration mappings, IContextConfiguration contextConfiguration)
     : this(connectionString, mappings, contextConfiguration, new NoOpLogger())
 {
 }
 public IClientContext CreateContext(IContextConfiguration configuration)
 {
     return new SDataClientContext((SDataContextConfiguration)configuration);
 }
 public static IClientContext GetContext(IClientContextFactory factory, IContextConfiguration configuration)
 {
     return factory.CreateContext(configuration);
 }
예제 #8
0
 public HighwayDataContext(string connectionString, IMappingConfiguration mapping, IContextConfiguration contextConfiguration, ILog log)
     : base(connectionString, mapping, contextConfiguration, log)
 {
 }
예제 #9
0
 /// <summary>
 ///     Constructs a context
 /// </summary>
 /// <param name="connectionString">The standard SQL connection string for the Database</param>
 /// <param name="mapping">The Mapping Configuration that will determine how the tables and objects interact</param>
 /// <param name="contextConfiguration">
 ///     The context specific configuration that will change context level behavior (
 ///     Optional )
 /// </param>
 public DataContext(string connectionString, IMappingConfiguration mapping,
                    IContextConfiguration contextConfiguration)
     : this(connectionString, mapping, contextConfiguration, new NoOpLogger())
 {
 }
예제 #10
0
 public HighwayDataContext(string connectionString, IMappingConfiguration mapping, IContextConfiguration contextConfiguration, ILog log)
     : base(connectionString, mapping, contextConfiguration, log)
 {
 }
예제 #11
0
 public UsersDataContext(IContextConfiguration config)
 {
     _config = config;
 }
예제 #12
0
 public EffectiveTablesContext(IContextConfiguration configuration)
 {
     _configuration = configuration;
 }
예제 #13
0
 public HighwayDataContext(IConnectionStringConfig config, IMappingConfiguration mapping, IContextConfiguration contextConfiguration, ILog log)
     : base(config.ConnectionString, mapping, contextConfiguration, log)
 {
     string msg = System.Configuration.ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString;
 }
 public MigrationsDataContext(string connectionString, IMappingConfiguration mapping, IContextConfiguration contextConfiguration)
     : base(connectionString, mapping, contextConfiguration)
 {
 }
예제 #15
0
 public Context(IContextConfiguration configuration) : base(configuration.GetDbContextOptions())
 {
 }
 public IClientContext CreateContext(IContextConfiguration configuration)
 {
     return new HibernateClientContext((HibernateContextConfiguration)configuration);
 }