Skip to content

Commit 623d195

Browse files
authored
Remove IParsable and IComparisonOperators from the IQuantity interface (#1459)
Fixes #1454
1 parent 7996500 commit 623d195

File tree

125 files changed

+872
-323
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+872
-323
lines changed

CodeGen/Generators/UnitsNetGen/QuantityGenerator.cs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,12 @@ public string Generate()
3838
using System.Diagnostics;
3939
using System.Diagnostics.CodeAnalysis;
4040
using System.Globalization;
41-
using System.Linq;");
42-
if (_quantity.Relations.Any(r => r.Operator is "*" or "/"))
43-
Writer.WL(@"#if NET7_0_OR_GREATER
44-
using System.Numerics;
45-
#endif");
46-
Writer.WL(@"using System.Runtime.Serialization;
47-
using UnitsNet.InternalHelpers;
41+
using System.Linq;
42+
using System.Runtime.Serialization;
4843
using UnitsNet.Units;
44+
#if NET
45+
using System.Numerics;
46+
#endif
4947
5048
#nullable enable
5149
@@ -101,6 +99,10 @@ namespace UnitsNet
10199
}
102100

103101
Writer.WL(@$"
102+
#if NET7_0_OR_GREATER
103+
IComparisonOperators<{_quantity.Name}, {_quantity.Name}, bool>,
104+
IParsable<{_quantity.Name}>,
105+
#endif
104106
IComparable,
105107
IComparable<{_quantity.Name}>,
106108
IConvertible,

UnitsNet/GeneratedCode/Quantities/AbsorbedDoseOfIonizingRadiation.g.cs

Lines changed: 7 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs

Lines changed: 7 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs

Lines changed: 7 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.g.cs

Lines changed: 7 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnitsNet/GeneratedCode/Quantities/Angle.g.cs

Lines changed: 7 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnitsNet/GeneratedCode/Quantities/ApparentEnergy.g.cs

Lines changed: 7 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnitsNet/GeneratedCode/Quantities/ApparentPower.g.cs

Lines changed: 7 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnitsNet/GeneratedCode/Quantities/Area.g.cs

Lines changed: 7 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnitsNet/GeneratedCode/Quantities/AreaDensity.g.cs

Lines changed: 7 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs

Lines changed: 7 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnitsNet/GeneratedCode/Quantities/BitRate.g.cs

Lines changed: 7 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.g.cs

Lines changed: 7 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnitsNet/GeneratedCode/Quantities/Capacitance.g.cs

Lines changed: 7 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.g.cs

Lines changed: 7 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)