• 大小: 21.76M
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2020-12-14
  • 语言: C#
  • 标签: MVC  c  插件  源码  

资源简介

1、自定义视图引擎 

2、插件式MVC项目 
3、IOC autofac 
4、mvc5.0

资源截图

代码片段和文件信息

using System.Web.Routing;
using System.Web.Mvc;
using Plugin;

namespace AutofacMvcPluginDemo.Plugins
{
    public class DemoPlugin : IPlugin
    {
        public string Name
        {
            get
            {
                return “Plugin“; //Assembly.GetExecutingAssembly().GetName().Name;            
            }
        }
        public void Initialize()
        {
            var route = RouteTable.Routes.MapRoute(
                 name: Name
                 url: Name + “/{controller}/{action}/{id}“
                 defaults: new { controller = “Home“ action = “Index“ id = UrlParameter.Optional pluginName = Name }
             );

            route.DataTokens[“area“] = Name;
        }

        public void Unload()
        {
            RouteTable.Routes.Remove(RouteTable.Ro

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2015-09-24 05:30  -AutofacMvcPluginDemo-master\
     目录           0  2015-09-24 05:30  -AutofacMvcPluginDemo-master\AutofacMvcPluginDemo.Plugins\
     目录           0  2015-09-24 05:30  -AutofacMvcPluginDemo-master\AutofacMvcPluginDemo.Plugins\App_Start\
     文件         605  2015-09-24 05:30  -AutofacMvcPluginDemo-master\AutofacMvcPluginDemo.Plugins\App_Start\RouteConfig.cs
     文件        8208  2015-09-24 05:30  -AutofacMvcPluginDemo-master\AutofacMvcPluginDemo.Plugins\AutofacMvcPluginDemo.Plugins.csproj
     文件        1541  2015-09-24 05:30  -AutofacMvcPluginDemo-master\AutofacMvcPluginDemo.Plugins\AutofacMvcPluginDemo.Plugins.csproj.user
     目录           0  2015-09-24 05:30  -AutofacMvcPluginDemo-master\AutofacMvcPluginDemo.Plugins\Controllers\
     文件         620  2015-09-24 05:30  -AutofacMvcPluginDemo-master\AutofacMvcPluginDemo.Plugins\Controllers\PluginsHomeController.cs
     文件         833  2015-09-24 05:30  -AutofacMvcPluginDemo-master\AutofacMvcPluginDemo.Plugins\DemoPlugin.cs
     文件         119  2015-09-24 05:30  -AutofacMvcPluginDemo-master\AutofacMvcPluginDemo.Plugins\Global.asax
     文件         424  2015-09-24 05:30  -AutofacMvcPluginDemo-master\AutofacMvcPluginDemo.Plugins\Global.asax.cs
     目录           0  2015-09-24 05:30  -AutofacMvcPluginDemo-master\AutofacMvcPluginDemo.Plugins\Properties\
     文件        1332  2015-09-24 05:30  -AutofacMvcPluginDemo-master\AutofacMvcPluginDemo.Plugins\Properties\AssemblyInfo.cs
     目录           0  2015-09-24 05:30  -AutofacMvcPluginDemo-master\AutofacMvcPluginDemo.Plugins\Views\
     目录           0  2015-09-24 05:30  -AutofacMvcPluginDemo-master\AutofacMvcPluginDemo.Plugins\Views\PluginsHome\
     文件         320  2015-09-24 05:30  -AutofacMvcPluginDemo-master\AutofacMvcPluginDemo.Plugins\Views\PluginsHome\Index.cshtml
     文件        1638  2015-09-24 05:30  -AutofacMvcPluginDemo-master\AutofacMvcPluginDemo.Plugins\Views\web.config
     文件        1215  2015-09-24 05:30  -AutofacMvcPluginDemo-master\AutofacMvcPluginDemo.Plugins\Web.Debug.config
     文件        1275  2015-09-24 05:30  -AutofacMvcPluginDemo-master\AutofacMvcPluginDemo.Plugins\Web.Release.config
     文件        1390  2015-09-24 05:30  -AutofacMvcPluginDemo-master\AutofacMvcPluginDemo.Plugins\Web.config
     目录           0  2015-09-24 05:30  -AutofacMvcPluginDemo-master\AutofacMvcPluginDemo.Plugins\bin\
     文件       10240  2015-09-24 05:30  -AutofacMvcPluginDemo-master\AutofacMvcPluginDemo.Plugins\bin\AutofacMvcPluginDemo.Plugins.dll
     文件        1390  2015-09-24 05:30  -AutofacMvcPluginDemo-master\AutofacMvcPluginDemo.Plugins\bin\AutofacMvcPluginDemo.Plugins.dll.config
     文件       17920  2015-09-24 05:30  -AutofacMvcPluginDemo-master\AutofacMvcPluginDemo.Plugins\bin\AutofacMvcPluginDemo.Plugins.pdb
     文件        4608  2015-09-24 05:30  -AutofacMvcPluginDemo-master\AutofacMvcPluginDemo.Plugins\bin\AutofacMvcPluginDemo.Services.dll
     文件       11776  2015-09-24 05:30  -AutofacMvcPluginDemo-master\AutofacMvcPluginDemo.Plugins\bin\AutofacMvcPluginDemo.Services.pdb
     文件       45416  2015-09-24 05:30  -AutofacMvcPluginDemo-master\AutofacMvcPluginDemo.Plugins\bin\Microsoft.Web.Infrastructure.dll
     文件        4608  2015-09-24 05:30  -AutofacMvcPluginDemo-master\AutofacMvcPluginDemo.Plugins\bin\Plugin.Interfaces.dll
     文件       10240  2015-09-24 05:30  -AutofacMvcPluginDemo-master\AutofacMvcPluginDemo.Plugins\bin\Plugin.Mvc.dll
     文件       20992  2015-09-24 05:30  -AutofacMvcPluginDemo-master\AutofacMvcPluginDemo.Plugins\bin\Plugin.dll
     文件      139984  2015-09-24 05:30  -AutofacMvcPluginDemo-master\AutofacMvcPluginDemo.Plugins\bin\System.Web.Helpers.dll
............此处省略625个文件信息

评论

共有 条评论