diff --git a/Oqtane.Client/Modules/Admin/ModuleCreator/Module.cs b/Oqtane.Client/Modules/Admin/ModuleCreator/Module.cs index 0760879b..c57bf1a9 100644 --- a/Oqtane.Client/Modules/Admin/ModuleCreator/Module.cs +++ b/Oqtane.Client/Modules/Admin/ModuleCreator/Module.cs @@ -1,22 +1,15 @@ -using System.Collections.Generic; +using Oqtane.Models; namespace Oqtane.Modules.Admin.ModuleCreator { public class Module : IModule { - public Dictionary Properties + public ModuleDefinition ModuleDefinition => new ModuleDefinition { - get - { - Dictionary properties = new Dictionary - { - { "Name", "Module Creator" }, - { "Description", "Enables software developers to quickly create modules by automating many of the initial module creation tasks" }, - { "Version", "1.0.0" }, - { "Categories", "Developer" } - }; - return properties; - } - } + Name = "Module Creator", + Description = "Enables software developers to quickly create modules by automating many of the initial module creation tasks", + Version = "1.0.0", + Categories = "Developer" + }; } } diff --git a/Oqtane.Client/Modules/Admin/ModuleCreator/Templates/Oqtane.Client/Modules/[Module]/[Module].cs b/Oqtane.Client/Modules/Admin/ModuleCreator/Templates/Oqtane.Client/Modules/[Module]/[Module].cs index 040fd244..630b488e 100644 --- a/Oqtane.Client/Modules/Admin/ModuleCreator/Templates/Oqtane.Client/Modules/[Module]/[Module].cs +++ b/Oqtane.Client/Modules/Admin/ModuleCreator/Templates/Oqtane.Client/Modules/[Module]/[Module].cs @@ -1,22 +1,16 @@ -using System.Collections.Generic; +using Oqtane.Models; +using Oqtane.Modules; namespace Oqtane.Modules.[Module]s { public class Module : IModule { - public Dictionary Properties + public ModuleDefinition ModuleDefinition => new ModuleDefinition { - get - { - Dictionary properties = new Dictionary - { - { "Name", "[Module]" }, - { "Description", "[Module]" }, - { "Version", "1.0.0" }, - { "ServerAssemblyName", "Oqtane.Server" } - }; - return properties; - } - } + Name = "[Module]", + Description = "[Module]", + Version = "1.0.0", + ServerAssemblyName = "Oqtane.Server" + }; } } diff --git a/Oqtane.Client/Modules/Admin/ModuleCreator/Templates/Oqtane.Server/Modules/[Module]/Controllers/[Module]Controller.cs b/Oqtane.Client/Modules/Admin/ModuleCreator/Templates/Oqtane.Server/Modules/[Module]/Controllers/[Module]Controller.cs index 023e42a4..9fcb319e 100644 --- a/Oqtane.Client/Modules/Admin/ModuleCreator/Templates/Oqtane.Server/Modules/[Module]/Controllers/[Module]Controller.cs +++ b/Oqtane.Client/Modules/Admin/ModuleCreator/Templates/Oqtane.Server/Modules/[Module]/Controllers/[Module]Controller.cs @@ -5,7 +5,7 @@ using Oqtane.Repository.[Module]s; using Oqtane.Shared; using System.Collections.Generic; using Oqtane.Enums; -using Oqtane.Infrastructure.Interfaces; +using Oqtane.Infrastructure; namespace Oqtane.Controllers.[Module]s { diff --git a/Oqtane.Client/Modules/Counter/Module.cs b/Oqtane.Client/Modules/Counter/Module.cs index 5f509ae2..dd2e0e35 100644 --- a/Oqtane.Client/Modules/Counter/Module.cs +++ b/Oqtane.Client/Modules/Counter/Module.cs @@ -1,21 +1,14 @@ -using System.Collections.Generic; +using Oqtane.Models; namespace Oqtane.Modules.Counter { public class Module : IModule { - public Dictionary Properties + public ModuleDefinition ModuleDefinition => new ModuleDefinition { - get - { - Dictionary properties = new Dictionary - { - { "Name", "Counter" }, - { "Description", "Increments a counter" }, - { "Version", "1.0.0" } - }; - return properties; - } - } + Name = "Counter", + Description = "Increments a counter", + Version = "1.0.0" + }; } } diff --git a/Oqtane.Client/Modules/HtmlText/ModuleInfo.cs b/Oqtane.Client/Modules/HtmlText/ModuleInfo.cs index df585a05..0d4ad914 100644 --- a/Oqtane.Client/Modules/HtmlText/ModuleInfo.cs +++ b/Oqtane.Client/Modules/HtmlText/ModuleInfo.cs @@ -1,22 +1,15 @@ -using System.Collections.Generic; +using Oqtane.Models; namespace Oqtane.Modules.HtmlText { public class ModuleInfo : IModule { - public Dictionary Properties + public ModuleDefinition ModuleDefinition => new ModuleDefinition { - get - { - Dictionary properties = new Dictionary - { - { "Name", "HtmlText" }, - { "Description", "Renders HTML or Text" }, - { "Version", "1.0.0" }, - { "ServerAssemblyName", "Oqtane.Server" } - }; - return properties; - } - } + Name = "HtmlText", + Description = "Renders HTML or Text", + Version = "1.0.0", + ServerAssemblyName = "Oqtane.Server" + }; } } diff --git a/Oqtane.Client/Modules/IModule.cs b/Oqtane.Client/Modules/IModule.cs index 675378b8..f0ecfacf 100644 --- a/Oqtane.Client/Modules/IModule.cs +++ b/Oqtane.Client/Modules/IModule.cs @@ -1,9 +1,9 @@ -using System.Collections.Generic; +using Oqtane.Models; namespace Oqtane.Modules { public interface IModule { - Dictionary Properties { get; } + ModuleDefinition ModuleDefinition { get; } } } diff --git a/Oqtane.Client/Modules/Weather/Module.cs b/Oqtane.Client/Modules/Weather/Module.cs index 65d719d8..99922df4 100644 --- a/Oqtane.Client/Modules/Weather/Module.cs +++ b/Oqtane.Client/Modules/Weather/Module.cs @@ -1,21 +1,14 @@ -using System.Collections.Generic; +using Oqtane.Models; namespace Oqtane.Modules.Weather { public class Module : IModule { - public Dictionary Properties + public ModuleDefinition ModuleDefinition => new ModuleDefinition { - get - { - Dictionary properties = new Dictionary - { - { "Name", "Weather" }, - { "Description", "Displays random weather using a service" }, - { "Version", "1.0.0" } - }; - return properties; - } - } + Name = "Weather", + Description = "Displays random weather using a service", + Version = "1.0.0" + }; } } diff --git a/Oqtane.Server/Controllers/AliasController.cs b/Oqtane.Server/Controllers/AliasController.cs index 47f2d0a9..6e5f6379 100644 --- a/Oqtane.Server/Controllers/AliasController.cs +++ b/Oqtane.Server/Controllers/AliasController.cs @@ -8,7 +8,7 @@ using System; using System.Net; using System.Globalization; using Oqtane.Enums; -using Oqtane.Infrastructure.Interfaces; +using Oqtane.Infrastructure; using Oqtane.Repository; namespace Oqtane.Controllers diff --git a/Oqtane.Server/Controllers/FileController.cs b/Oqtane.Server/Controllers/FileController.cs index ad85e6c2..4256e17f 100644 --- a/Oqtane.Server/Controllers/FileController.cs +++ b/Oqtane.Server/Controllers/FileController.cs @@ -14,7 +14,7 @@ using System.Linq; using System.Drawing; using System.Net; using Oqtane.Enums; -using Oqtane.Infrastructure.Interfaces; +using Oqtane.Infrastructure; using Oqtane.Repository; // ReSharper disable StringIndexOfIsCultureSpecific.1 diff --git a/Oqtane.Server/Controllers/FolderController.cs b/Oqtane.Server/Controllers/FolderController.cs index 1a2fdb2f..ee75a536 100644 --- a/Oqtane.Server/Controllers/FolderController.cs +++ b/Oqtane.Server/Controllers/FolderController.cs @@ -6,7 +6,7 @@ using Oqtane.Shared; using System.Linq; using System.Net; using Oqtane.Enums; -using Oqtane.Infrastructure.Interfaces; +using Oqtane.Infrastructure; using Oqtane.Repository; using Oqtane.Security; diff --git a/Oqtane.Server/Controllers/InstallationController.cs b/Oqtane.Server/Controllers/InstallationController.cs index bb99f23f..c812c47e 100644 --- a/Oqtane.Server/Controllers/InstallationController.cs +++ b/Oqtane.Server/Controllers/InstallationController.cs @@ -4,7 +4,6 @@ using Microsoft.Extensions.Configuration; using Oqtane.Models; using Oqtane.Shared; using Oqtane.Infrastructure; -using Oqtane.Infrastructure.Interfaces; // ReSharper disable StringIndexOfIsCultureSpecific.1 diff --git a/Oqtane.Server/Controllers/JobController.cs b/Oqtane.Server/Controllers/JobController.cs index 838a62fb..6d5c5c7b 100644 --- a/Oqtane.Server/Controllers/JobController.cs +++ b/Oqtane.Server/Controllers/JobController.cs @@ -7,7 +7,7 @@ using System; using Microsoft.Extensions.Hosting; using Microsoft.Extensions.DependencyInjection; using Oqtane.Enums; -using Oqtane.Infrastructure.Interfaces; +using Oqtane.Infrastructure; using Oqtane.Repository; namespace Oqtane.Controllers diff --git a/Oqtane.Server/Controllers/JobLogController.cs b/Oqtane.Server/Controllers/JobLogController.cs index f2a506d5..15b2714b 100644 --- a/Oqtane.Server/Controllers/JobLogController.cs +++ b/Oqtane.Server/Controllers/JobLogController.cs @@ -4,7 +4,7 @@ using Microsoft.AspNetCore.Authorization; using Oqtane.Enums; using Oqtane.Models; using Oqtane.Shared; -using Oqtane.Infrastructure.Interfaces; +using Oqtane.Infrastructure; using Oqtane.Repository; namespace Oqtane.Controllers diff --git a/Oqtane.Server/Controllers/LogController.cs b/Oqtane.Server/Controllers/LogController.cs index d59b9411..9e62bd0c 100644 --- a/Oqtane.Server/Controllers/LogController.cs +++ b/Oqtane.Server/Controllers/LogController.cs @@ -2,7 +2,7 @@ using Oqtane.Models; using System.Collections.Generic; using Microsoft.AspNetCore.Authorization; -using Oqtane.Infrastructure.Interfaces; +using Oqtane.Infrastructure; using Oqtane.Repository; using Oqtane.Shared; diff --git a/Oqtane.Server/Controllers/ModuleController.cs b/Oqtane.Server/Controllers/ModuleController.cs index 348f973e..e87a7a5a 100644 --- a/Oqtane.Server/Controllers/ModuleController.cs +++ b/Oqtane.Server/Controllers/ModuleController.cs @@ -5,7 +5,7 @@ using Oqtane.Models; using Oqtane.Shared; using System.Linq; using Oqtane.Enums; -using Oqtane.Infrastructure.Interfaces; +using Oqtane.Infrastructure; using Oqtane.Repository; using Oqtane.Security; diff --git a/Oqtane.Server/Controllers/ModuleDefinitionController.cs b/Oqtane.Server/Controllers/ModuleDefinitionController.cs index 5e4659ce..3f0f1e84 100644 --- a/Oqtane.Server/Controllers/ModuleDefinitionController.cs +++ b/Oqtane.Server/Controllers/ModuleDefinitionController.cs @@ -8,7 +8,7 @@ using System.Reflection; using System.Linq; using Microsoft.AspNetCore.Hosting; using Oqtane.Enums; -using Oqtane.Infrastructure.Interfaces; +using Oqtane.Infrastructure; using Oqtane.Repository; using Oqtane.Security; using System; diff --git a/Oqtane.Server/Controllers/NotificationController.cs b/Oqtane.Server/Controllers/NotificationController.cs index 47f0f85f..ebf7489b 100644 --- a/Oqtane.Server/Controllers/NotificationController.cs +++ b/Oqtane.Server/Controllers/NotificationController.cs @@ -4,7 +4,7 @@ using Microsoft.AspNetCore.Authorization; using Oqtane.Enums; using Oqtane.Models; using Oqtane.Shared; -using Oqtane.Infrastructure.Interfaces; +using Oqtane.Infrastructure; using Oqtane.Repository; using Oqtane.Security; diff --git a/Oqtane.Server/Controllers/PageController.cs b/Oqtane.Server/Controllers/PageController.cs index 607ceaef..2b87c7e4 100644 --- a/Oqtane.Server/Controllers/PageController.cs +++ b/Oqtane.Server/Controllers/PageController.cs @@ -7,7 +7,7 @@ using System.Linq; using Oqtane.Security; using System.Net; using Oqtane.Enums; -using Oqtane.Infrastructure.Interfaces; +using Oqtane.Infrastructure; using Oqtane.Repository; namespace Oqtane.Controllers diff --git a/Oqtane.Server/Controllers/PageModuleController.cs b/Oqtane.Server/Controllers/PageModuleController.cs index c6149cbd..fc8e92cc 100644 --- a/Oqtane.Server/Controllers/PageModuleController.cs +++ b/Oqtane.Server/Controllers/PageModuleController.cs @@ -5,7 +5,7 @@ using Oqtane.Models; using Oqtane.Shared; using System.Linq; using Oqtane.Enums; -using Oqtane.Infrastructure.Interfaces; +using Oqtane.Infrastructure; using Oqtane.Repository; using Oqtane.Security; diff --git a/Oqtane.Server/Controllers/ProfileController.cs b/Oqtane.Server/Controllers/ProfileController.cs index 1a3c0f40..aad21208 100644 --- a/Oqtane.Server/Controllers/ProfileController.cs +++ b/Oqtane.Server/Controllers/ProfileController.cs @@ -4,7 +4,7 @@ using Microsoft.AspNetCore.Authorization; using Oqtane.Enums; using Oqtane.Models; using Oqtane.Shared; -using Oqtane.Infrastructure.Interfaces; +using Oqtane.Infrastructure; using Oqtane.Repository; namespace Oqtane.Controllers diff --git a/Oqtane.Server/Controllers/RoleController.cs b/Oqtane.Server/Controllers/RoleController.cs index 61f58f4a..956fad8f 100644 --- a/Oqtane.Server/Controllers/RoleController.cs +++ b/Oqtane.Server/Controllers/RoleController.cs @@ -4,7 +4,7 @@ using Microsoft.AspNetCore.Authorization; using Oqtane.Enums; using Oqtane.Models; using Oqtane.Shared; -using Oqtane.Infrastructure.Interfaces; +using Oqtane.Infrastructure; using Oqtane.Repository; namespace Oqtane.Controllers diff --git a/Oqtane.Server/Controllers/SettingController.cs b/Oqtane.Server/Controllers/SettingController.cs index 4c551098..2599fde7 100644 --- a/Oqtane.Server/Controllers/SettingController.cs +++ b/Oqtane.Server/Controllers/SettingController.cs @@ -5,7 +5,7 @@ using Oqtane.Shared; using Oqtane.Security; using System.Linq; using Oqtane.Enums; -using Oqtane.Infrastructure.Interfaces; +using Oqtane.Infrastructure; using Oqtane.Repository; namespace Oqtane.Controllers diff --git a/Oqtane.Server/Controllers/SiteController.cs b/Oqtane.Server/Controllers/SiteController.cs index a8db1073..1adfe517 100644 --- a/Oqtane.Server/Controllers/SiteController.cs +++ b/Oqtane.Server/Controllers/SiteController.cs @@ -5,7 +5,7 @@ using Oqtane.Models; using Oqtane.Shared; using System.Linq; using Oqtane.Enums; -using Oqtane.Infrastructure.Interfaces; +using Oqtane.Infrastructure; using Oqtane.Repository; namespace Oqtane.Controllers diff --git a/Oqtane.Server/Controllers/SqlController.cs b/Oqtane.Server/Controllers/SqlController.cs index 1ec75d19..a884ab35 100644 --- a/Oqtane.Server/Controllers/SqlController.cs +++ b/Oqtane.Server/Controllers/SqlController.cs @@ -3,7 +3,7 @@ using Microsoft.AspNetCore.Authorization; using Oqtane.Models; using System.Collections.Generic; using Oqtane.Shared; -using Oqtane.Infrastructure.Interfaces; +using Oqtane.Infrastructure; using Oqtane.Repository; using Oqtane.Enums; using System.Data.SqlClient; diff --git a/Oqtane.Server/Controllers/TenantController.cs b/Oqtane.Server/Controllers/TenantController.cs index 83f84355..03e4b1f4 100644 --- a/Oqtane.Server/Controllers/TenantController.cs +++ b/Oqtane.Server/Controllers/TenantController.cs @@ -4,7 +4,7 @@ using Oqtane.Models; using System.Collections.Generic; using Oqtane.Enums; using Oqtane.Shared; -using Oqtane.Infrastructure.Interfaces; +using Oqtane.Infrastructure; using Oqtane.Repository; namespace Oqtane.Controllers diff --git a/Oqtane.Server/Controllers/ThemeController.cs b/Oqtane.Server/Controllers/ThemeController.cs index 5fadf164..120e5d96 100644 --- a/Oqtane.Server/Controllers/ThemeController.cs +++ b/Oqtane.Server/Controllers/ThemeController.cs @@ -8,7 +8,7 @@ using System.Reflection; using System.Linq; using Microsoft.AspNetCore.Hosting; using Oqtane.Enums; -using Oqtane.Infrastructure.Interfaces; +using Oqtane.Infrastructure; using Oqtane.Repository; // ReSharper disable StringIndexOfIsCultureSpecific.1 diff --git a/Oqtane.Server/Controllers/UserController.cs b/Oqtane.Server/Controllers/UserController.cs index d2bc94db..d0f5d96f 100644 --- a/Oqtane.Server/Controllers/UserController.cs +++ b/Oqtane.Server/Controllers/UserController.cs @@ -11,7 +11,7 @@ using Oqtane.Shared; using System; using System.Net; using Oqtane.Enums; -using Oqtane.Infrastructure.Interfaces; +using Oqtane.Infrastructure; using Oqtane.Repository; namespace Oqtane.Controllers diff --git a/Oqtane.Server/Controllers/UserRoleController.cs b/Oqtane.Server/Controllers/UserRoleController.cs index fa3d2d6c..c159cd0a 100644 --- a/Oqtane.Server/Controllers/UserRoleController.cs +++ b/Oqtane.Server/Controllers/UserRoleController.cs @@ -4,7 +4,7 @@ using Microsoft.AspNetCore.Authorization; using Oqtane.Enums; using Oqtane.Models; using Oqtane.Shared; -using Oqtane.Infrastructure.Interfaces; +using Oqtane.Infrastructure; using Oqtane.Repository; namespace Oqtane.Controllers diff --git a/Oqtane.Server/Infrastructure/InstallationManager.cs b/Oqtane.Server/Infrastructure/InstallationManager.cs index 3825d454..82eab80f 100644 --- a/Oqtane.Server/Infrastructure/InstallationManager.cs +++ b/Oqtane.Server/Infrastructure/InstallationManager.cs @@ -7,7 +7,6 @@ using System.Xml; using Oqtane.Shared; using System; using System.Diagnostics; -using Oqtane.Infrastructure.Interfaces; using Microsoft.Extensions.Caching.Memory; namespace Oqtane.Infrastructure diff --git a/Oqtane.Server/Infrastructure/Interfaces/IInstallationManager.cs b/Oqtane.Server/Infrastructure/Interfaces/IInstallationManager.cs index a6d0fa90..f34165f0 100644 --- a/Oqtane.Server/Infrastructure/Interfaces/IInstallationManager.cs +++ b/Oqtane.Server/Infrastructure/Interfaces/IInstallationManager.cs @@ -1,4 +1,4 @@ -namespace Oqtane.Infrastructure.Interfaces +namespace Oqtane.Infrastructure { public interface IInstallationManager { diff --git a/Oqtane.Server/Infrastructure/Interfaces/ILogManager.cs b/Oqtane.Server/Infrastructure/Interfaces/ILogManager.cs index 20808f87..bd52214c 100644 --- a/Oqtane.Server/Infrastructure/Interfaces/ILogManager.cs +++ b/Oqtane.Server/Infrastructure/Interfaces/ILogManager.cs @@ -3,7 +3,7 @@ using Oqtane.Enums; using Oqtane.Models; using Oqtane.Shared; -namespace Oqtane.Infrastructure.Interfaces +namespace Oqtane.Infrastructure { public interface ILogManager { diff --git a/Oqtane.Server/Infrastructure/Interfaces/ISiteTemplate.cs b/Oqtane.Server/Infrastructure/Interfaces/ISiteTemplate.cs index 20b8cdb8..4d987a97 100644 --- a/Oqtane.Server/Infrastructure/Interfaces/ISiteTemplate.cs +++ b/Oqtane.Server/Infrastructure/Interfaces/ISiteTemplate.cs @@ -1,7 +1,7 @@ using Oqtane.Models; using System.Collections.Generic; -namespace Oqtane.Infrastructure.Interfaces +namespace Oqtane.Infrastructure { public interface ISiteTemplate { diff --git a/Oqtane.Server/Infrastructure/Interfaces/ISyncManager.cs b/Oqtane.Server/Infrastructure/Interfaces/ISyncManager.cs index 3b821f38..e90ae246 100644 --- a/Oqtane.Server/Infrastructure/Interfaces/ISyncManager.cs +++ b/Oqtane.Server/Infrastructure/Interfaces/ISyncManager.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using Oqtane.Models; -namespace Oqtane.Infrastructure.Interfaces +namespace Oqtane.Infrastructure { public interface ISyncManager { diff --git a/Oqtane.Server/Infrastructure/LogManager.cs b/Oqtane.Server/Infrastructure/LogManager.cs index 47101016..a213cb10 100644 --- a/Oqtane.Server/Infrastructure/LogManager.cs +++ b/Oqtane.Server/Infrastructure/LogManager.cs @@ -6,7 +6,6 @@ using Microsoft.Extensions.Configuration; using Microsoft.AspNetCore.Http; using System.Collections.Generic; using Oqtane.Enums; -using Oqtane.Infrastructure.Interfaces; using Oqtane.Repository; using Oqtane.Security; // ReSharper disable StringIndexOfIsCultureSpecific.2 diff --git a/Oqtane.Server/Infrastructure/SiteTemplates/DefaultSiteTemplate.cs b/Oqtane.Server/Infrastructure/SiteTemplates/DefaultSiteTemplate.cs index 45d61327..daab95f1 100644 --- a/Oqtane.Server/Infrastructure/SiteTemplates/DefaultSiteTemplate.cs +++ b/Oqtane.Server/Infrastructure/SiteTemplates/DefaultSiteTemplate.cs @@ -1,5 +1,5 @@ using Oqtane.Models; -using Oqtane.Infrastructure.Interfaces; +using Oqtane.Infrastructure; using System.Collections.Generic; using Oqtane.Repository; using Microsoft.AspNetCore.Hosting; diff --git a/Oqtane.Server/Infrastructure/SyncManager.cs b/Oqtane.Server/Infrastructure/SyncManager.cs index 7828bbc3..63f0b648 100644 --- a/Oqtane.Server/Infrastructure/SyncManager.cs +++ b/Oqtane.Server/Infrastructure/SyncManager.cs @@ -3,7 +3,7 @@ using Oqtane.Models; using System; using System.Collections.Generic; using System.Linq; -using Oqtane.Infrastructure.Interfaces; +using Oqtane.Infrastructure; using Oqtane.Repository; namespace Oqtane.Infrastructure diff --git a/Oqtane.Server/Modules/HtmlText/Controllers/HtmlTextController.cs b/Oqtane.Server/Modules/HtmlText/Controllers/HtmlTextController.cs index 01eb92cf..5eb6f37f 100644 --- a/Oqtane.Server/Modules/HtmlText/Controllers/HtmlTextController.cs +++ b/Oqtane.Server/Modules/HtmlText/Controllers/HtmlTextController.cs @@ -7,7 +7,7 @@ using Oqtane.Shared; using System; using System.Collections.Generic; using Oqtane.Enums; -using Oqtane.Infrastructure.Interfaces; +using Oqtane.Infrastructure; namespace Oqtane.Modules.HtmlText.Controllers { diff --git a/Oqtane.Server/Repository/ModuleDefinitionRepository.cs b/Oqtane.Server/Repository/ModuleDefinitionRepository.cs index db4a8339..a97992c4 100644 --- a/Oqtane.Server/Repository/ModuleDefinitionRepository.cs +++ b/Oqtane.Server/Repository/ModuleDefinitionRepository.cs @@ -148,50 +148,22 @@ namespace Oqtane.Repository if (moduletype != null) { var moduleobject = Activator.CreateInstance(moduletype); - Dictionary properties = (Dictionary)moduletype.GetProperty("Properties").GetValue(moduleobject); - moduledefinition = new ModuleDefinition - { - ModuleDefinitionName = qualifiedModuleType, - Name = GetProperty(properties, "Name"), - Description = GetProperty(properties, "Description"), - Categories = GetProperty(properties, "Categories"), - Version = GetProperty(properties, "Version"), - Owner = GetProperty(properties, "Owner"), - Url = GetProperty(properties, "Url"), - Contact = GetProperty(properties, "Contact"), - License = GetProperty(properties, "License"), - Dependencies = GetProperty(properties, "Dependencies"), - PermissionNames = GetProperty(properties, "PermissionNames"), - ServerAssemblyName = GetProperty(properties, "ServerAssemblyName"), - ControlTypeTemplate = moduleType + "." + Constants.ActionToken + ", " + typename[1], - ControlTypeRoutes = "", - AssemblyName = assembly.FullName.Split(",")[0], - Permissions = "" - }; + moduledefinition = (ModuleDefinition)moduletype.GetProperty("ModuleDefinition").GetValue(moduleobject); } else { moduledefinition = new ModuleDefinition { - ModuleDefinitionName = qualifiedModuleType, Name = moduleType.Substring(moduleType.LastIndexOf(".") + 1), Description = moduleType.Substring(moduleType.LastIndexOf(".") + 1), Categories = ((qualifiedModuleType.StartsWith("Oqtane.Modules.Admin.")) ? "Admin" : ""), - Version = new Version(1, 0, 0).ToString(), - Owner = "", - Url = "", - Contact = "", - License = "", - Dependencies = "", - PermissionNames = "", - ServerAssemblyName = "", - ControlTypeTemplate = moduleType + "." + Constants.ActionToken + ", " + typename[1], - ControlTypeRoutes = "", - AssemblyName = assembly.FullName.Split(",")[0], - Permissions = "" + Version = new Version(1, 0, 0).ToString() }; } - // permissions + // set internal properties + moduledefinition.ModuleDefinitionName = qualifiedModuleType; + moduledefinition.ControlTypeTemplate = moduleType + "." + Constants.ActionToken + ", " + typename[1]; + moduledefinition.AssemblyName = assembly.FullName.Split(",")[0]; if (moduledefinition.Categories == "Admin") { moduledefinition.Permissions = "[{\"PermissionName\":\"Utilize\",\"Permissions\":\"" + Constants.AdminRole + "\"}]"; diff --git a/Oqtane.Server/Repository/SiteRepository.cs b/Oqtane.Server/Repository/SiteRepository.cs index cbbc889d..70e7ec2c 100644 --- a/Oqtane.Server/Repository/SiteRepository.cs +++ b/Oqtane.Server/Repository/SiteRepository.cs @@ -6,7 +6,7 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Oqtane.Extensions; -using Oqtane.Infrastructure.Interfaces; +using Oqtane.Infrastructure; using Oqtane.Models; using Oqtane.Modules; using Oqtane.Shared; diff --git a/Oqtane.Server/Repository/SiteTemplateRepository.cs b/Oqtane.Server/Repository/SiteTemplateRepository.cs index c88934fd..c471f5c0 100644 --- a/Oqtane.Server/Repository/SiteTemplateRepository.cs +++ b/Oqtane.Server/Repository/SiteTemplateRepository.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Reflection; using Microsoft.Extensions.DependencyInjection; -using Oqtane.Infrastructure.Interfaces; +using Oqtane.Infrastructure; using Oqtane.Models; namespace Oqtane.Repository diff --git a/Oqtane.Server/Security/PermissionHandler.cs b/Oqtane.Server/Security/PermissionHandler.cs index 07652811..8735d0d0 100644 --- a/Oqtane.Server/Security/PermissionHandler.cs +++ b/Oqtane.Server/Security/PermissionHandler.cs @@ -2,7 +2,7 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; using Oqtane.Enums; -using Oqtane.Infrastructure.Interfaces; +using Oqtane.Infrastructure; using Oqtane.Shared; namespace Oqtane.Security diff --git a/Oqtane.Server/Startup.cs b/Oqtane.Server/Startup.cs index ed8e8678..714834e1 100644 --- a/Oqtane.Server/Startup.cs +++ b/Oqtane.Server/Startup.cs @@ -15,7 +15,6 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using Microsoft.OpenApi.Models; using Oqtane.Infrastructure; -using Oqtane.Infrastructure.Interfaces; using Oqtane.Repository; using Oqtane.Security; using Oqtane.Services; diff --git a/Oqtane.Shared/Models/ModuleDefinition.cs b/Oqtane.Shared/Models/ModuleDefinition.cs index 35a27840..33880e1f 100644 --- a/Oqtane.Shared/Models/ModuleDefinition.cs +++ b/Oqtane.Shared/Models/ModuleDefinition.cs @@ -5,6 +5,22 @@ namespace Oqtane.Models { public class ModuleDefinition : IAuditable { + public ModuleDefinition() + { + Name = ""; + Description = ""; + Categories = ""; + Version = ""; + Owner = ""; + Url = ""; + Contact = ""; + License = ""; + Dependencies = ""; + PermissionNames = ""; + ServerAssemblyName = ""; + ControlTypeRoutes = ""; + } + public int ModuleDefinitionId { get; set; } public string ModuleDefinitionName { get; set; } @@ -13,6 +29,8 @@ namespace Oqtane.Models public string ModifiedBy { get; set; } public DateTime ModifiedOn { get; set; } + [NotMapped] + public int SiteId { get; set; } [NotMapped] public string Name { get; set; } [NotMapped] @@ -42,8 +60,6 @@ namespace Oqtane.Models [NotMapped] public string AssemblyName { get; set; } [NotMapped] - public int SiteId { get; set; } - [NotMapped] public string Permissions { get; set; } } }