Giter Club home page Giter Club logo

odata.net's Introduction

# OData .NET Libraries

Build Status
Rolling
Nightly

1. Introduction

The OData .NET Libraries (or OData .NET, for short) project includes the implementation of core functionalities of OData protocol on the .NET platform, including URI parsing, request and response reading and writing, Entity Data Model (EDM) building, and a .Net OData client which can be used to consume an OData service. It is a fully open sourced project maintained by Microsoft OData team. The libraries are used by the WebApi and RESTier libraries for building OData Services.

OData stands for the Open Data Protocol. It was initiated by Microsoft and is now an ISO ratified OASIS standard. OData enables the creation and consumption of REST APIs, which allow resources, identified using URLs and defined in a data model, to be published and edited by Web clients using simple HTTP requests.

For more information about OData, please refer to the following resources:

For how to adopt this and related libraries to build or consume OData service, please refer to the following resources:

2. Project structure

The project currently has a main branch and three archived branches: maintenance-6.x, maintenance-5.x, and maintenance-wcf-dataservice-v4.

main branch:

The main branch is the active development branch for ODataV4 7.x. It produces libraries targeting .NET 4.5 as well as .NET Standard 1.1 and 2.0. The branch builds with Visual Studio 2019.

For each profile above, it has the following libraries:

  • ODataLib (namespace Microsoft.OData.Core): The ODataLib contains classes to serialize and deserialize OData JSON payloads, and to parse OData Urls.
  • EdmLib (namespace Microsoft.OData.Edm): The EdmLib contains classes to represent, construct, parse, serialize and validate entity data models.
  • Microsoft.Spatial (namespace Microsoft.Spatial): The spatial library contains classes and methods that facilitate geography and geometry spatial operations.
  • OData Client for .NET (namespace Microsoft.OData.Client): The client library is built on top of ODataLib and EdmLib and provides LINQ-enabled client APIs for issuing OData queries and constructing and consuming OData JSON payloads.

For these libraries, we accept issue reports and welcome contributions through pull requests.

maintenance-6.x branch: (maintenance mode)

The maintenance-6.x branch includes the .NET libraries for ODataV4 6.x maintenance releases.

maintenance-5.x branch: (maintenance mode)

The maintenance-5.x branch includes the .NET libraries for OData V1-3 releases only. It has the similar libraries as the maintenance-6.x branch except for some differences in namespaces and two additional libraries:

  • ODataLib for OData v1-3 (namespace Microsoft.Data.Core): It contains classes to serialize, deserialize and validate OData payloads. Enables construction of OData producers and consumers.
  • EdmLib for OData v1-3 (namespace Microsoft.Data.Edm): It contains classes to represent, construct, parse, serialize and validate entity data models.
  • System.Spatial for OData v1-3 (namespace System.Spatial): It contains classes and methods that facilitate geography and geometry spatial operations.
  • WCF Data Services Client for OData v1-3 (namespace Microsoft.Data.Services.Client): It contains LINQ-enabled client API for issuing OData queries and consuming OData payloads.
  • WCF Data Services Server for OData v1-3 (namespace Microsoft.Data.Services): Fully-featured server API for responding to OData queries and consuming/producing OData payloads.
  • WCF Data Services EntityFramework Provider (namespace Microsoft.OData.EntityFrameworkProvider): Server API for responding to OData queries and consuming/producing OData payloads based on entity framework version 6.0 or higher.

These libraries are in maintenance mode. Only security bugs will be accepted. The release will be irregular depends on the bugs fixed.

maintenance-wcf-dataservice-v4 branch: (maintenance mode)

The maintenance-wcf-dataservice-v4 branch has the source code of the OData V4 parity of the WCF Data Services Server for OData v1-3. It is provide for demo purposes only; it has no binary release and does not accept contributions. WebApi or RESTier is recommended for building new OData Services.

3. Building, Testing, Debugging and Release

Since we are building this on VS2019 LocalDB v12.0 or above will be used which is part of VS2019 and no additional installation is needed. The Database will be automatically initialized by the test code if it doesn't exist.

