52 lines
1.7 KiB
C#
52 lines
1.7 KiB
C#
using BankBusinessLogic.BusinessLogics;
|
|
using BankContracts.BusinessLogicsContracts;
|
|
using BankContracts.StoragesContracts;
|
|
using BankDatabaseImplement.Implements;
|
|
using BankContracts.BindingModels;
|
|
using BankOperatorApp;
|
|
|
|
var builder = WebApplication.CreateBuilder(args);
|
|
|
|
// Add services to the container.
|
|
builder.Services.AddControllersWithViews();
|
|
|
|
builder.Services.AddTransient<ICurrencyPurchaseStorage, CurrencyPurchaseStorage>();
|
|
builder.Services.AddTransient<ICurrencyStorage, CurrencyStorage>();
|
|
builder.Services.AddTransient<ICreditProgramStorage, CreditProgramStorage>();
|
|
builder.Services.AddTransient<IBankOperatorStorage, BankOperatorStorage>();
|
|
|
|
builder.Services.AddTransient<IDealStorage, DealStorage>();
|
|
builder.Services.AddTransient<ITransferStorage, TransferStorage>();
|
|
builder.Services.AddTransient<IPaymentStorage, PaymentStorage>();
|
|
|
|
|
|
builder.Services.AddTransient<ICurrencyPurchaseLogic, CurrencyPurchaseLogic>();
|
|
builder.Services.AddTransient<ICurrencyLogic, CurrencyLogic>();
|
|
builder.Services.AddTransient<ICreditProgramLogic, CreditProgramLogic>();
|
|
builder.Services.AddTransient<IBankOperatorLogic, BankOperatorLogic>();
|
|
|
|
builder.Services.AddControllersWithViews();
|
|
|
|
var app = builder.Build();
|
|
|
|
// Configure the HTTP request pipeline.
|
|
if (!app.Environment.IsDevelopment())
|
|
{
|
|
app.UseExceptionHandler("/Home/Error");
|
|
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
|
|
app.UseHsts();
|
|
}
|
|
|
|
app.UseHttpsRedirection();
|
|
app.UseStaticFiles();
|
|
|
|
app.UseRouting();
|
|
|
|
app.UseAuthorization();
|
|
|
|
app.MapControllerRoute(
|
|
name: "default",
|
|
pattern: "{controller=Home}/{action=Index}/{id?}");
|
|
|
|
app.Run();
|