Skip to content

Fix OData methods with OData primitive return type #300

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

Merged
merged 9 commits into from
Oct 6, 2020

Conversation

MIchaelMainer
Copy link
Contributor

@MIchaelMainer MIchaelMainer commented Sep 25, 2020

Summary

ODate primitives method return types are returned in an object.
We weren't handling the object which resulted in serialization
exceptions.

modified:   Templates/CSharp/Base/SharedCSharp.template.tt
modified:   Templates/CSharp/Requests/MethodRequest.cs.tt

Generated code differences

microsoftgraph/msgraph-beta-sdk-dotnet#160
microsoftgraph/msgraph-sdk-dotnet#800

Command line arguments to run these changes

# Run against the current typewriter dev branch 
-v Info -m https://raw.githubusercontent.com/microsoftgraph/msgraph-metadata/master/clean_beta_metadata/cleanMetadataWithDescriptionsbeta.xml -o dotnetbeta_old -l CSharp -g Files -e beta

# Run against this typewriter branch 
-v Info -m https://raw.githubusercontent.com/microsoftgraph/msgraph-metadata/master/clean_beta_metadata/cleanMetadataWithDescriptionsbeta.xml -o dotnetbeta_new -l CSharp -g Files -e beta

Links to issues or work items this PR addresses

The generated changes are supported by these changes: microsoftgraph/msgraph-sdk-dotnet-core#135

ODate primitives method return types are returned in an object.
We weren't handling the object which resulted in serialization
exceptions.

	modified:   Templates/CSharp/Base/SharedCSharp.template.tt
	modified:   Templates/CSharp/Requests/MethodRequest.cs.tt
zengin
zengin previously approved these changes Sep 25, 2020
zengin
zengin previously approved these changes Sep 30, 2020
zengin
zengin previously approved these changes Oct 6, 2020
// GetMethodRequestPrimitiveReturnTypeString() in SharedCSharp.
var tempReturnType = GetMethodRequestPrimitiveReturnTypeString(returnEntityType);

// These magic strings represent types in M.G.C. If the return
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: What it represents is clear from the context, but having it full string may help in a future search for this comment.

Suggested change
// These magic strings represent types in M.G.C. If the return
// These magic strings represent types in Microsoft.Graph.Core. If the return

nikithauc
nikithauc previously approved these changes Oct 6, 2020
@MIchaelMainer MIchaelMainer dismissed stale reviews from nikithauc and zengin via af8a21f October 6, 2020 06:16
@MIchaelMainer MIchaelMainer merged commit 3219c92 into dev Oct 6, 2020
MIchaelMainer added a commit that referenced this pull request Oct 6, 2020
ODate primitives method return types are returned in an object.
We weren't handling the object which resulted in serialization
exceptions.

	modified:   Templates/CSharp/Base/SharedCSharp.template.tt
	modified:   Templates/CSharp/Requests/MethodRequest.cs.tt
        modified:   Templates/CSharp/Requests/IMethodRequest.cs.tt
@MIchaelMainer MIchaelMainer deleted the fix/methodWithODataPrimitiveReturnValue branch October 6, 2020 06:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants