asp.net mvc - Html.RenderAction performance? -
I can do multiple renderings on my point of view, but one thing to consider is that in this case the render action returns. For example, I have many modules and I would like to render it on the scene, there are two ways to do this:
- In the controller to call the query, which is too long, here we are Async
- In the view, call the renderer, each presentation will be called by the query
Can you tell which is better and which Is a fast?
Thanks
There are no general answers here. On the basis of the case you should be made a case of this decision. Personally, I tend to make as much a single query as possible as it reduces the goaltries to the database. But if your query contains cartesian products, then you are generally better at sharing in many questions (render action approach).
You also have to consider that more reusable actions are generated from the renderation point of view, if reusable is necessary then you can also select render action, when it is not optimal displayable .
A mixed approach will be doing future inquiries. Supports NHibernate, which can be used to run many questions in a round trap transparently. It is said, it has not been left AFAIK yet, but you can apply this concept independently of NHibernate.
Comments
Post a Comment