Ejemplo n.º 1
0
        public string?ToJson()
        {
            if (Ret == null)
            {
                return(null);
            }

            if (IsPainText)
            {
                return(Ret.ToString());
            }

            if (StatusCode == 200)
            {
                return(Ret.ToDtoJson());
            }

            return(JsonSerializer.Serialize(Ret, new JsonSerializerOptions
            {
                WriteIndented = true,
                IgnoreNullValues = true
            }));
        }