Aqueduct.FrontEnd.Site.ModelProvider.GetModel C# (CSharp) Method

GetModel() public method

public GetModel ( string viewName ) : dynamic
viewName string
return dynamic
        public dynamic GetModel(string viewName)
        {
            string modelPath = Path.Combine(_rootPathProvider.GetRootPath(), _settings.ModelsPath, viewName + ".js");

            if (File.Exists(modelPath) == false)
                return null;

            var bodyStream = new StreamReader(modelPath);
            try
            {
                var json = bodyStream.ReadToEnd();
                return JsonHelpers.ParseJsonObject(json);
            }
            catch (Exception ex)
            {
                throw new ApplicationException("Error while parsing global model", ex);
            }
            finally
            {
                if (bodyStream != null)
                    bodyStream.Dispose();
            }
        }