Skip to content

Commit 600f9fe

Browse files
committed
Removing backing fields
1 parent 00cc83c commit 600f9fe

File tree

1 file changed

+41
-29
lines changed

1 file changed

+41
-29
lines changed

UnitsNet/BaseDimensions.cs

Lines changed: 41 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -29,24 +29,15 @@ namespace UnitsNet
2929
/// </summary>
3030
public sealed class BaseDimensions
3131
{
32-
private readonly int
33-
_length, // L
34-
_mass, // M
35-
_time, // T
36-
_current, // I
37-
_temperature, // Θ
38-
_amount, // N
39-
_luminousIntensity; // J
40-
4132
public BaseDimensions(int length, int mass, int time, int current, int temperature, int amount, int luminousIntensity)
4233
{
43-
_length = length;
44-
_mass = mass;
45-
_time = time;
46-
_current = current;
47-
_temperature = temperature;
48-
_amount = amount;
49-
_luminousIntensity = luminousIntensity;
34+
Length = length;
35+
Mass = mass;
36+
Time = time;
37+
Current = current;
38+
Temperature = temperature;
39+
Amount = amount;
40+
LuminousIntensity = luminousIntensity;
5041
}
5142

5243
public override bool Equals(object obj)
@@ -152,18 +143,39 @@ private static void AppendDimensionString( StringBuilder sb, string name, int va
152143
}
153144
}
154145

155-
public int Length { get { return _length; } }
156-
157-
public int Mass{ get{ return _mass; } }
158-
159-
public int Time{ get{ return _time; } }
160-
161-
public int Current{ get{ return _current; } }
162-
163-
public int Temperature{ get{ return _temperature; } }
164-
165-
public int Amount{ get{ return _amount; } }
166-
167-
public int LuminousIntensity{ get{ return _luminousIntensity; } }
146+
/// <summary>
147+
/// Gets the length dimensions (L).
148+
/// </summary>
149+
public int Length { get; }
150+
151+
/// <summary>
152+
/// Gets the mass dimensions (M).
153+
/// </summary>
154+
public int Mass{ get; }
155+
156+
/// <summary>
157+
/// Gets the time dimensions (T).
158+
/// </summary>
159+
public int Time{ get; }
160+
161+
/// <summary>
162+
/// Gets the electric current dimensions (I).
163+
/// </summary>
164+
public int Current{ get; }
165+
166+
/// <summary>
167+
/// Gets the temperature dimensions (Θ).
168+
/// </summary>
169+
public int Temperature{ get; }
170+
171+
/// <summary>
172+
/// Gets the amount of substance dimensions (N).
173+
/// </summary>
174+
public int Amount{ get; }
175+
176+
/// <summary>
177+
/// Gets the luminous intensity dimensions (J).
178+
/// </summary>
179+
public int LuminousIntensity{ get; }
168180
}
169181
}

0 commit comments

Comments
 (0)