ODataConnectedService
ODataConnectedService copied to clipboard
Parsing for the xml file name can result in exception with multiple services
Describe the bug
If you have multiple services in your project this here can lead to a linq enumeration exception. (same goes for the ttinclude as well of course)
This should not be done via EndsWith
but comparing the full filename.
Version of the Project affected
ODataConnectedService latest VisualStudio Version v17.10.4 Microsoft.Odata.Client v7.21.3
To Reproduce
Steps to reproduce the behavior:
- Install a odata service, name it "OData Service"
- Install another odata service and name it "My secondary OData Service" into the same assembly
- make some boilerplate code to initialize and connect to the first service
- Run
- See error
Expected behavior
Expected behavior: Both services should be found, no exception should be thrown.
Actual behavior
Since both services end with "OData Service", the line mentioned above results in finding the xml for BOTH services. So the comparison should not be done via EndsWith, it should check the whole file name, not just a part of it.
Additional context
Exception thrown:
System.InvalidOperationException: 'Sequence contains more than one matching element'