| | 1 | | using System; |
| | 2 | | using System.Collections.Generic; |
| | 3 | | using System.Linq; |
| | 4 | | using System.Runtime.Serialization; |
| | 5 | | using System.Text; |
| | 6 | | using System.Threading.Tasks; |
| | 7 | | using Microsoft.Azure.ApplicationInsights.Query.Models; |
| | 8 | | using Newtonsoft.Json.Linq; |
| | 9 | |
|
| | 10 | | namespace Microsoft.Azure.ApplicationInsights.Query.Models |
| | 11 | | { |
| | 12 | | public abstract class BaseSegmentInfo : BaseMetricInfo |
| | 13 | | { |
| 0 | 14 | | public string SegmentId { get; private set; } |
| 0 | 15 | | public string SegmentValue { get; private set; } |
| | 16 | |
|
| | 17 | | [OnDeserialized] |
| | 18 | | internal void InitSegmentFields(StreamingContext context) |
| | 19 | | { |
| 0 | 20 | | var additionalProperties = GetAdditionalProperties(); |
| | 21 | |
|
| 0 | 22 | | if (additionalProperties != null) |
| | 23 | | { |
| 0 | 24 | | foreach (var additionalProp in additionalProperties) |
| | 25 | | { |
| 0 | 26 | | if (additionalProp.Value is string) |
| | 27 | | { |
| 0 | 28 | | SegmentId = additionalProp.Key; |
| 0 | 29 | | SegmentValue = additionalProp.Value as string; |
| | 30 | | } |
| | 31 | | } |
| | 32 | | } |
| 0 | 33 | | } |
| | 34 | | } |
| | 35 | | } |