fix BankRestApi.Program, add dependency injection

This commit is contained in:
Zakharov_Rostislav 2024-05-17 15:26:15 +04:00
parent e3c55f7c65
commit 1a25fc7b93
2 changed files with 20 additions and 4 deletions

View File

@ -12,7 +12,7 @@ using System.Threading.Tasks;
namespace BankDatabaseImplement.Implements
{
internal class AccountStorage : IAccountStorage
public class AccountStorage : IAccountStorage
{
public List<AccountViewModel> GetFullList()
{

View File

@ -12,13 +12,29 @@ builder.Logging.AddLog4Net("log4net.config");
// Add services to the container.
builder.Services.AddTransient<IClientStorage, ClientStorage>();
builder.Services.AddTransient<ICardStorage, CardStorage>();
builder.Services.AddTransient<IOperationStorage, OperationStorage>();
builder.Services.AddTransient<IRequestStorage, RequestStorage>();
builder.Services.AddTransient<IClientLogic, ClientLogic>();
builder.Services.AddTransient<IManagerStorage, ManagerStorage>();
builder.Services.AddTransient<IManagerLogic, ManagerLogic>();
builder.Services.AddTransient<ICardStorage, CardStorage>();
builder.Services.AddTransient<ICardLogic, CardLogic>();
builder.Services.AddTransient<IAccountStorage, AccountStorage>();
builder.Services.AddTransient<IAccountLogic, AccountLogic>();
builder.Services.AddTransient<IOperationStorage, OperationStorage>();
builder.Services.AddTransient<IOperationLogic, OperationLogic>();
builder.Services.AddTransient<ITransferStorage, TransferStorage>();
builder.Services.AddTransient<ITransferLogic, TransferLogic>();
builder.Services.AddTransient<IRequestStorage, RequestStorage>();
builder.Services.AddTransient<IRequestLogic, RequestLogic>();
builder.Services.AddTransient<IWithdrawalStorage, WithdrawalStorage>();
builder.Services.AddTransient<IWithdrawalLogic, WithdrawalLogic>();
builder.Services.AddLogging(option =>
{
option.SetMinimumLevel(LogLevel.Information);