27 lines
764 B
C#
27 lines
764 B
C#
using Bimix.Infrastructure.Data;
|
|
using Bimix.Infrastructure.Sync;
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
var builder = WebApplication.CreateBuilder(args);
|
|
|
|
var connectionString = builder.Configuration.GetConnectionString("DefaultConnection");
|
|
builder.Services.AddDbContext<BimixDbContext>(options => options.UseSqlServer(connectionString));
|
|
builder.Services.AddScoped<ProductSyncService>();
|
|
|
|
builder.Services.AddHttpClient();
|
|
builder.Services.AddControllers();
|
|
builder.Services.AddEndpointsApiExplorer();
|
|
builder.Services.AddSwaggerGen();
|
|
|
|
var app = builder.Build();
|
|
|
|
if (app.Environment.IsDevelopment())
|
|
{
|
|
app.UseSwagger();
|
|
app.UseSwaggerUI();
|
|
}
|
|
|
|
app.UseHttpsRedirection();
|
|
app.UseAuthorization();
|
|
app.MapControllers();
|
|
app.Run(); |