摘要: 今天我们试着在WebApi2实现autofac的注入,关于这方面也是看了几位园友的分享省了不少时间,所以结合着前篇的demo再新建webapi进行... demo3下载地址: http://pan.baidu.com/s/1eSCAZtC 一样开篇还是发下大概demo结构: 还是nuget安装 Au 阅读全文
posted @ 2017-03-07 11:38 __Burt 阅读(643) 评论(2) 推荐(2) 编辑
摘要: 首先看下Demo2的结构 分享下demo源码 :http://pan.baidu.com/s/1qYtZCrM 然后下面一步步将Autofac集成到mvc中。 首先,定义Model Product.cs public class Product { public int Id { get; set; 阅读全文
posted @ 2017-03-06 20:36 __Burt 阅读(1194) 评论(5) 推荐(6) 编辑
摘要: Autofac是.NET领域最为流行的IOC框架之一,传说是速度最快的一个: 优点: 通过VS中的NuGet来加载AutoFac,不论是哪种方式,最终的目的就是将 Autofac.dll程序集引用到你的项目中。 demo1结构 数据访问的接口IDAL Sql和Oracle两种方式分别实现IDAL接口 阅读全文
posted @ 2017-03-06 16:06 __Burt 阅读(800) 评论(0) 推荐(3) 编辑