Note: The project T4CrossPlatformTests.WindowsStore.csproj will not be loaded unless you have installed the Windows 8.1 and Windows Phone 8.0 / 8.1 tools.

3.1 Building and Testing in Visual Studio

Simply open the shortcut OData.sln at the root level folder to launch a solution that contains the product source and relevant unit tests. Should you see the need to modify or add additional tests, please see the sln folder for the whole set of solution files.

Here is the usage of each solution file (the OData.sln shortcut opens the one marked default):

  • OData.sln - Product source built with .Net Framework 4.5, .Net Standard 1.1 (except for OData Client ), .Net Standard 2.0. Unit Tests built with .Net Framework 4.5.2, .Net Core 1.1, .Net Core 2.1, .Net Core 3.1
  • OData.E2E.sln - Product source built with .Net Framework 4.5. Contains exhaustive list of tests (unit, E2E, and regression). The Build.cmd script will run all tests from here and this solution is used to fully test your code.

Each solution contains some test projects. Please open it, build it and run all the tests in the test explorer. For running tests within OData.E2E.sln you need to open Visual Studio IDE as Administrator so that the test services can be started properly.

3.2 One-click build and test script in command line

Open Command Line Window with "Run as administrator", cd to the root folder and run following command:

build.cmd

This will build the full product and run all tests. It will take about 60 minutes. Use the to ensure your change compiles and passes tests before submitting a pull request.

Optionally, you can run following command:

build.cmd quick

This will build a single set of product Dlls and run unit tests. It will take about 5 minutes. Use this for quickly testing a change.

Here are some other usages or build.cmd:

  • build.cmd or build.cmd Nightly - Build and run all nightly test suites.
  • build.cmd Quick or build.cmd -q - Build and run all unit test suites (with less legacy tests thus faster).
  • build.cmd EnableSkipStrongName - Configure strong name skip of OData libraries on your machine and build (no test run).
  • build.cmd DisableSkipStrongName - Disable strong name skip of OData libraries on your machine and build (no test run).

Notes: If your receive build error with message "build.ps1 cannot be loaded", right click "build.ps1" -> Properties -> "Unlock".

3.3 Debug

Please refer to the How to debug.

3.4 Nightly Builds

The nightly build process will upload NuGet packages for ODataLib (Core, Edm, Spatial, Client) to the MyGet.org odlnightly feed.

To connect to odlnightly feed, use this feed URL: odlnightly MyGet feed URL.

You can query the latest nightly NuGet packages using this query: MAGIC OData query

3.5 Official Release

The release of the component binaries is carried out regularly through Nuget. A new version is released every 2 months. A new milestone item will be created after each release. It will correspond to the work that is expected to be included in the next release. Any work that has been completed by the due date for the milestone will be shipped regardless of if the entire milestone is completed. Work that is not completed by the due date will be moved to another milestone.

Details on the release process are found here

3.6 Performance benchmarks

Installation

The easiest way to run the perf benchmarks is to use the Microsoft.Crank toolset.

  • Install the Crank controller, the CLI used to run benchmarks:

    dotnet tool install -g Microsoft.Crank.Controller --version "0.2.0-*"
    
  • Install the Crank agent, service that executes benchmark jobs. This should be installed on the server(s) where the benchmarks will run. Install locally if you intend to run benchmarks locally.

    dotnet tool install -g Microsoft.Crank.Agent --version "0.2.0-*" 
    
  • Verify installation was complete by running:

    crank
    

Start the agent

  • Start the agent by running the following command.:

    crank-agent
    

    Once the agent has started, you should see output like:

    Now listening on: http://[::]:5010
    ...
    Agent ready, waiting for jobs...
    

