| | |
| | | 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; |
| | |
| | | |
| | | 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) |
| | | { |
| | |
| | | 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() |