protected ITestDataContext GetDataContext(string configuration, MappingSchema ms = null) { if (configuration.EndsWith(".LinqService")) { #if !NETSTANDARD1_6 && !NETSTANDARD2_0 && !MONO OpenHost(); var str = configuration.Substring(0, configuration.Length - ".LinqService".Length); var dx = new TestServiceModelDataContext(IP) { Configuration = str }; Debug.WriteLine(((IDataContext)dx).ContextID, "Provider "); if (ms != null) { dx.MappingSchema = new MappingSchema(dx.MappingSchema, ms); } return(dx); #else configuration = configuration.Substring(0, configuration.Length - ".LinqService".Length); #endif } Debug.WriteLine(configuration, "Provider "); var res = new TestDataConnection(configuration); if (ms != null) { res.AddMappingSchema(ms); } return(res); }
protected ITestDataContext GetDataContext(string configuration) { if (configuration.EndsWith(".LinqService")) { var str = configuration.Substring(0, configuration.Length - ".LinqService".Length); var dx = new TestServiceModelDataContext(IP) { Configuration = str }; Debug.WriteLine(((IDataContext)dx).ContextID, "Provider "); return(dx); } Debug.WriteLine(configuration, "Provider "); return(new TestDataConnection(configuration)); }