Stuff and things
This commit is contained in:
@@ -6,9 +6,10 @@ using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.OpenApi.Models;
|
||||
using PartSource.Api.Formatters;
|
||||
using PartSource.Data;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Serialization;
|
||||
using PartSource.Data.AutoMapper;
|
||||
using PartSource.Data.Contexts;
|
||||
using PartSource.Services;
|
||||
using System.IO;
|
||||
|
||||
@@ -30,6 +31,14 @@ namespace PartSource.Api
|
||||
{
|
||||
options.OutputFormatters.RemoveType(typeof(StringOutputFormatter));
|
||||
options.EnableEndpointRouting = false;
|
||||
})
|
||||
.AddNewtonsoftJson(options =>
|
||||
{
|
||||
options.SerializerSettings.NullValueHandling = NullValueHandling.Ignore;
|
||||
options.SerializerSettings.ContractResolver = new DefaultContractResolver()
|
||||
{
|
||||
NamingStrategy = new SnakeCaseNamingStrategy()
|
||||
};
|
||||
});
|
||||
|
||||
services.AddSwaggerGen(c =>
|
||||
@@ -46,6 +55,7 @@ namespace PartSource.Api
|
||||
services.AddTransient<NexpartService>();
|
||||
services.AddTransient<SecurityService>();
|
||||
services.AddTransient<VehicleService>();
|
||||
services.AddTransient<ShopifyChangelogService>();
|
||||
|
||||
services.AddCors(o => o.AddPolicy("Default", builder =>
|
||||
{
|
||||
@@ -57,6 +67,9 @@ namespace PartSource.Api
|
||||
services.AddDbContext<PartSourceContext>(options =>
|
||||
options.UseSqlServer(Configuration.GetConnectionString("PartSourceDatabase"))
|
||||
);
|
||||
services.AddDbContext<FitmentContext>(options =>
|
||||
options.UseSqlServer(Configuration.GetConnectionString("FitmentDatabase"))
|
||||
);
|
||||
}
|
||||
|
||||
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
||||
|
||||
Reference in New Issue
Block a user