asp.net mvc - Is there a performance sacrifice when calling a C# helper from razor? -


if (from razor view), call c# helper (i.e compiled dll). there performance loss here?

e.g

i use @model.user.getfriendlyname(); (calls method in model inside dll).

or pass friendlyname razor view, (storing in viewmodel initially).

is there speed difference between these 2 methodologies?

calling user.getfriendlyname() isn't slower in view anywhere else. razor views compiled classes behind scenes.

one thing keep in mind if method gets database cause queries , if using orm lazy loading context/session lost then.


Comments

Popular posts from this blog

javascript - Unusual behaviour when drawing lots of images onto a large canvas -

how can i manage url using .htaccess in php? -

javascript - Chart.js - setting tooltip z-index -