Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit 3096a01

Browse files
committed
fix C# 6 build
1 parent ee9e21f commit 3096a01

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

tests/ServiceStack.Text.Tests/JsonTests/CustomSerializerTests.cs

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -319,16 +319,19 @@ public class DcStatus
319319
[Format("{0:0.000} A")]
320320
public Double Current { get; set; }
321321
[Format("{0:0} W")]
322-
public Double Power => Voltage * Current;
322+
public Double Power
323+
{
324+
get { return Voltage * Current; }
325+
}
323326

324327
public string ToJson()
325328
{
326329
return new Dictionary<string, string>
327-
{
328-
{ "Voltage", "{0:0.0} V".Fmt(Voltage) },
329-
{ "Current", "{0:0.000} A".Fmt(Current) },
330-
{ "Power", "{0:0} W".Fmt(Power) },
331-
}.ToJson();
330+
{
331+
{ "Voltage", "{0:0.0} V".Fmt(Voltage) },
332+
{ "Current", "{0:0.000} A".Fmt(Current) },
333+
{ "Power", "{0:0} W".Fmt(Power) },
334+
}.ToJson();
332335
}
333336
}
334337

@@ -339,7 +342,10 @@ public class DcStatus2
339342
[Format("{0:0.000} A")]
340343
public Double Current { get; set; }
341344
[Format("{0:0} W")]
342-
public Double Power => Voltage * Current;
345+
public Double Power
346+
{
347+
get { return Voltage*Current; }
348+
}
343349
}
344350

345351
[Test]

0 commit comments

Comments
 (0)