WCS
dengjunjie
2024-10-17 a38b50675f2cf8e813bd337ca2f9d9456cc421d3
项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/Extensions/AutofacModuleRegister.cs
@@ -2,6 +2,7 @@
using Autofac.Extras.DynamicProxy;
using log4net;
using Microsoft.Extensions.DependencyModel;
using OfficeOpenXml.FormulaParsing.Excel.Functions.Text;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -33,9 +34,9 @@
            List<RuntimeLibrary> compilationLibrary = DependencyContext.Default
                    .RuntimeLibraries
                    .Where(x => !x.Serviceable
                    && x.Type == "project")
                    .Where(x => !x.Serviceable && x.Type == "project")
                    .ToList();
            List<Assembly> assemblyList = new List<Assembly>();
            foreach (var library in compilationLibrary)
            {
@@ -52,10 +53,22 @@
            builder.RegisterAssemblyTypes(assemblyList.ToArray()).Where(x => !x.IsInterface && !x.IsAbstract && baseType.IsAssignableFrom(x))
                        .AsImplementedInterfaces()
                        .PropertiesAutowired()
                        .InstancePerDependency().
                        EnableInterfaceInterceptors()
                        .InstancePerDependency()
                        .EnableInterfaceInterceptors()
                        .InterceptedBy(cacheType.ToArray());
            foreach (var assembly in assemblyList)
            {
                foreach (var type in assembly.GetTypes())
                {
                    if (!type.IsInterface && !type.IsAbstract && baseType.IsAssignableFrom(type))
                    {
                        Console.WriteLine($"娉ㄥ唽绫诲瀷: {type.FullName}");
                    }
                }
            }
            builder.RegisterType<UnitOfWorkManage>().As<IUnitOfWorkManage>()
               .AsImplementedInterfaces()
               .InstancePerLifetimeScope()