Skip to content

Wrong method signature generated when using nullable enum as parameter type #23

@querbyte

Description

@querbyte

Example:

[CreateAngular2TsProxy(ReturnType = typeof(List<Foo>))]
public ActionResult Get(int id, MyEnum enumValue)
{
	//...
}

generates

public get(id: number, enumValue: MyEnum) : Observable<Foo[]> { 
	return this.http.post('api/Foo/Get'+ '?id='+id,enumValue) as Observable<Foo[]>;
}

The generated method does not work as expected and handle the enum value as a complex type and send the value in the body of the post request. So on the server side you never receive a valid value for the enum, it is always null.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions