using Autofac; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks;
namespace YFJK.BasicServices.Host.Builder { public class DefaultModuleRegister : Module { protected override void Load(ContainerBuilder builder) { builder.RegisterType< Models.BaseResponse> ().AsSelf();
} } }
指定构造函数参数注册
containerBuilder.RegisterType< Neo4jHelper> ().WithParameters(new List< NamedParameter> () { new NamedParameter("bolturl",Configuration["Neo4jSetting:Bolt"]), new NamedParameter("httpurl",Configuration["Neo4jSetting:Url"]), new NamedParameter("user",SecurityCommon.DecryptDES(Configuration["Neo4jSetting:User"])), new NamedParameter("password",SecurityCommon.DecryptDES(Configuration["Neo4jSetting:Password"])), }).SingleInstance();