Esempio n. 1
0
            public static string Serialize(Money?instance)
            {
                string serialized;

                if (instance.HasValue)
                {
                    var surrogate = new NumericSurrogate(instance.Value);
                    serialized = JsonSerializer.SerializeToString(surrogate);
                }
                else
                {
                    serialized = JsonSerializer.SerializeToString(instance);
                }
                return(serialized);
            }
Esempio n. 2
0
            public static string Serialize(Money instance)
            {
                var surrogate = new NumericSurrogate(instance);

                return(JsonSerializer.SerializeToString(surrogate));
            }