protected void Application_Start() { SqlSetup.Setup(); Config.Configure(); AreaRegistration.RegisterAllAreas(); GlobalConfiguration.Configure(WebApiConfig.Register); }
public void FromConfigurationTest() { var entity = new ColumnData { ObjectId = 95 }; var resources = new Resources <DataTests>(); var source = resources.String("TestData.data.configuration"); var _adapter = from configuration in Configuration.FromString(source) from setup in SqlSetup.FromConfiguration(configuration, "all") from adapter in Adapter <ColumnData> .FromSetup(setup, entity) select adapter; if (_adapter.If(out var allColumnData, out var exception)) { var data = allColumnData.ToArray(); foreach (var columnData in data) { Console.WriteLine(columnData); } } else { Console.WriteLine($"Exception: {exception.Message}"); } }
static Adapters() { setups = new StringHash <Func <DataGroups, string, ISetup> >(true) { ["sql"] = (dataGroups, adapterName) => { var sqlSetup = SqlSetup.FromDataGroups(dataGroups, adapterName).ForceValue(); sqlSetup.Handler = Handler; return(sqlSetup); } }; }
public void FromConnectionStringTest() { var resources = new Resources <DataTests>(); var source = resources.String("TestData.data.configuration"); var _adapter = from configuration in Configuration.FromString(source) from setup in SqlSetup.FromConfiguration(configuration, "all2") from adapter in Adapter <ColumnData> .FromSetup(setup, new ColumnData { ObjectId = 5664280 }) select adapter; if (_adapter.If(out var allColumnData, out var exception)) { allColumnData.ConnectionString = TRUE_CONNECTION_STRING; foreach (var columnData in allColumnData) { Console.WriteLine(columnData); } } else { Console.WriteLine($"Exception: {exception.Message}"); } }