public VfpProviderTests() { VfpProviderFactory.Register(); string connectionString = @"D:\GitHub\dados\sinca.dbc"; //DELETED=true;data source= _context = new Context(new VfpConnection(connectionString)); }
protected void Application_Start() { VfpProviderFactory.Register(); AreaRegistration.RegisterAllAreas(); WebApiConfig.Register(GlobalConfiguration.Configuration); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); }
static void Main(string[] args) { VfpProviderFactory.Register(); string connectionString = @"D:\GitHub\dados\SincaTeste.dbc"; //DELETED=true;data source= Context dc = new Context(new VfpConnection(connectionString)); var teste = dc.TabelaTeste.Find(1); Console.WriteLine("Id {0} - Nome {1}", teste.id, teste.nome); Console.ReadKey(); }
public static void AssemblyInit(TestContext context) { testRun = Guid.NewGuid(); VfpProviderFactory.Register(); CreateZip("NorthwindVfp.zip", Properties.Resources.NorthwindVfp); CreateZip("DecimalTable.zip", Properties.Resources.DecimalTable); CreateZip("AutoGenId.zip", Properties.Resources.AutoGenId); CreateZip("AllTypes.zip", Properties.Resources.AllTypes); UnZip("NorthwindVfp.zip", GetTestDeploymentDir(context)); UnZip("DecimalTable.zip", Path.Combine(GetTestDeploymentDir(context), "Decimal")); UnZip("AutoGenId.zip", Path.Combine(GetTestDeploymentDir(context), @"AutoGenId\Data")); UnZip("AllTypes.zip", Path.Combine(GetTestDeploymentDir(context), @"AllTypes")); VfpClientTracing.Tracer = new TraceSource("VfpClient", SourceLevels.Information); VfpClientTracing.Tracer.Listeners.Add(new TestContextTraceListener(context)); }
public static void AssemblyInit(TestContext context) { VfpProviderFactory.Register(); File.WriteAllBytes("NorthwindVfp.zip", Properties.Resources.NorthwindVfp); File.WriteAllBytes("DecimalTable.zip", Properties.Resources.DecimalTable); File.WriteAllBytes("AutoGenId.zip", Properties.Resources.AutoGenId); File.WriteAllBytes("AllTypes.zip", Properties.Resources.AllTypes); var zip = new FastZip(); zip.ExtractZip("NorthwindVfp.zip", context.TestDeploymentDir, String.Empty); zip.ExtractZip("DecimalTable.zip", Path.Combine(context.TestDeploymentDir, "Decimal"), String.Empty); zip.ExtractZip("AutoGenId.zip", Path.Combine(context.TestDeploymentDir, @"AutoGenId\Data"), String.Empty); Directory.CreateDirectory(Path.Combine(context.TestDeploymentDir, "AllTypes")); zip.ExtractZip("AllTypes.zip", Path.Combine(context.TestDeploymentDir, @"AllTypes"), String.Empty); VfpClientTracing.Tracer = new TraceSource("VfpClient", SourceLevels.Information); VfpClientTracing.Tracer.Listeners.Add(new TestContextTraceListener(context)); }
static void Main(string[] args) { VfpProviderFactory.Register(); bool runAll = false; bool pause = false; string logFile = null; string connectionString = ConfigurationManager.ConnectionStrings .Cast <ConnectionStringSettings>() .Where(c => c.ProviderName == "System.Data.EntityClient") .First() .ConnectionString; for (int i = 0; i < args.Length; ++i) { switch (args[i]) { case "/runall": runAll = true; break; case "/pause": pause = true; break; case "/log": logFile = args[++i]; break; case "/connectionString": connectionString = ConfigurationManager.ConnectionStrings[args[++i]].ConnectionString; break; } } // set up a loader and source code search paths SampleLoader loader = new SampleLoader(); loader.AddSourceDirectory(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, ".")); loader.AddSourceDirectory(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Samples")); loader.AddSourceDirectory(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"..\..\Samples")); // load samples SampleGroup allSamples = new SampleGroup(null, "Entity Framework Query Samples", ""); allSamples.Children.Add(loader.Load(new EntitySQLSamples())); allSamples.Children.Add(loader.Load(new LinqToEntitiesSamples())); allSamples.Children.Add(loader.Load(new BuilderMethodSamples())); //allSamples.Children.Add(loader.Load(new DesignTimeSamples())); allSamples.Children.Add(loader.Load(new ObjectServicesSamples())); if (runAll) { NativeMethods.AllocConsole(); SampleRunner runner; if (logFile != null) { StreamWriter sw = File.CreateText(logFile); sw.AutoFlush = true; runner = new TextWriterSampleRunner(sw); } else { runner = new ConsoleSampleRunner(); } runner.ConnectionString = connectionString; runner.Run(allSamples); if (pause) { Console.ReadKey(); } } else { // launch WinForms UI Application.EnableVisualStyles(); Application.Run(new FormSampleRunner(allSamples)); } }
public static void Main(string[] args) { VfpProviderFactory.Register(); LinqFunctionStubsCodeGen.Generate("..\\..\\..\\VfpEntityFrameworkProvider\\VfpFunctions.cs"); }