摘要: 在上篇中我们通过创建一个类并继承autoMapper的Profile类 public class Mappings : Profile { public Mappings() { CreateMap<UserDto, TbUser>(); } } 这样做有一种弊端,就是当传输对象很多的时候,还需要手 阅读全文
posted @ 2020-04-28 14:14 YuanY 阅读(212) 评论(0) 推荐(0) 编辑
摘要: Autofac自动注入是通过名称约定来实现依赖注入 ps:本demo接口层都以“I”开头,以“Service”结尾。服务层实现都以“Service”结尾。 为什么要实现自动注入 大多时候,我们都是 以下方式进行依赖注入 public IServiceProvider ConfigureService 阅读全文
posted @ 2020-04-28 12:15 YuanY 阅读(364) 评论(0) 推荐(0) 编辑