-
Notifications
You must be signed in to change notification settings - Fork 221
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
Incompatible .net Standard output #3829
Comments
Hi @scottlocknet, |
Not sure if I know how to ref a spot in code. I see in the Kiota/src/Kiota.Builder/Writers/CSharp/CSharpConventionService.cs on line 99, it has -> nullCheck = $"if ({identName} is not null) "; That appears to be the piece that is producing the code that doesn't run with C# 7.3 (standard). Code that was generated looked like this: public class UsersWithUserIDRequestBuilder : BaseRequestBuilder {
/// <summary>
/// Instantiates a new UsersWithUserIDRequestBuilder and sets the default values.
/// </summary>
/// <param name="pathParameters">Path parameters for the request</param>
/// <param name="requestAdapter">The request adapter to use to execute the requests.</param>
/// <param name="userID">The unique identifier of User</param>
public UsersWithUserIDRequestBuilder(Dictionary<string, object> pathParameters, IRequestAdapter requestAdapter, int? userID = default) : base(requestAdapter, "{+baseurl}/odata/AttDepartments({id})/users({userID}){?%24select,%24expand}", pathParameters) {
if (userID is not null) PathParameters.Add("userID", userID); /// * problem here with .net standard 2.0
} Thanks for the response. I love this tooling and it has saved us (me lol) many hours! |
Thanks for providing the details. Since you've identified the source of the issue in the code, would you mind submitting a pull request to address it please? |
Sorry, I'm unable to get a push to work (getting 403) to submit the PR. I haven't pushed to a public repo, so I must be missing something about security (token or otherwise). |
you should
Let us know if you have further questions. |
Producing incompatible is not null check
I've run into an issue with the c# code generated. It appears the writer is using c# 9 syntax for checking nulls. In the request builder, it does a 'if (id is not null)...' instead of a compatible 'if (id != null)...'.
The text was updated successfully, but these errors were encountered: