惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
The Blog of Author Tim Ferriss
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
云风的 BLOG
云风的 BLOG
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
P
Palo Alto Networks Blog
D
Docker
H
Hackread – Cybersecurity News, Data Breaches, AI and More
S
Schneier on Security
Engineering at Meta
Engineering at Meta
I
InfoQ
L
LangChain Blog
Cyberwarzone
Cyberwarzone
T
Tenable Blog
WordPress大学
WordPress大学
P
Privacy & Cybersecurity Law Blog
罗磊的独立博客
Apple Machine Learning Research
Apple Machine Learning Research
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Jina AI
Jina AI
C
CERT Recently Published Vulnerability Notes
Scott Helme
Scott Helme
博客园 - 三生石上(FineUI控件)
酷 壳 – CoolShell
酷 壳 – CoolShell
Know Your Adversary
Know Your Adversary
D
Darknet – Hacking Tools, Hacker News & Cyber Security
The Last Watchdog
The Last Watchdog
Last Week in AI
Last Week in AI
Cloudbric
Cloudbric
S
SegmentFault 最新的问题
爱范儿
爱范儿
Application and Cybersecurity Blog
Application and Cybersecurity Blog
博客园 - 叶小钗
AI
AI
T
Tor Project blog
I
Intezer
T
Threatpost
www.infosecurity-magazine.com
www.infosecurity-magazine.com
V
Visual Studio Blog
N
News and Events Feed by Topic
Latest news
Latest news
S
Security Affairs
博客园 - Franky
Microsoft Security Blog
Microsoft Security Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
B
Blog RSS Feed
C
Cybersecurity and Infrastructure Security Agency CISA
Hugging Face - Blog
Hugging Face - Blog
小众软件
小众软件
S
Securelist

博客园 - 云龙

win8.1安装出错解决方法之一 vs未能正确加载XX包的解决方法 下载android sdk ubuntu下安装与卸载软件方法 Ubuntu 安装杀毒软件防火墙 Ubuntu 图形处理软件 Ubuntu 下编译Android 源代码 ubuntu 安装配置 JDK7和Android Studio(apt-get方式) ununtu 下安装 Nvidia 显卡驱动 windows 8.1 在硬盘上创建扩展分区 (转)ASP.NET Identity登录原理 - Claims-based认证和OWIN (转)从Membership 到 .NET4.5 之 ASP.NET Identity (转)Asp.Net MVC中身份认证和授权 用JSON数据向已定义列的表格添加数据行 在MVC中动态读取JSON数据创建表格 IIS7.0(虚拟机)发布MVC5程序出现Http403错误的解决方法. 如何避免MVC Model First 设计时添加的DataAnnotation被覆盖掉 移动路由表 cisco路由基于策略的路由选择
Unity4.0配置
云龙 · 2016-06-05 · via 博客园 - 云龙

关于Unity4.0的使用:

一 安装Unity
  在程序包管理器控制台输入命令:Istall-Pckage unity.mvc
安装后会在App_Start中生成UnityConfig.cs 和UnityMvcActivator.cs 两个文件,打开UnityConfig.cs这个文件,修改如下

打开UnityConfig.cs这个文件,修改如下

在Global.asax中增加UnityWebActivator.Start();

Web.comfig:在<configuration></configuration>中加入

  <configSections>
    <section name="unity" type="Microsoft.Practices.Unity.Configuration.UnityConfigurationSection,Microsoft.Practices.Unity.Configuration"/>
  </configSections>

View Code

然后配置:

  <unity xmlns="http://schemas.microsoft.com/practices/2010/unity" >
    
    <!--版本-->
    <assembly name="LongIBLL"/>
    <assembly name="LongBLL"/>
    <assembly name="LongIDAL"/>
    <assembly name="LongDAL"/>
    
    <!--命名空间-->
    <namespace name="LongIBLL"/>
    <namespace name="LongBLL"/>
    <namespace name ="LongIDAL"/>
    <namespace name ="LongDAL"/>
    <container>
      
      <!--IBLL映射BLL类-->
      <register type="ILongRolesService"                             mapTo="LongRolesService"/>
      <register type="ILongManagersService"                          mapTo="LongManagersService"/>
      <register type="ILongNewsService"                              mapTo="LongNewsService"/>
      <register type="ILongModulesService"                           mapTo="LongModulesService"/>
      <register type="ILongPermissionModulesService"                 mapTo="LongPermissionModulesService"/>
      <register type="ILongPermissionService"                        mapTo="LongPermissionService"/>
      
      <!--IBLL<T>映射BLL类<T> 泛型注入-->
      <register type="IBaseService[]"              mapTo="LongBaseService[]"/>

      <!-- IDAL映射DAL-->
      <register type="ILongRolesRepository"                          mapTo="LongRolesRepository"/>
      <register type="ILongManagersRepository"                       mapTo="LongManagersRepository"/>
      <register type="ILongNewsRepository"                           mapTo="LongNewsRepository"/>
      <register type="ILongModulesRepository"                        mapTo="LongModulesRepository"/>
      <register type="ILongPermissionModulesRepository"              mapTo="LongPermissionModulesRepository"/>
      <register type="ILongPermissionRepository"                     mapTo="LongPermissionRepository"/>

      <!-- IDAL<T>映射DAL<T>泛型注入-->
      <register type="IBaseRepository[]"           mapTo="LongBaseRepository[]"/>
    </container>
  </unity> 

Unity注册配置(web.config)

最后在需要的地方调用