Skip to content
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

Service Method Input Parameter of Type int Throws Exception #313

Open
AYColumbia opened this issue Oct 30, 2023 · 0 comments
Open

Service Method Input Parameter of Type int Throws Exception #313

AYColumbia opened this issue Oct 30, 2023 · 0 comments

Comments

@AYColumbia
Copy link

I added a new service with a method that takes an int input parameter and the call kept failing with the exception below.

Error obtaining client-helper 'UnaryTaskAsync' (from: 'System.Int32', to: 'System.Collections.Generic.IEnumerable´1[[Project.DataLayer.Application.Models.WebARMenu, Project.DataLayer.Application, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]'): GenericArguments[0], 'System.Int32', on 'System.Threading.Tasks.Task´1[TResponse] UnaryTaskAsync[TRequest,TResponse](ProtoBuf.Grpc.CallContext ByRef, Grpc.Core.CallInvoker, Grpc.Core.Method´2[TRequest,TResponse], TRequest, System.String)' violates the constraint of type 'TRequest'.

I was able to get around it by creating a data contract with the int parameter as a property and update my service method to take the data contract object as the input.

I have seen some stackoverflow posts on this now that go back to 2020 and mention adding support for int input param types. It's now 2023 and am wondering if this is going to happen any time soon? Thanks.

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

No branches or pull requests

1 participant