2

We are currently devloping a ASP MVC Webapplication. In this Webapplication, we have a User that can have 1 or many contracts.

We currently have 2 controller:

  • UserController
  • ContractController

Now we want to display all Contracts for a User. Which of the above Controllers should contain the Action to List all Contracts for a User?

Further: Where to place the actions if one actions only displays the empty form, and the other action delivers the contracts via Json.

1

If you're calling the controller from the User screen, use the UserController. If you're calling the controller from the Contracts screen, use the Contracts controller. And if you're displaying a list of contracts in both places, use both controllers.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.