Run benchmarks locally

  • Run benchmarks for different components (reader, writer, batch, URI parser, etc.) using in-memory payloads:

    crank --config benchmarks.yml --scenario Components --profile local
    
  • Run only ODataReader tests:

    crank --config benchmarks.yml --scenario Reader --profile local
    
  • Run only ODataWriter tests:

    crank --config benchmarks.yml --scenario Writer --profile local
    
  • Run only UriParser tests:

    crank --config benchmarks.yml --scenario UriParser --profile local
    
  • Run tests that compare different writer implementations and configurations

    crank --config benchmarks.yml --scenario SerializationComparisons --profile local
    

Run benchmarks on remote dedicated agents

The local profile is provided for testing purposes, but it's not ideal for running benchmarks. For more stable results and results that we can more reliably compare, the following profiles are also available and should be preferred whenever possible:

Profile Machine Architecture OS
lab-windows INTEL, 12 Cores Windows Server 2016
lab-linux INTEL, 12 Cores Ubuntu 18.04, Kernel 4.x

Use the --profile argument to specify the profile you want to use. For example, to run the components benchmark on the Windows agent, run the following command:

crank --config benchmarks.yml --scenario Components --profile lab-windows

And to run on the Linux agent:

crank --config benchmarks.yml --scenario Components --profile lab-linux

PS: We should not use these machines to run automated scheduled benchmarks.

Run benchmarks against the official repo

To run benchmarks against the official repo instead of your local repo, pass the base=true variable to the command, e.g.:

crank --config benchmarks.yml --scenario ODataWriter --profile local --variable base=true

This will cause the crank agent to clone the official repo and run the tests against the main branch.

You can specify a different branch, commit or tag using the baseBranch variable:

crank --config benchmarks.yml --scenario ODataWriter --profile local --variable base=true --variable baseBranch=v7.6.4

Run load tests

Besides benchmarks, we also have some load tests which measure request round-trips from a client to a server. These can be used to evaluate how OData libraries behave when handling multiple concurrent requests on the same server.

We have tests that evaluate different writer implementations, serializing a simple static collection response on each request:

crank --config loadtests.yml --config lab-windows --scenario SerializationComparisons --application.options.counterProviders System.Runtime --variable writer=ODataMessageWriter

This scenario allows you to choose which writer implementation is used to process the response as well. It also allows you to configure different aspects of the requests, e.g. number of connections, max requests per second, etc.

For more information about these tests, read this doc.

Collecting traces

Crank can collect and download native trace files from the benchmarked application that you can analyze in specialized tools using the --[job].collect true option, where [job] is the name of a job defined in the .yml config file.

On Windows, --[job].collect true option will collect traces using PerfView download an .etl trace file that you can you can also analyze using PerfView.

For example, the loadtest.yml config defines an application job which refers to the server handling the requests. We can collect traces from the server as follows:

crank --config loadtests.yml --config lab-windows --scenario SerializationComparisons --variable writer=ODataMessageWriter --application.collect true

Comparing benchmarks

You can use the ResultsComparer tool to compare benchmark results.

Example:

cd tools/perf/ResultsComparer/src/ResultsComparer

dotnet run -- --base=BenchmarkBefore.json --diff=BenchmarkAfter.json --threshold 1%

Learn more about the benchmark results comparer here.

4. Documentation

Please visit the ODataLib docs on docs.microsoft.com. It has detailed descriptions on each feature provided by OData lib, how to use the OData .Net Client to consume OData service etc.

5. Community

5.1 Contribution

There are many ways for you to contribute to OData .NET. The easiest way is to participate in discussion of features and issues. You can also contribute by sending pull requests of features or bug fixes to us. Contribution to the documentations is also highly welcomed. Please refer to the CONTRIBUTING.md for more details.

5.2 Reporting Security Issues

Security issues and bugs should be reported privately, via email, to the Microsoft Security Response Center (MSRC) [email protected]. You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Further information, including the MSRC PGP key, can be found in the Security TechCenter. You can also find these instructions in this repo's SECURITY.md.

5.3 Support

Thank you

We’re using NDepend to analyze and increase code quality.

NDepend

Code of Conduct

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

odata.net's People

Contributors

alanwong-ms avatar biaol-odata avatar challenh avatar congysu avatar corranrogue9 avatar cxlove avatar dependabot[bot] avatar dingeins avatar elizabethokerio avatar gathogojr avatar habbes avatar jefwight avatar kanishmanuja-ms avatar karataliu avatar kenitoinc avatar kosinsky avatar laylaliu avatar lewischeng-ms avatar lianwms avatar lingxi-li avatar marabooy avatar mikepizzo avatar robward-ms avatar sreejithpin avatar tomdu avatar vikingsfan avatar voronov-maxim avatar xuzhg avatar ysanghi avatar zoe-ms avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

odata.net's Issues

IEdmEntityContainer does not expose <EntityContainer>'s Extends attribute

When parsing an EDMX we get back an IEdmEntityContainer for the entity container.
However, the interface does not expose the Extends attribute, even thou the underlying CsdlSemanticsEntityContainer has the property available.

Ideally, IEdmEntityContainer would expose the base container as another IEdmEntityContainer, not just a string.

Web API OData: Support heterogeneous navigations (i.e. NavigationPropertyBinding is optional in CSDL spec)

(Moved across from https://aspnetwebstack.codeplex.com/workitem/2095)

Similar to #1884 (the issue asking for returning non set or even abstract entity types from Function), I would benefit from allowing types of non set, abstract, or even contained entity set types be returned from a given navigation.

This would allow having an abstract relationship that could then be identified to concrete set type upon response by the included data context and type fields as required. At the moment the only way to really return a relationship to something is to either:

a) Force all return types of given navigation to have same key scheme and be homed in one entity set from common base (that has the key defined) or

b) Workaround by having multiple navigations for same relationship to various possible set types and then provide meta property to indicate which one should be populated (to avoid client checking all of them to find the relationship);

c) assuming issue #1884 was fixed, then perhaps a bound function to abstract type (but this is not possible now either as formatter can't deduce from type not associated to entity set)

To support this we need a way to have navigation properties in the model that allow not having a navigationPropertyBinding (this is an optional element). Then we need a way to ensure formatter can deduce the set of type being returned (particularly if want to support contained set type, then this would be trickier than via RTTI)

Without support for this and issue #1884 we cannot get the the full benefit of abstract = true types that do not require key and corresponding set to be identified at design time from access point (function or navigation):

http://docs.oasis-open.org/odata/odata/v4.0/os/part3-csdl/odata-v4.0-os-part3-csdl.html#_Toc372793991

13.4 Element edm:NavigationPropertyBinding

If omitted, clients MUST assume that the target entity set or singleton can vary per related entity.

Cannot mark ComplexType as abstract

6.7

When I try to parse and validate a 4.0 schema that contains an abstract ComplexType I get the following validation error: The complex type 'SampleSchema.C1' is marked as abstract. Abstract complex types are only supported in version 1.1 EDM models.

[OData-Part3] section 9.1.3, Complex Type Attribute Abstract states that:

"A complex type MAY indicate that it cannot be instantiated by providing a Boolean value of true to the Abstract attribute."

Expected: validation must accept abstract complex types as valid.

Example:

<?xml version="1.0" encoding="utf-8" ?>
<edmx:Edmx Version="4.0" xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx">
  <edmx:DataServices>
    <Schema xmlns="http://docs.oasis-open.org/odata/ns/edm" Namespace="SampleSchema" Alias="Self">

      <ComplexType Name="C1" Abstract="true">
      </ComplexType>
      <ComplexType Name="D1" BaseType="SampleSchema.C1">
      </ComplexType>

    </Schema>
  </edmx:DataServices>
</edmx:Edmx>

Support hex values in enum member values when parsing an EDM file.

Hello,

It looks like ODATAv4 does not support specifying values of enum members as hex values.
For flag-enums, being able to specify them using hex is usually more intuitive,

For example:

<Member Name="All" Value="0xFFFFFFFF" />

Instead of:

<Member Name="All" Value="4294967295" /> 

Reading odata-abnf-construction-rules.txt I see these rules, indicating that hex values are not permitted:

enumMemberValue = int64Value
int64Value = [ sign ] 1*19DIGIT ; numbers in the range from -9223372036854775808 to 9223372036854775807

Looking further at the implementation of the EdmValueParser.TryParseLong, we land in XmlConvert.ToInt64 which, consistent with the rule above, does not parse hex values.

Any plans to support hex values in the future?

Make API versioning support easy in client

There are three major types of API versioning recommendations in use today:

  1. Path, e.g. .../api/1.0/Customers
  2. QueryString, e.g., .../api/Customers?api-version=1.0
  3. Header, e.g., x-api-version: 1.0

The .NET client should allow enable a single place to assign a string representation of the API version that should be used, and enable the three strategies mentioned above. Possible client API:

 context.UseQueryStringApiVersioning("api-version", "1.0");
 context.UseHeaderApiVersioning("x-api-version", "1.0");
 context.UsePathApiVersioning("1.0"); // This may not be necessary since this versioning strategy yields different endpoints.

ODL should support property and dynamic property template.

So far, ODL supports key and function parameter template. for example:

~/Customers({key}}/Default.MyFunction(p1={p1})

However, ODL should support property and dynamic property template, for example:

~/Customers({key})/{property}
~/Customers({key})/{dynamicProperty}

Client do not materialize the derived complex value to correct type.

With following payload, the HomeAddress is serialized into "Address" type, instead of "HomeAddress" type.

{
"@odata.context": "http://bixu-odata-3:9090/OperationService635520379911784964/$metadata#Customers",
"value": [
{
"@odata.id": "http://bixu-odata-3:9090/OperationService635520379911784964/Customers(1)",
"@odata.editLink": "http://bixu-odata-3:9090/OperationService635520379911784964/Customers(1)",
"ID": 1,
"FirstName": "Bob",
"LastName": "Cat",
"Address": {
"@odata.type": "#Microsoft.Test.OData.Services.ODataOperationService.HomeAddress",
"Street": "1 Microsoft Way",
"City": "Tokyo",
"PostalCode": "98052",
"FamilyName": "Cats"
},
"Emails": [
"[email protected]"
],
"Level": "Common"
}
]
}

T4 cannot correctly generate code when EntityType name and one of their property name are same

Model:

<?xml version="1.0" encoding="utf-8"?>
<edmx:Edmx Version="4.0" xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx">
  <edmx:DataServices>
    <Schema Namespace="NS" xmlns="http://docs.oasis-open.org/odata/ns/edm">
      <ComplexType Name="Name">
        <Property Name="Name" Type="Edm.String" Nullable="true" />
      </ComplexType>
    </Schema>
  </edmx:DataServices>
</edmx:Edmx>

The generated file is like

public partial class Name : global::System.ComponentModel.INotifyPropertyChanged
    {
        /// <summary>
        /// There are no comments for Property Name in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        public string Name
        {
            get
            {
                return this._Name;
            }
            set
            {
                this.OnNameChanging(value);
                this._Name = value;
                this.OnNameChanged();
                this.OnPropertyChanged("Name");
            }
        }
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        private string _Name;

It will report Error : 'Name': member names cannot be the same as their enclosing type

Handling of preference header 'continue-on-error' in user request by Web Api

We are getting problems with preference header “continue-on-error” in batch handling. As per OData specs, “if this is not specified, then upon encountering an error the service MUST return the error within the batch and stop processing additional requests within the batch”. But we have observed that this is not happening by default.

The WebAPI’s DefaultODataBatchHandler class returns the request collection after parsing, but if we look into individual request then we find that these headers are missing. We could only see it on the top level http request messages’ header, but not on individual batch request item’s header. As of now we have overloaded this class and manually handling this scenario.

MicrosoftOData.Client - Allowance of container.Execute(requestUri, “DELETE”)

Within our service we would like to improve the efficiency of deleting an entity that, in addition to it's canonical entity set home, can be accessed by a singleton navigation elsewhere for the scenario where the client does not know (or need to know) the actual Key/s of the entity and hence can't delete it from it's canonical home, but does know the key of the entity that has the singleton navigation to it. In other words we want to delete via the navigation path instead of retrieving it just to determine it's key/s so can then delete from canonical home.

We have no trouble creating the URI with the OData.Client library via a linq expression for the singleton nav ...container.OtherEntities.Where(oe => oe.Id == "blah").Select(oe => oe.TheSingleNavigation) as DataServiceQuery).RequestUri...

But we can't easily send the URI as "container.Execute(requestUri, "DELETE") is explicitly blocked (restricts the verb to not be DELETE).

Can we remove this restriction in the OData.Client ?

TripPin - InternalServerError when trying to sort People/Trips/PlanItems

When trying to sort by some of the properties in the People/Trips/PlanItems collection (for example ConfirmationCode, StartsAt, EndsAt, or Duration), it returns an InternalServerError:

http://services.odata.org/V4/TripPinService/People('russellwhyte')/Trips(0)/PlanItems?$orderby=ConfirmationCode%20asc

{
• error: {
• code: "InternalServerError",
• message: "GenericArguments[0], 'System.String', on 'System.Nullable1[T]' violates the constraint of type 'T'.", • innererror: { • message: "GenericArguments[0], 'System.String', on 'System.Nullable1[T]' violates the constraint of type 'T'.",
• type: "System.ArgumentException",
• stacktrace:
" at System.RuntimeType.ValidateGenericArguments(MemberInfo definition, RuntimeType[] genericArguments, Exception e)
at System.RuntimeType.MakeGenericType(Type[] instantiation)
at Microsoft.Test.OData.Services.ODataWCFService.QueryOptionExtensions.ApplyOrderBy(Expression rootExpression, Type entityInstanceType, ODataUriParser uriParser, OrderByClause orderByClause)
at Microsoft.Test.OData.Services.ODataWCFService.QueryContext.ResolveQuery(IODataDataSource dataSource, Int32 level)
at Microsoft.Test.OData.Services.ODataWCFService.Handlers.QueryHandler.Process(IODataRequestMessage requestMessage, IODataResponseMessage responseMessage)
at Microsoft.Test.OData.Services.ODataWCFService.Handlers.RequestHandler.Process(Stream requestStream)
at Microsoft.Test.OData.Services.ODataWCFService.Handlers.RootRequestHandler.Process(Stream requestStream)"
,
• internalexception: {
• message: "GenericArguments[0], 'System.String', on 'System.Nullable`1[T]' violates the constraint of type parameter 'T'.",
• type: "System.TypeLoadException",
• stacktrace:
" at System.RuntimeTypeHandle.Instantiate(RuntimeTypeHandle handle, IntPtr* pInst, Int32 numGenericArgs, ObjectHandleOnStack type)
at System.RuntimeTypeHandle.Instantiate(Type[] inst)
at System.RuntimeType.MakeGenericType(Type[] instantiation)"

}
}
}
}

Issues about EdmLib/ODataLib annotation Support

1. Support Annotation for Schema
2. Support defaultvalue of term
3. EdmLib should support 
    ○ dynamic conditional expression "Comparison and Logical Operators"
    ○ NavigationPropertyPath
    ○ PropertyPath
    ○ AnnotationPath
4.Add Terms for Capabilities/Measure/Core
5.EdmLib doesn't report error When external targeting annotation and embedded annotation use same termName and qualifier.
5. ODataLib doesn't support instanceannotation when query a primtive/collection/enum property 
6. ODataLib doesn't support write instanceannotation on expandedFeed.
7. ODataLib doesn't support metadata annotation of external targeting on Function or on properties and navigation properties of singletons or entities in a particular entity set.
<Annotations Target=""OperationTestService.FunctionBoundToCollectionOfEntity"" Qualifier=""Q1"">
     ...
