-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.cs
More file actions
37 lines (26 loc) · 1.25 KB
/
Copy pathMain.cs
File metadata and controls
37 lines (26 loc) · 1.25 KB
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
34
35
36
37
using System.Text;
using Microsoft.EntityFrameworkCore;
using FastTrackEServices.Data;
using FastTrackEServices.Implementation;
using FastTrackEServices.HelperAlgorithms;
using FastTrackEServices.ServiceResolver;
var builder = WebApplication.CreateBuilder(args);
var connectionString = builder.Configuration.GetConnectionString("Default");
// Dependency Injections
// Shoe Color's resources will not have a dedicated module
builder.Services.AddDbContext<AppDbContext>(options => options.UseMySql(connectionString, ServerVersion.AutoDetect(connectionString)));
builder.Services.AddScoped<IRestOperation, ClientRest>();
builder.Services.AddScoped<IRestOperation, ShoewareRest>();
builder.Services.AddScoped<IRestOperation, ShoewareRepairRest>();
builder.Services.AddScoped<IRestOperation, OwnedShoewareRest>();
builder.Services.AddScoped<IRestOperation, OrderCartRest>();
builder.Services.AddScoped<IRestOperation, ShoewareOrderRest>();
// DI for helper algorithms
builder.Services.AddSingleton<ITransform, CollectionToStringArray>();
//Routing
builder.Services.AddControllers();
var app = builder.Build();
// Adds enpoints to controller functions to the endpoint builder interface
app.MapControllers();
app.UseStaticFiles();
app.Run();