remove hardcoded names when using GetInterface()

This commit is contained in:
sbwalker
2024-07-17 19:52:44 -04:00
parent 45afbbdac6
commit 7ee6775251
6 changed files with 7 additions and 7 deletions

View File

@ -340,7 +340,7 @@ namespace Oqtane.Repository
if (!string.IsNullOrEmpty(moduledefinition.ServerManagerType))
{
Type servertype = Type.GetType(moduledefinition.ServerManagerType);
if (servertype != null && servertype.GetInterface("IPortable") != null)
if (servertype != null && servertype.GetInterface(nameof(IPortable)) != null)
{
moduledefinition.IsPortable = true;
}

View File

@ -107,7 +107,7 @@ namespace Oqtane.Repository
if (moduledefinition.ServerManagerType != "")
{
Type moduletype = Type.GetType(moduledefinition.ServerManagerType);
if (moduletype != null && moduletype.GetInterface("IPortable") != null)
if (moduletype != null && moduletype.GetInterface(nameof(IPortable)) != null)
{
try
{
@ -152,7 +152,7 @@ namespace Oqtane.Repository
if (moduledefinition.ServerManagerType != "")
{
Type moduletype = Type.GetType(moduledefinition.ServerManagerType);
if (moduletype != null && moduletype.GetInterface("IPortable") != null)
if (moduletype != null && moduletype.GetInterface(nameof(IPortable)) != null)
{
try
{

View File

@ -542,7 +542,7 @@ namespace Oqtane.Repository
if (pageTemplateModule.Content != "" && moduleDefinition.ServerManagerType != "")
{
Type moduletype = Type.GetType(moduleDefinition.ServerManagerType);
if (moduletype != null && moduletype.GetInterface("IPortable") != null)
if (moduletype != null && moduletype.GetInterface(nameof(IPortable)) != null)
{
try
{