public static void AddMSFramework(this IServiceCollection services, Action <MSFrameworkBuilder> builderAction = null) { var builder = new MSFrameworkBuilder(services); builderAction?.Invoke(builder); services.AddMemoryCache(); builder.Services.TryAddScoped <IUnitOfWorkManager, DefaultUnitOfWorkManager>(); // 如果你想换成消息队列,则重新注册一个对应的服务即可 builder.Services.TryAddScoped <IAuditService, DefaultAuditService>(); builder.UseInitializer(); }
public static void AddMSFramework(this IServiceCollection services, Action <MSFrameworkBuilder> builderAction = null) { var builder = new MSFrameworkBuilder(services); builderAction?.Invoke(builder); services.AddMemoryCache(); builder.Services.TryAddScoped <IUnitOfWorkManager, DefaultUnitOfWorkManager>(); // 如果你想换成消息队列,则重新注册一个对应的服务即可 builder.Services.TryAddScoped <IAuditService, DefaultAuditService>(); builder.UseInitializer(); var assemblies = AssemblyFinder.GetAllList(); // todo: how to print logs in ConfigureService method Console.WriteLine($"Find assemblies: {string.Join(", ", assemblies.Select(x => x.GetName().Name))}"); }