</Annotations>
MySchema.MyEnumType/MyMember
MySchema.MyEntityContainer/MyEntitySet/MyProperty
MySchema.MyEntityContainer/MyEntitySet/MyNavigationProperty
MySchema.MyEntityContainer/MyEntitySet/MySchema.MyEntityType/MyProperty
MySchema.MyEntityContainer/MyEntitySet/MySchema.MyEntityType/MyNavProperty
MySchema.MyEntityContainer/MyEntitySet/MyComplexProperty/MyProperty
MySchema.MyEntityContainer/MyEntitySet/MyComplexProperty/MyNavigationProperty
MySchema.MyEntityContainer/MySingleton/MyComplexProperty/MyNavigationProperty

Capabilities Vocabulary loaded in all EDM Models looks out of date / incomplete

Description

There is a version of the OData.OData.Capabilities.V1 vocabulary hosted on Oasis which seems mostly complete: https://tools.oasis-open.org/version-control/browse/wsvn/odata/trunk/spec/vocabularies/Org.OData.Capabilities.V1.xml

The version used internally seems to be much smaller and incomplete.
https://github.com/OData/odata.net/blob/master/src/Edm/Microsoft/OData/Edm/Vocabularies/CapabilitiesVocabularies.xml#L7

Is there a standard capabilities vocabulary hosted somewhere? Which version should be loaded by EDM implicitly? In the status quo, the latter vocabulary is loaded, but this doesn't seem correct.

Minimal repro steps

  1. Instantiate a EDMModel
  2. Attempt to add InsertRestriction annotation to the model

Expected result

InsertRestriction can be added without loading additional vocabularies since capabilities are already implicitly referenced in all EDMModels

Actual result

Must explicitly load a copy of the capabilities vocabulary that is more complete. Preferably one similar in completeness to https://tools.oasis-open.org/version-control/browse/wsvn/odata/trunk/spec/vocabularies/Org.OData.Capabilities.V1.xml

Serialization issue while using function bound to an entityset which returns different entityset that is not associated with bounded entityset

We have two entities say Entity1 and Entity2 and these doesn't have any relationship between them. A function that is bound to Collection and it returns the Collection is giving serialization error as below.
"The related entity set could not be found from the OData path. The related entity set is required to serialize the payload."

As per investigation found that the NavigationSource property is set null in ODataPath in this scenario due to which we are getting the error.

Is there any workaround available for this issue?

EdmError/EdmLocation does not provide file name

When parsing an EDMX file using EdmxReader we can get a list of EdmError.
The CsdlLocation in these error objects do not have the name of the file where the error originated, although they contain line/column information.

This is not a problem for standalone files, but if the model references other models, it is hard to pinpoint which file contains the error.

Expected: for CsdlLocation to contain file name, in addition to line/column numbers.

Remove unused error message

To Remove:
ODataMessageReader_EntityReferenceLinksInRequestNotAllowed // It is not used any more.

To Modify:
Context_ExecuteExpectsGetOrPost // Now delete is also supported.

Support custom payload format

ODataLib used to supports JSON format for payload only,, we can allow read or write payloads with custom format.

• Support resolving custom media types for request and response messages
• Support reading and writing following kinds of payload in custom payload format:
o Feed
o Entry
o Property
o Collection
o Parameter
o Error

Tests appear to be missing from odata.net?

Description

Tests, such as unit tests, are an important part of the development process. It's hard to imagine how a contributor could safely contribute to this project without automated tests to run for validation.

Minimal repro steps

  1. git clone https://github.com/OData/odata.net.git
  2. Browse cloned code and look for tests to read
  3. Attempt to run tests in visual studio

Expected result

Open source code bases should include both product code and relevant test code.

Actual result

odata.net does not contain any test code.

actions to return entity with expanded navigation links

please consider the following scenarion

public class Parent
{
    int TotalKPI;
    ICollection<Child> Children;
}

public class Child
{
    int KPI;
}

action does some complex business processing (which is not possible to do on client) that results in creating or updating parent and related children. how to return created/updated parent with all related chidren? now I can either return parent with empty .Children or collection of children

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.