0

I am new to Web API and I have a Class Library I would like other applications to access via an ASP.NET Web API site.

The problem I have is that I do not know how to call methods that have multiple input objects some of which are custom entities (they all have several variables inside them and come from the Class Library which I don't have access to change).

Here is an example of one of the methods my API Controller

public bool Process(IBusinessObject businessObject, BusinessValidationObject businessValidationObject, IList<string> messages)
    {
        //Code to call Class Library is here that requires the 3 inputs
    }

Is the above bit of code a valid API method?

I would like to call that method from another ASP.NET Web Application (an MVC application in another solution which will be installed on another server). I have had a look at the Web API Client Libraries but I can't see a way to pass in multiple objects.

Anyone have any ideas?

1 Answer 1

3

You can only post one complex object.

A solution might be to create an object that contains all three of the objects that you are trying to pass.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks. I had a feeling that was the case. I think I may just do as you suggested and put all 3 items into a single item.

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.