Exemplo n.º 1
0
        static void Main(string[] args)
        {
            var seedDataService = DiFactory.GetService <SeedDataService>();

            seedDataService.SeedData();

            // new RunService().Run();
            var summary = BenchmarkRunner.Run <TestRunner>();

            seedDataService.ClearSeedData();
        }
Exemplo n.º 2
0
        public void SeedData()
        {
            var testDbContext = DiFactory.GetService <TestDbContext>();

            testDbContext.Database.EnsureCreated();

            testDbContext.A.Add(new A
            {
                Guid = AGuid,
                Name = "C",

                Details = new[]
                {
                    new ADetail {
                        Guid = Guid.NewGuid(), AGuid = AGuid, Name = "C1",
                    },
                    new ADetail {
                        Guid = Guid.NewGuid(), AGuid = AGuid, Name = "C2",
                    },
                    new ADetail {
                        Guid = Guid.NewGuid(), AGuid = AGuid, Name = "C3",
                    },
                }
            });

            var dGuid = Guid.NewGuid();

            testDbContext.A.Add(new A
            {
                Guid = dGuid,
                Name = "D",

                Details = new[]
                {
                    new ADetail {
                        Guid = Guid.NewGuid(), AGuid = dGuid, Name = "D1",
                    },
                    new ADetail {
                        Guid = Guid.NewGuid(), AGuid = dGuid, Name = "D2",
                    },
                }
            });

            testDbContext.SaveChanges();
        }
Exemplo n.º 3
0
        public void ClearSeedData()
        {
            var testDbContext = DiFactory.GetService <TestDbContext>();

            testDbContext.Database.EnsureDeleted();
        }
Exemplo n.º 4
0
 public void Dapper() => DiFactory.GetService <DapperService>().Run();
Exemplo n.º 5
0
 public void EfCore_QueryMultiple() => DiFactory.GetService <EfCoreService>().QueryMultiple();
Exemplo n.º 6
0
 public void EfCore_FromSqlRaw_Where() => DiFactory.GetService <EfCoreService>().FromSqlRaw_Where();
Exemplo n.º 7
0
 public void EfCore_FromSqlRaw() => DiFactory.GetService <EfCoreService>().FromSqlRaw_SqlParameter();