Open chunyu3 opened 1 year ago
Root cause: when create parameter, it will change the type of parameter from enum type to the type of enumValueType(e.g. string), model => {object}. https://github.com/Azure/autorest.csharp/blob/787427f570ab913fd4c0eb642f417fba892e2d55/src/AutoRest.CSharp/LowLevel/Output/OperationMethodChainBuilder.cs#L359
When _fields.GetFieldByParameter(parameter)
to get client Field, it will fail to get one, return null Which cause exception.
Reassign the PR as there is already a fix for it.
When the type of client parameter is enum or model, authorest.csharp throw exception.
e.g. When define apiVersion as an enum APIVersion
exception occur:![image](https://user-images.githubusercontent.com/10458143/203737392-1f5777dc-191a-453f-bc54-9da2bcc9b7f0.png)