-
Notifications
You must be signed in to change notification settings - Fork 353
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Task #1778 : Containment support to webapi.odata
1. Able to build an Edm model has a contained navigation property, using convention model builder Add a [Contained] attribute to mark a navigation property as containment. 2. Able to build a model has a contained navigation property, using model builder EntityTypeConfiguration<T>: ContainsMany, ContainsRequired, ContainsOptional These, and existing HasMany etc. can be used to override convention model builder. 3. Able to build a model with a base type has a contained navigation property, and the navigation property is inherited by a derived type, using model builder and convention model builder. 4. Able to route for fundamental scenarios ../MyOrders(orderId)/OrdersLines ../MyOrders(orderId)/OrdersLines(lineId) 5. Able to serialize / des-serialize containment 6. Containment in expand 7. Calculate links via ODL In derived scenario, when generate ID link (should be a Uri as per spec, instead of string,) we should not append type cast at the end. Previously, when webapi.odata generates an Id link, it will check if a derived type has a nav prop, if yes, it will append a type cast (even if the actual type is the same to the request one.) After we leverage ODL for edit link generation, the edit link will be: ./service_root/es(key)/cast/cast As per v4 spec, the editlink/readlink does include the type-cast; however, according to convention the Id does NOT include the type-cast: 8. Fix test cases about editLink 9. Verify containment after composable function / action
- Loading branch information
Showing
59 changed files
with
1,306 additions
and
161 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. | ||
|
||
namespace System.Web.OData.Builder | ||
{ | ||
/// <summary> | ||
/// Mark a navigation property as containment. | ||
/// </summary> | ||
[AttributeUsage(AttributeTargets.Property)] | ||
public sealed class ContainedAttribute : Attribute | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.