Skip to content

Commit 33dab7e

Browse files
author
srsedate
committed
Expanded expression-bodied property accessors to block bodies for C# 6.0 compatibility.
1 parent 30490fc commit 33dab7e

File tree

2 files changed

+40
-10
lines changed

2 files changed

+40
-10
lines changed

src/ResourceManager/Insights/Commands.Insights/TransitionalClasses/MetricTrigger.cs

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,26 +27,44 @@ public class MetricTrigger : Monitor.Models.MetricTrigger
2727
/// </summary>
2828
public new ComparisonOperationType OperatorProperty
2929
{
30-
get => (ComparisonOperationType)System.Enum.Parse(typeof(ComparisonOperationType), base.OperatorProperty.ToString());
31-
set => base.OperatorProperty = (Monitor.Models.ComparisonOperationType)System.Enum.Parse(typeof(Monitor.Models.ComparisonOperationType), value.ToString());
30+
get
31+
{
32+
return (ComparisonOperationType)System.Enum.Parse(typeof(ComparisonOperationType), base.OperatorProperty.ToString());
33+
}
34+
set
35+
{
36+
base.OperatorProperty = (Monitor.Models.ComparisonOperationType)System.Enum.Parse(typeof(Monitor.Models.ComparisonOperationType), value.ToString());
37+
}
3238
}
3339

3440
/// <summary>
3541
/// Gets or sets the Statistic of the Metric Trigger
3642
/// </summary>
3743
public new MetricStatisticType Statistic
3844
{
39-
get => (MetricStatisticType)System.Enum.Parse(typeof(MetricStatisticType), base.Statistic.ToString());
40-
set => base.Statistic = (Monitor.Models.MetricStatisticType)System.Enum.Parse(typeof(Monitor.Models.MetricStatisticType), value.ToString());
45+
get
46+
{
47+
return (MetricStatisticType)System.Enum.Parse(typeof(MetricStatisticType), base.Statistic.ToString());
48+
}
49+
set
50+
{
51+
base.Statistic = (Monitor.Models.MetricStatisticType)System.Enum.Parse(typeof(Monitor.Models.MetricStatisticType), value.ToString());
52+
}
4153
}
4254

4355
/// <summary>
4456
/// Gets or sets the TimeAggregation of the Metric Trigger
4557
/// </summary>
4658
public new TimeAggregationType TimeAggregation
4759
{
48-
get => (TimeAggregationType)System.Enum.Parse(typeof(TimeAggregationType), base.TimeAggregation.ToString());
49-
set => base.TimeAggregation = (Monitor.Models.TimeAggregationType)System.Enum.Parse(typeof(Monitor.Models.TimeAggregationType), value.ToString());
60+
get
61+
{
62+
return (TimeAggregationType)System.Enum.Parse(typeof(TimeAggregationType), base.TimeAggregation.ToString());
63+
}
64+
set
65+
{
66+
base.TimeAggregation = (Monitor.Models.TimeAggregationType)System.Enum.Parse(typeof(Monitor.Models.TimeAggregationType), value.ToString());
67+
}
5068
}
5169

5270
/// <summary>

src/ResourceManager/Insights/Commands.Insights/TransitionalClasses/ScaleAction.cs

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,29 @@ public class ScaleAction : Monitor.Models.ScaleAction
2727
/// </summary>
2828
public new ScaleType Type
2929
{
30-
get => (ScaleType)System.Enum.Parse(typeof(ScaleType), base.Type.ToString());
31-
set => base.Type = (Monitor.Models.ScaleType)System.Enum.Parse(typeof(Monitor.Models.ScaleType), value.ToString());
30+
get
31+
{
32+
return (ScaleType)System.Enum.Parse(typeof(ScaleType), base.Type.ToString());
33+
}
34+
set
35+
{
36+
base.Type = (Monitor.Models.ScaleType)System.Enum.Parse(typeof(Monitor.Models.ScaleType), value.ToString());
37+
}
3238
}
3339

3440
/// <summary>
3541
/// Gets or sets the Direction of the scale action
3642
/// </summary>
3743
public new ScaleDirection Direction
3844
{
39-
get => (ScaleDirection)System.Enum.Parse(typeof(ScaleDirection), base.Direction.ToString());
40-
set => base.Direction = (Monitor.Models.ScaleDirection)System.Enum.Parse(typeof(Monitor.Models.ScaleDirection), value.ToString());
45+
get
46+
{
47+
return (ScaleDirection)System.Enum.Parse(typeof(ScaleDirection), base.Direction.ToString());
48+
}
49+
set
50+
{
51+
base.Direction = (Monitor.Models.ScaleDirection)System.Enum.Parse(typeof(Monitor.Models.ScaleDirection), value.ToString());
52+
}
4153
}
4254

4355
/// <summary>

0 commit comments

Comments
 (0)