using System; using System.Collections.Generic; using System.Linq; using System.Web; using Autofac; using System.Reflection; using Autofac.Core; using EMISOnline.DataLogic; using EMISOnline.Utility; namespace EMISOnline.CommonLogic { public class ServiceModule : Autofac.Module { static int BusinessModuleIndex { get; set; } protected override void Load(ContainerBuilder builder) { //通用类型注册 var blAssembly = typeof(BaseServices).Assembly; builder.RegisterAssemblyTypes(blAssembly) .Where(x => x.FullName.StartsWith("EMISOnline.CommonLogic") && x.Name != "BaseServices" && x.Name.EndsWith("Services")) .AsImplementedInterfaces() .PropertiesAutowired() .InstancePerLifetimeScope(); } } }