I have a model created in EF core 3.0, using database first approach.
public partial class Study
{
public int StudyId { get; set; }
public int SampleId { get; set; }
public byte StudyNumber { get; set; }
public int StudyTypeId { get; set; }
public int? PhaseId { get; set; }
public String StudyData { get; set; }
}
The attribute StudyData maps to a SQL server nvarchar field that holds a JSON document.
This is part of a asp.net core web api and the controller returns JSON.
services.AddControllers().AddNewtonsoftJson(options =>
options.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore
);
My problem is that the controller now serialise twice the StudyData and adds slashes at the original quotes. I am not sure how to avoid this behaviour.