Trying out some json converters
This commit is contained in:
@@ -12,8 +12,10 @@ using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.OpenApi.Models;
|
||||
using Newtonsoft.Json;
|
||||
using NLog.Extensions.Logging;
|
||||
using TOOHUCardAPI.Data;
|
||||
using TOOHUCardAPI.Data.JsonConverters;
|
||||
using TOOHUCardAPI.Data.Repositories;
|
||||
using TOOHUCardAPI.Data.Services;
|
||||
|
||||
@@ -32,7 +34,14 @@ namespace TOOHUCardAPI
|
||||
// This method gets called by the runtime. Use this method to add services to the container.
|
||||
public void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
services.AddControllers().AddNewtonsoftJson();
|
||||
services.AddControllers().AddNewtonsoftJson(opt =>
|
||||
{
|
||||
opt.SerializerSettings.Converters = new List<JsonConverter>
|
||||
{
|
||||
new RankEntryDTOConverter(),
|
||||
new PlayerDataGetResponseObjectPlayerConverter()
|
||||
};
|
||||
});
|
||||
services.AddDbContext<AppDbContext>(opt =>
|
||||
{
|
||||
opt.UseNpgsql(Configuration.GetConnectionString("postgres"));
|
||||
|
||||
Reference in New Issue
Block a user