//using Microsoft.AspNetCore.Mvc; //using System.Dynamic; //namespace zero.Metadata; //public class Schema //{ // public dynamic Model { get; private set; } // static JsonOptions Settings; // static Schema() // { // Settings = new JsonOptions() // { // Formatting = Formatting.None, // TypeNameHandling = TypeNameHandling.None // }; // Settings.Converters.Add(new SchemaConverter()); // } // public Schema(string type, Action set) : this(type, false, set) { } // public Schema(string type, bool isRoot, Action set) // { // Model = new ExpandoObject(); // var dict = Model as IDictionary; // if (isRoot) // { // dict["@context"] = "https://schema.org"; // } // dict["@type"] = type; // set(Model); // } // public string ToJson() => JsonConvert.SerializeObject(Model, Settings); // class SchemaConverter : JsonConverter // { // public override void WriteJson(JsonWriter writer, Schema value, JsonSerializer serializer) // { // serializer.Serialize(writer, value.Model); // } // public override Schema ReadJson(JsonReader reader, Type objectType, Schema existingValue, bool hasExistingValue, JsonSerializer serializer) // { // throw new NotImplementedException(); // } // } //}