41 lines
829 B
C#
41 lines
829 B
C#
using SQLiteEF;
|
|
|
|
namespace API;
|
|
|
|
public class Api
|
|
{
|
|
public Api(string[] args)
|
|
{
|
|
WebApplicationBuilder builder = WebApplication.CreateBuilder(args);
|
|
|
|
// Add services to the container.
|
|
|
|
builder.Services.AddControllers();
|
|
// Learn more about configuring OpenAPI at https://aka.ms/aspnet/openapi
|
|
builder.Services.AddOpenApi();
|
|
|
|
builder.Services.AddDbContext<Context>();
|
|
|
|
WebApplication app = builder.Build();
|
|
|
|
// Configure the HTTP request pipeline.
|
|
if (app.Environment.IsDevelopment())
|
|
{
|
|
app.MapOpenApi();
|
|
}
|
|
|
|
app.UseHttpsRedirection();
|
|
|
|
app.UseAuthorization();
|
|
|
|
|
|
app.MapControllers();
|
|
|
|
app.Run();
|
|
}
|
|
|
|
public static void Main(string[] args)
|
|
{
|
|
Api _ = new (args);
|
|
}
|
|
} |