我是.NET开发人员,目前,我正在尝试学习ASP.NET Boilerplate . 我遇到了PlugIn Modules,我认为它可以用于模块依赖,但他们有这些我想要了解的行:
AbpBootstrapper类定义PlugInSources属性,该属性可用于添加源以动态加载插件模块 . 插件源可以是实现IPlugInSource接口的任何类 . PlugInFolderSource类实现它以从位于文件夹中的程序集获取插件模块 .
所以在尝试实现 IPlugInSource
界面之后:
using Abp.Modules;
using Abp.PlugIns;
using System;
using System.Collections.Generic;
using System.Text;
using System.Reflection;
public class EmpDetails : IPlugInSource
{
public string EmpName { get; set; }
public string Address { get; set; }
public string Email { get; set; }
public List<Assembly> GetAssemblies()
{
throw new NotImplementedException();
}
public List<Type> GetModules()
{
throw new NotImplementedException();
}
}
我的疑问是:我必须在 GetAssemblies()
和 GetModules()
方法中执行哪些操作,因为我必须返回 Assemblies
和 Type
?我已经提到了官方网站文档,如果他们提供了正确的示例,我无法找到它 . 提前致谢 .
1 回答
您不应该实现
IPlugInSource
.该文档提供了如何在 Startup 类中添加插件源的明确示例:
要清除您的疑问,请参阅FolderPlugInSource中的
GetAssemblies
和GetModules
方法: