Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add function support (part 1) #424

Merged
merged 2 commits into from Jun 15, 2016
Merged

Conversation

@chinadragon0515
Copy link
Contributor

@chinadragon0515 chinadragon0515 commented Jun 6, 2016

Issues

*This pull request fixes issue #378

Description

User does not need additional controller for operation route.

Checklist (Uncheck if it is not completed)

  • [ x ] Test cases added
  • [ x ] Build and test with one-click build and test script passed

Additional work necessary

Will need to update document

{
internal static object ConvertValue(object oDataValue, Type expectedReturnType, ref IEdmTypeReference propertyType, ApiBase api)
{
var model = api.GetModelAsync().Result;
Copy link
Contributor

@rayao rayao Jun 6, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is dangerous, for a truly async model pipeline this could hang forever.

Loading

Copy link
Contributor Author

@chinadragon0515 chinadragon0515 Jun 6, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I change these method to async and use await, this should avoid deadlock, let me know if you have other suggestions on this part. I am new to c# :)

Loading

MethodInfo method = Api.GetType().GetMethod(segment.Function.Name, BindingFlags.Public | BindingFlags.Instance | BindingFlags.FlattenHierarchy);
var parameterArray = method.GetParameters();

var model = Api.GetModelAsync(cancellationToken).Result;
Copy link
Contributor

@rayao rayao Jun 8, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

await

Loading

@chinadragon0515 chinadragon0515 force-pushed the operation branch 4 times, most recently from bd04fe0 to 9a65c98 Jun 14, 2016
@@ -42,6 +42,7 @@ public RestierQueryBuilder(ApiBase api, ODataPath path)
this.handlers[ODataSegmentKinds.EntitySet] = this.HandleEntitySetPathSegment;
this.handlers[ODataSegmentKinds.Singleton] = this.HandleSingletonPathSegment;
this.handlers[ODataSegmentKinds.UnboundFunction] = this.HandleUnboundFunctionPathSegment;
this.handlers[ODataSegmentKinds.Function] = this.HandleBoundFunctionPathSegment;
Copy link
Contributor

@lewischeng-ms lewischeng-ms Jun 14, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better add a static readonly action in this class probably called NoOpHandler whose body contains nothing and set it to both bound and unbound function handlers to make the code less and clear.

Loading

Copy link
Contributor Author

@chinadragon0515 chinadragon0515 Jun 15, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants