Skip to content

Commit e94c875

Browse files
committed
Regenerate code
1 parent 34492e1 commit e94c875

File tree

6 files changed

+23
-55
lines changed

6 files changed

+23
-55
lines changed

Common/GeneratedCode/Quantities/CoefficientOfThermalExpansion.Common.g.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ int CompareTo(CoefficientOfThermalExpansion other)
279279
return _value.CompareTo(other.AsBaseNumericType(this.Unit));
280280
}
281281

282-
[Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")]
282+
[Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(CoefficientOfThermalExpansion, double, ComparisonType) to provide the max allowed absolute or relative error.")]
283283
public override bool Equals(object obj)
284284
{
285285
if(obj is null || !(obj is CoefficientOfThermalExpansion))

UnitsNet/GeneratedCode/Extensions/Number/NumberToMassFlowExtensions.g.cs

Lines changed: 6 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -135,34 +135,11 @@ public static class NumberToMassFlowExtensions
135135
#region MegapoundPerMinute
136136

137137
/// <inheritdoc cref="MassFlow.FromMegapoundsPerMinute(UnitsNet.QuantityValue)" />
138-
public static MassFlow MegapoundsPerMinute(this int value) => MassFlow.FromMegapoundsPerMinute(value);
138+
public static MassFlow MegapoundsPerMinute<T>(this T value) => MassFlow.FromMegapoundsPerMinute(Convert.ToDouble(value));
139139

140140
/// <inheritdoc cref="MassFlow.FromMegapoundsPerMinute(UnitsNet.QuantityValue)" />
141-
public static MassFlow? MegapoundsPerMinute(this int? value) => MassFlow.FromMegapoundsPerMinute(value);
142-
143-
/// <inheritdoc cref="MassFlow.FromMegapoundsPerMinute(UnitsNet.QuantityValue)" />
144-
public static MassFlow MegapoundsPerMinute(this long value) => MassFlow.FromMegapoundsPerMinute(value);
145-
146-
/// <inheritdoc cref="MassFlow.FromMegapoundsPerMinute(UnitsNet.QuantityValue)" />
147-
public static MassFlow? MegapoundsPerMinute(this long? value) => MassFlow.FromMegapoundsPerMinute(value);
148-
149-
/// <inheritdoc cref="MassFlow.FromMegapoundsPerMinute(UnitsNet.QuantityValue)" />
150-
public static MassFlow MegapoundsPerMinute(this double value) => MassFlow.FromMegapoundsPerMinute(value);
151-
152-
/// <inheritdoc cref="MassFlow.FromMegapoundsPerMinute(UnitsNet.QuantityValue)" />
153-
public static MassFlow? MegapoundsPerMinute(this double? value) => MassFlow.FromMegapoundsPerMinute(value);
154-
155-
/// <inheritdoc cref="MassFlow.FromMegapoundsPerMinute(UnitsNet.QuantityValue)" />
156-
public static MassFlow MegapoundsPerMinute(this float value) => MassFlow.FromMegapoundsPerMinute(value);
157-
158-
/// <inheritdoc cref="MassFlow.FromMegapoundsPerMinute(UnitsNet.QuantityValue)" />
159-
public static MassFlow? MegapoundsPerMinute(this float? value) => MassFlow.FromMegapoundsPerMinute(value);
160-
161-
/// <inheritdoc cref="MassFlow.FromMegapoundsPerMinute(UnitsNet.QuantityValue)" />
162-
public static MassFlow MegapoundsPerMinute(this decimal value) => MassFlow.FromMegapoundsPerMinute(Convert.ToDouble(value));
163-
164-
/// <inheritdoc cref="MassFlow.FromMegapoundsPerMinute(UnitsNet.QuantityValue)" />
165-
public static MassFlow? MegapoundsPerMinute(this decimal? value) => MassFlow.FromMegapoundsPerMinute(value == null ? (double?)null : Convert.ToDouble(value.Value));
141+
[Obsolete("Nullable type support has been deprecated and will be removed in a future release.")]
142+
public static MassFlow? MegapoundsPerMinute<T>(this T? value) where T : struct => MassFlow.FromMegapoundsPerMinute(value == null ? (double?)null : Convert.ToDouble(value.Value));
166143

167144
#endregion
168145

@@ -213,34 +190,11 @@ public static class NumberToMassFlowExtensions
213190
#region PoundPerMinute
214191

215192
/// <inheritdoc cref="MassFlow.FromPoundsPerMinute(UnitsNet.QuantityValue)" />
216-
public static MassFlow PoundsPerMinute(this int value) => MassFlow.FromPoundsPerMinute(value);
193+
public static MassFlow PoundsPerMinute<T>(this T value) => MassFlow.FromPoundsPerMinute(Convert.ToDouble(value));
217194

218195
/// <inheritdoc cref="MassFlow.FromPoundsPerMinute(UnitsNet.QuantityValue)" />
219-
public static MassFlow? PoundsPerMinute(this int? value) => MassFlow.FromPoundsPerMinute(value);
220-
221-
/// <inheritdoc cref="MassFlow.FromPoundsPerMinute(UnitsNet.QuantityValue)" />
222-
public static MassFlow PoundsPerMinute(this long value) => MassFlow.FromPoundsPerMinute(value);
223-
224-
/// <inheritdoc cref="MassFlow.FromPoundsPerMinute(UnitsNet.QuantityValue)" />
225-
public static MassFlow? PoundsPerMinute(this long? value) => MassFlow.FromPoundsPerMinute(value);
226-
227-
/// <inheritdoc cref="MassFlow.FromPoundsPerMinute(UnitsNet.QuantityValue)" />
228-
public static MassFlow PoundsPerMinute(this double value) => MassFlow.FromPoundsPerMinute(value);
229-
230-
/// <inheritdoc cref="MassFlow.FromPoundsPerMinute(UnitsNet.QuantityValue)" />
231-
public static MassFlow? PoundsPerMinute(this double? value) => MassFlow.FromPoundsPerMinute(value);
232-
233-
/// <inheritdoc cref="MassFlow.FromPoundsPerMinute(UnitsNet.QuantityValue)" />
234-
public static MassFlow PoundsPerMinute(this float value) => MassFlow.FromPoundsPerMinute(value);
235-
236-
/// <inheritdoc cref="MassFlow.FromPoundsPerMinute(UnitsNet.QuantityValue)" />
237-
public static MassFlow? PoundsPerMinute(this float? value) => MassFlow.FromPoundsPerMinute(value);
238-
239-
/// <inheritdoc cref="MassFlow.FromPoundsPerMinute(UnitsNet.QuantityValue)" />
240-
public static MassFlow PoundsPerMinute(this decimal value) => MassFlow.FromPoundsPerMinute(Convert.ToDouble(value));
241-
242-
/// <inheritdoc cref="MassFlow.FromPoundsPerMinute(UnitsNet.QuantityValue)" />
243-
public static MassFlow? PoundsPerMinute(this decimal? value) => MassFlow.FromPoundsPerMinute(value == null ? (double?)null : Convert.ToDouble(value.Value));
196+
[Obsolete("Nullable type support has been deprecated and will be removed in a future release.")]
197+
public static MassFlow? PoundsPerMinute<T>(this T? value) where T : struct => MassFlow.FromPoundsPerMinute(value == null ? (double?)null : Convert.ToDouble(value.Value));
244198

245199
#endregion
246200

UnitsNet/GeneratedCode/Extensions/Number/NumberToVolumeExtensions.g.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,17 @@ public static class NumberToVolumeExtensions
286286

287287
#endregion
288288

289+
#region Kiloliter
290+
291+
/// <inheritdoc cref="Volume.FromKiloliters(UnitsNet.QuantityValue)" />
292+
public static Volume Kiloliters<T>(this T value) => Volume.FromKiloliters(Convert.ToDouble(value));
293+
294+
/// <inheritdoc cref="Volume.FromKiloliters(UnitsNet.QuantityValue)" />
295+
[Obsolete("Nullable type support has been deprecated and will be removed in a future release.")]
296+
public static Volume? Kiloliters<T>(this T? value) where T : struct => Volume.FromKiloliters(value == null ? (double?)null : Convert.ToDouble(value.Value));
297+
298+
#endregion
299+
289300
#region KilousGallon
290301

291302
/// <inheritdoc cref="Volume.FromKilousGallons(UnitsNet.QuantityValue)" />

UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.NetFramework.g.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,14 +176,14 @@ public static string GetAbbreviation(CoefficientOfThermalExpansionUnit unit, [Ca
176176
return left.Value > right.AsBaseNumericType(left.Unit);
177177
}
178178

179-
[Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")]
179+
[Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(CoefficientOfThermalExpansion, double, ComparisonType) to provide the max allowed absolute or relative error.")]
180180
public static bool operator ==(CoefficientOfThermalExpansion left, CoefficientOfThermalExpansion right)
181181
{
182182
// ReSharper disable once CompareOfFloatsByEqualityOperator
183183
return left.Value == right.AsBaseNumericType(left.Unit);
184184
}
185185

186-
[Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")]
186+
[Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(CoefficientOfThermalExpansion, double, ComparisonType) to provide the max allowed absolute or relative error.")]
187187
public static bool operator !=(CoefficientOfThermalExpansion left, CoefficientOfThermalExpansion right)
188188
{
189189
// ReSharper disable once CompareOfFloatsByEqualityOperator

UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ public partial struct MassFlow : IComparable, IComparable<MassFlow>
137137
/// <summary>
138138
/// Get nullable MassFlow from nullable MegapoundsPerMinute.
139139
/// </summary>
140+
[Obsolete("Nullable type support is obsolete and will be removed in a future release.")]
140141
public static MassFlow? FromMegapoundsPerMinute(QuantityValue? megapoundsperminute)
141142
{
142143
return megapoundsperminute.HasValue ? FromMegapoundsPerMinute(megapoundsperminute.Value) : default(MassFlow?);
@@ -181,6 +182,7 @@ public partial struct MassFlow : IComparable, IComparable<MassFlow>
181182
/// <summary>
182183
/// Get nullable MassFlow from nullable PoundsPerMinute.
183184
/// </summary>
185+
[Obsolete("Nullable type support is obsolete and will be removed in a future release.")]
184186
public static MassFlow? FromPoundsPerMinute(QuantityValue? poundsperminute)
185187
{
186188
return poundsperminute.HasValue ? FromPoundsPerMinute(poundsperminute.Value) : default(MassFlow?);

UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,7 @@ public partial struct Volume : IComparable, IComparable<Volume>
263263
/// <summary>
264264
/// Get nullable Volume from nullable Kiloliters.
265265
/// </summary>
266+
[Obsolete("Nullable type support is obsolete and will be removed in a future release.")]
266267
public static Volume? FromKiloliters(QuantityValue? kiloliters)
267268
{
268269
return kiloliters.HasValue ? FromKiloliters(kiloliters.Value) : default(Volume?);

0 commit comments

Comments
 (0)