コード例 #1
0
 /// <summary>
 /// Adds the tenents to context.
 /// </summary>
 /// <param name="context">The context.</param>
 private void AddTenentsToContext(IntegrationTestContext context)
 {
     context.Tenants.Add(new Tenant()
     {
         IsActive = true,
         TenantId = 1,
         TenantName = "Me",
         RecordCreatedDateTime = DateTime.Now
     });
     context.Tenants.Add(new Tenant()
     {
         IsActive = true,
         TenantId = 2,
         TenantName = "You",
         RecordCreatedDateTime = DateTime.Now
     });
     context.SaveChanges();
 }
コード例 #2
0
 /// <summary>
 /// Prepares the database.
 /// </summary>
 private void PrepareDatabase()
 {
     _context = new IntegrationTestContext("IntegrationTestConnection");
     _context.Database.CreateIfNotExists();
     ClearDownAllTables();
     //if (CreateTransaction)
     //{
     _transaction = new TransactionScope(TransactionScopeOption.RequiresNew);
     //}
 }