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

GetGlobalModel() public method

public GetGlobalModel ( ) : dynamic
return dynamic
        public dynamic GetGlobalModel()
        {
            string globalModelPath = Path.Combine(_rootPathProvider.GetRootPath(), _settings.ModelsPath, Conventions.GlobalModelFile);

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

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