-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
33 lines (22 loc) · 907 Bytes
/
Copy pathProgram.cs
File metadata and controls
33 lines (22 loc) · 907 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
using BudgetTrackerWithDB.Application.Interfaces;
using BudgetTrackerWithDB.Application.Services;
using BudgetTrackerWithDB.Infrastructure;
using Microsoft.EntityFrameworkCore;
using Scalar.AspNetCore;
var builder = WebApplication.CreateBuilder(args);
// builder.Services.AddSingleton<ITransactionService, TransactionServiceMock>();
// builder.Services.AddSingleton<IReportService, ReportServiceMock>();
builder.Services.AddDbContext<ApplicationDbContext>(options =>
options.UseSqlite(builder.Configuration.GetConnectionString("DefaultConnection")));
builder.Services.AddScoped<ITransactionService, TransactionServiceEf>();
builder.Services.AddScoped<IReportService, ReportServiceEf>();
builder.Services.AddOpenApi();
var app = builder.Build();
if (app.Environment.IsDevelopment())
{
app.MapOpenApi();
app.MapScalarApiReference();
}
app.MapTransactions();
app.MapReports();
app.Run();