コード例 #1
0
        public static ZonedDateTimeSerializer RegisterSerializer(IDateTimeZoneProvider provider)
        {
            ZonedDateTimeSerializer serializer = new ZonedDateTimeSerializer(provider);

            BsonSerializer.RegisterSerializer(typeof(ZonedDateTime), serializer);
            return(serializer);
        }
        public static void RegisterAll(IDateTimeZoneProvider provider)
        {
            ZonedDateTimeSerializer.RegisterSerializer(provider);

            LocalDateTimeSerializer.RegisterSerializer();
            LocalDateSerializer.RegisterSerializer();
            LocalTimeSerializer.RegisterSerializer();

            OffSetDatetimeSerializer.RegisterSerializer();
            OffSetTimeSerializer.RegisterSerializer();
            OffSetDateSerializer.RegisterSerializer();

            PeriodSerializer.RegisterSerializer();
            DurationSerializer.RegisterSerializer();
        }