@@ -614,29 +614,16 @@ bool filter(IEdmNavigationSource z) =>
614
614
foreach ( var bindingEntityType in allEntitiesForOperation )
615
615
{
616
616
// 1. Search for corresponding navigation source path
617
- if ( AppendBoundOperationOnNavigationSourcePath ( edmOperation , isCollection , bindingEntityType ) )
618
- {
619
- continue ;
620
- }
617
+ AppendBoundOperationOnNavigationSourcePath ( edmOperation , isCollection , bindingEntityType ) ;
621
618
622
619
// 2. Search for generated navigation property
623
- if ( AppendBoundOperationOnNavigationPropertyPath ( edmOperation , isCollection , bindingEntityType ) )
624
- {
625
- continue ;
626
- }
620
+ AppendBoundOperationOnNavigationPropertyPath ( edmOperation , isCollection , bindingEntityType ) ;
627
621
628
622
// 3. Search for derived
629
- if ( AppendBoundOperationOnDerived ( edmOperation , isCollection , bindingEntityType , convertSettings ) )
630
- {
631
- continue ;
632
- }
623
+ AppendBoundOperationOnDerived ( edmOperation , isCollection , bindingEntityType , convertSettings ) ;
633
624
634
625
// 4. Search for derived generated navigation property
635
- if ( AppendBoundOperationOnDerivedNavigationPropertyPath ( edmOperation , isCollection , bindingEntityType , convertSettings ) )
636
- {
637
- continue ;
638
- }
639
-
626
+ AppendBoundOperationOnDerivedNavigationPropertyPath ( edmOperation , isCollection , bindingEntityType , convertSettings ) ;
640
627
}
641
628
}
642
629
}
@@ -646,10 +633,8 @@ bool filter(IEdmNavigationSource z) =>
646
633
ODataPathKind . DollarCount ,
647
634
ODataPathKind . ComplexProperty ,
648
635
} ;
649
- private bool AppendBoundOperationOnNavigationSourcePath ( IEdmOperation edmOperation , bool isCollection , IEdmEntityType bindingEntityType )
636
+ private void AppendBoundOperationOnNavigationSourcePath ( IEdmOperation edmOperation , bool isCollection , IEdmEntityType bindingEntityType )
650
637
{
651
- bool found = false ;
652
-
653
638
if ( _allNavigationSourcePaths . TryGetValue ( bindingEntityType , out IList < ODataPath > value ) )
654
639
{
655
640
bool isEscapedFunction = _model . IsUrlEscapeFunction ( edmOperation ) ;
@@ -676,19 +661,15 @@ secondLastPathSegment is not ODataKeySegment &&
676
661
ODataPath newPath = subPath . Clone ( ) ;
677
662
newPath . Push ( new ODataOperationSegment ( edmOperation , isEscapedFunction ) ) ;
678
663
AppendPath ( newPath ) ;
679
- found = true ;
680
664
}
681
665
}
682
666
}
683
-
684
- return found ;
685
667
}
686
668
private static readonly HashSet < ODataPathKind > _pathKindToSkipForNavigationProperties = new ( ) {
687
669
ODataPathKind . Ref ,
688
670
} ;
689
- private bool AppendBoundOperationOnNavigationPropertyPath ( IEdmOperation edmOperation , bool isCollection , IEdmEntityType bindingEntityType )
671
+ private void AppendBoundOperationOnNavigationPropertyPath ( IEdmOperation edmOperation , bool isCollection , IEdmEntityType bindingEntityType )
690
672
{
691
- bool found = false ;
692
673
bool isEscapedFunction = _model . IsUrlEscapeFunction ( edmOperation ) ;
693
674
694
675
if ( _allNavigationPropertyPaths . TryGetValue ( bindingEntityType , out IList < ODataPath > value ) )
@@ -727,21 +708,16 @@ private bool AppendBoundOperationOnNavigationPropertyPath(IEdmOperation edmOpera
727
708
ODataPath newPath = path . Clone ( ) ;
728
709
newPath . Push ( new ODataOperationSegment ( edmOperation , isEscapedFunction ) ) ;
729
710
AppendPath ( newPath ) ;
730
- found = true ;
731
711
}
732
712
}
733
-
734
- return found ;
735
713
}
736
714
737
- private bool AppendBoundOperationOnDerived (
715
+ private void AppendBoundOperationOnDerived (
738
716
IEdmOperation edmOperation ,
739
717
bool isCollection ,
740
718
IEdmEntityType bindingEntityType ,
741
719
OpenApiConvertSettings convertSettings )
742
720
{
743
- bool found = false ;
744
-
745
721
bool isEscapedFunction = _model . IsUrlEscapeFunction ( edmOperation ) ;
746
722
foreach ( var baseType in bindingEntityType . FindAllBaseTypes ( ) )
747
723
{
@@ -764,7 +740,6 @@ private bool AppendBoundOperationOnDerived(
764
740
ODataPath newPath = new ODataPath ( new ODataNavigationSourceSegment ( ns ) , new ODataTypeCastSegment ( bindingEntityType ) ,
765
741
new ODataOperationSegment ( edmOperation , isEscapedFunction ) ) ;
766
742
AppendPath ( newPath ) ;
767
- found = true ;
768
743
}
769
744
}
770
745
else
@@ -774,22 +749,18 @@ private bool AppendBoundOperationOnDerived(
774
749
ODataPath newPath = new ODataPath ( new ODataNavigationSourceSegment ( ns ) , new ODataTypeCastSegment ( bindingEntityType ) ,
775
750
new ODataOperationSegment ( edmOperation , isEscapedFunction ) ) ;
776
751
AppendPath ( newPath ) ;
777
- found = true ;
778
752
}
779
753
else
780
754
{
781
755
ODataPath newPath = new ODataPath ( new ODataNavigationSourceSegment ( ns ) , new ODataKeySegment ( ns . EntityType ( ) ) ,
782
756
new ODataTypeCastSegment ( bindingEntityType ) ,
783
757
new ODataOperationSegment ( edmOperation , isEscapedFunction ) ) ;
784
758
AppendPath ( newPath ) ;
785
- found = true ;
786
759
}
787
760
}
788
761
}
789
762
}
790
763
}
791
-
792
- return found ;
793
764
}
794
765
795
766
private bool HasUnsatisfiedDerivedTypeConstraint (
@@ -804,13 +775,12 @@ private bool HasUnsatisfiedDerivedTypeConstraint(
804
775
private IEnumerable < string > GetDerivedTypeConstaintTypeNames ( IEdmVocabularyAnnotatable annotatable ) =>
805
776
_model . GetCollection ( annotatable , "Org.OData.Validation.V1.DerivedTypeConstraint" ) ?? Enumerable . Empty < string > ( ) ;
806
777
807
- private bool AppendBoundOperationOnDerivedNavigationPropertyPath (
778
+ private void AppendBoundOperationOnDerivedNavigationPropertyPath (
808
779
IEdmOperation edmOperation ,
809
780
bool isCollection ,
810
781
IEdmEntityType bindingEntityType ,
811
782
OpenApiConvertSettings convertSettings )
812
783
{
813
- bool found = false ;
814
784
bool isEscapedFunction = _model . IsUrlEscapeFunction ( edmOperation ) ;
815
785
816
786
foreach ( var baseType in bindingEntityType . FindAllBaseTypes ( ) )
@@ -865,12 +835,9 @@ private bool AppendBoundOperationOnDerivedNavigationPropertyPath(
865
835
newPath . Push ( new ODataTypeCastSegment ( bindingEntityType ) ) ;
866
836
newPath . Push ( new ODataOperationSegment ( edmOperation , isEscapedFunction ) ) ;
867
837
AppendPath ( newPath ) ;
868
- found = true ;
869
838
}
870
839
}
871
840
}
872
-
873
- return found ;
874
841
}
875
842
}
876
843
}
0 commit comments