示例#1
0
        /// <summary>
        /// Applies .proto rules to ensure that this value is in the expected ranges
        /// </summary>
        public Duration Normalize()
        {
            var seconds = Seconds;
            var nanos   = Nanoseconds;

            PrimaryTypeProvider.NormalizeSecondsNanoseconds(ref seconds, ref nanos, false);
            return(new Duration(seconds, nanos));
        }
示例#2
0
        /// <summary>
        /// Applies .proto rules to ensure that this value is in the expected ranges
        /// </summary>
        public Timestamp Normalize()
        {
            var seconds = Seconds;
            var nanos   = Nanoseconds;

            PrimaryTypeProvider.NormalizeSecondsNanoseconds(ref seconds, ref nanos, true);
            return(new Timestamp(seconds, nanos));
        }