@@ -339,7 +339,7 @@ module EntityFramework {
339
339
* Gets the string representation for synthetic identifiers for SaveChanges methods
340
340
* on this.
341
341
*/
342
- string getSyntheticNames ( ) {
342
+ private string getSyntheticNames ( ) {
343
343
exists ( string qualifier , string type , string name |
344
344
this .getASaveChanges ( ) .hasQualifiedName ( qualifier , type , name )
345
345
|
@@ -381,6 +381,17 @@ module EntityFramework {
381
381
this .stepRev ( tailHead , tailType , head , headType , dist )
382
382
)
383
383
}
384
+
385
+ pragma [ nomagic]
386
+ string getInputSynthetic ( SummaryComponentStack output , DbContextClassSetProperty p ) {
387
+ exists ( SummaryComponentStack synthetic , Property mapped |
388
+ this = p .getDbContextClass ( ) and
389
+ input ( this , synthetic , mapped ) and
390
+ output ( this , output , mapped , p ) and
391
+ result =
392
+ getFullSyntheticName ( this .getSyntheticNames ( ) , p .getSyntheticName ( ) , synthetic , output )
393
+ )
394
+ }
384
395
}
385
396
386
397
private class DbContextClassSetProperty extends Property {
@@ -454,12 +465,9 @@ module EntityFramework {
454
465
override predicate propagatesFlow (
455
466
SummaryComponentStack input , SummaryComponentStack output , boolean preservesValue
456
467
) {
457
- exists ( SummaryComponentStack synthetic , string name , DbContextClass c , Property mapped |
468
+ exists ( string name , DbContextClass c |
458
469
preservesValue = true and
459
- c = p .getDbContextClass ( ) and
460
- input ( c , synthetic , mapped ) and
461
- output ( c , output , mapped , p ) and
462
- name = getFullSyntheticName ( c .getSyntheticNames ( ) , p .getSyntheticName ( ) , synthetic , output ) and
470
+ name = c .getInputSynthetic ( output , p ) and
463
471
input = SummaryComponentStack:: syntheticGlobal ( name )
464
472
)
465
473
}
@@ -478,18 +486,22 @@ module EntityFramework {
478
486
)
479
487
}
480
488
489
+ pragma [ nomagic]
490
+ string getOutputSynthetic ( SummaryComponentStack input ) {
491
+ exists ( SummaryComponentStack synthetic , Property mapped , DbContextClassSetProperty dbSet |
492
+ input ( c , input , mapped ) and
493
+ output ( c , synthetic , mapped , dbSet ) and
494
+ result =
495
+ getFullSyntheticName ( this .getSyntheticName ( ) , dbSet .getSyntheticName ( ) , input , synthetic )
496
+ )
497
+ }
498
+
481
499
override predicate propagatesFlow (
482
500
SummaryComponentStack input , SummaryComponentStack output , boolean preservesValue
483
501
) {
484
- exists (
485
- SummaryComponentStack synthetic , string name , Property mapped ,
486
- DbContextClassSetProperty dbSet
487
- |
502
+ exists ( string name |
488
503
preservesValue = true and
489
- input ( c , input , mapped ) and
490
- output ( c , synthetic , mapped , dbSet ) and
491
- name =
492
- getFullSyntheticName ( this .getSyntheticName ( ) , dbSet .getSyntheticName ( ) , input , synthetic ) and
504
+ name = this .getOutputSynthetic ( input ) and
493
505
output = SummaryComponentStack:: syntheticGlobal ( name )
494
506
)
495
507
}
@@ -500,15 +512,8 @@ module EntityFramework {
500
512
*/
501
513
private class EFSummarizedCallableSyntheticGlobal extends SummaryComponent:: SyntheticGlobal {
502
514
EFSummarizedCallableSyntheticGlobal ( ) {
503
- exists (
504
- DbContextClass c , SummaryComponentStack input , SummaryComponentStack output ,
505
- Property mapped , DbContextClassSetProperty dbSet
506
- |
507
- input ( c , input , mapped ) and
508
- output ( c , output , mapped , dbSet )
509
- |
510
- this = getFullSyntheticName ( c .getSyntheticNames ( ) , dbSet .getSyntheticName ( ) , input , output )
511
- )
515
+ this = any ( DbContextClass c ) .getInputSynthetic ( _, _) or
516
+ this = any ( DbContextSaveChanges c ) .getOutputSynthetic ( _)
512
517
}
513
518
}
514
519
0 commit comments