public EntityJsonWriter(Type docType, TextWriter textWriter) : base(textWriter) { Ensure.That(docType, "docType").IsNotNull(); DocType = docType; Conventions = new SerializationConventions(); }
public DocumentJsonWriter(DocumentSerializationMeta documentMeta, TextWriter textWriter, SerializationConventions conventions) : base(textWriter) { Ensure.That(documentMeta, "documentMeta").IsNotNull(); Ensure.That(conventions, "conventions").IsNotNull(); HasWrittenDocumentMeta = false; DocumentMeta = documentMeta; Conventions = conventions; ConventionWriter = new SerializationConventionWriter(this); }
public DocumentJsonWriter(TextWriter textWriter, DocumentSerializationMeta documentMeta, SerializationConventions conventions, IEntityReflector entityReflector) : base(textWriter) { EnsureArg.IsNotNull(documentMeta, nameof(documentMeta)); EnsureArg.IsNotNull(conventions, nameof(conventions)); EnsureArg.IsNotNull(entityReflector, nameof(entityReflector)); HasWrittenDocumentMeta = false; DocumentMeta = documentMeta; Conventions = conventions; ConventionWriter = new SerializationConventionWriter(this); EntityReflector = entityReflector; CloseOutput = false; }
public DocumentJsonWriter(TextWriter textWriter, DocumentSerializationMeta documentMeta, SerializationConventions conventions, IEntityReflector entityReflector) : base(textWriter) { Ensure.That(documentMeta, "documentMeta").IsNotNull(); Ensure.That(conventions, "conventions").IsNotNull(); Ensure.That(conventions, "entityReflector").IsNotNull(); HasWrittenDocumentMeta = false; DocumentMeta = documentMeta; Conventions = conventions; ConventionWriter = new SerializationConventionWriter(this); EntityReflector = entityReflector; CloseOutput = false; }
public SerializationConfiguration(IContractResolver contractResolver = null) { Settings = new JsonSerializerSettings { TypeNameHandling = TypeNameHandling.None, ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, ContractResolver = contractResolver ?? new SerializationContractResolver(), DateFormatHandling = DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = DateTimeZoneHandling.RoundtripKind, Formatting = Formatting.None, DefaultValueHandling = DefaultValueHandling.Include, MissingMemberHandling = MissingMemberHandling.Ignore, NullValueHandling = NullValueHandling.Ignore }; Settings.Converters.Add(new StringEnumConverter()); Conventions = new SerializationConventions(); }