Major update

This commit is contained in:
2023-06-01 08:52:05 -05:00
parent d7c0f373f4
commit df84287eb2
264 changed files with 8614 additions and 964 deletions

View File

@@ -1,8 +1,7 @@
using Microsoft.EntityFrameworkCore;
using MediatR;
using Microsoft.EntityFrameworkCore;
using Serilog;
using Teams;
using Teams.DbContexts;
using Teams.Services;
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Debug()
@@ -16,22 +15,17 @@ builder.Host.UseSerilog();
// Add services to the container.
builder.Services.AddControllers(options =>
{
options.ReturnHttpNotAcceptable = true;
}).AddXmlDataContractSerializerFormatters();
builder.Services.AddMediatR(typeof(Program));
builder.Services.AddControllers();
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
builder.Services.AddDbContext<MlbGameDayContext>(dbContextOptions =>
builder.Services.AddDbContext<TeamsContext>(dbContextOptions =>
dbContextOptions.UseNpgsql(builder.Configuration["ConnectionStrings:DBConnectionString"])
);
builder.Services.AddScoped<ITeamsRepository, TeamsRepository>();
builder.Services.AddAutoMapper(AppDomain.CurrentDomain.GetAssemblies());
var app = builder.Build();
// Configure the HTTP request pipeline.
@@ -47,10 +41,7 @@ app.UseRouting();
app.UseAuthorization();
app.UseEndpoints(endpoints =>
{
endpoints.MapControllers();
});
app.MapControllers();
app.Run();