コード例 #1
0
ファイル: TpcFacts.cs プロジェクト: mstaessen/EFExperiments
 public void QueriesOnAlternateIdentifier()
 {
     using (var context = new InheritanceContext()) {
         var query = context.Set <TpcRoot>().Where(x => x.AlternateIdentifiers.Any(y => y.Identifier == "SomeIdentifier"));
         var sql   = query.ToString();
         Assert.Contains("tpc_leaf1", sql);
         Assert.Contains("tpc_leaf2", sql);
         Assert.Contains("tpc_leaf3", sql);
     }
 }
コード例 #2
0
ファイル: TpcFacts.cs プロジェクト: mstaessen/EFExperiments
 public void QueriesOnIntermediateTypeIncludesChildTablesAndUp()
 {
     using (var context = new InheritanceContext()) {
         var query = context.Set <TpcIntermediate>().Where(x => x.Id == Guid.Empty);
         var sql   = query.ToString();
         Assert.Contains("tpc_leaf1", sql);
         Assert.Contains("tpc_leaf2", sql);
         Assert.DoesNotContain("tpc_leaf3", sql);
     }
 }
コード例 #3
0
ファイル: TpcFacts.cs プロジェクト: mstaessen/EFExperiments
 public void QueriesOnRootTypeIncludeAllTables()
 {
     using (var context = new InheritanceContext()) {
         var query = context.Set <TpcRoot>().Where(x => x.Id == Guid.Empty);
         var sql   = query.ToString();
         Assert.Contains("tpc_leaf1", sql);
         Assert.Contains("tpc_leaf2", sql);
         Assert.Contains("tpc_leaf3", sql);
     }
 }
コード例 #4
0
ファイル: TpcFacts.cs プロジェクト: mstaessen/EFExperiments
 public void QueriesOnLeafTypesOnlyIncludeLeafTypeTable()
 {
     using (var context = new InheritanceContext()) {
         var query = context.Set <TpcLeafType1>();
         var sql   = query.ToString();
         Assert.Contains("tpc_leaf1", sql);
         Assert.DoesNotContain("tpc_leaf2", sql);
         Assert.DoesNotContain("tpc_leaf3", sql);
     }
 }
コード例 #5
0
ファイル: TphFacts.cs プロジェクト: mstaessen/EFExperiments
 public void QueriesOnAlternateIdentifier()
 {
     using (var context = new InheritanceContext()) {
         var query = context.Set <TphRoot>().Where(x => x.AlternateIdentifiers.Any(y => y.Identifier == "SomeIdentifier"));
         var sql   = query.ToString();
         Assert.Contains("tph_root", sql);
         Assert.DoesNotContain("tph_leaf1", sql); // simply does not exist
         Assert.DoesNotContain("tph_leaf2", sql); // simply does not exist
         Assert.DoesNotContain("tph_leaf3", sql); // simply does not exist
     }
 }
コード例 #6
0
ファイル: TphFacts.cs プロジェクト: mstaessen/EFExperiments
 public void QueriesOnRootTypeIncludeAllTables()
 {
     using (var context = new InheritanceContext()) {
         var query = context.Set <TphRoot>().Where(x => x.Id == Guid.Empty);
         var sql   = query.ToString();
         Assert.Contains("tph_root", sql);
         Assert.DoesNotContain("tph_leaf1", sql); // simply does not exist
         Assert.DoesNotContain("tph_leaf2", sql); // simply does not exist
         Assert.DoesNotContain("tph_leaf3", sql); // simply does not exist
     }
 }
コード例 #7
0
ファイル: TphFacts.cs プロジェクト: mstaessen/EFExperiments
 public void QueriesOnLeafTypesOnlyIncludeLeafTypeTable()
 {
     using (var context = new InheritanceContext()) {
         var query = context.Set <TphLeafType1>();
         var sql   = query.ToString();
         Assert.Contains("tph_root", sql);
         Assert.DoesNotContain("tph_leaf1", sql); // simply does not exist
         Assert.DoesNotContain("tph_leaf2", sql); // simply does not exist
         Assert.DoesNotContain("tph_leaf3", sql); // simply does not exist
     }
 }