コード例 #1
0
 public CommonOptions Value()
 => new CommonOptions
 {
     Assembly         = Assembly.Value(),
     StartupAssembly  = StartupAssembly.Value(),
     DataDirectory    = DataDirectory.Value(),
     ProjectDirectory = ProjectDirectory.Value(),
     ContentRootPath  = ContentRootPath.Value(),
     RootNamespace    = RootNamespace.Value()
 };
コード例 #2
0
        public IDictionary <string, object> ToJson()
        {
            Dictionary <string, object> dictionary = new Dictionary <string, object>();

            dictionary.Add(nameof(EnvironmentName), EnvironmentName);

            // Windows supports forward slashes to easy copy paste and check the path
            dictionary.Add(nameof(ContentRootPath), ContentRootPath.Replace("\\", "/"));
            dictionary.Add(nameof(WebRootPath), WebRootPath.Replace("\\", "/"));
            dictionary.Add(nameof(ApplicationBasePath), ApplicationBasePath.Replace("\\", "/"));
            dictionary.Add(nameof(AppDirectory), AppDirectory.Replace("\\", "/"));
            dictionary.Add(nameof(DatabasePath), DatabasePath.Replace("\\", "/"));
            dictionary.Add(nameof(MainAppDirectoryWebRoot), MainAppDirectoryWebRoot.Replace("\\", "/"));
            dictionary.Add(nameof(ExecutionPath), ExecutionPath.Replace("\\", "/"));
            dictionary.Add(nameof(Version), Version);
            dictionary.Add(nameof(AssemblyPath), AssemblyPath.Replace("\\", "/"));
            dictionary.Add(nameof(ContextDateTime), ContextDateTime);
            dictionary.Add(nameof(ComponentDefinition.ComponentId), ComponentInfo?.ComponentId);

            return(dictionary);
        }