• 大小: 2.71MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-09-09
  • 语言: C#
  • 标签: asp.net  mvc  

资源简介

asp.net mvc做的博客系统,asp.net mvc做的博客系统,asp.net mvc做的博客系统,

资源截图

代码片段和文件信息

using Beginner.Blog.Core.Engines;
using System.Linq;
using System.Reflection;
using Autofac;

using Autofac.Integration.Mvc;
using Beginner.Blog.Core;
using Beginner.Blog.Models;
using System;
using System.Web.Mvc;
using Beginner.Blog.Service.Interfaces;
using Beginner.Blog.Service.Implements;
using Beginner.Blog.Core.Authentication;
using Beginner.Blog.Helper;

using System.Configuration;
using Beginner.Blog.Core.Logging;
using Beginner.Blog.Core.Email;

namespace Beginner.Blog
{
    public class AutoFacBootStrapper
    {
        public static void Register()
        {
            var builder = new ContainerBuilder();

            #region MVC
            // Register your MVC controllers. (MvcApplication is the name of
            // the class in Global.asax.)
            builder.RegisterControllers(typeof(MvcApplication).Assembly);
            #endregion


            builder.RegisterType().As().InstancePerLifetimeScope();


            builder.RegisterType().As().InstancePerLifetimeScope();
            builder.RegisterType().As().InstancePerLifetimeScope();

            //EF DbContextFactory
            //builder.RegisterType().As().InstancePerLifetimeScope();

            //业务类
            //builder.RegisterType>().As>().InstancePerLifetimeScope();
            //builder.RegisterType>().As>().InstancePerLifetimeScope();
            //builder.RegisterType>().As>().InstancePerLifetimeScope();

            //自动注册
            //var baseType = typeof (IDependency);
            //var assembly = Assembly.GetExecutingAssembly();
            //builder.RegisterAssemblyTypes(assembly).Where(p => baseType.IsAssignableFrom(p) && p != baseType).AsImplementedInterfaces().InstancePerLifetimeScope();

            var connectionString = ConfigurationManager.ConnectionStrings[“DefaultConnectionString“].ConnectionString;
            builder.Register(c => new objectContext(connectionString)).InstancePerLifetimeScope();

            builder.RegisterGeneric(typeof(EfRepository<>)).As(typeof(IRepository<>)).InstancePerLifetimeScope();

            //Service
            builder.RegisterType().As().InstancePerLifetimeScope();

            var container = builder.Build();
            DependencyResolver.SetResolver(new AutofacDependencyResolver(container));

            EngineContainerFactory.InitializeEngineContainerFactory(new EngineContainer(container));
        }

    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2016-11-17 09:58  beginner.blog\
     文件        2518  2016-11-17 09:58  beginner.blog\.gitattributes
     文件        3990  2016-11-17 09:58  beginner.blog\.gitignore
     目录           0  2016-11-17 09:58  beginner.blog\Beginner.Blog\
     目录           0  2016-11-17 09:58  beginner.blog\Beginner.Blog\App_Start\
     文件        5458  2016-11-17 09:58  beginner.blog\Beginner.Blog\App_Start\RouteConfig.cs
     文件        5968  2016-11-17 09:58  beginner.blog\Beginner.Blog\ApplicationInsights.config
     文件        2706  2016-11-17 09:58  beginner.blog\Beginner.Blog\AutoFacBootStrapper.cs
     文件       25753  2016-11-17 09:58  beginner.blog\Beginner.Blog\Beginner.Blog.csproj
     目录           0  2016-11-17 09:58  beginner.blog\Beginner.Blog\Configs\
     文件        1523  2016-11-17 09:58  beginner.blog\Beginner.Blog\Configs\ConfigHelper.cs
     目录           0  2016-11-17 09:58  beginner.blog\Beginner.Blog\Configs\Files\
     文件         186  2016-11-17 09:58  beginner.blog\Beginner.Blog\Configs\Files\EmailConfig.json
     文件          88  2016-11-17 09:58  beginner.blog\Beginner.Blog\Configs\Files\setting.json
     目录           0  2016-11-17 09:58  beginner.blog\Beginner.Blog\Configs\Models\
     文件         685  2016-11-17 09:58  beginner.blog\Beginner.Blog\Configs\Models\Setting.cs
     目录           0  2016-11-17 09:58  beginner.blog\Beginner.Blog\Content\
     文件        3034  2016-11-17 09:58  beginner.blog\Beginner.Blog\Content\PagedList.css
     文件       26132  2016-11-17 09:58  beginner.blog\Beginner.Blog\Content\bootstrap-theme.css
     文件       47706  2016-11-17 09:58  beginner.blog\Beginner.Blog\Content\bootstrap-theme.css.map
     文件       23409  2016-11-17 09:58  beginner.blog\Beginner.Blog\Content\bootstrap-theme.min.css
     文件       25648  2016-11-17 09:58  beginner.blog\Beginner.Blog\Content\bootstrap-theme.min.css.map
     文件      146010  2016-11-17 09:58  beginner.blog\Beginner.Blog\Content\bootstrap.css
     文件      389287  2016-11-17 09:58  beginner.blog\Beginner.Blog\Content\bootstrap.css.map
     文件      121200  2016-11-17 09:58  beginner.blog\Beginner.Blog\Content\bootstrap.min.css
     文件      542194  2016-11-17 09:58  beginner.blog\Beginner.Blog\Content\bootstrap.min.css.map
     文件       35134  2016-11-17 09:58  beginner.blog\Beginner.Blog\Content\font-awesome.css
     文件       29063  2016-11-17 09:58  beginner.blog\Beginner.Blog\Content\font-awesome.min.css
     文件        1830  2016-11-17 09:58  beginner.blog\Beginner.Blog\Content\global.css
     文件        1620  2016-11-17 09:58  beginner.blog\Beginner.Blog\Content\login.css
     文件        6450  2016-11-17 09:58  beginner.blog\Beginner.Blog\Content\main.css
............此处省略310个文件信息

评论

共有 条评论