| | 1 | | using Despesas.Application.Abstractions; |
| | 2 | | using Despesas.Application.Dtos; |
| | 3 | | using Despesas.Application.Dtos.Core; |
| | 4 | | using Despesas.Application.Implementations; |
| | 5 | | using Despesas.Infrastructure.Email; |
| | 6 | | using Despesas.Infrastructure.Email.Abstractions; |
| | 7 | | using Despesas.Repository.UnitOfWork; |
| | 8 | | using Despesas.Repository.UnitOfWork.Abstractions; |
| | 9 | | using Domain.Entities; |
| | 10 | | using EasyCryptoSalt; |
| | 11 | | using Microsoft.Extensions.Configuration; |
| | 12 | | using Microsoft.Extensions.DependencyInjection; |
| | 13 | |
|
| | 14 | | namespace Despesas.Application.CommonDependenceInject; |
| | 15 | |
|
| | 16 | | public static class ServicesDependenceInject |
| | 17 | | { |
| | 18 | | public static IServiceCollection AddServicesCryptography(this IServiceCollection services, IConfiguration configurat |
| 12 | 19 | | { |
| 12 | 20 | | services.Configure<CryptoOptions>(configuration.GetSection("CryptoConfigurations")); |
| 12 | 21 | | services.AddSingleton<ICrypto, Crypto>(); |
| 12 | 22 | | return services; |
| 12 | 23 | | } |
| | 24 | |
|
| | 25 | | public static IServiceCollection AddServices(this IServiceCollection services) |
| 1 | 26 | | { |
| 1 | 27 | | services.AddScoped(typeof(IAcessoBusiness<AcessoDto, LoginDto>), typeof(AcessoBusinessImpl<AcessoDto, LoginDto>) |
| 1 | 28 | | services.AddScoped(typeof(ICategoriaBusiness<CategoriaDto, Categoria>), typeof(CategoriaBusinessImpl<CategoriaDt |
| 1 | 29 | | services.AddScoped(typeof(IBusinessBase<DespesaDto, Despesa>), typeof(DespesaBusinessImpl<DespesaDto>)); |
| 1 | 30 | | services.AddScoped(typeof(IBusinessBase<ReceitaDto, Receita>), typeof(ReceitaBusinessImpl<ReceitaDto>)); |
| 1 | 31 | | services.AddScoped(typeof(ILancamentoBusiness<LancamentoDto>), typeof(LancamentoBusinessImpl<LancamentoDto>)); |
| 1 | 32 | | services.AddScoped(typeof(IUsuarioBusiness<UsuarioDto>), typeof(UsuarioBusinessImpl<UsuarioDto>)); |
| 1 | 33 | | services.AddScoped(typeof(IImagemPerfilUsuarioBusiness<ImagemPerfilDto, UsuarioDto>), typeof(ImagemPerfilUsuario |
| 1 | 34 | | services.AddScoped(typeof(ISaldoBusiness), typeof(SaldoBusinessImpl)); |
| 1 | 35 | | services.AddScoped(typeof(IGraficosBusiness), typeof(GraficosBusinessImpl)); |
| | 36 | |
|
| 1 | 37 | | services.AddScoped(typeof(IUnitOfWork<>), typeof(UnitOfWork<>)); |
| | 38 | |
|
| 1 | 39 | | services.AddScoped<IEmailSender, EmailSender>(); |
| 1 | 40 | | return services; |
| 1 | 41 | | } |
| | 42 | | } |
| | 43 | |
|
| | 44 | |
|