Exemplo n.º 1
0
        public DataContext CreateBuilderContextByConfig()
        {
            var builder = new DataContextOptionsConfigurator <DataContext>();

            builder.ConfigName = "mssql";
            builder.SetCommandOutput(commandOutput);
            var         options = builder.Create(DataContextConfiguration.Global);
            DataContext context = new DataContext(options);

            return(context);
        }
Exemplo n.º 2
0
        public DataContext CreateBuilderContextFactoryByConfig()
        {
            var builder = new DataContextOptionsConfigurator <DataContext>();

            builder.ConfigName = "mysql";
            builder.SetCommandOutput(commandOutput);
            var options = builder.Create(DataContextConfiguration.Global);
            LightDataContextFactory factory = new LightDataContextFactory(options);
            DataContext             context = factory.CreateDataContext();

            return(context);
        }