-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
28 lines (19 loc) · 930 Bytes
/
Program.cs
File metadata and controls
28 lines (19 loc) · 930 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
using NetAstroBookings.Presentation;
using NetAstroBookings.Persistence;
using NetAstroBookings.Business;
using System;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddSingleton<TimeProvider>(TimeProvider.System);
builder.Services.AddSingleton<IRocketRepository, InMemoryRocketRepository>();
builder.Services.AddSingleton<IFlightRepository, InMemoryFlightRepository>();
builder.Services.AddSingleton<IBookingRepository, InMemoryBookingRepository>();
builder.Services.AddSingleton<IFlightOperationGate, FlightOperationGate>();
builder.Services.AddScoped<NetAstroBookings.Business.RocketService>();
builder.Services.AddScoped<NetAstroBookings.Business.FlightService>();
builder.Services.AddSingleton<NetAstroBookings.Business.BookingService>();
var app = builder.Build();
app.MapGet("/", () => "Hello World!");
app.MapRocketEndpoints();
app.MapFlightEndpoints();
app.MapBookingEndpoints();
app.Run();