0

I have a stored procedure that returns two tables this two tables I store them in two lists example: List<SpObject1> ob1 and List<SpObject2> ob2.

What is the best way to return this data from model to view ? I can create another class(tuple) that can store 2 lists and return them to controller but will this be problem to display on view like this and is it good solution ?

Salah Akbari
  • 39,330
  • 10
  • 79
  • 109
xMilos
  • 1,519
  • 4
  • 21
  • 36

1 Answers1

1

You should always try and use ViewModels when returning any data to a view.

Modeling and validating a form with multiple submit

is a good example.

In your controller you will just pass your Lists to that view model and then use the viewModel as a @model.

Budyn
  • 563
  • 7
  • 21