Sage.Controllers.SageController.GetViewModel C# (CSharp) Method

GetViewModel() public method

Processes the view configuration associated with the specified viewInfo, and returns a ViewModel instance that contains the result.
public GetViewModel ( ViewInfo viewInfo ) : ViewModel
viewInfo Sage.Views.ViewInfo The object that contains information about the view.
return Sage.Views.ViewModel
        public virtual ViewModel GetViewModel(ViewInfo viewInfo)
        {
            try
            {
                var startTime = DateTime.Now.Ticks;
                ViewConfiguration config = ViewConfiguration.Create(this, viewInfo);
                var result = config.Process();

                var elapsed = new TimeSpan(DateTime.Now.Ticks - startTime);
                log.DebugFormat("Completed processing view {0} in {1}ms", viewInfo.Action, elapsed.Milliseconds);
                return result;
            }
            catch (Exception ex)
            {
                throw new SageHelpException(new ProblemInfo(ProblemType.ViewProcessingError), ex);
            }
        }

Same methods

SageController::GetViewModel ( string viewName ) : ViewModel