рефакторинг, переименование DependencyRegistration

This commit is contained in:
kotcheshir73 2022-03-19 22:54:25 +04:00
parent cce896bf2b
commit 05d88ca8f1
6 changed files with 10 additions and 10 deletions

View File

@ -42,9 +42,9 @@ namespace ToolsModule.BusinessLogics
/// Загрузка всех классов-реализаций IImplementationExtension
/// </summary>
/// <returns></returns>
public static List<IImplementationExtension> GetImplementationExtensions()
public static List<IDependencyRegistration> GetImplementationExtensions()
{
var list = new List<IImplementationExtension>();
var list = new List<IDependencyRegistration>();
if(Directory.Exists(_pathToImplementationExt))
{
var files = Directory.GetFiles(_pathToImplementationExt, "*.dll", SearchOption.AllDirectories);
@ -55,12 +55,12 @@ namespace ToolsModule.BusinessLogics
{
continue;
}
Assembly asm = Assembly.LoadFrom(file);
var asm = Assembly.LoadFrom(file);
foreach (var t in asm.GetExportedTypes())
{
if (t.IsClass && typeof(IImplementationExtension).IsAssignableFrom(t))
if (t.IsClass && typeof(IDependencyRegistration).IsAssignableFrom(t))
{
list.Add((IImplementationExtension)Activator.CreateInstance(t));
list.Add((IDependencyRegistration)Activator.CreateInstance(t));
}
}
loadedFiles.Add(file.GetFileName());

View File

@ -3,7 +3,7 @@
/// <summary>
/// Интерфейс для регистрации зависимостей в модулях
/// </summary>
public interface IImplementationExtension
public interface IDependencyRegistration
{
/// <summary>
/// Регистрация сервисов

View File

@ -5,7 +5,7 @@ using ToolsModule.Interfaces;
namespace DepartmentBusinessLogic
{
public class DepartmentLogicDependencyRegistration : IImplementationExtension
public class DepartmentLogicDependencyRegistration : IDependencyRegistration
{
public void RegisterServices()
{

View File

@ -6,7 +6,7 @@ using ToolsModule.Interfaces;
namespace DepartmentDatabaseImplementation
{
public class DepartmentImplementationExtensions : IImplementationExtension
public class DepartmentImplementationDependencyRegistration : IDependencyRegistration
{
public void RegisterServices()
{

View File

@ -7,7 +7,7 @@ using ToolsModule.Interfaces;
namespace SecurityBusinessLogic
{
public class SecurityLogicDependencyRegistration : IImplementationExtension
public class SecurityLogicDependencyRegistration : IDependencyRegistration
{
public void RegisterServices()
{

View File

@ -7,7 +7,7 @@ using ToolsModule.Interfaces;
namespace SecurityDatabaseImplementation
{
public class SecurityImplementationExtensions : IImplementationExtension
public class SecurityImplementationDependencyRegistration : IDependencyRegistration
{
public void RegisterServices()
{