@@ -191,6 +191,7 @@ public static Metric ConvertVersionBMetric(VersionBProtoBuf.ProtoBufPayload.Metr
191
191
/// Gets the version B ProtoBuf metric from the version B metric.
192
192
/// </summary>
193
193
/// <param name="metric">The <see cref="Metric"/>.</param>
194
+ /// <exception cref="ArgumentException">Thrown if the property set data type is set for a metric.</exception>
194
195
/// <exception cref="ArgumentOutOfRangeException">Thrown if the metric data type is unknown.</exception>
195
196
/// <returns>The <see cref="VersionBProtoBuf.ProtoBufPayload.Metric"/>.</returns>
196
197
public static VersionBProtoBuf . ProtoBufPayload . Metric ConvertVersionBMetric ( Metric metric )
@@ -205,7 +206,7 @@ public static VersionBProtoBuf.ProtoBufPayload.Metric ConvertVersionBMetric(Metr
205
206
MetaData = ConvertVersionBMetaData ( metric . MetaData ) ,
206
207
Name = metric . Name ,
207
208
Timestamp = metric . Timestamp ,
208
- PropertySetValue = ! ( metric . Properties is null ) ? ConvertVersionBPropertySet ( metric . Properties . ConvertOrDefaultTo < PropertySet > ( ) ) : null
209
+ PropertySetValue = metric . Properties is not null ? ConvertVersionBPropertySet ( metric . Properties . ConvertOrDefaultTo < PropertySet > ( ) ) : null
209
210
} ;
210
211
211
212
switch ( metric . DataType )
@@ -267,9 +268,8 @@ public static VersionBProtoBuf.ProtoBufPayload.Metric ConvertVersionBMetric(Metr
267
268
case VersionBDataTypeEnum . Template :
268
269
protoMetric . TemplateValue = ConvertVersionBTemplate ( metric . Value . ConvertOrDefaultTo < Template > ( ) ) ;
269
270
break ;
270
- //case VersionBDataTypeEnum.PropertySet:
271
- // protoMetric.PropertySetValue = ConvertVersionBPropertySet(metric.Value.ConvertOrDefaultTo<PropertySet>());
272
- // break;
271
+ case VersionBDataTypeEnum . PropertySet :
272
+ throw new ArgumentException ( "The property set data type is not valid for a metric" ) ;
273
273
case VersionBDataTypeEnum . Int8Array :
274
274
protoMetric . BytesValue = ( byte [ ] ? ) metric . Value ?? [ ] ;
275
275
break ;
0 commit comments