2

I have 3 parameters that I am passing to WebMethod but I don't want them to pass as separate 3 parameters. Then I know solution is to pass object but that object must have structure in C#. Is there any other way so that I don't need to build a class and pass parameters in anonymous one? like var or dynamic?

6
  • Please check this stackoverflow.com/questions/18078957/… Commented Sep 14, 2015 at 6:11
  • @KaushikMaheta thanks for the comment. I know it is the way but here I have to define structure of class, I am finding the way to pass ANONYMOUS one. :) Commented Sep 14, 2015 at 6:13
  • What's wrong in defining a class? As far as I know you can't use var here. You can use an string array though depending upon the type of data you want to send. Commented Sep 14, 2015 at 6:23
  • Nothing wrong, I did that indeed. Just wanted to know alternative to reduce typing efforts ;) Commented Sep 14, 2015 at 6:30
  • you can use the word dynamic and send the object without class structure Commented Sep 14, 2015 at 6:34

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.