Creating Static fields across IEnumerable when using ASP.MVC

Creating Static fields across IEnumerable when using ASP.MVC

DuckieCodeDuckieCode Posts: 1Questions: 1Answers: 0

We are implementing the DataTables grid using IEnumerable<Model> in our ASP.MVC application. Which is working great. But when retrieving the data for our view there are fields not related to the grid. These fields that appear once in the view, i.e. parent details common across the whole IEnumerable<Model> collection. We don't want to load them multiple times in every model. Our solution was to load them into viewdata. We feel this is a pretty ugly solution. Is there a more simple solution that is obvious to you?

DuckieCode

This discussion has been closed.