@@ -370,16 +370,45 @@ module EntityFramework {
370
370
)
371
371
}
372
372
373
+ /**
374
+ * Holds if `input` is a valid summary component stack for property `mapped` for this.
375
+ */
376
+ pragma [ noinline]
377
+ predicate input ( SummaryComponentStack input , Property mapped ) {
378
+ exists ( PropertyContent head , SummaryComponentStack tail |
379
+ this .requiresComponentStackIn ( head , _, tail , _) and
380
+ head .getProperty ( ) = mapped and
381
+ mapped = this .getAColumnProperty ( _) and
382
+ input = SummaryComponentStack:: push ( SummaryComponent:: content ( head ) , tail )
383
+ )
384
+ }
385
+
386
+ /**
387
+ * Holds if `output` is a valid summary component stack for the getter of `dbSet`
388
+ * for property `mapped` for this.
389
+ */
390
+ pragma [ noinline]
391
+ predicate output ( SummaryComponentStack output , Property mapped , DbContextClassSetProperty dbSet ) {
392
+ exists ( PropertyContent head , SummaryComponentStack tail |
393
+ this .requiresComponentStackOut ( head , _, tail , _, dbSet ) and
394
+ head .getProperty ( ) = mapped and
395
+ mapped = this .getAColumnProperty ( _) and
396
+ output = SummaryComponentStack:: push ( SummaryComponent:: content ( head ) , tail )
397
+ )
398
+ }
399
+
400
+ /**
401
+ * Gets the synthetic name for the getter of `dbSet` for property `mapped` for this,
402
+ * where `output` is a valid summary component stack for the getter of `dbSet`
403
+ * for the property `mapped`.
404
+ */
373
405
pragma [ nomagic]
374
- string getSyntheticNames (
375
- SummaryComponentStack input , SummaryComponentStack output , DbContextClassSetProperty dbSet
406
+ string getSyntheticName (
407
+ SummaryComponentStack output , Property mapped , DbContextClassSetProperty dbSet
376
408
) {
377
- exists ( Property mapped |
378
- this = dbSet .getDbContextClass ( ) and
379
- input ( this , input , mapped ) and
380
- output ( this , output , mapped , dbSet ) and
381
- result = dbSet .getSyntheticName ( ) + "#" + SummaryComponentStack:: getComponentStack ( output )
382
- )
409
+ this = dbSet .getDbContextClass ( ) and
410
+ this .output ( output , mapped , dbSet ) and
411
+ result = dbSet .getFullName ( ) + "#" + SummaryComponentStack:: getComponentStack ( output )
383
412
}
384
413
}
385
414
@@ -389,9 +418,9 @@ module EntityFramework {
389
418
DbContextClassSetProperty ( ) { this = c .getADbSetProperty ( _) }
390
419
391
420
/**
392
- * Gets the string representation for a synthetic identifier for this.
421
+ * Gets the fully qualified name for this.
393
422
*/
394
- string getSyntheticName ( ) {
423
+ string getFullName ( ) {
395
424
exists ( string qualifier , string type , string name |
396
425
this .hasQualifiedName ( qualifier , type , name )
397
426
|
@@ -400,41 +429,11 @@ module EntityFramework {
400
429
}
401
430
402
431
/**
403
- * Gets the context class where this is a Db set property.
432
+ * Gets the context class where this is a DbSet property.
404
433
*/
405
434
DbContextClass getDbContextClass ( ) { result = c }
406
435
}
407
436
408
- /**
409
- * Holds if `input` is a valid summary component stack for property `mapped`
410
- * for the context class `c`.
411
- */
412
- pragma [ noinline]
413
- predicate input ( DbContextClass c , SummaryComponentStack input , Property mapped ) {
414
- exists ( PropertyContent head , SummaryComponentStack tail |
415
- c .requiresComponentStackIn ( head , _, tail , _) and
416
- head .getProperty ( ) = mapped and
417
- mapped = c .getAColumnProperty ( _) and
418
- input = SummaryComponentStack:: push ( SummaryComponent:: content ( head ) , tail )
419
- )
420
- }
421
-
422
- /**
423
- * Holds if `output` is a valid summary component stack for the getter of `dbSet`
424
- * for property `mapped` for the context class `c`.
425
- */
426
- pragma [ noinline]
427
- predicate output (
428
- DbContextClass c , SummaryComponentStack output , Property mapped , DbContextClassSetProperty dbSet
429
- ) {
430
- exists ( PropertyContent head , SummaryComponentStack tail |
431
- c .requiresComponentStackOut ( head , _, tail , _, dbSet ) and
432
- head .getProperty ( ) = mapped and
433
- mapped = c .getAColumnProperty ( _) and
434
- output = SummaryComponentStack:: push ( SummaryComponent:: content ( head ) , tail )
435
- )
436
- }
437
-
438
437
private class DbContextClassSetPropertySynthetic extends EFSummarizedCallable {
439
438
private DbContextClassSetProperty p ;
440
439
@@ -445,7 +444,7 @@ module EntityFramework {
445
444
) {
446
445
exists ( string name , DbContextClass c |
447
446
preservesValue = true and
448
- name = c .getSyntheticNames ( _ , output , p ) and
447
+ name = c .getSyntheticName ( output , _ , p ) and
449
448
input = SummaryComponentStack:: syntheticGlobal ( name )
450
449
)
451
450
}
@@ -459,21 +458,20 @@ module EntityFramework {
459
458
override predicate propagatesFlow (
460
459
SummaryComponentStack input , SummaryComponentStack output , boolean preservesValue
461
460
) {
462
- exists ( string name |
461
+ exists ( string name , Property mapped |
463
462
preservesValue = true and
464
- name = c .getSyntheticNames ( input , _, _) and
463
+ c .input ( input , mapped ) and
464
+ name = c .getSyntheticName ( _, mapped , _) and
465
465
output = SummaryComponentStack:: syntheticGlobal ( name )
466
466
)
467
467
}
468
468
}
469
469
470
470
/**
471
- * Add all `DbContext` property names as potential synthetic globals .
471
+ * Add all possible synthetic global names .
472
472
*/
473
473
private class EFSummarizedCallableSyntheticGlobal extends SummaryComponent:: SyntheticGlobal {
474
- EFSummarizedCallableSyntheticGlobal ( ) {
475
- this = any ( DbContextClass c ) .getSyntheticNames ( _, _, _)
476
- }
474
+ EFSummarizedCallableSyntheticGlobal ( ) { this = any ( DbContextClass c ) .getSyntheticName ( _, _, _) }
477
475
}
478
476
479
477
private class DbContextSaveChangesRequiredSummaryComponentStack extends RequiredSummaryComponentStack
0 commit comments