// public static string CreatedFilePath { get; set; } = "../../json/created.json"; public static string CreateJSON(MandelbrotJSON mandelbrotJSON, string createdFilePath) { string directory = Directory.GetCurrentDirectory(); string jsonString = JsonSerializer.Serialize(mandelbrotJSON); File.WriteAllText(createdFilePath, jsonString); return(jsonString); }
private string CreateMandelbrotRequestObject(string createdFilePath) { MandelbrotJSON mandelbrotJSON = new MandelbrotJSON() { Center = center, Zoom = zoom, HeightPixel = HeightPixel, WidthPixel = WidthPixel, MaxIterations = maxIterations }; return(ConverterJSON.CreateJSON(mandelbrotJSON, createdFilePath)); }
public static string WriteFromObject(MandelbrotJSON mandelbrotJSON) { return(JsonSerializer.Serialize(mandelbrotJSON)); }