Skip to content

Optional Paramaters #116

@rscole

Description

@rscole

I have created a method on an ApiController with optional parameters:

Public void getInformation(int? id1 = null, int? id2 = null){
}

When generating the proxy code, the method in WebApiProxy.generated.cs is:

Void getInformation(Nullable<Int32> id1, Nullable<int32>id2);

I would like to call this method with any of the following:

getInformation(1,2);
getInformation(1);
getInformation();

Currently I have to call this method with nulls for it to work:

getInformation(1,null);
getInformation(null,null);

Is there something I can do or can be changed so I can call this method without passing it null values?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions