public JsonDomainEventSerializer(string virtualNamespaceName)
        {
            _binder = new TypeAliasBinder(virtualNamespaceName);

            Settings = new JsonSerializerSettings
            {
                ContractResolver = new ContractResolver(),
                Binder = _binder.AddType(typeof(Metadata)),
                TypeNameHandling = TypeNameHandling.Objects,
                Formatting = Formatting.Indented,
            };
        }
Example #2
0
        public JsonDomainEventSerializer(string virtualNamespaceName)
        {
            _binder = new TypeAliasBinder(virtualNamespaceName);

            Settings = new JsonSerializerSettings
            {
                ContractResolver = new ContractResolver(),
                Binder           = _binder.AddType(typeof(Metadata)),
                TypeNameHandling = TypeNameHandling.Objects,
                Formatting       = Formatting.Indented,
            };
        }
        public JsonDomainEventSerializer(string virtualNamespaceName)
        {
            _binder = new TypeAliasBinder(virtualNamespaceName);

            Settings = new JsonSerializerSettings {
                ContractResolver    = new ContractResolver(),
                Binder              = _binder.AddType(typeof(Metadata)),
                TypeNameHandling    = TypeNameHandling.Objects,
                Formatting          = Formatting.Indented,
                FloatFormatHandling = FloatFormatHandling.DefaultValue,
                FloatParseHandling  = FloatParseHandling.Decimal,
                Converters          = new List <JsonConverter> {
                    new CustomDecimalJsonConverter()
                }
            };
        }
Example #4
0
 public JsonDomainEventSerializer AddAliasFor(Type type)
 {
     _binder.AddType(type);
     return(this);
 }