.Net优秀开源(2)Autofac

序言

 

IOC

Autofac

https://github.com/autofac/Autofac/tree/v6.0.0

 

builder.RegisterType<LocalConfigNodeCache>()
.As<ISoaNodeCache>()
.SingleInstance()
.AutoActivate();

 

AOP

AOP的实现方式大致可以分为两类:动态代理和IL编织两种方式

 

KingAop

https://github.com/AntyaDev/KingAOP

Couldn't load type 'KingAOP.AspectWeaver'

Because KingAOP is not avaible in nuget repository, I donwloaded github project, builded and add it as DLL library to my project.

 

Castle.Core

Castle.Core 本质是创建继承原来类的代理类,重写虚方法实现AOP功能。

https://github.com/castleproject/Core

 

Autofac.Aop

Autofac的AOP是通过Castle(也是一个容器)项目的核心部分实现的,名为Autofac.Extras.DynamicProxy,顾名思义,其实现方式为动态代理。

 

 

AutoMapper

https://github.com/AutoMapper/AutoMapper/tree/master

 

Dapper

https://github.com/DapperLib/Dapper/tree/main

 

资料

C#使用Autofac实现控制反转IoC和面向切面编程AOP

C#使用Castle实现AOP面向切面编程

https://www.cnblogs.com/li150dan/category/1351056.html

posted @   ~沐风  阅读(76)  评论(0编辑  收藏  举报
编辑推荐:
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 单线程的Redis速度为什么快?
· SQL Server 2025 AI相关能力初探
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 展开说说关于C#中ORM框架的用法!
历史上的今天:
2019-10-21 微信公众号开发
2018-10-21 Elasticsearch查询

喜欢请打赏

扫描二维码打赏

了解更多

点击右上角即可分享
微信分享提示