using CloudBuilder.Core.Application.Builders; using CloudBuilder.Core.Application.Options; using CloudBuilder.Core.DatabaseAccessor; using CloudBuilder.Core.DatabaseAccessor.Entity; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Extensions; using Microsoft.Extensions.Options; using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Text; using System.Threading.Tasks; namespace CloudBuilder.Core.Application.Packs { /// /// CloudBuilder核心模块 /// [Description("CloudBuilder核心模块")] [PackLevel(0)] public class CloudBuilderCorePack : CloudBuilderPack { /// /// 获取 模块级别 /// public override PackLevel Level => PackLevel.Core; /// /// 将全局应用添加到依赖注入服务容器中 /// /// 依赖注入服务容器 /// public override IServiceCollection AddServices(IServiceCollection services, CloudBuilderBuilder builder) { services.AddSingleton(); services.AddSingleton(new WebService(services)); services.AddScoped(); //services.TryAddSingleton(); //services.TryAddSingleton(); //services.TryAddSingleton(); //services.TryAddSingleton(); //services.TryAddSingleton(); //services.TryAddScoped(); //services.TryAddTransient(); //services.AddTransient(); //services.AddDistributedMemoryCache(); return services; } } }