Generic Service

JSON Reference loop
Events
This commit is contained in:
2018-10-07 03:03:38 +02:00
parent 642d533a49
commit 9a9d4c7053
12 changed files with 270 additions and 117 deletions

View File

@@ -7,9 +7,9 @@ using System.Security.Cryptography.X509Certificates;
using System.Threading.Tasks;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Hosting.Internal;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
namespace LaDOSE.Api
{
public class Program

View File

@@ -41,7 +41,7 @@ namespace LaDOSE.Api
var MySqlUser = this.Configuration["MySql:User"];
var MySqlPassword = this.Configuration["MySql:Password"];
services.AddCors();
services.AddMvc();
services.AddMvc().AddJsonOptions(x => x.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore);
services.AddDbContextPool<LaDOSEDbContext>( // replace "YourDbContext" with the class name of your DbContext
options => options.UseMySql($"Server={MySqlServer};Database={MySqlDatabase};User={MySqlUser};Password={MySqlPassword};", // replace with your Connection String
mysqlOptions =>