AutoMapper

AutoMapper.Extensions.Microsoft.DependencyInjection

first

public class AutoMapperSetup : Profile
{
public AutoMapperSetup()
{
//CreateMap<model1, model2>();
}
}

second

startup.cs

services.AddAutoMapper(typeof(AutoMapperSetup));

 

Autofac

Autofac.Extensions.DependencyInjection

first

public class AutofacSetup : Module
{
protected override void Load(ContainerBuilder builder)
{
//builder.RegisterType<Service>().As<IService>().SingleInstance();

}
}

second

startup.cs

public void ConfigureContainer(ContainerBuilder builder)
{
builder.RegisterModule(new AutofacSetup());
}

 

相关文章:

  • 2021-09-05
  • 2022-12-23
  • 2022-02-23
  • 2022-12-23
  • 2022-01-23
  • 2021-08-31
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-04-08
  • 2021-05-30
  • 2021-12-09
相关资源
相似解决方案