using IM.Application.Abstractions; using IM.Commons; using IM.Infrastructure.Efcore; using IM.Protocols.Grpc.Contact; using IM.Protocols.Grpc.User; using MessageService.Infrastructure; using MessageService.WebApi.Application; using MessageService.WebApi.Application.Conversation; using MessageService.WebApi.Application.IntegrationServices; using Microsoft.Extensions.Options; namespace MessageService.WebApi { public class ModuleInit : IModuleInitializer { public void Initialize(IServiceCollection services) { services.AddScoped(); services.AddScoped>(); services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddHttpClient(c => { c.BaseAddress = new Uri("http://im-group-service:8080/"); }); services.AddGrpcClient((sp, o) => { var options = sp.GetRequiredService>(); o.Address = new Uri(options.CurrentValue.ContactServiceUrl); }); } } }