diff --git a/CodeGen/Generators/NanoFrameworkGen/QuantityGenerator.cs b/CodeGen/Generators/NanoFrameworkGen/QuantityGenerator.cs index 721c9a94ce..10aca1bc75 100644 --- a/CodeGen/Generators/NanoFrameworkGen/QuantityGenerator.cs +++ b/CodeGen/Generators/NanoFrameworkGen/QuantityGenerator.cs @@ -43,7 +43,7 @@ public struct {_quantity.Name} /// /// The numeric value this quantity was constructed with. /// - private readonly {_quantity.ValueType} _value; + private readonly double _value; /// /// The unit this quantity was constructed with. @@ -53,7 +53,7 @@ public struct {_quantity.Name} /// /// The numeric value this quantity was constructed with. /// - public {_quantity.ValueType} Value => _value; + public double Value => _value; /// public {_unitEnumName} Unit => _unit; @@ -66,7 +66,7 @@ public struct {_quantity.Name} /// The numeric value to construct this quantity with. /// The unit representation to construct this quantity with. /// If value is NaN or Infinity. - public {_quantity.Name}({_quantity.ValueType} value, {_unitEnumName} unit) + public {_quantity.Name}(double value, {_unitEnumName} unit) {{ _value = value; _unit = unit; @@ -79,29 +79,14 @@ public struct {_quantity.Name} /// /// Represents the largest possible value of {_quantity.Name}. - /// "); - - // Non decimal - Writer.WLCondition(_quantity.ValueType != "decimal", $@" - public static {_quantity.Name} MaxValue {{ get; }} = new {_quantity.Name}({_quantity.ValueType}.MaxValue, BaseUnit); - - /// - /// Represents the smallest possible value of {_quantity.Name}. /// - public static {_quantity.Name} MinValue {{ get; }} = new {_quantity.Name}({_quantity.ValueType}.MinValue, BaseUnit); -"); - - // Decimal MaxValue = 79228162514264337593543950335M - Writer.WLCondition(_quantity.ValueType == "decimal", $@" - public static {_quantity.Name} MaxValue {{ get; }} = new {_quantity.Name}(79228162514264337593543950335M, BaseUnit); + public static {_quantity.Name} MaxValue {{ get; }} = new {_quantity.Name}(double.MaxValue, BaseUnit); /// /// Represents the smallest possible value of {_quantity.Name}. /// - public static {_quantity.Name} MinValue {{ get; }} = new {_quantity.Name}(-79228162514264337593543950335M, BaseUnit); -"); + public static {_quantity.Name} MinValue {{ get; }} = new {_quantity.Name}(double.MinValue, BaseUnit); - Writer.WL($@" /// /// Gets an instance of this quantity with a value of 0 in the base unit Second. /// @@ -134,7 +119,7 @@ private void GenerateConversionProperties() /// "); Writer.WLIfText(2, GetObsoleteAttributeOrNull(unit)); Writer.WL($@" - public {_quantity.ValueType} {unit.PluralName} => As({_unitEnumName}.{unit.SingularName}); + public double {unit.PluralName} => As({_unitEnumName}.{unit.SingularName}); "); } @@ -161,7 +146,7 @@ private void GenerateStaticFactoryMethods() /// If value is NaN or Infinity."); Writer.WLIfText(2, GetObsoleteAttributeOrNull(unit)); Writer.WL($@" - public static {_quantity.Name} From{unit.PluralName}({_quantity.ValueType} {valueParamName}) => new {_quantity.Name}({valueParamName}, {_unitEnumName}.{unit.SingularName}); + public static {_quantity.Name} From{unit.PluralName}(double {valueParamName}) => new {_quantity.Name}({valueParamName}, {_unitEnumName}.{unit.SingularName}); "); } @@ -172,7 +157,7 @@ private void GenerateStaticFactoryMethods() /// Value to convert from. /// Unit to convert from. /// {_quantity.Name} unit value. - public static {_quantity.Name} From({_quantity.ValueType} value, {_unitEnumName} fromUnit) + public static {_quantity.Name} From(double value, {_unitEnumName} fromUnit) {{ return new {_quantity.Name}(value, fromUnit); }} @@ -190,7 +175,7 @@ private void GenerateConversionMethods() /// Convert to the unit representation . /// /// Value converted to the specified unit. - public {_quantity.ValueType} As({_unitEnumName} unit) => GetValueAs(unit); + public double As({_unitEnumName} unit) => GetValueAs(unit); /// /// Converts this {_quantity.Name} to another {_quantity.Name} with the unit representation . @@ -207,7 +192,7 @@ private void GenerateConversionMethods() /// This is typically the first step in converting from one unit to another. /// /// The value in the base unit representation. - private {_quantity.ValueType} GetValueInBaseUnit() + private double GetValueInBaseUnit() {{ return Unit switch {{"); @@ -223,7 +208,7 @@ private void GenerateConversionMethods() }}; }} - private {_quantity.ValueType} GetValueAs({_unitEnumName} unit) + private double GetValueAs({_unitEnumName} unit) {{ if (Unit == unit) return _value; diff --git a/CodeGen/Generators/NanoFrameworkGenerator.cs b/CodeGen/Generators/NanoFrameworkGenerator.cs index 1753235749..19d8cab43c 100644 --- a/CodeGen/Generators/NanoFrameworkGenerator.cs +++ b/CodeGen/Generators/NanoFrameworkGenerator.cs @@ -90,20 +90,6 @@ public static void Generate(string rootDir, Quantity[] quantities, QuantityNameT GenerateQuantity(quantity, Path.Combine(outputQuantities, $"{quantity.Name}.g.cs")); GenerateProject(quantity, Path.Combine(projectPath, $"{quantity.Name}.nfproj"), versions); - // Convert decimal based units to floats; decimals are not supported by nanoFramework - if (quantity.ValueType == "decimal") - { - var replacements = new Dictionary - { - { "(\\d)m", "$1d" }, - { "(\\d)M", "$1d" }, - { " decimal ", " double " }, - { "(decimal ", "(double " } - }; - new FileInfo(Path.Combine(outputDir, "Units", $"{quantity.Name}Unit.g.cs")).EditFile(replacements); - new FileInfo(Path.Combine(outputDir, "Quantities", $"{quantity.Name}.g.cs")).EditFile(replacements); - } - Log.Information("✅ {Quantity} (nanoFramework)", quantity.Name); } Log.Information(""); diff --git a/CodeGen/Generators/QuantityJsonFilesParser.cs b/CodeGen/Generators/QuantityJsonFilesParser.cs index 316e785fd6..a9393e9efa 100644 --- a/CodeGen/Generators/QuantityJsonFilesParser.cs +++ b/CodeGen/Generators/QuantityJsonFilesParser.cs @@ -48,7 +48,6 @@ private static Quantity ParseQuantityFile(string jsonFileName) ?? throw new UnitsNetCodeGenException($"Unable to parse quantity from JSON file: {jsonFileName}"); AddPrefixUnits(quantity); - FixConversionFunctionsForDecimalValueTypes(quantity); OrderUnitsByName(quantity); return quantity; } @@ -63,20 +62,6 @@ private static void OrderUnitsByName(Quantity quantity) quantity.Units = quantity.Units.OrderBy(u => u.SingularName, StringComparer.OrdinalIgnoreCase).ToArray(); } - private static void FixConversionFunctionsForDecimalValueTypes(Quantity quantity) - { - foreach (Unit u in quantity.Units) - // Use decimal for internal calculations if base type is not double, such as for long or int. - { - if (string.Equals(quantity.ValueType, "decimal", StringComparison.OrdinalIgnoreCase)) - { - // Change any double literals like "1024d" to decimal literals "1024m" - u.FromUnitToBaseFunc = u.FromUnitToBaseFunc.Replace("d", "m"); - u.FromBaseToUnitFunc = u.FromBaseToUnitFunc.Replace("d", "m"); - } - } - } - private static void AddPrefixUnits(Quantity quantity) { var unitsToAdd = new List(); diff --git a/CodeGen/Generators/UnitsNetGen/NumberExtensionsGenerator.cs b/CodeGen/Generators/UnitsNetGen/NumberExtensionsGenerator.cs index 61749f5f08..0c5f762c04 100644 --- a/CodeGen/Generators/UnitsNetGen/NumberExtensionsGenerator.cs +++ b/CodeGen/Generators/UnitsNetGen/NumberExtensionsGenerator.cs @@ -45,7 +45,7 @@ public static class NumberTo{_quantityName}Extensions continue; Writer.WL(2, $@" -/// "); +/// "); Writer.WLIfText(2, GetObsoleteAttributeOrNull(unit.ObsoleteText)); diff --git a/CodeGen/Generators/UnitsNetGen/QuantityGenerator.cs b/CodeGen/Generators/UnitsNetGen/QuantityGenerator.cs index 86490605d1..e0d5f41066 100644 --- a/CodeGen/Generators/UnitsNetGen/QuantityGenerator.cs +++ b/CodeGen/Generators/UnitsNetGen/QuantityGenerator.cs @@ -14,7 +14,6 @@ internal class QuantityGenerator : GeneratorBase private readonly bool _isDimensionless; private readonly string _unitEnumName; - private readonly string _valueType; private readonly Unit _baseUnit; public QuantityGenerator(Quantity quantity) @@ -25,7 +24,6 @@ public QuantityGenerator(Quantity quantity) throw new ArgumentException($"No unit found with SingularName equal to BaseUnit [{_quantity.BaseUnit}]. This unit must be defined.", nameof(quantity)); - _valueType = quantity.ValueType; _unitEnumName = $"{quantity.Name}Unit"; BaseDimensions baseDimensions = quantity.BaseDimensions; @@ -69,7 +67,7 @@ namespace UnitsNet Writer.WL(@$" [DataContract] public readonly partial struct {_quantity.Name} : - {(_quantity.GenerateArithmetic ? "IArithmeticQuantity" : "IQuantity")}<{_quantity.Name}, {_unitEnumName}, {_quantity.ValueType}>,"); + {(_quantity.GenerateArithmetic ? "IArithmeticQuantity" : "IQuantity")}<{_quantity.Name}, {_unitEnumName}>,"); if (_quantity.Relations.Any(r => r.Operator is "*" or "/")) { @@ -100,9 +98,6 @@ namespace UnitsNet #endif"); } - if (_quantity.ValueType == "decimal") Writer.WL(@$" - IDecimalQuantity,"); - Writer.WL(@$" IComparable, IComparable<{_quantity.Name}>, @@ -116,7 +111,7 @@ namespace UnitsNet /// The numeric value this quantity was constructed with. /// [DataMember(Name = ""Value"", Order = 1)] - private readonly {_quantity.ValueType} _value; + private readonly double _value; /// /// The unit this quantity was constructed with. @@ -209,7 +204,7 @@ private void GenerateInstanceConstructors() /// The numeric value to construct this quantity with. /// The unit representation to construct this quantity with. /// If value is NaN or Infinity. - public {_quantity.Name}({_quantity.ValueType} value, {_unitEnumName} unit) + public {_quantity.Name}(double value, {_unitEnumName} unit) {{"); Writer.WL(@" _value = value;"); @@ -225,7 +220,7 @@ private void GenerateInstanceConstructors() /// The unit system to create the quantity with. /// The given is null. /// No unit was found for the given . - public {_quantity.Name}({_valueType} value, UnitSystem unitSystem) + public {_quantity.Name}(double value, UnitSystem unitSystem) {{ if (unitSystem is null) throw new ArgumentNullException(nameof(unitSystem)); @@ -296,10 +291,10 @@ private void GenerateProperties() /// /// The numeric value this quantity was constructed with. /// - public {_valueType} Value => _value; + public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -332,11 +327,11 @@ private void GenerateConversionProperties() Writer.WL($@" /// - /// Gets a value of this quantity converted into + /// Gets a value of this quantity converted into /// "); Writer.WLIfText(2, GetObsoleteAttributeOrNull(unit)); Writer.WL($@" - public {_quantity.ValueType} {unit.PluralName} => As({_unitEnumName}.{unit.SingularName}); + public double {unit.PluralName} => As({_unitEnumName}.{unit.SingularName}); "); } @@ -421,7 +416,6 @@ private void GenerateStaticFactoryMethods() { if (unit.SkipConversionGeneration) continue; - var valueParamName = unit.PluralName.ToLowerInvariant(); Writer.WL($@" /// /// Creates a from . @@ -429,9 +423,8 @@ private void GenerateStaticFactoryMethods() /// If value is NaN or Infinity."); Writer.WLIfText(2, GetObsoleteAttributeOrNull(unit)); Writer.WL($@" - public static {_quantity.Name} From{unit.PluralName}(QuantityValue {valueParamName}) + public static {_quantity.Name} From{unit.PluralName}(double value) {{ - {_valueType} value = ({_valueType}) {valueParamName}; return new {_quantity.Name}(value, {_unitEnumName}.{unit.SingularName}); }} "); @@ -444,9 +437,9 @@ private void GenerateStaticFactoryMethods() /// Value to convert from. /// Unit to convert from. /// {_quantity.Name} unit value. - public static {_quantity.Name} From(QuantityValue value, {_unitEnumName} fromUnit) + public static {_quantity.Name} From(double value, {_unitEnumName} fromUnit) {{ - return new {_quantity.Name}(({_valueType})value, fromUnit); + return new {_quantity.Name}(value, fromUnit); }} #endregion @@ -635,25 +628,25 @@ private void GenerateArithmeticOperators() }} /// Get from multiplying value and . - public static {_quantity.Name} operator *({_valueType} left, {_quantity.Name} right) + public static {_quantity.Name} operator *(double left, {_quantity.Name} right) {{ return new {_quantity.Name}(left * right.Value, right.Unit); }} /// Get from multiplying value and . - public static {_quantity.Name} operator *({_quantity.Name} left, {_valueType} right) + public static {_quantity.Name} operator *({_quantity.Name} left, double right) {{ return new {_quantity.Name}(left.Value * right, left.Unit); }} /// Get from dividing by value. - public static {_quantity.Name} operator /({_quantity.Name} left, {_valueType} right) + public static {_quantity.Name} operator /({_quantity.Name} left, double right) {{ return new {_quantity.Name}(left.Value / right, left.Unit); }} /// Get ratio value from dividing by . - public static {_quantity.ValueType} operator /({_quantity.Name} left, {_quantity.Name} right) + public static double operator /({_quantity.Name} left, {_quantity.Name} right) {{ return left.{_baseUnit.PluralName} / right.{_baseUnit.PluralName}; }} @@ -693,7 +686,7 @@ private void GenerateLogarithmicArithmeticOperators() }} /// Get from logarithmic multiplication of value and . - public static {_quantity.Name} operator *({_valueType} left, {_quantity.Name} right) + public static {_quantity.Name} operator *(double left, {_quantity.Name} right) {{ // Logarithmic multiplication = addition return new {_quantity.Name}(left + right.Value, right.Unit); @@ -703,14 +696,14 @@ private void GenerateLogarithmicArithmeticOperators() public static {_quantity.Name} operator *({_quantity.Name} left, double right) {{ // Logarithmic multiplication = addition - return new {_quantity.Name}(left.Value + ({_valueType})right, left.Unit); + return new {_quantity.Name}(left.Value + right, left.Unit); }} /// Get from logarithmic division of by value. public static {_quantity.Name} operator /({_quantity.Name} left, double right) {{ // Logarithmic division = subtraction - return new {_quantity.Name}(left.Value - ({_valueType})right, left.Unit); + return new {_quantity.Name}(left.Value - right, left.Unit); }} /// Get ratio value from logarithmic division of by . @@ -784,12 +777,9 @@ private void GenerateRelationalOperators() rightParameter = rightPart = "value"; } - var leftCast = relation.LeftQuantity.ValueType is "decimal" ? "(double)" : string.Empty; - var rightCast = relation.RightQuantity.ValueType is "decimal" ? "(double)" : string.Empty; - - var expression = $"{leftCast}{leftPart} {relation.Operator} {rightCast}{rightPart}"; + var expression = $"{leftPart} {relation.Operator} {rightPart}"; - if (relation.ResultQuantity.Name is not ("double" or "decimal")) + if (relation.ResultQuantity.Name is not "double") { expression = $"{relation.ResultQuantity.Name}.From{relation.ResultUnit.PluralName}({expression})"; } @@ -947,7 +937,7 @@ public int CompareTo({_quantity.Name} other) /// /// /// Note that it is advised against specifying zero difference, due to the nature - /// of floating-point operations and using {_valueType} internally. + /// of floating-point operations and using double internally. /// /// /// The other quantity to compare to. @@ -955,7 +945,7 @@ public int CompareTo({_quantity.Name} other) /// The comparison type: either relative or absolute. /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. [Obsolete(""Use Equals({_quantity.Name} other, {_quantity.Name} tolerance) instead, to check equality across units and to specify the max tolerance for rounding errors due to floating-point arithmetic when converting between units."")] - public bool Equals({_quantity.Name} other, {_quantity.ValueType} tolerance, ComparisonType comparisonType) + public bool Equals({_quantity.Name} other, double tolerance, ComparisonType comparisonType) {{ if (tolerance < 0) throw new ArgumentOutOfRangeException(nameof(tolerance), ""Tolerance must be greater than or equal to 0.""); @@ -1009,7 +999,7 @@ private void GenerateConversionMethods() /// Convert to the unit representation . /// /// Value converted to the specified unit. - public {_quantity.ValueType} As({_unitEnumName} unit) + public double As({_unitEnumName} unit) {{ if (Unit == unit) return Value; @@ -1018,21 +1008,10 @@ private void GenerateConversionMethods() }} "); - if (_quantity.ValueType == "decimal") - { - Writer.WL($@" - - double IQuantity<{_unitEnumName}>.As({_unitEnumName} unit) - {{ - return (double)As(unit); - }} -"); - } - Writer.WL($@" /// - public {_quantity.ValueType} As(UnitSystem unitSystem) + public double As(UnitSystem unitSystem) {{ if (unitSystem is null) throw new ArgumentNullException(nameof(unitSystem)); @@ -1047,29 +1026,9 @@ private void GenerateConversionMethods() }} "); - if (_quantity.ValueType == "decimal") - { - Writer.WL($@" - /// - double IQuantity.As(UnitSystem unitSystem) - {{ - return (double)As(unitSystem); - }} -"); - } - Writer.WL($@" /// double IQuantity.As(Enum unit) - {{ - if (!(unit is {_unitEnumName} typedUnit)) - throw new ArgumentException($""The given unit is of type {{unit.GetType()}}. Only {{typeof({_unitEnumName})}} is supported."", nameof(unit)); - - return (double)As(typedUnit); - }} - - /// - {_quantity.ValueType} IValueQuantity<{_quantity.ValueType}>.As(Enum unit) {{ if (!(unit is {_unitEnumName} typedUnit)) throw new ArgumentException($""The given unit is of type {{unit.GetType()}}. Only {{typeof({_unitEnumName})}} is supported."", nameof(unit)); @@ -1206,18 +1165,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity<{_unitEnumName}> IQuantity<{_unitEnumName}>.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity<{_quantity.ValueType}> IValueQuantity<{_quantity.ValueType}>.ToUnit(Enum unit) - {{ - if (unit is not {_unitEnumName} typedUnit) - throw new ArgumentException($""The given unit is of type {{unit.GetType()}}. Only {{typeof({_unitEnumName})}} is supported."", nameof(unit)); - - return ToUnit(typedUnit); - }} - - /// - IValueQuantity<{_quantity.ValueType}> IValueQuantity<{_quantity.ValueType}>.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion "); } diff --git a/CodeGen/Generators/UnitsNetGen/StaticQuantityGenerator.cs b/CodeGen/Generators/UnitsNetGen/StaticQuantityGenerator.cs index 502437b592..4dc356fd1e 100644 --- a/CodeGen/Generators/UnitsNetGen/StaticQuantityGenerator.cs +++ b/CodeGen/Generators/UnitsNetGen/StaticQuantityGenerator.cs @@ -49,7 +49,7 @@ public partial class Quantity /// The of the quantity to create. /// The value to construct the quantity with. /// The created quantity. - public static IQuantity FromQuantityInfo(QuantityInfo quantityInfo, QuantityValue value) + public static IQuantity FromQuantityInfo(QuantityInfo quantityInfo, double value) { return quantityInfo.Name switch {"); @@ -72,7 +72,7 @@ public static IQuantity FromQuantityInfo(QuantityInfo quantityInfo, QuantityValu /// Unit enum value. /// The resulting quantity if successful, otherwise default. /// True if successful with assigned the value, otherwise false. - public static bool TryFrom(QuantityValue value, Enum? unit, [NotNullWhen(true)] out IQuantity? quantity) + public static bool TryFrom(double value, Enum? unit, [NotNullWhen(true)] out IQuantity? quantity) { quantity = unit switch {"); diff --git a/CodeGen/Generators/UnitsNetGen/UnitTestBaseClassGenerator.cs b/CodeGen/Generators/UnitsNetGen/UnitTestBaseClassGenerator.cs index 1c39c9824f..6c0b3b9c2c 100644 --- a/CodeGen/Generators/UnitsNetGen/UnitTestBaseClassGenerator.cs +++ b/CodeGen/Generators/UnitsNetGen/UnitTestBaseClassGenerator.cs @@ -40,11 +40,6 @@ internal class UnitTestBaseClassGenerator : GeneratorBase /// private readonly string _baseUnitFullName; - /// - /// Constructors for decimal-backed quantities require decimal numbers as input, so add the "m" suffix to numbers when constructing those quantities. - /// - private readonly string _numberSuffix; - /// /// Other unit, if more than one unit exists for quantity, otherwise same as . /// @@ -66,7 +61,6 @@ public UnitTestBaseClassGenerator(Quantity quantity) _baseUnitEnglishAbbreviation = GetEnglishAbbreviation(_baseUnit); _baseUnitFullName = $"{_unitEnumName}.{_baseUnit.SingularName}"; - _numberSuffix = quantity.ValueType == "decimal" ? "m" : ""; // Try to pick another unit, or fall back to base unit if only a single unit. _otherOrBaseUnit = quantity.Units.Where(u => u != _baseUnit).DefaultIfEmpty(_baseUnit).First(); @@ -117,7 +111,7 @@ public abstract partial class {_quantity.Name}TestsBase : QuantityTestsBase if (unit.SkipConversionGeneration) continue; Writer.WL($@" - protected abstract {_quantity.ValueType} {unit.PluralName}InOne{_baseUnit.SingularName} {{ get; }}"); + protected abstract double {unit.PluralName}InOne{_baseUnit.SingularName} {{ get; }}"); } Writer.WL(); @@ -128,12 +122,12 @@ public abstract partial class {_quantity.Name}TestsBase : QuantityTestsBase if (unit.SkipConversionGeneration) continue; Writer.WL($@" - protected virtual {_quantity.ValueType} {unit.PluralName}Tolerance {{ get {{ return { (_quantity.ValueType == "decimal" ? "1e-9m" : "1e-5") }; }} }}"); + protected virtual double {unit.PluralName}Tolerance {{ get {{ return 1e-5; }} }}"); } Writer.WL($@" // ReSharper restore VirtualMemberNeverOverriden.Global - protected ({_quantity.ValueType} UnitsInBaseUnit, {_quantity.ValueType} Tolerence) GetConversionFactor({_unitEnumName} unit) + protected (double UnitsInBaseUnit, double Tolerence) GetConversionFactor({_unitEnumName} unit) {{ return unit switch {{"); @@ -162,14 +156,10 @@ public abstract partial class {_quantity.Name}TestsBase : QuantityTestsBase public void DefaultCtor_ReturnsQuantityWithZeroValueAndBaseUnit() {{ var quantity = new {_quantity.Name}(); - Assert.Equal(0, quantity.Value);"); - if (_quantity.ValueType == "decimal") Writer.WL(@" - Assert.Equal(0m, ((IValueQuantity)quantity).Value);"); - Writer.WL($@" + Assert.Equal(0, quantity.Value); Assert.Equal({_baseUnitFullName}, quantity.Unit); }} -"); - if (_quantity.ValueType == "double") Writer.WL($@" + [Fact] public void Ctor_WithInfinityValue_DoNotThrowsArgumentException() {{ @@ -187,7 +177,6 @@ public void Ctor_WithNaNValue_DoNotThrowsArgumentException() Assert.Null(exception); }} -"); Writer.WL($@" [Fact] public void Ctor_NullAsUnitSystem_ThrowsArgumentNullException() @@ -250,8 +239,7 @@ public void From_ValueAndUnit_ReturnsQuantityWithSameValueAndUnit() } Writer.WL($@" }} -"); - if (_quantity.ValueType == "double") Writer.WL($@" + [Fact] public void From{_baseUnit.PluralName}_WithInfinityValue_DoNotThrowsArgumentException() {{ @@ -269,7 +257,6 @@ public void From_ValueAndUnit_ReturnsQuantityWithSameValueAndUnit() Assert.Null(exception); }} -"); Writer.WL($@" [Fact] public void As() @@ -521,7 +508,7 @@ public void CompareToThrowsOnNull() [InlineData(1, {_baseUnitFullName}, 1, {_otherOrBaseUnitFullName}, false)] // Different unit."); } Writer.WL($@" - public void Equals_ReturnsTrue_IfValueAndUnitAreEqual({_quantity.ValueType} valueA, {_unitEnumName} unitA, {_quantity.ValueType} valueB, {_unitEnumName} unitB, bool expectEqual) + public void Equals_ReturnsTrue_IfValueAndUnitAreEqual(double valueA, {_unitEnumName} unitA, double valueB, {_unitEnumName} unitB, bool expectEqual) {{ var a = new {_quantity.Name}(valueA, unitA); var b = new {_quantity.Name}(valueB, unitB); @@ -642,10 +629,10 @@ public void ToString_SFormat_FormatsNumberWithGivenDigitsAfterRadixForCurrentCul try {{ CultureInfo.CurrentCulture = CultureInfo.InvariantCulture; - Assert.Equal(""0.1{_baseUnitEnglishAbbreviation}"", new {_quantity.Name}(0.123456{_numberSuffix}, {_baseUnitFullName}).ToString(""s1"")); - Assert.Equal(""0.12{_baseUnitEnglishAbbreviation}"", new {_quantity.Name}(0.123456{_numberSuffix}, {_baseUnitFullName}).ToString(""s2"")); - Assert.Equal(""0.123{_baseUnitEnglishAbbreviation}"", new {_quantity.Name}(0.123456{_numberSuffix}, {_baseUnitFullName}).ToString(""s3"")); - Assert.Equal(""0.1235{_baseUnitEnglishAbbreviation}"", new {_quantity.Name}(0.123456{_numberSuffix}, {_baseUnitFullName}).ToString(""s4"")); + Assert.Equal(""0.1{_baseUnitEnglishAbbreviation}"", new {_quantity.Name}(0.123456, {_baseUnitFullName}).ToString(""s1"")); + Assert.Equal(""0.12{_baseUnitEnglishAbbreviation}"", new {_quantity.Name}(0.123456, {_baseUnitFullName}).ToString(""s2"")); + Assert.Equal(""0.123{_baseUnitEnglishAbbreviation}"", new {_quantity.Name}(0.123456, {_baseUnitFullName}).ToString(""s3"")); + Assert.Equal(""0.1235{_baseUnitEnglishAbbreviation}"", new {_quantity.Name}(0.123456, {_baseUnitFullName}).ToString(""s4"")); }} finally {{ @@ -657,10 +644,10 @@ public void ToString_SFormat_FormatsNumberWithGivenDigitsAfterRadixForCurrentCul public void ToString_SFormatAndCulture_FormatsNumberWithGivenDigitsAfterRadixForGivenCulture() {{ var culture = CultureInfo.InvariantCulture; - Assert.Equal(""0.1{_baseUnitEnglishAbbreviation}"", new {_quantity.Name}(0.123456{_numberSuffix}, {_baseUnitFullName}).ToString(""s1"", culture)); - Assert.Equal(""0.12{_baseUnitEnglishAbbreviation}"", new {_quantity.Name}(0.123456{_numberSuffix}, {_baseUnitFullName}).ToString(""s2"", culture)); - Assert.Equal(""0.123{_baseUnitEnglishAbbreviation}"", new {_quantity.Name}(0.123456{_numberSuffix}, {_baseUnitFullName}).ToString(""s3"", culture)); - Assert.Equal(""0.1235{_baseUnitEnglishAbbreviation}"", new {_quantity.Name}(0.123456{_numberSuffix}, {_baseUnitFullName}).ToString(""s4"", culture)); + Assert.Equal(""0.1{_baseUnitEnglishAbbreviation}"", new {_quantity.Name}(0.123456, {_baseUnitFullName}).ToString(""s1"", culture)); + Assert.Equal(""0.12{_baseUnitEnglishAbbreviation}"", new {_quantity.Name}(0.123456, {_baseUnitFullName}).ToString(""s2"", culture)); + Assert.Equal(""0.123{_baseUnitEnglishAbbreviation}"", new {_quantity.Name}(0.123456, {_baseUnitFullName}).ToString(""s3"", culture)); + Assert.Equal(""0.1235{_baseUnitEnglishAbbreviation}"", new {_quantity.Name}(0.123456, {_baseUnitFullName}).ToString(""s4"", culture)); }} [Theory] diff --git a/CodeGen/JsonTypes/Quantity.cs b/CodeGen/JsonTypes/Quantity.cs index 6956560161..35f81a3ee2 100644 --- a/CodeGen/JsonTypes/Quantity.cs +++ b/CodeGen/JsonTypes/Quantity.cs @@ -11,7 +11,6 @@ internal record Quantity #pragma warning disable 0649 public BaseDimensions BaseDimensions = new(); // Default to empty - public string ValueType = "double"; public string BaseUnit = null!; public bool GenerateArithmetic = true; public bool Logarithmic = false; diff --git a/CodeGen/PrefixInfo.cs b/CodeGen/PrefixInfo.cs index 1ec641b3b6..e44c643c48 100644 --- a/CodeGen/PrefixInfo.cs +++ b/CodeGen/PrefixInfo.cs @@ -15,9 +15,6 @@ internal class PrefixInfo public static readonly IReadOnlyDictionary Entries = new[] { - // Need to append 'd' suffix for double in order to later search/replace "d" with "m" - // when creating decimal conversion functions in CodeGen.Generator.FixConversionFunctionsForDecimalValueTypes. - // SI prefixes new PrefixInfo(Prefix.Yocto, "1e-24d", "y",(Chinese, "夭")), new PrefixInfo(Prefix.Zepto, "1e-21d", "z",(Chinese, "仄")), diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToAbsorbedDoseOfIonizingRadiationExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToAbsorbedDoseOfIonizingRadiationExtensions.g.cs index c4dc4f6742..8011ae4fef 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToAbsorbedDoseOfIonizingRadiationExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToAbsorbedDoseOfIonizingRadiationExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToAbsorbedDoseOfIonizingRadiation /// public static class NumberToAbsorbedDoseOfIonizingRadiationExtensions { - /// + /// public static AbsorbedDoseOfIonizingRadiation Centigrays(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static AbsorbedDoseOfIonizingRadiation Centigrays(this T value) #endif => AbsorbedDoseOfIonizingRadiation.FromCentigrays(Convert.ToDouble(value)); - /// + /// public static AbsorbedDoseOfIonizingRadiation Femtograys(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static AbsorbedDoseOfIonizingRadiation Femtograys(this T value) #endif => AbsorbedDoseOfIonizingRadiation.FromFemtograys(Convert.ToDouble(value)); - /// + /// public static AbsorbedDoseOfIonizingRadiation Gigagrays(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static AbsorbedDoseOfIonizingRadiation Gigagrays(this T value) #endif => AbsorbedDoseOfIonizingRadiation.FromGigagrays(Convert.ToDouble(value)); - /// + /// public static AbsorbedDoseOfIonizingRadiation Grays(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static AbsorbedDoseOfIonizingRadiation Grays(this T value) #endif => AbsorbedDoseOfIonizingRadiation.FromGrays(Convert.ToDouble(value)); - /// + /// public static AbsorbedDoseOfIonizingRadiation Kilograys(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -72,7 +72,7 @@ public static AbsorbedDoseOfIonizingRadiation Kilograys(this T value) #endif => AbsorbedDoseOfIonizingRadiation.FromKilograys(Convert.ToDouble(value)); - /// + /// public static AbsorbedDoseOfIonizingRadiation Kilorads(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -80,7 +80,7 @@ public static AbsorbedDoseOfIonizingRadiation Kilorads(this T value) #endif => AbsorbedDoseOfIonizingRadiation.FromKilorads(Convert.ToDouble(value)); - /// + /// public static AbsorbedDoseOfIonizingRadiation Megagrays(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -88,7 +88,7 @@ public static AbsorbedDoseOfIonizingRadiation Megagrays(this T value) #endif => AbsorbedDoseOfIonizingRadiation.FromMegagrays(Convert.ToDouble(value)); - /// + /// public static AbsorbedDoseOfIonizingRadiation Megarads(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -96,7 +96,7 @@ public static AbsorbedDoseOfIonizingRadiation Megarads(this T value) #endif => AbsorbedDoseOfIonizingRadiation.FromMegarads(Convert.ToDouble(value)); - /// + /// public static AbsorbedDoseOfIonizingRadiation Micrograys(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -104,7 +104,7 @@ public static AbsorbedDoseOfIonizingRadiation Micrograys(this T value) #endif => AbsorbedDoseOfIonizingRadiation.FromMicrograys(Convert.ToDouble(value)); - /// + /// public static AbsorbedDoseOfIonizingRadiation Milligrays(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -112,7 +112,7 @@ public static AbsorbedDoseOfIonizingRadiation Milligrays(this T value) #endif => AbsorbedDoseOfIonizingRadiation.FromMilligrays(Convert.ToDouble(value)); - /// + /// public static AbsorbedDoseOfIonizingRadiation Millirads(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -120,7 +120,7 @@ public static AbsorbedDoseOfIonizingRadiation Millirads(this T value) #endif => AbsorbedDoseOfIonizingRadiation.FromMillirads(Convert.ToDouble(value)); - /// + /// public static AbsorbedDoseOfIonizingRadiation Nanograys(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -128,7 +128,7 @@ public static AbsorbedDoseOfIonizingRadiation Nanograys(this T value) #endif => AbsorbedDoseOfIonizingRadiation.FromNanograys(Convert.ToDouble(value)); - /// + /// public static AbsorbedDoseOfIonizingRadiation Petagrays(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -136,7 +136,7 @@ public static AbsorbedDoseOfIonizingRadiation Petagrays(this T value) #endif => AbsorbedDoseOfIonizingRadiation.FromPetagrays(Convert.ToDouble(value)); - /// + /// public static AbsorbedDoseOfIonizingRadiation Picograys(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -144,7 +144,7 @@ public static AbsorbedDoseOfIonizingRadiation Picograys(this T value) #endif => AbsorbedDoseOfIonizingRadiation.FromPicograys(Convert.ToDouble(value)); - /// + /// public static AbsorbedDoseOfIonizingRadiation Rads(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -152,7 +152,7 @@ public static AbsorbedDoseOfIonizingRadiation Rads(this T value) #endif => AbsorbedDoseOfIonizingRadiation.FromRads(Convert.ToDouble(value)); - /// + /// public static AbsorbedDoseOfIonizingRadiation Teragrays(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToAccelerationExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToAccelerationExtensions.g.cs index 169625ebe9..53301e4bef 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToAccelerationExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToAccelerationExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToAcceleration /// public static class NumberToAccelerationExtensions { - /// + /// public static Acceleration CentimetersPerSecondSquared(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static Acceleration CentimetersPerSecondSquared(this T value) #endif => Acceleration.FromCentimetersPerSecondSquared(Convert.ToDouble(value)); - /// + /// public static Acceleration DecimetersPerSecondSquared(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static Acceleration DecimetersPerSecondSquared(this T value) #endif => Acceleration.FromDecimetersPerSecondSquared(Convert.ToDouble(value)); - /// + /// public static Acceleration FeetPerSecondSquared(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static Acceleration FeetPerSecondSquared(this T value) #endif => Acceleration.FromFeetPerSecondSquared(Convert.ToDouble(value)); - /// + /// public static Acceleration InchesPerSecondSquared(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static Acceleration InchesPerSecondSquared(this T value) #endif => Acceleration.FromInchesPerSecondSquared(Convert.ToDouble(value)); - /// + /// public static Acceleration KilometersPerSecondSquared(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -72,7 +72,7 @@ public static Acceleration KilometersPerSecondSquared(this T value) #endif => Acceleration.FromKilometersPerSecondSquared(Convert.ToDouble(value)); - /// + /// public static Acceleration KnotsPerHour(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -80,7 +80,7 @@ public static Acceleration KnotsPerHour(this T value) #endif => Acceleration.FromKnotsPerHour(Convert.ToDouble(value)); - /// + /// public static Acceleration KnotsPerMinute(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -88,7 +88,7 @@ public static Acceleration KnotsPerMinute(this T value) #endif => Acceleration.FromKnotsPerMinute(Convert.ToDouble(value)); - /// + /// public static Acceleration KnotsPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -96,7 +96,7 @@ public static Acceleration KnotsPerSecond(this T value) #endif => Acceleration.FromKnotsPerSecond(Convert.ToDouble(value)); - /// + /// public static Acceleration MetersPerSecondSquared(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -104,7 +104,7 @@ public static Acceleration MetersPerSecondSquared(this T value) #endif => Acceleration.FromMetersPerSecondSquared(Convert.ToDouble(value)); - /// + /// public static Acceleration MicrometersPerSecondSquared(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -112,7 +112,7 @@ public static Acceleration MicrometersPerSecondSquared(this T value) #endif => Acceleration.FromMicrometersPerSecondSquared(Convert.ToDouble(value)); - /// + /// public static Acceleration MillimetersPerSecondSquared(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -120,7 +120,7 @@ public static Acceleration MillimetersPerSecondSquared(this T value) #endif => Acceleration.FromMillimetersPerSecondSquared(Convert.ToDouble(value)); - /// + /// public static Acceleration MillistandardGravity(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -128,7 +128,7 @@ public static Acceleration MillistandardGravity(this T value) #endif => Acceleration.FromMillistandardGravity(Convert.ToDouble(value)); - /// + /// public static Acceleration NanometersPerSecondSquared(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -136,7 +136,7 @@ public static Acceleration NanometersPerSecondSquared(this T value) #endif => Acceleration.FromNanometersPerSecondSquared(Convert.ToDouble(value)); - /// + /// public static Acceleration StandardGravity(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToAmountOfSubstanceExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToAmountOfSubstanceExtensions.g.cs index 25fc55c494..4993b43931 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToAmountOfSubstanceExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToAmountOfSubstanceExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToAmountOfSubstance /// public static class NumberToAmountOfSubstanceExtensions { - /// + /// public static AmountOfSubstance Centimoles(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static AmountOfSubstance Centimoles(this T value) #endif => AmountOfSubstance.FromCentimoles(Convert.ToDouble(value)); - /// + /// public static AmountOfSubstance CentipoundMoles(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static AmountOfSubstance CentipoundMoles(this T value) #endif => AmountOfSubstance.FromCentipoundMoles(Convert.ToDouble(value)); - /// + /// public static AmountOfSubstance Decimoles(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static AmountOfSubstance Decimoles(this T value) #endif => AmountOfSubstance.FromDecimoles(Convert.ToDouble(value)); - /// + /// public static AmountOfSubstance DecipoundMoles(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static AmountOfSubstance DecipoundMoles(this T value) #endif => AmountOfSubstance.FromDecipoundMoles(Convert.ToDouble(value)); - /// + /// public static AmountOfSubstance Femtomoles(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -72,7 +72,7 @@ public static AmountOfSubstance Femtomoles(this T value) #endif => AmountOfSubstance.FromFemtomoles(Convert.ToDouble(value)); - /// + /// public static AmountOfSubstance Kilomoles(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -80,7 +80,7 @@ public static AmountOfSubstance Kilomoles(this T value) #endif => AmountOfSubstance.FromKilomoles(Convert.ToDouble(value)); - /// + /// public static AmountOfSubstance KilopoundMoles(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -88,7 +88,7 @@ public static AmountOfSubstance KilopoundMoles(this T value) #endif => AmountOfSubstance.FromKilopoundMoles(Convert.ToDouble(value)); - /// + /// public static AmountOfSubstance Megamoles(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -96,7 +96,7 @@ public static AmountOfSubstance Megamoles(this T value) #endif => AmountOfSubstance.FromMegamoles(Convert.ToDouble(value)); - /// + /// public static AmountOfSubstance Micromoles(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -104,7 +104,7 @@ public static AmountOfSubstance Micromoles(this T value) #endif => AmountOfSubstance.FromMicromoles(Convert.ToDouble(value)); - /// + /// public static AmountOfSubstance MicropoundMoles(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -112,7 +112,7 @@ public static AmountOfSubstance MicropoundMoles(this T value) #endif => AmountOfSubstance.FromMicropoundMoles(Convert.ToDouble(value)); - /// + /// public static AmountOfSubstance Millimoles(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -120,7 +120,7 @@ public static AmountOfSubstance Millimoles(this T value) #endif => AmountOfSubstance.FromMillimoles(Convert.ToDouble(value)); - /// + /// public static AmountOfSubstance MillipoundMoles(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -128,7 +128,7 @@ public static AmountOfSubstance MillipoundMoles(this T value) #endif => AmountOfSubstance.FromMillipoundMoles(Convert.ToDouble(value)); - /// + /// public static AmountOfSubstance Moles(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -136,7 +136,7 @@ public static AmountOfSubstance Moles(this T value) #endif => AmountOfSubstance.FromMoles(Convert.ToDouble(value)); - /// + /// public static AmountOfSubstance Nanomoles(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -144,7 +144,7 @@ public static AmountOfSubstance Nanomoles(this T value) #endif => AmountOfSubstance.FromNanomoles(Convert.ToDouble(value)); - /// + /// public static AmountOfSubstance NanopoundMoles(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -152,7 +152,7 @@ public static AmountOfSubstance NanopoundMoles(this T value) #endif => AmountOfSubstance.FromNanopoundMoles(Convert.ToDouble(value)); - /// + /// public static AmountOfSubstance Picomoles(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -160,7 +160,7 @@ public static AmountOfSubstance Picomoles(this T value) #endif => AmountOfSubstance.FromPicomoles(Convert.ToDouble(value)); - /// + /// public static AmountOfSubstance PoundMoles(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToAmplitudeRatioExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToAmplitudeRatioExtensions.g.cs index 1f3d3ae750..778ee3b019 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToAmplitudeRatioExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToAmplitudeRatioExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToAmplitudeRatio /// public static class NumberToAmplitudeRatioExtensions { - /// + /// public static AmplitudeRatio DecibelMicrovolts(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static AmplitudeRatio DecibelMicrovolts(this T value) #endif => AmplitudeRatio.FromDecibelMicrovolts(Convert.ToDouble(value)); - /// + /// public static AmplitudeRatio DecibelMillivolts(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static AmplitudeRatio DecibelMillivolts(this T value) #endif => AmplitudeRatio.FromDecibelMillivolts(Convert.ToDouble(value)); - /// + /// public static AmplitudeRatio DecibelsUnloaded(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static AmplitudeRatio DecibelsUnloaded(this T value) #endif => AmplitudeRatio.FromDecibelsUnloaded(Convert.ToDouble(value)); - /// + /// public static AmplitudeRatio DecibelVolts(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToAngleExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToAngleExtensions.g.cs index 947e4fc504..538044922c 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToAngleExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToAngleExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToAngle /// public static class NumberToAngleExtensions { - /// + /// public static Angle Arcminutes(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static Angle Arcminutes(this T value) #endif => Angle.FromArcminutes(Convert.ToDouble(value)); - /// + /// public static Angle Arcseconds(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static Angle Arcseconds(this T value) #endif => Angle.FromArcseconds(Convert.ToDouble(value)); - /// + /// public static Angle Centiradians(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static Angle Centiradians(this T value) #endif => Angle.FromCentiradians(Convert.ToDouble(value)); - /// + /// public static Angle Deciradians(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static Angle Deciradians(this T value) #endif => Angle.FromDeciradians(Convert.ToDouble(value)); - /// + /// public static Angle Degrees(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -72,7 +72,7 @@ public static Angle Degrees(this T value) #endif => Angle.FromDegrees(Convert.ToDouble(value)); - /// + /// public static Angle Gradians(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -80,7 +80,7 @@ public static Angle Gradians(this T value) #endif => Angle.FromGradians(Convert.ToDouble(value)); - /// + /// public static Angle Microdegrees(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -88,7 +88,7 @@ public static Angle Microdegrees(this T value) #endif => Angle.FromMicrodegrees(Convert.ToDouble(value)); - /// + /// public static Angle Microradians(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -96,7 +96,7 @@ public static Angle Microradians(this T value) #endif => Angle.FromMicroradians(Convert.ToDouble(value)); - /// + /// public static Angle Millidegrees(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -104,7 +104,7 @@ public static Angle Millidegrees(this T value) #endif => Angle.FromMillidegrees(Convert.ToDouble(value)); - /// + /// public static Angle Milliradians(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -112,7 +112,7 @@ public static Angle Milliradians(this T value) #endif => Angle.FromMilliradians(Convert.ToDouble(value)); - /// + /// public static Angle Nanodegrees(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -120,7 +120,7 @@ public static Angle Nanodegrees(this T value) #endif => Angle.FromNanodegrees(Convert.ToDouble(value)); - /// + /// public static Angle Nanoradians(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -128,7 +128,7 @@ public static Angle Nanoradians(this T value) #endif => Angle.FromNanoradians(Convert.ToDouble(value)); - /// + /// public static Angle NatoMils(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -136,7 +136,7 @@ public static Angle NatoMils(this T value) #endif => Angle.FromNatoMils(Convert.ToDouble(value)); - /// + /// public static Angle Radians(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -144,7 +144,7 @@ public static Angle Radians(this T value) #endif => Angle.FromRadians(Convert.ToDouble(value)); - /// + /// public static Angle Revolutions(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -152,7 +152,7 @@ public static Angle Revolutions(this T value) #endif => Angle.FromRevolutions(Convert.ToDouble(value)); - /// + /// public static Angle Tilt(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToApparentEnergyExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToApparentEnergyExtensions.g.cs index 9d22f10bd9..4f5e9aa218 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToApparentEnergyExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToApparentEnergyExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToApparentEnergy /// public static class NumberToApparentEnergyExtensions { - /// + /// public static ApparentEnergy KilovoltampereHours(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static ApparentEnergy KilovoltampereHours(this T value) #endif => ApparentEnergy.FromKilovoltampereHours(Convert.ToDouble(value)); - /// + /// public static ApparentEnergy MegavoltampereHours(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static ApparentEnergy MegavoltampereHours(this T value) #endif => ApparentEnergy.FromMegavoltampereHours(Convert.ToDouble(value)); - /// + /// public static ApparentEnergy VoltampereHours(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToApparentPowerExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToApparentPowerExtensions.g.cs index 9cf9e6ed71..7fb405d7e3 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToApparentPowerExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToApparentPowerExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToApparentPower /// public static class NumberToApparentPowerExtensions { - /// + /// public static ApparentPower Gigavoltamperes(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static ApparentPower Gigavoltamperes(this T value) #endif => ApparentPower.FromGigavoltamperes(Convert.ToDouble(value)); - /// + /// public static ApparentPower Kilovoltamperes(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static ApparentPower Kilovoltamperes(this T value) #endif => ApparentPower.FromKilovoltamperes(Convert.ToDouble(value)); - /// + /// public static ApparentPower Megavoltamperes(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static ApparentPower Megavoltamperes(this T value) #endif => ApparentPower.FromMegavoltamperes(Convert.ToDouble(value)); - /// + /// public static ApparentPower Microvoltamperes(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static ApparentPower Microvoltamperes(this T value) #endif => ApparentPower.FromMicrovoltamperes(Convert.ToDouble(value)); - /// + /// public static ApparentPower Millivoltamperes(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -72,7 +72,7 @@ public static ApparentPower Millivoltamperes(this T value) #endif => ApparentPower.FromMillivoltamperes(Convert.ToDouble(value)); - /// + /// public static ApparentPower Voltamperes(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToAreaDensityExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToAreaDensityExtensions.g.cs index fa13776c9c..ad2a5a212a 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToAreaDensityExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToAreaDensityExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToAreaDensity /// public static class NumberToAreaDensityExtensions { - /// + /// public static AreaDensity GramsPerSquareMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static AreaDensity GramsPerSquareMeter(this T value) #endif => AreaDensity.FromGramsPerSquareMeter(Convert.ToDouble(value)); - /// + /// public static AreaDensity KilogramsPerSquareMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static AreaDensity KilogramsPerSquareMeter(this T value) #endif => AreaDensity.FromKilogramsPerSquareMeter(Convert.ToDouble(value)); - /// + /// public static AreaDensity MilligramsPerSquareMeter(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToAreaExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToAreaExtensions.g.cs index 8669dd728a..11c81e72b1 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToAreaExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToAreaExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToArea /// public static class NumberToAreaExtensions { - /// + /// public static Area Acres(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static Area Acres(this T value) #endif => Area.FromAcres(Convert.ToDouble(value)); - /// + /// public static Area Hectares(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static Area Hectares(this T value) #endif => Area.FromHectares(Convert.ToDouble(value)); - /// + /// public static Area SquareCentimeters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static Area SquareCentimeters(this T value) #endif => Area.FromSquareCentimeters(Convert.ToDouble(value)); - /// + /// public static Area SquareDecimeters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static Area SquareDecimeters(this T value) #endif => Area.FromSquareDecimeters(Convert.ToDouble(value)); - /// + /// public static Area SquareFeet(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -72,7 +72,7 @@ public static Area SquareFeet(this T value) #endif => Area.FromSquareFeet(Convert.ToDouble(value)); - /// + /// public static Area SquareInches(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -80,7 +80,7 @@ public static Area SquareInches(this T value) #endif => Area.FromSquareInches(Convert.ToDouble(value)); - /// + /// public static Area SquareKilometers(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -88,7 +88,7 @@ public static Area SquareKilometers(this T value) #endif => Area.FromSquareKilometers(Convert.ToDouble(value)); - /// + /// public static Area SquareMeters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -96,7 +96,7 @@ public static Area SquareMeters(this T value) #endif => Area.FromSquareMeters(Convert.ToDouble(value)); - /// + /// public static Area SquareMicrometers(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -104,7 +104,7 @@ public static Area SquareMicrometers(this T value) #endif => Area.FromSquareMicrometers(Convert.ToDouble(value)); - /// + /// public static Area SquareMiles(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -112,7 +112,7 @@ public static Area SquareMiles(this T value) #endif => Area.FromSquareMiles(Convert.ToDouble(value)); - /// + /// public static Area SquareMillimeters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -120,7 +120,7 @@ public static Area SquareMillimeters(this T value) #endif => Area.FromSquareMillimeters(Convert.ToDouble(value)); - /// + /// public static Area SquareNauticalMiles(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -128,7 +128,7 @@ public static Area SquareNauticalMiles(this T value) #endif => Area.FromSquareNauticalMiles(Convert.ToDouble(value)); - /// + /// public static Area SquareYards(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -136,7 +136,7 @@ public static Area SquareYards(this T value) #endif => Area.FromSquareYards(Convert.ToDouble(value)); - /// + /// public static Area UsSurveySquareFeet(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToAreaMomentOfInertiaExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToAreaMomentOfInertiaExtensions.g.cs index 7835b4d707..09807623e6 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToAreaMomentOfInertiaExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToAreaMomentOfInertiaExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToAreaMomentOfInertia /// public static class NumberToAreaMomentOfInertiaExtensions { - /// + /// public static AreaMomentOfInertia CentimetersToTheFourth(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static AreaMomentOfInertia CentimetersToTheFourth(this T value) #endif => AreaMomentOfInertia.FromCentimetersToTheFourth(Convert.ToDouble(value)); - /// + /// public static AreaMomentOfInertia DecimetersToTheFourth(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static AreaMomentOfInertia DecimetersToTheFourth(this T value) #endif => AreaMomentOfInertia.FromDecimetersToTheFourth(Convert.ToDouble(value)); - /// + /// public static AreaMomentOfInertia FeetToTheFourth(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static AreaMomentOfInertia FeetToTheFourth(this T value) #endif => AreaMomentOfInertia.FromFeetToTheFourth(Convert.ToDouble(value)); - /// + /// public static AreaMomentOfInertia InchesToTheFourth(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static AreaMomentOfInertia InchesToTheFourth(this T value) #endif => AreaMomentOfInertia.FromInchesToTheFourth(Convert.ToDouble(value)); - /// + /// public static AreaMomentOfInertia MetersToTheFourth(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -72,7 +72,7 @@ public static AreaMomentOfInertia MetersToTheFourth(this T value) #endif => AreaMomentOfInertia.FromMetersToTheFourth(Convert.ToDouble(value)); - /// + /// public static AreaMomentOfInertia MillimetersToTheFourth(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToBitRateExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToBitRateExtensions.g.cs index bdc4de545f..2f85da9ccc 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToBitRateExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToBitRateExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToBitRate /// public static class NumberToBitRateExtensions { - /// + /// public static BitRate BitsPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static BitRate BitsPerSecond(this T value) #endif => BitRate.FromBitsPerSecond(Convert.ToDouble(value)); - /// + /// public static BitRate BytesPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static BitRate BytesPerSecond(this T value) #endif => BitRate.FromBytesPerSecond(Convert.ToDouble(value)); - /// + /// public static BitRate ExabitsPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static BitRate ExabitsPerSecond(this T value) #endif => BitRate.FromExabitsPerSecond(Convert.ToDouble(value)); - /// + /// public static BitRate ExabytesPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static BitRate ExabytesPerSecond(this T value) #endif => BitRate.FromExabytesPerSecond(Convert.ToDouble(value)); - /// + /// public static BitRate ExbibitsPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -72,7 +72,7 @@ public static BitRate ExbibitsPerSecond(this T value) #endif => BitRate.FromExbibitsPerSecond(Convert.ToDouble(value)); - /// + /// public static BitRate ExbibytesPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -80,7 +80,7 @@ public static BitRate ExbibytesPerSecond(this T value) #endif => BitRate.FromExbibytesPerSecond(Convert.ToDouble(value)); - /// + /// public static BitRate GibibitsPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -88,7 +88,7 @@ public static BitRate GibibitsPerSecond(this T value) #endif => BitRate.FromGibibitsPerSecond(Convert.ToDouble(value)); - /// + /// public static BitRate GibibytesPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -96,7 +96,7 @@ public static BitRate GibibytesPerSecond(this T value) #endif => BitRate.FromGibibytesPerSecond(Convert.ToDouble(value)); - /// + /// public static BitRate GigabitsPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -104,7 +104,7 @@ public static BitRate GigabitsPerSecond(this T value) #endif => BitRate.FromGigabitsPerSecond(Convert.ToDouble(value)); - /// + /// public static BitRate GigabytesPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -112,7 +112,7 @@ public static BitRate GigabytesPerSecond(this T value) #endif => BitRate.FromGigabytesPerSecond(Convert.ToDouble(value)); - /// + /// public static BitRate KibibitsPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -120,7 +120,7 @@ public static BitRate KibibitsPerSecond(this T value) #endif => BitRate.FromKibibitsPerSecond(Convert.ToDouble(value)); - /// + /// public static BitRate KibibytesPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -128,7 +128,7 @@ public static BitRate KibibytesPerSecond(this T value) #endif => BitRate.FromKibibytesPerSecond(Convert.ToDouble(value)); - /// + /// public static BitRate KilobitsPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -136,7 +136,7 @@ public static BitRate KilobitsPerSecond(this T value) #endif => BitRate.FromKilobitsPerSecond(Convert.ToDouble(value)); - /// + /// public static BitRate KilobytesPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -144,7 +144,7 @@ public static BitRate KilobytesPerSecond(this T value) #endif => BitRate.FromKilobytesPerSecond(Convert.ToDouble(value)); - /// + /// public static BitRate MebibitsPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -152,7 +152,7 @@ public static BitRate MebibitsPerSecond(this T value) #endif => BitRate.FromMebibitsPerSecond(Convert.ToDouble(value)); - /// + /// public static BitRate MebibytesPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -160,7 +160,7 @@ public static BitRate MebibytesPerSecond(this T value) #endif => BitRate.FromMebibytesPerSecond(Convert.ToDouble(value)); - /// + /// public static BitRate MegabitsPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -168,7 +168,7 @@ public static BitRate MegabitsPerSecond(this T value) #endif => BitRate.FromMegabitsPerSecond(Convert.ToDouble(value)); - /// + /// public static BitRate MegabytesPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -176,7 +176,7 @@ public static BitRate MegabytesPerSecond(this T value) #endif => BitRate.FromMegabytesPerSecond(Convert.ToDouble(value)); - /// + /// public static BitRate PebibitsPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -184,7 +184,7 @@ public static BitRate PebibitsPerSecond(this T value) #endif => BitRate.FromPebibitsPerSecond(Convert.ToDouble(value)); - /// + /// public static BitRate PebibytesPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -192,7 +192,7 @@ public static BitRate PebibytesPerSecond(this T value) #endif => BitRate.FromPebibytesPerSecond(Convert.ToDouble(value)); - /// + /// public static BitRate PetabitsPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -200,7 +200,7 @@ public static BitRate PetabitsPerSecond(this T value) #endif => BitRate.FromPetabitsPerSecond(Convert.ToDouble(value)); - /// + /// public static BitRate PetabytesPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -208,7 +208,7 @@ public static BitRate PetabytesPerSecond(this T value) #endif => BitRate.FromPetabytesPerSecond(Convert.ToDouble(value)); - /// + /// public static BitRate TebibitsPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -216,7 +216,7 @@ public static BitRate TebibitsPerSecond(this T value) #endif => BitRate.FromTebibitsPerSecond(Convert.ToDouble(value)); - /// + /// public static BitRate TebibytesPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -224,7 +224,7 @@ public static BitRate TebibytesPerSecond(this T value) #endif => BitRate.FromTebibytesPerSecond(Convert.ToDouble(value)); - /// + /// public static BitRate TerabitsPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -232,7 +232,7 @@ public static BitRate TerabitsPerSecond(this T value) #endif => BitRate.FromTerabitsPerSecond(Convert.ToDouble(value)); - /// + /// public static BitRate TerabytesPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToBrakeSpecificFuelConsumptionExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToBrakeSpecificFuelConsumptionExtensions.g.cs index 1eb91c5977..bfffa5835f 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToBrakeSpecificFuelConsumptionExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToBrakeSpecificFuelConsumptionExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToBrakeSpecificFuelConsumption /// public static class NumberToBrakeSpecificFuelConsumptionExtensions { - /// + /// public static BrakeSpecificFuelConsumption GramsPerKiloWattHour(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static BrakeSpecificFuelConsumption GramsPerKiloWattHour(this T value) #endif => BrakeSpecificFuelConsumption.FromGramsPerKiloWattHour(Convert.ToDouble(value)); - /// + /// public static BrakeSpecificFuelConsumption KilogramsPerJoule(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static BrakeSpecificFuelConsumption KilogramsPerJoule(this T value) #endif => BrakeSpecificFuelConsumption.FromKilogramsPerJoule(Convert.ToDouble(value)); - /// + /// public static BrakeSpecificFuelConsumption PoundsPerMechanicalHorsepowerHour(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToCapacitanceExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToCapacitanceExtensions.g.cs index b70ed1583e..ca11428455 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToCapacitanceExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToCapacitanceExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToCapacitance /// public static class NumberToCapacitanceExtensions { - /// + /// public static Capacitance Farads(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static Capacitance Farads(this T value) #endif => Capacitance.FromFarads(Convert.ToDouble(value)); - /// + /// public static Capacitance Kilofarads(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static Capacitance Kilofarads(this T value) #endif => Capacitance.FromKilofarads(Convert.ToDouble(value)); - /// + /// public static Capacitance Megafarads(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static Capacitance Megafarads(this T value) #endif => Capacitance.FromMegafarads(Convert.ToDouble(value)); - /// + /// public static Capacitance Microfarads(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static Capacitance Microfarads(this T value) #endif => Capacitance.FromMicrofarads(Convert.ToDouble(value)); - /// + /// public static Capacitance Millifarads(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -72,7 +72,7 @@ public static Capacitance Millifarads(this T value) #endif => Capacitance.FromMillifarads(Convert.ToDouble(value)); - /// + /// public static Capacitance Nanofarads(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -80,7 +80,7 @@ public static Capacitance Nanofarads(this T value) #endif => Capacitance.FromNanofarads(Convert.ToDouble(value)); - /// + /// public static Capacitance Picofarads(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToCoefficientOfThermalExpansionExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToCoefficientOfThermalExpansionExtensions.g.cs index 7ab80eda79..ad0f6b2bc5 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToCoefficientOfThermalExpansionExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToCoefficientOfThermalExpansionExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToCoefficientOfThermalExpansion /// public static class NumberToCoefficientOfThermalExpansionExtensions { - /// + /// [Obsolete("Use PerDegreeCelsius instead.")] public static CoefficientOfThermalExpansion InverseDegreeCelsius(this T value) where T : notnull @@ -41,7 +41,7 @@ public static CoefficientOfThermalExpansion InverseDegreeCelsius(this T value #endif => CoefficientOfThermalExpansion.FromInverseDegreeCelsius(Convert.ToDouble(value)); - /// + /// [Obsolete("Use PerDegreeFahrenheit instead.")] public static CoefficientOfThermalExpansion InverseDegreeFahrenheit(this T value) where T : notnull @@ -50,7 +50,7 @@ public static CoefficientOfThermalExpansion InverseDegreeFahrenheit(this T va #endif => CoefficientOfThermalExpansion.FromInverseDegreeFahrenheit(Convert.ToDouble(value)); - /// + /// [Obsolete("Use PerKelvin instead.")] public static CoefficientOfThermalExpansion InverseKelvin(this T value) where T : notnull @@ -59,7 +59,7 @@ public static CoefficientOfThermalExpansion InverseKelvin(this T value) #endif => CoefficientOfThermalExpansion.FromInverseKelvin(Convert.ToDouble(value)); - /// + /// public static CoefficientOfThermalExpansion PerDegreeCelsius(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -67,7 +67,7 @@ public static CoefficientOfThermalExpansion PerDegreeCelsius(this T value) #endif => CoefficientOfThermalExpansion.FromPerDegreeCelsius(Convert.ToDouble(value)); - /// + /// public static CoefficientOfThermalExpansion PerDegreeFahrenheit(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -75,7 +75,7 @@ public static CoefficientOfThermalExpansion PerDegreeFahrenheit(this T value) #endif => CoefficientOfThermalExpansion.FromPerDegreeFahrenheit(Convert.ToDouble(value)); - /// + /// public static CoefficientOfThermalExpansion PerKelvin(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -83,7 +83,7 @@ public static CoefficientOfThermalExpansion PerKelvin(this T value) #endif => CoefficientOfThermalExpansion.FromPerKelvin(Convert.ToDouble(value)); - /// + /// public static CoefficientOfThermalExpansion PpmPerDegreeCelsius(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -91,7 +91,7 @@ public static CoefficientOfThermalExpansion PpmPerDegreeCelsius(this T value) #endif => CoefficientOfThermalExpansion.FromPpmPerDegreeCelsius(Convert.ToDouble(value)); - /// + /// public static CoefficientOfThermalExpansion PpmPerDegreeFahrenheit(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -99,7 +99,7 @@ public static CoefficientOfThermalExpansion PpmPerDegreeFahrenheit(this T val #endif => CoefficientOfThermalExpansion.FromPpmPerDegreeFahrenheit(Convert.ToDouble(value)); - /// + /// public static CoefficientOfThermalExpansion PpmPerKelvin(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToCompressibilityExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToCompressibilityExtensions.g.cs index bb3cdbbeb0..f5683c23f3 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToCompressibilityExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToCompressibilityExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToCompressibility /// public static class NumberToCompressibilityExtensions { - /// + /// public static Compressibility InverseAtmospheres(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static Compressibility InverseAtmospheres(this T value) #endif => Compressibility.FromInverseAtmospheres(Convert.ToDouble(value)); - /// + /// public static Compressibility InverseBars(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static Compressibility InverseBars(this T value) #endif => Compressibility.FromInverseBars(Convert.ToDouble(value)); - /// + /// public static Compressibility InverseKilopascals(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static Compressibility InverseKilopascals(this T value) #endif => Compressibility.FromInverseKilopascals(Convert.ToDouble(value)); - /// + /// public static Compressibility InverseMegapascals(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static Compressibility InverseMegapascals(this T value) #endif => Compressibility.FromInverseMegapascals(Convert.ToDouble(value)); - /// + /// public static Compressibility InverseMillibars(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -72,7 +72,7 @@ public static Compressibility InverseMillibars(this T value) #endif => Compressibility.FromInverseMillibars(Convert.ToDouble(value)); - /// + /// public static Compressibility InversePascals(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -80,7 +80,7 @@ public static Compressibility InversePascals(this T value) #endif => Compressibility.FromInversePascals(Convert.ToDouble(value)); - /// + /// public static Compressibility InversePoundsForcePerSquareInch(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToDensityExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToDensityExtensions.g.cs index fab19c64b9..a10af41796 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToDensityExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToDensityExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToDensity /// public static class NumberToDensityExtensions { - /// + /// public static Density CentigramsPerDeciliter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static Density CentigramsPerDeciliter(this T value) #endif => Density.FromCentigramsPerDeciliter(Convert.ToDouble(value)); - /// + /// public static Density CentigramsPerLiter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static Density CentigramsPerLiter(this T value) #endif => Density.FromCentigramsPerLiter(Convert.ToDouble(value)); - /// + /// public static Density CentigramsPerMilliliter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static Density CentigramsPerMilliliter(this T value) #endif => Density.FromCentigramsPerMilliliter(Convert.ToDouble(value)); - /// + /// public static Density DecigramsPerDeciliter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static Density DecigramsPerDeciliter(this T value) #endif => Density.FromDecigramsPerDeciliter(Convert.ToDouble(value)); - /// + /// public static Density DecigramsPerLiter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -72,7 +72,7 @@ public static Density DecigramsPerLiter(this T value) #endif => Density.FromDecigramsPerLiter(Convert.ToDouble(value)); - /// + /// public static Density DecigramsPerMilliliter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -80,7 +80,7 @@ public static Density DecigramsPerMilliliter(this T value) #endif => Density.FromDecigramsPerMilliliter(Convert.ToDouble(value)); - /// + /// public static Density FemtogramsPerDeciliter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -88,7 +88,7 @@ public static Density FemtogramsPerDeciliter(this T value) #endif => Density.FromFemtogramsPerDeciliter(Convert.ToDouble(value)); - /// + /// public static Density FemtogramsPerLiter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -96,7 +96,7 @@ public static Density FemtogramsPerLiter(this T value) #endif => Density.FromFemtogramsPerLiter(Convert.ToDouble(value)); - /// + /// public static Density FemtogramsPerMilliliter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -104,7 +104,7 @@ public static Density FemtogramsPerMilliliter(this T value) #endif => Density.FromFemtogramsPerMilliliter(Convert.ToDouble(value)); - /// + /// public static Density GramsPerCubicCentimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -112,7 +112,7 @@ public static Density GramsPerCubicCentimeter(this T value) #endif => Density.FromGramsPerCubicCentimeter(Convert.ToDouble(value)); - /// + /// public static Density GramsPerCubicFoot(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -120,7 +120,7 @@ public static Density GramsPerCubicFoot(this T value) #endif => Density.FromGramsPerCubicFoot(Convert.ToDouble(value)); - /// + /// public static Density GramsPerCubicInch(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -128,7 +128,7 @@ public static Density GramsPerCubicInch(this T value) #endif => Density.FromGramsPerCubicInch(Convert.ToDouble(value)); - /// + /// public static Density GramsPerCubicMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -136,7 +136,7 @@ public static Density GramsPerCubicMeter(this T value) #endif => Density.FromGramsPerCubicMeter(Convert.ToDouble(value)); - /// + /// public static Density GramsPerCubicMillimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -144,7 +144,7 @@ public static Density GramsPerCubicMillimeter(this T value) #endif => Density.FromGramsPerCubicMillimeter(Convert.ToDouble(value)); - /// + /// public static Density GramsPerDeciliter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -152,7 +152,7 @@ public static Density GramsPerDeciliter(this T value) #endif => Density.FromGramsPerDeciliter(Convert.ToDouble(value)); - /// + /// public static Density GramsPerLiter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -160,7 +160,7 @@ public static Density GramsPerLiter(this T value) #endif => Density.FromGramsPerLiter(Convert.ToDouble(value)); - /// + /// public static Density GramsPerMilliliter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -168,7 +168,7 @@ public static Density GramsPerMilliliter(this T value) #endif => Density.FromGramsPerMilliliter(Convert.ToDouble(value)); - /// + /// public static Density KilogramsPerCubicCentimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -176,7 +176,7 @@ public static Density KilogramsPerCubicCentimeter(this T value) #endif => Density.FromKilogramsPerCubicCentimeter(Convert.ToDouble(value)); - /// + /// public static Density KilogramsPerCubicMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -184,7 +184,7 @@ public static Density KilogramsPerCubicMeter(this T value) #endif => Density.FromKilogramsPerCubicMeter(Convert.ToDouble(value)); - /// + /// public static Density KilogramsPerCubicMillimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -192,7 +192,7 @@ public static Density KilogramsPerCubicMillimeter(this T value) #endif => Density.FromKilogramsPerCubicMillimeter(Convert.ToDouble(value)); - /// + /// public static Density KilogramsPerLiter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -200,7 +200,7 @@ public static Density KilogramsPerLiter(this T value) #endif => Density.FromKilogramsPerLiter(Convert.ToDouble(value)); - /// + /// public static Density KilopoundsPerCubicFoot(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -208,7 +208,7 @@ public static Density KilopoundsPerCubicFoot(this T value) #endif => Density.FromKilopoundsPerCubicFoot(Convert.ToDouble(value)); - /// + /// public static Density KilopoundsPerCubicInch(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -216,7 +216,7 @@ public static Density KilopoundsPerCubicInch(this T value) #endif => Density.FromKilopoundsPerCubicInch(Convert.ToDouble(value)); - /// + /// public static Density KilopoundsPerCubicYard(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -224,7 +224,7 @@ public static Density KilopoundsPerCubicYard(this T value) #endif => Density.FromKilopoundsPerCubicYard(Convert.ToDouble(value)); - /// + /// public static Density MicrogramsPerCubicMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -232,7 +232,7 @@ public static Density MicrogramsPerCubicMeter(this T value) #endif => Density.FromMicrogramsPerCubicMeter(Convert.ToDouble(value)); - /// + /// public static Density MicrogramsPerDeciliter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -240,7 +240,7 @@ public static Density MicrogramsPerDeciliter(this T value) #endif => Density.FromMicrogramsPerDeciliter(Convert.ToDouble(value)); - /// + /// public static Density MicrogramsPerLiter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -248,7 +248,7 @@ public static Density MicrogramsPerLiter(this T value) #endif => Density.FromMicrogramsPerLiter(Convert.ToDouble(value)); - /// + /// public static Density MicrogramsPerMilliliter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -256,7 +256,7 @@ public static Density MicrogramsPerMilliliter(this T value) #endif => Density.FromMicrogramsPerMilliliter(Convert.ToDouble(value)); - /// + /// public static Density MilligramsPerCubicMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -264,7 +264,7 @@ public static Density MilligramsPerCubicMeter(this T value) #endif => Density.FromMilligramsPerCubicMeter(Convert.ToDouble(value)); - /// + /// public static Density MilligramsPerDeciliter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -272,7 +272,7 @@ public static Density MilligramsPerDeciliter(this T value) #endif => Density.FromMilligramsPerDeciliter(Convert.ToDouble(value)); - /// + /// public static Density MilligramsPerLiter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -280,7 +280,7 @@ public static Density MilligramsPerLiter(this T value) #endif => Density.FromMilligramsPerLiter(Convert.ToDouble(value)); - /// + /// public static Density MilligramsPerMilliliter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -288,7 +288,7 @@ public static Density MilligramsPerMilliliter(this T value) #endif => Density.FromMilligramsPerMilliliter(Convert.ToDouble(value)); - /// + /// public static Density NanogramsPerDeciliter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -296,7 +296,7 @@ public static Density NanogramsPerDeciliter(this T value) #endif => Density.FromNanogramsPerDeciliter(Convert.ToDouble(value)); - /// + /// public static Density NanogramsPerLiter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -304,7 +304,7 @@ public static Density NanogramsPerLiter(this T value) #endif => Density.FromNanogramsPerLiter(Convert.ToDouble(value)); - /// + /// public static Density NanogramsPerMilliliter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -312,7 +312,7 @@ public static Density NanogramsPerMilliliter(this T value) #endif => Density.FromNanogramsPerMilliliter(Convert.ToDouble(value)); - /// + /// public static Density PicogramsPerDeciliter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -320,7 +320,7 @@ public static Density PicogramsPerDeciliter(this T value) #endif => Density.FromPicogramsPerDeciliter(Convert.ToDouble(value)); - /// + /// public static Density PicogramsPerLiter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -328,7 +328,7 @@ public static Density PicogramsPerLiter(this T value) #endif => Density.FromPicogramsPerLiter(Convert.ToDouble(value)); - /// + /// public static Density PicogramsPerMilliliter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -336,7 +336,7 @@ public static Density PicogramsPerMilliliter(this T value) #endif => Density.FromPicogramsPerMilliliter(Convert.ToDouble(value)); - /// + /// public static Density PoundsPerCubicCentimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -344,7 +344,7 @@ public static Density PoundsPerCubicCentimeter(this T value) #endif => Density.FromPoundsPerCubicCentimeter(Convert.ToDouble(value)); - /// + /// public static Density PoundsPerCubicFoot(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -352,7 +352,7 @@ public static Density PoundsPerCubicFoot(this T value) #endif => Density.FromPoundsPerCubicFoot(Convert.ToDouble(value)); - /// + /// public static Density PoundsPerCubicInch(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -360,7 +360,7 @@ public static Density PoundsPerCubicInch(this T value) #endif => Density.FromPoundsPerCubicInch(Convert.ToDouble(value)); - /// + /// public static Density PoundsPerCubicMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -368,7 +368,7 @@ public static Density PoundsPerCubicMeter(this T value) #endif => Density.FromPoundsPerCubicMeter(Convert.ToDouble(value)); - /// + /// public static Density PoundsPerCubicMillimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -376,7 +376,7 @@ public static Density PoundsPerCubicMillimeter(this T value) #endif => Density.FromPoundsPerCubicMillimeter(Convert.ToDouble(value)); - /// + /// public static Density PoundsPerCubicYard(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -384,7 +384,7 @@ public static Density PoundsPerCubicYard(this T value) #endif => Density.FromPoundsPerCubicYard(Convert.ToDouble(value)); - /// + /// public static Density PoundsPerImperialGallon(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -392,7 +392,7 @@ public static Density PoundsPerImperialGallon(this T value) #endif => Density.FromPoundsPerImperialGallon(Convert.ToDouble(value)); - /// + /// public static Density PoundsPerUSGallon(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -400,7 +400,7 @@ public static Density PoundsPerUSGallon(this T value) #endif => Density.FromPoundsPerUSGallon(Convert.ToDouble(value)); - /// + /// public static Density SlugsPerCubicCentimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -408,7 +408,7 @@ public static Density SlugsPerCubicCentimeter(this T value) #endif => Density.FromSlugsPerCubicCentimeter(Convert.ToDouble(value)); - /// + /// public static Density SlugsPerCubicFoot(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -416,7 +416,7 @@ public static Density SlugsPerCubicFoot(this T value) #endif => Density.FromSlugsPerCubicFoot(Convert.ToDouble(value)); - /// + /// public static Density SlugsPerCubicInch(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -424,7 +424,7 @@ public static Density SlugsPerCubicInch(this T value) #endif => Density.FromSlugsPerCubicInch(Convert.ToDouble(value)); - /// + /// public static Density SlugsPerCubicMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -432,7 +432,7 @@ public static Density SlugsPerCubicMeter(this T value) #endif => Density.FromSlugsPerCubicMeter(Convert.ToDouble(value)); - /// + /// public static Density SlugsPerCubicMillimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -440,7 +440,7 @@ public static Density SlugsPerCubicMillimeter(this T value) #endif => Density.FromSlugsPerCubicMillimeter(Convert.ToDouble(value)); - /// + /// public static Density TonnesPerCubicCentimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -448,7 +448,7 @@ public static Density TonnesPerCubicCentimeter(this T value) #endif => Density.FromTonnesPerCubicCentimeter(Convert.ToDouble(value)); - /// + /// public static Density TonnesPerCubicFoot(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -456,7 +456,7 @@ public static Density TonnesPerCubicFoot(this T value) #endif => Density.FromTonnesPerCubicFoot(Convert.ToDouble(value)); - /// + /// public static Density TonnesPerCubicInch(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -464,7 +464,7 @@ public static Density TonnesPerCubicInch(this T value) #endif => Density.FromTonnesPerCubicInch(Convert.ToDouble(value)); - /// + /// public static Density TonnesPerCubicMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -472,7 +472,7 @@ public static Density TonnesPerCubicMeter(this T value) #endif => Density.FromTonnesPerCubicMeter(Convert.ToDouble(value)); - /// + /// public static Density TonnesPerCubicMillimeter(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToDurationExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToDurationExtensions.g.cs index 70318cf6a5..518f224453 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToDurationExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToDurationExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToDuration /// public static class NumberToDurationExtensions { - /// + /// public static Duration Days(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static Duration Days(this T value) #endif => Duration.FromDays(Convert.ToDouble(value)); - /// + /// public static Duration Hours(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static Duration Hours(this T value) #endif => Duration.FromHours(Convert.ToDouble(value)); - /// + /// public static Duration JulianYears(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static Duration JulianYears(this T value) #endif => Duration.FromJulianYears(Convert.ToDouble(value)); - /// + /// public static Duration Microseconds(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static Duration Microseconds(this T value) #endif => Duration.FromMicroseconds(Convert.ToDouble(value)); - /// + /// public static Duration Milliseconds(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -72,7 +72,7 @@ public static Duration Milliseconds(this T value) #endif => Duration.FromMilliseconds(Convert.ToDouble(value)); - /// + /// public static Duration Minutes(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -80,7 +80,7 @@ public static Duration Minutes(this T value) #endif => Duration.FromMinutes(Convert.ToDouble(value)); - /// + /// public static Duration Months30(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -88,7 +88,7 @@ public static Duration Months30(this T value) #endif => Duration.FromMonths30(Convert.ToDouble(value)); - /// + /// public static Duration Nanoseconds(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -96,7 +96,7 @@ public static Duration Nanoseconds(this T value) #endif => Duration.FromNanoseconds(Convert.ToDouble(value)); - /// + /// public static Duration Seconds(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -104,7 +104,7 @@ public static Duration Seconds(this T value) #endif => Duration.FromSeconds(Convert.ToDouble(value)); - /// + /// public static Duration Weeks(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -112,7 +112,7 @@ public static Duration Weeks(this T value) #endif => Duration.FromWeeks(Convert.ToDouble(value)); - /// + /// public static Duration Years365(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToDynamicViscosityExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToDynamicViscosityExtensions.g.cs index 5d955b9d26..59c792b747 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToDynamicViscosityExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToDynamicViscosityExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToDynamicViscosity /// public static class NumberToDynamicViscosityExtensions { - /// + /// public static DynamicViscosity Centipoise(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static DynamicViscosity Centipoise(this T value) #endif => DynamicViscosity.FromCentipoise(Convert.ToDouble(value)); - /// + /// public static DynamicViscosity MicropascalSeconds(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static DynamicViscosity MicropascalSeconds(this T value) #endif => DynamicViscosity.FromMicropascalSeconds(Convert.ToDouble(value)); - /// + /// public static DynamicViscosity MillipascalSeconds(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static DynamicViscosity MillipascalSeconds(this T value) #endif => DynamicViscosity.FromMillipascalSeconds(Convert.ToDouble(value)); - /// + /// public static DynamicViscosity NewtonSecondsPerMeterSquared(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static DynamicViscosity NewtonSecondsPerMeterSquared(this T value) #endif => DynamicViscosity.FromNewtonSecondsPerMeterSquared(Convert.ToDouble(value)); - /// + /// public static DynamicViscosity PascalSeconds(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -72,7 +72,7 @@ public static DynamicViscosity PascalSeconds(this T value) #endif => DynamicViscosity.FromPascalSeconds(Convert.ToDouble(value)); - /// + /// public static DynamicViscosity Poise(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -80,7 +80,7 @@ public static DynamicViscosity Poise(this T value) #endif => DynamicViscosity.FromPoise(Convert.ToDouble(value)); - /// + /// public static DynamicViscosity PoundsForceSecondPerSquareFoot(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -88,7 +88,7 @@ public static DynamicViscosity PoundsForceSecondPerSquareFoot(this T value) #endif => DynamicViscosity.FromPoundsForceSecondPerSquareFoot(Convert.ToDouble(value)); - /// + /// public static DynamicViscosity PoundsForceSecondPerSquareInch(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -96,7 +96,7 @@ public static DynamicViscosity PoundsForceSecondPerSquareInch(this T value) #endif => DynamicViscosity.FromPoundsForceSecondPerSquareInch(Convert.ToDouble(value)); - /// + /// public static DynamicViscosity PoundsPerFootSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -104,7 +104,7 @@ public static DynamicViscosity PoundsPerFootSecond(this T value) #endif => DynamicViscosity.FromPoundsPerFootSecond(Convert.ToDouble(value)); - /// + /// public static DynamicViscosity Reyns(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToElectricAdmittanceExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToElectricAdmittanceExtensions.g.cs index 8d84623f00..b02da0f9f6 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToElectricAdmittanceExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToElectricAdmittanceExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToElectricAdmittance /// public static class NumberToElectricAdmittanceExtensions { - /// + /// public static ElectricAdmittance Microsiemens(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static ElectricAdmittance Microsiemens(this T value) #endif => ElectricAdmittance.FromMicrosiemens(Convert.ToDouble(value)); - /// + /// public static ElectricAdmittance Millisiemens(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static ElectricAdmittance Millisiemens(this T value) #endif => ElectricAdmittance.FromMillisiemens(Convert.ToDouble(value)); - /// + /// public static ElectricAdmittance Nanosiemens(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static ElectricAdmittance Nanosiemens(this T value) #endif => ElectricAdmittance.FromNanosiemens(Convert.ToDouble(value)); - /// + /// public static ElectricAdmittance Siemens(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToElectricChargeDensityExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToElectricChargeDensityExtensions.g.cs index 1e7609d96a..640d805651 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToElectricChargeDensityExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToElectricChargeDensityExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToElectricChargeDensity /// public static class NumberToElectricChargeDensityExtensions { - /// + /// public static ElectricChargeDensity CoulombsPerCubicMeter(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToElectricChargeExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToElectricChargeExtensions.g.cs index e4e4376f61..422aa5f121 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToElectricChargeExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToElectricChargeExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToElectricCharge /// public static class NumberToElectricChargeExtensions { - /// + /// public static ElectricCharge AmpereHours(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static ElectricCharge AmpereHours(this T value) #endif => ElectricCharge.FromAmpereHours(Convert.ToDouble(value)); - /// + /// public static ElectricCharge Coulombs(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static ElectricCharge Coulombs(this T value) #endif => ElectricCharge.FromCoulombs(Convert.ToDouble(value)); - /// + /// public static ElectricCharge KiloampereHours(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static ElectricCharge KiloampereHours(this T value) #endif => ElectricCharge.FromKiloampereHours(Convert.ToDouble(value)); - /// + /// public static ElectricCharge Kilocoulombs(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static ElectricCharge Kilocoulombs(this T value) #endif => ElectricCharge.FromKilocoulombs(Convert.ToDouble(value)); - /// + /// public static ElectricCharge MegaampereHours(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -72,7 +72,7 @@ public static ElectricCharge MegaampereHours(this T value) #endif => ElectricCharge.FromMegaampereHours(Convert.ToDouble(value)); - /// + /// public static ElectricCharge Megacoulombs(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -80,7 +80,7 @@ public static ElectricCharge Megacoulombs(this T value) #endif => ElectricCharge.FromMegacoulombs(Convert.ToDouble(value)); - /// + /// public static ElectricCharge Microcoulombs(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -88,7 +88,7 @@ public static ElectricCharge Microcoulombs(this T value) #endif => ElectricCharge.FromMicrocoulombs(Convert.ToDouble(value)); - /// + /// public static ElectricCharge MilliampereHours(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -96,7 +96,7 @@ public static ElectricCharge MilliampereHours(this T value) #endif => ElectricCharge.FromMilliampereHours(Convert.ToDouble(value)); - /// + /// public static ElectricCharge Millicoulombs(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -104,7 +104,7 @@ public static ElectricCharge Millicoulombs(this T value) #endif => ElectricCharge.FromMillicoulombs(Convert.ToDouble(value)); - /// + /// public static ElectricCharge Nanocoulombs(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -112,7 +112,7 @@ public static ElectricCharge Nanocoulombs(this T value) #endif => ElectricCharge.FromNanocoulombs(Convert.ToDouble(value)); - /// + /// public static ElectricCharge Picocoulombs(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToElectricConductanceExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToElectricConductanceExtensions.g.cs index e7ba0e2806..d656b7462b 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToElectricConductanceExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToElectricConductanceExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToElectricConductance /// public static class NumberToElectricConductanceExtensions { - /// + /// public static ElectricConductance Kilosiemens(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static ElectricConductance Kilosiemens(this T value) #endif => ElectricConductance.FromKilosiemens(Convert.ToDouble(value)); - /// + /// public static ElectricConductance Microsiemens(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static ElectricConductance Microsiemens(this T value) #endif => ElectricConductance.FromMicrosiemens(Convert.ToDouble(value)); - /// + /// public static ElectricConductance Millisiemens(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static ElectricConductance Millisiemens(this T value) #endif => ElectricConductance.FromMillisiemens(Convert.ToDouble(value)); - /// + /// public static ElectricConductance Nanosiemens(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static ElectricConductance Nanosiemens(this T value) #endif => ElectricConductance.FromNanosiemens(Convert.ToDouble(value)); - /// + /// public static ElectricConductance Siemens(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToElectricConductivityExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToElectricConductivityExtensions.g.cs index a901af79db..d5a791c5c9 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToElectricConductivityExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToElectricConductivityExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToElectricConductivity /// public static class NumberToElectricConductivityExtensions { - /// + /// public static ElectricConductivity MicrosiemensPerCentimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static ElectricConductivity MicrosiemensPerCentimeter(this T value) #endif => ElectricConductivity.FromMicrosiemensPerCentimeter(Convert.ToDouble(value)); - /// + /// public static ElectricConductivity MillisiemensPerCentimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static ElectricConductivity MillisiemensPerCentimeter(this T value) #endif => ElectricConductivity.FromMillisiemensPerCentimeter(Convert.ToDouble(value)); - /// + /// public static ElectricConductivity SiemensPerCentimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static ElectricConductivity SiemensPerCentimeter(this T value) #endif => ElectricConductivity.FromSiemensPerCentimeter(Convert.ToDouble(value)); - /// + /// public static ElectricConductivity SiemensPerFoot(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static ElectricConductivity SiemensPerFoot(this T value) #endif => ElectricConductivity.FromSiemensPerFoot(Convert.ToDouble(value)); - /// + /// public static ElectricConductivity SiemensPerInch(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -72,7 +72,7 @@ public static ElectricConductivity SiemensPerInch(this T value) #endif => ElectricConductivity.FromSiemensPerInch(Convert.ToDouble(value)); - /// + /// public static ElectricConductivity SiemensPerMeter(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToElectricCurrentDensityExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToElectricCurrentDensityExtensions.g.cs index d77451ffa8..58d52df54b 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToElectricCurrentDensityExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToElectricCurrentDensityExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToElectricCurrentDensity /// public static class NumberToElectricCurrentDensityExtensions { - /// + /// public static ElectricCurrentDensity AmperesPerSquareFoot(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static ElectricCurrentDensity AmperesPerSquareFoot(this T value) #endif => ElectricCurrentDensity.FromAmperesPerSquareFoot(Convert.ToDouble(value)); - /// + /// public static ElectricCurrentDensity AmperesPerSquareInch(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static ElectricCurrentDensity AmperesPerSquareInch(this T value) #endif => ElectricCurrentDensity.FromAmperesPerSquareInch(Convert.ToDouble(value)); - /// + /// public static ElectricCurrentDensity AmperesPerSquareMeter(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToElectricCurrentExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToElectricCurrentExtensions.g.cs index e77703c45d..42816bffd1 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToElectricCurrentExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToElectricCurrentExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToElectricCurrent /// public static class NumberToElectricCurrentExtensions { - /// + /// public static ElectricCurrent Amperes(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static ElectricCurrent Amperes(this T value) #endif => ElectricCurrent.FromAmperes(Convert.ToDouble(value)); - /// + /// public static ElectricCurrent Centiamperes(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static ElectricCurrent Centiamperes(this T value) #endif => ElectricCurrent.FromCentiamperes(Convert.ToDouble(value)); - /// + /// public static ElectricCurrent Femtoamperes(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static ElectricCurrent Femtoamperes(this T value) #endif => ElectricCurrent.FromFemtoamperes(Convert.ToDouble(value)); - /// + /// public static ElectricCurrent Kiloamperes(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static ElectricCurrent Kiloamperes(this T value) #endif => ElectricCurrent.FromKiloamperes(Convert.ToDouble(value)); - /// + /// public static ElectricCurrent Megaamperes(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -72,7 +72,7 @@ public static ElectricCurrent Megaamperes(this T value) #endif => ElectricCurrent.FromMegaamperes(Convert.ToDouble(value)); - /// + /// public static ElectricCurrent Microamperes(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -80,7 +80,7 @@ public static ElectricCurrent Microamperes(this T value) #endif => ElectricCurrent.FromMicroamperes(Convert.ToDouble(value)); - /// + /// public static ElectricCurrent Milliamperes(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -88,7 +88,7 @@ public static ElectricCurrent Milliamperes(this T value) #endif => ElectricCurrent.FromMilliamperes(Convert.ToDouble(value)); - /// + /// public static ElectricCurrent Nanoamperes(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -96,7 +96,7 @@ public static ElectricCurrent Nanoamperes(this T value) #endif => ElectricCurrent.FromNanoamperes(Convert.ToDouble(value)); - /// + /// public static ElectricCurrent Picoamperes(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToElectricCurrentGradientExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToElectricCurrentGradientExtensions.g.cs index 2aa7b4d12b..898b7c41e0 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToElectricCurrentGradientExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToElectricCurrentGradientExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToElectricCurrentGradient /// public static class NumberToElectricCurrentGradientExtensions { - /// + /// public static ElectricCurrentGradient AmperesPerMicrosecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static ElectricCurrentGradient AmperesPerMicrosecond(this T value) #endif => ElectricCurrentGradient.FromAmperesPerMicrosecond(Convert.ToDouble(value)); - /// + /// public static ElectricCurrentGradient AmperesPerMillisecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static ElectricCurrentGradient AmperesPerMillisecond(this T value) #endif => ElectricCurrentGradient.FromAmperesPerMillisecond(Convert.ToDouble(value)); - /// + /// public static ElectricCurrentGradient AmperesPerMinute(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static ElectricCurrentGradient AmperesPerMinute(this T value) #endif => ElectricCurrentGradient.FromAmperesPerMinute(Convert.ToDouble(value)); - /// + /// public static ElectricCurrentGradient AmperesPerNanosecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static ElectricCurrentGradient AmperesPerNanosecond(this T value) #endif => ElectricCurrentGradient.FromAmperesPerNanosecond(Convert.ToDouble(value)); - /// + /// public static ElectricCurrentGradient AmperesPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -72,7 +72,7 @@ public static ElectricCurrentGradient AmperesPerSecond(this T value) #endif => ElectricCurrentGradient.FromAmperesPerSecond(Convert.ToDouble(value)); - /// + /// public static ElectricCurrentGradient MilliamperesPerMinute(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -80,7 +80,7 @@ public static ElectricCurrentGradient MilliamperesPerMinute(this T value) #endif => ElectricCurrentGradient.FromMilliamperesPerMinute(Convert.ToDouble(value)); - /// + /// public static ElectricCurrentGradient MilliamperesPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToElectricFieldExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToElectricFieldExtensions.g.cs index 72d4932716..bb9a391be8 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToElectricFieldExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToElectricFieldExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToElectricField /// public static class NumberToElectricFieldExtensions { - /// + /// public static ElectricField VoltsPerMeter(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToElectricInductanceExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToElectricInductanceExtensions.g.cs index 40356c4efc..07aedbcbb2 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToElectricInductanceExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToElectricInductanceExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToElectricInductance /// public static class NumberToElectricInductanceExtensions { - /// + /// public static ElectricInductance Henries(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static ElectricInductance Henries(this T value) #endif => ElectricInductance.FromHenries(Convert.ToDouble(value)); - /// + /// public static ElectricInductance Microhenries(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static ElectricInductance Microhenries(this T value) #endif => ElectricInductance.FromMicrohenries(Convert.ToDouble(value)); - /// + /// public static ElectricInductance Millihenries(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static ElectricInductance Millihenries(this T value) #endif => ElectricInductance.FromMillihenries(Convert.ToDouble(value)); - /// + /// public static ElectricInductance Nanohenries(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static ElectricInductance Nanohenries(this T value) #endif => ElectricInductance.FromNanohenries(Convert.ToDouble(value)); - /// + /// public static ElectricInductance Picohenries(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToElectricPotentialAcExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToElectricPotentialAcExtensions.g.cs index 24cb4db585..cb96006b46 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToElectricPotentialAcExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToElectricPotentialAcExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToElectricPotentialAc /// public static class NumberToElectricPotentialAcExtensions { - /// + /// public static ElectricPotentialAc KilovoltsAc(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static ElectricPotentialAc KilovoltsAc(this T value) #endif => ElectricPotentialAc.FromKilovoltsAc(Convert.ToDouble(value)); - /// + /// public static ElectricPotentialAc MegavoltsAc(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static ElectricPotentialAc MegavoltsAc(this T value) #endif => ElectricPotentialAc.FromMegavoltsAc(Convert.ToDouble(value)); - /// + /// public static ElectricPotentialAc MicrovoltsAc(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static ElectricPotentialAc MicrovoltsAc(this T value) #endif => ElectricPotentialAc.FromMicrovoltsAc(Convert.ToDouble(value)); - /// + /// public static ElectricPotentialAc MillivoltsAc(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static ElectricPotentialAc MillivoltsAc(this T value) #endif => ElectricPotentialAc.FromMillivoltsAc(Convert.ToDouble(value)); - /// + /// public static ElectricPotentialAc VoltsAc(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToElectricPotentialChangeRateExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToElectricPotentialChangeRateExtensions.g.cs index c41cfd13ba..3381b64770 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToElectricPotentialChangeRateExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToElectricPotentialChangeRateExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToElectricPotentialChangeRate /// public static class NumberToElectricPotentialChangeRateExtensions { - /// + /// public static ElectricPotentialChangeRate KilovoltsPerHour(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static ElectricPotentialChangeRate KilovoltsPerHour(this T value) #endif => ElectricPotentialChangeRate.FromKilovoltsPerHour(Convert.ToDouble(value)); - /// + /// public static ElectricPotentialChangeRate KilovoltsPerMicrosecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static ElectricPotentialChangeRate KilovoltsPerMicrosecond(this T valu #endif => ElectricPotentialChangeRate.FromKilovoltsPerMicrosecond(Convert.ToDouble(value)); - /// + /// public static ElectricPotentialChangeRate KilovoltsPerMinute(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static ElectricPotentialChangeRate KilovoltsPerMinute(this T value) #endif => ElectricPotentialChangeRate.FromKilovoltsPerMinute(Convert.ToDouble(value)); - /// + /// public static ElectricPotentialChangeRate KilovoltsPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static ElectricPotentialChangeRate KilovoltsPerSecond(this T value) #endif => ElectricPotentialChangeRate.FromKilovoltsPerSecond(Convert.ToDouble(value)); - /// + /// public static ElectricPotentialChangeRate MegavoltsPerHour(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -72,7 +72,7 @@ public static ElectricPotentialChangeRate MegavoltsPerHour(this T value) #endif => ElectricPotentialChangeRate.FromMegavoltsPerHour(Convert.ToDouble(value)); - /// + /// public static ElectricPotentialChangeRate MegavoltsPerMicrosecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -80,7 +80,7 @@ public static ElectricPotentialChangeRate MegavoltsPerMicrosecond(this T valu #endif => ElectricPotentialChangeRate.FromMegavoltsPerMicrosecond(Convert.ToDouble(value)); - /// + /// public static ElectricPotentialChangeRate MegavoltsPerMinute(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -88,7 +88,7 @@ public static ElectricPotentialChangeRate MegavoltsPerMinute(this T value) #endif => ElectricPotentialChangeRate.FromMegavoltsPerMinute(Convert.ToDouble(value)); - /// + /// public static ElectricPotentialChangeRate MegavoltsPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -96,7 +96,7 @@ public static ElectricPotentialChangeRate MegavoltsPerSecond(this T value) #endif => ElectricPotentialChangeRate.FromMegavoltsPerSecond(Convert.ToDouble(value)); - /// + /// public static ElectricPotentialChangeRate MicrovoltsPerHour(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -104,7 +104,7 @@ public static ElectricPotentialChangeRate MicrovoltsPerHour(this T value) #endif => ElectricPotentialChangeRate.FromMicrovoltsPerHour(Convert.ToDouble(value)); - /// + /// public static ElectricPotentialChangeRate MicrovoltsPerMicrosecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -112,7 +112,7 @@ public static ElectricPotentialChangeRate MicrovoltsPerMicrosecond(this T val #endif => ElectricPotentialChangeRate.FromMicrovoltsPerMicrosecond(Convert.ToDouble(value)); - /// + /// public static ElectricPotentialChangeRate MicrovoltsPerMinute(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -120,7 +120,7 @@ public static ElectricPotentialChangeRate MicrovoltsPerMinute(this T value) #endif => ElectricPotentialChangeRate.FromMicrovoltsPerMinute(Convert.ToDouble(value)); - /// + /// public static ElectricPotentialChangeRate MicrovoltsPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -128,7 +128,7 @@ public static ElectricPotentialChangeRate MicrovoltsPerSecond(this T value) #endif => ElectricPotentialChangeRate.FromMicrovoltsPerSecond(Convert.ToDouble(value)); - /// + /// public static ElectricPotentialChangeRate MillivoltsPerHour(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -136,7 +136,7 @@ public static ElectricPotentialChangeRate MillivoltsPerHour(this T value) #endif => ElectricPotentialChangeRate.FromMillivoltsPerHour(Convert.ToDouble(value)); - /// + /// public static ElectricPotentialChangeRate MillivoltsPerMicrosecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -144,7 +144,7 @@ public static ElectricPotentialChangeRate MillivoltsPerMicrosecond(this T val #endif => ElectricPotentialChangeRate.FromMillivoltsPerMicrosecond(Convert.ToDouble(value)); - /// + /// public static ElectricPotentialChangeRate MillivoltsPerMinute(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -152,7 +152,7 @@ public static ElectricPotentialChangeRate MillivoltsPerMinute(this T value) #endif => ElectricPotentialChangeRate.FromMillivoltsPerMinute(Convert.ToDouble(value)); - /// + /// public static ElectricPotentialChangeRate MillivoltsPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -160,7 +160,7 @@ public static ElectricPotentialChangeRate MillivoltsPerSecond(this T value) #endif => ElectricPotentialChangeRate.FromMillivoltsPerSecond(Convert.ToDouble(value)); - /// + /// public static ElectricPotentialChangeRate VoltsPerHour(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -168,7 +168,7 @@ public static ElectricPotentialChangeRate VoltsPerHour(this T value) #endif => ElectricPotentialChangeRate.FromVoltsPerHour(Convert.ToDouble(value)); - /// + /// public static ElectricPotentialChangeRate VoltsPerMicrosecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -176,7 +176,7 @@ public static ElectricPotentialChangeRate VoltsPerMicrosecond(this T value) #endif => ElectricPotentialChangeRate.FromVoltsPerMicrosecond(Convert.ToDouble(value)); - /// + /// public static ElectricPotentialChangeRate VoltsPerMinute(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -184,7 +184,7 @@ public static ElectricPotentialChangeRate VoltsPerMinute(this T value) #endif => ElectricPotentialChangeRate.FromVoltsPerMinute(Convert.ToDouble(value)); - /// + /// public static ElectricPotentialChangeRate VoltsPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToElectricPotentialDcExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToElectricPotentialDcExtensions.g.cs index 62ab533375..a8614fd5db 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToElectricPotentialDcExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToElectricPotentialDcExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToElectricPotentialDc /// public static class NumberToElectricPotentialDcExtensions { - /// + /// public static ElectricPotentialDc KilovoltsDc(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static ElectricPotentialDc KilovoltsDc(this T value) #endif => ElectricPotentialDc.FromKilovoltsDc(Convert.ToDouble(value)); - /// + /// public static ElectricPotentialDc MegavoltsDc(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static ElectricPotentialDc MegavoltsDc(this T value) #endif => ElectricPotentialDc.FromMegavoltsDc(Convert.ToDouble(value)); - /// + /// public static ElectricPotentialDc MicrovoltsDc(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static ElectricPotentialDc MicrovoltsDc(this T value) #endif => ElectricPotentialDc.FromMicrovoltsDc(Convert.ToDouble(value)); - /// + /// public static ElectricPotentialDc MillivoltsDc(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static ElectricPotentialDc MillivoltsDc(this T value) #endif => ElectricPotentialDc.FromMillivoltsDc(Convert.ToDouble(value)); - /// + /// public static ElectricPotentialDc VoltsDc(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToElectricPotentialExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToElectricPotentialExtensions.g.cs index 0c3a18b571..c89a5069a6 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToElectricPotentialExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToElectricPotentialExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToElectricPotential /// public static class NumberToElectricPotentialExtensions { - /// + /// public static ElectricPotential Kilovolts(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static ElectricPotential Kilovolts(this T value) #endif => ElectricPotential.FromKilovolts(Convert.ToDouble(value)); - /// + /// public static ElectricPotential Megavolts(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static ElectricPotential Megavolts(this T value) #endif => ElectricPotential.FromMegavolts(Convert.ToDouble(value)); - /// + /// public static ElectricPotential Microvolts(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static ElectricPotential Microvolts(this T value) #endif => ElectricPotential.FromMicrovolts(Convert.ToDouble(value)); - /// + /// public static ElectricPotential Millivolts(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static ElectricPotential Millivolts(this T value) #endif => ElectricPotential.FromMillivolts(Convert.ToDouble(value)); - /// + /// public static ElectricPotential Nanovolts(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -72,7 +72,7 @@ public static ElectricPotential Nanovolts(this T value) #endif => ElectricPotential.FromNanovolts(Convert.ToDouble(value)); - /// + /// public static ElectricPotential Volts(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToElectricResistanceExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToElectricResistanceExtensions.g.cs index a616e57ac7..99e17110cf 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToElectricResistanceExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToElectricResistanceExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToElectricResistance /// public static class NumberToElectricResistanceExtensions { - /// + /// public static ElectricResistance Gigaohms(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static ElectricResistance Gigaohms(this T value) #endif => ElectricResistance.FromGigaohms(Convert.ToDouble(value)); - /// + /// public static ElectricResistance Kiloohms(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static ElectricResistance Kiloohms(this T value) #endif => ElectricResistance.FromKiloohms(Convert.ToDouble(value)); - /// + /// public static ElectricResistance Megaohms(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static ElectricResistance Megaohms(this T value) #endif => ElectricResistance.FromMegaohms(Convert.ToDouble(value)); - /// + /// public static ElectricResistance Microohms(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static ElectricResistance Microohms(this T value) #endif => ElectricResistance.FromMicroohms(Convert.ToDouble(value)); - /// + /// public static ElectricResistance Milliohms(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -72,7 +72,7 @@ public static ElectricResistance Milliohms(this T value) #endif => ElectricResistance.FromMilliohms(Convert.ToDouble(value)); - /// + /// public static ElectricResistance Ohms(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -80,7 +80,7 @@ public static ElectricResistance Ohms(this T value) #endif => ElectricResistance.FromOhms(Convert.ToDouble(value)); - /// + /// public static ElectricResistance Teraohms(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToElectricResistivityExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToElectricResistivityExtensions.g.cs index 78ab4c55fa..4beb953b18 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToElectricResistivityExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToElectricResistivityExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToElectricResistivity /// public static class NumberToElectricResistivityExtensions { - /// + /// public static ElectricResistivity KiloohmsCentimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static ElectricResistivity KiloohmsCentimeter(this T value) #endif => ElectricResistivity.FromKiloohmsCentimeter(Convert.ToDouble(value)); - /// + /// public static ElectricResistivity KiloohmMeters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static ElectricResistivity KiloohmMeters(this T value) #endif => ElectricResistivity.FromKiloohmMeters(Convert.ToDouble(value)); - /// + /// public static ElectricResistivity MegaohmsCentimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static ElectricResistivity MegaohmsCentimeter(this T value) #endif => ElectricResistivity.FromMegaohmsCentimeter(Convert.ToDouble(value)); - /// + /// public static ElectricResistivity MegaohmMeters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static ElectricResistivity MegaohmMeters(this T value) #endif => ElectricResistivity.FromMegaohmMeters(Convert.ToDouble(value)); - /// + /// public static ElectricResistivity MicroohmsCentimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -72,7 +72,7 @@ public static ElectricResistivity MicroohmsCentimeter(this T value) #endif => ElectricResistivity.FromMicroohmsCentimeter(Convert.ToDouble(value)); - /// + /// public static ElectricResistivity MicroohmMeters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -80,7 +80,7 @@ public static ElectricResistivity MicroohmMeters(this T value) #endif => ElectricResistivity.FromMicroohmMeters(Convert.ToDouble(value)); - /// + /// public static ElectricResistivity MilliohmsCentimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -88,7 +88,7 @@ public static ElectricResistivity MilliohmsCentimeter(this T value) #endif => ElectricResistivity.FromMilliohmsCentimeter(Convert.ToDouble(value)); - /// + /// public static ElectricResistivity MilliohmMeters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -96,7 +96,7 @@ public static ElectricResistivity MilliohmMeters(this T value) #endif => ElectricResistivity.FromMilliohmMeters(Convert.ToDouble(value)); - /// + /// public static ElectricResistivity NanoohmsCentimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -104,7 +104,7 @@ public static ElectricResistivity NanoohmsCentimeter(this T value) #endif => ElectricResistivity.FromNanoohmsCentimeter(Convert.ToDouble(value)); - /// + /// public static ElectricResistivity NanoohmMeters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -112,7 +112,7 @@ public static ElectricResistivity NanoohmMeters(this T value) #endif => ElectricResistivity.FromNanoohmMeters(Convert.ToDouble(value)); - /// + /// public static ElectricResistivity OhmsCentimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -120,7 +120,7 @@ public static ElectricResistivity OhmsCentimeter(this T value) #endif => ElectricResistivity.FromOhmsCentimeter(Convert.ToDouble(value)); - /// + /// public static ElectricResistivity OhmMeters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -128,7 +128,7 @@ public static ElectricResistivity OhmMeters(this T value) #endif => ElectricResistivity.FromOhmMeters(Convert.ToDouble(value)); - /// + /// public static ElectricResistivity PicoohmsCentimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -136,7 +136,7 @@ public static ElectricResistivity PicoohmsCentimeter(this T value) #endif => ElectricResistivity.FromPicoohmsCentimeter(Convert.ToDouble(value)); - /// + /// public static ElectricResistivity PicoohmMeters(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToElectricSurfaceChargeDensityExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToElectricSurfaceChargeDensityExtensions.g.cs index efb17fb6de..4324398c42 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToElectricSurfaceChargeDensityExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToElectricSurfaceChargeDensityExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToElectricSurfaceChargeDensity /// public static class NumberToElectricSurfaceChargeDensityExtensions { - /// + /// public static ElectricSurfaceChargeDensity CoulombsPerSquareCentimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static ElectricSurfaceChargeDensity CoulombsPerSquareCentimeter(this T #endif => ElectricSurfaceChargeDensity.FromCoulombsPerSquareCentimeter(Convert.ToDouble(value)); - /// + /// public static ElectricSurfaceChargeDensity CoulombsPerSquareInch(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static ElectricSurfaceChargeDensity CoulombsPerSquareInch(this T value #endif => ElectricSurfaceChargeDensity.FromCoulombsPerSquareInch(Convert.ToDouble(value)); - /// + /// public static ElectricSurfaceChargeDensity CoulombsPerSquareMeter(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToEnergyDensityExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToEnergyDensityExtensions.g.cs index 0533f56582..6cc51eeee6 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToEnergyDensityExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToEnergyDensityExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToEnergyDensity /// public static class NumberToEnergyDensityExtensions { - /// + /// public static EnergyDensity GigajoulesPerCubicMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static EnergyDensity GigajoulesPerCubicMeter(this T value) #endif => EnergyDensity.FromGigajoulesPerCubicMeter(Convert.ToDouble(value)); - /// + /// public static EnergyDensity GigawattHoursPerCubicMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static EnergyDensity GigawattHoursPerCubicMeter(this T value) #endif => EnergyDensity.FromGigawattHoursPerCubicMeter(Convert.ToDouble(value)); - /// + /// public static EnergyDensity JoulesPerCubicMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static EnergyDensity JoulesPerCubicMeter(this T value) #endif => EnergyDensity.FromJoulesPerCubicMeter(Convert.ToDouble(value)); - /// + /// public static EnergyDensity KilojoulesPerCubicMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static EnergyDensity KilojoulesPerCubicMeter(this T value) #endif => EnergyDensity.FromKilojoulesPerCubicMeter(Convert.ToDouble(value)); - /// + /// public static EnergyDensity KilowattHoursPerCubicMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -72,7 +72,7 @@ public static EnergyDensity KilowattHoursPerCubicMeter(this T value) #endif => EnergyDensity.FromKilowattHoursPerCubicMeter(Convert.ToDouble(value)); - /// + /// public static EnergyDensity MegajoulesPerCubicMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -80,7 +80,7 @@ public static EnergyDensity MegajoulesPerCubicMeter(this T value) #endif => EnergyDensity.FromMegajoulesPerCubicMeter(Convert.ToDouble(value)); - /// + /// public static EnergyDensity MegawattHoursPerCubicMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -88,7 +88,7 @@ public static EnergyDensity MegawattHoursPerCubicMeter(this T value) #endif => EnergyDensity.FromMegawattHoursPerCubicMeter(Convert.ToDouble(value)); - /// + /// public static EnergyDensity PetajoulesPerCubicMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -96,7 +96,7 @@ public static EnergyDensity PetajoulesPerCubicMeter(this T value) #endif => EnergyDensity.FromPetajoulesPerCubicMeter(Convert.ToDouble(value)); - /// + /// public static EnergyDensity PetawattHoursPerCubicMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -104,7 +104,7 @@ public static EnergyDensity PetawattHoursPerCubicMeter(this T value) #endif => EnergyDensity.FromPetawattHoursPerCubicMeter(Convert.ToDouble(value)); - /// + /// public static EnergyDensity TerajoulesPerCubicMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -112,7 +112,7 @@ public static EnergyDensity TerajoulesPerCubicMeter(this T value) #endif => EnergyDensity.FromTerajoulesPerCubicMeter(Convert.ToDouble(value)); - /// + /// public static EnergyDensity TerawattHoursPerCubicMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -120,7 +120,7 @@ public static EnergyDensity TerawattHoursPerCubicMeter(this T value) #endif => EnergyDensity.FromTerawattHoursPerCubicMeter(Convert.ToDouble(value)); - /// + /// public static EnergyDensity WattHoursPerCubicMeter(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToEnergyExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToEnergyExtensions.g.cs index 57b559c185..e07186fad8 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToEnergyExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToEnergyExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToEnergy /// public static class NumberToEnergyExtensions { - /// + /// public static Energy BritishThermalUnits(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static Energy BritishThermalUnits(this T value) #endif => Energy.FromBritishThermalUnits(Convert.ToDouble(value)); - /// + /// public static Energy Calories(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static Energy Calories(this T value) #endif => Energy.FromCalories(Convert.ToDouble(value)); - /// + /// public static Energy DecathermsEc(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static Energy DecathermsEc(this T value) #endif => Energy.FromDecathermsEc(Convert.ToDouble(value)); - /// + /// public static Energy DecathermsImperial(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static Energy DecathermsImperial(this T value) #endif => Energy.FromDecathermsImperial(Convert.ToDouble(value)); - /// + /// public static Energy DecathermsUs(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -72,7 +72,7 @@ public static Energy DecathermsUs(this T value) #endif => Energy.FromDecathermsUs(Convert.ToDouble(value)); - /// + /// public static Energy ElectronVolts(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -80,7 +80,7 @@ public static Energy ElectronVolts(this T value) #endif => Energy.FromElectronVolts(Convert.ToDouble(value)); - /// + /// public static Energy Ergs(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -88,7 +88,7 @@ public static Energy Ergs(this T value) #endif => Energy.FromErgs(Convert.ToDouble(value)); - /// + /// public static Energy FootPounds(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -96,7 +96,7 @@ public static Energy FootPounds(this T value) #endif => Energy.FromFootPounds(Convert.ToDouble(value)); - /// + /// public static Energy GigabritishThermalUnits(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -104,7 +104,7 @@ public static Energy GigabritishThermalUnits(this T value) #endif => Energy.FromGigabritishThermalUnits(Convert.ToDouble(value)); - /// + /// public static Energy GigaelectronVolts(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -112,7 +112,7 @@ public static Energy GigaelectronVolts(this T value) #endif => Energy.FromGigaelectronVolts(Convert.ToDouble(value)); - /// + /// public static Energy Gigajoules(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -120,7 +120,7 @@ public static Energy Gigajoules(this T value) #endif => Energy.FromGigajoules(Convert.ToDouble(value)); - /// + /// public static Energy GigawattDays(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -128,7 +128,7 @@ public static Energy GigawattDays(this T value) #endif => Energy.FromGigawattDays(Convert.ToDouble(value)); - /// + /// public static Energy GigawattHours(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -136,7 +136,7 @@ public static Energy GigawattHours(this T value) #endif => Energy.FromGigawattHours(Convert.ToDouble(value)); - /// + /// public static Energy HorsepowerHours(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -144,7 +144,7 @@ public static Energy HorsepowerHours(this T value) #endif => Energy.FromHorsepowerHours(Convert.ToDouble(value)); - /// + /// public static Energy Joules(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -152,7 +152,7 @@ public static Energy Joules(this T value) #endif => Energy.FromJoules(Convert.ToDouble(value)); - /// + /// public static Energy KilobritishThermalUnits(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -160,7 +160,7 @@ public static Energy KilobritishThermalUnits(this T value) #endif => Energy.FromKilobritishThermalUnits(Convert.ToDouble(value)); - /// + /// public static Energy Kilocalories(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -168,7 +168,7 @@ public static Energy Kilocalories(this T value) #endif => Energy.FromKilocalories(Convert.ToDouble(value)); - /// + /// public static Energy KiloelectronVolts(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -176,7 +176,7 @@ public static Energy KiloelectronVolts(this T value) #endif => Energy.FromKiloelectronVolts(Convert.ToDouble(value)); - /// + /// public static Energy Kilojoules(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -184,7 +184,7 @@ public static Energy Kilojoules(this T value) #endif => Energy.FromKilojoules(Convert.ToDouble(value)); - /// + /// public static Energy KilowattDays(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -192,7 +192,7 @@ public static Energy KilowattDays(this T value) #endif => Energy.FromKilowattDays(Convert.ToDouble(value)); - /// + /// public static Energy KilowattHours(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -200,7 +200,7 @@ public static Energy KilowattHours(this T value) #endif => Energy.FromKilowattHours(Convert.ToDouble(value)); - /// + /// public static Energy MegabritishThermalUnits(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -208,7 +208,7 @@ public static Energy MegabritishThermalUnits(this T value) #endif => Energy.FromMegabritishThermalUnits(Convert.ToDouble(value)); - /// + /// public static Energy Megacalories(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -216,7 +216,7 @@ public static Energy Megacalories(this T value) #endif => Energy.FromMegacalories(Convert.ToDouble(value)); - /// + /// public static Energy MegaelectronVolts(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -224,7 +224,7 @@ public static Energy MegaelectronVolts(this T value) #endif => Energy.FromMegaelectronVolts(Convert.ToDouble(value)); - /// + /// public static Energy Megajoules(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -232,7 +232,7 @@ public static Energy Megajoules(this T value) #endif => Energy.FromMegajoules(Convert.ToDouble(value)); - /// + /// public static Energy MegawattDays(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -240,7 +240,7 @@ public static Energy MegawattDays(this T value) #endif => Energy.FromMegawattDays(Convert.ToDouble(value)); - /// + /// public static Energy MegawattHours(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -248,7 +248,7 @@ public static Energy MegawattHours(this T value) #endif => Energy.FromMegawattHours(Convert.ToDouble(value)); - /// + /// public static Energy Microjoules(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -256,7 +256,7 @@ public static Energy Microjoules(this T value) #endif => Energy.FromMicrojoules(Convert.ToDouble(value)); - /// + /// public static Energy Millijoules(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -264,7 +264,7 @@ public static Energy Millijoules(this T value) #endif => Energy.FromMillijoules(Convert.ToDouble(value)); - /// + /// public static Energy Nanojoules(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -272,7 +272,7 @@ public static Energy Nanojoules(this T value) #endif => Energy.FromNanojoules(Convert.ToDouble(value)); - /// + /// public static Energy Petajoules(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -280,7 +280,7 @@ public static Energy Petajoules(this T value) #endif => Energy.FromPetajoules(Convert.ToDouble(value)); - /// + /// public static Energy TeraelectronVolts(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -288,7 +288,7 @@ public static Energy TeraelectronVolts(this T value) #endif => Energy.FromTeraelectronVolts(Convert.ToDouble(value)); - /// + /// public static Energy Terajoules(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -296,7 +296,7 @@ public static Energy Terajoules(this T value) #endif => Energy.FromTerajoules(Convert.ToDouble(value)); - /// + /// public static Energy TerawattDays(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -304,7 +304,7 @@ public static Energy TerawattDays(this T value) #endif => Energy.FromTerawattDays(Convert.ToDouble(value)); - /// + /// public static Energy TerawattHours(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -312,7 +312,7 @@ public static Energy TerawattHours(this T value) #endif => Energy.FromTerawattHours(Convert.ToDouble(value)); - /// + /// public static Energy ThermsEc(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -320,7 +320,7 @@ public static Energy ThermsEc(this T value) #endif => Energy.FromThermsEc(Convert.ToDouble(value)); - /// + /// public static Energy ThermsImperial(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -328,7 +328,7 @@ public static Energy ThermsImperial(this T value) #endif => Energy.FromThermsImperial(Convert.ToDouble(value)); - /// + /// public static Energy ThermsUs(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -336,7 +336,7 @@ public static Energy ThermsUs(this T value) #endif => Energy.FromThermsUs(Convert.ToDouble(value)); - /// + /// public static Energy WattDays(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -344,7 +344,7 @@ public static Energy WattDays(this T value) #endif => Energy.FromWattDays(Convert.ToDouble(value)); - /// + /// public static Energy WattHours(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToEntropyExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToEntropyExtensions.g.cs index ebe9df9ae5..a0ccaf7096 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToEntropyExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToEntropyExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToEntropy /// public static class NumberToEntropyExtensions { - /// + /// public static Entropy CaloriesPerKelvin(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static Entropy CaloriesPerKelvin(this T value) #endif => Entropy.FromCaloriesPerKelvin(Convert.ToDouble(value)); - /// + /// public static Entropy JoulesPerDegreeCelsius(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static Entropy JoulesPerDegreeCelsius(this T value) #endif => Entropy.FromJoulesPerDegreeCelsius(Convert.ToDouble(value)); - /// + /// public static Entropy JoulesPerKelvin(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static Entropy JoulesPerKelvin(this T value) #endif => Entropy.FromJoulesPerKelvin(Convert.ToDouble(value)); - /// + /// public static Entropy KilocaloriesPerKelvin(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static Entropy KilocaloriesPerKelvin(this T value) #endif => Entropy.FromKilocaloriesPerKelvin(Convert.ToDouble(value)); - /// + /// public static Entropy KilojoulesPerDegreeCelsius(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -72,7 +72,7 @@ public static Entropy KilojoulesPerDegreeCelsius(this T value) #endif => Entropy.FromKilojoulesPerDegreeCelsius(Convert.ToDouble(value)); - /// + /// public static Entropy KilojoulesPerKelvin(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -80,7 +80,7 @@ public static Entropy KilojoulesPerKelvin(this T value) #endif => Entropy.FromKilojoulesPerKelvin(Convert.ToDouble(value)); - /// + /// public static Entropy MegajoulesPerKelvin(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToForceChangeRateExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToForceChangeRateExtensions.g.cs index 4413dfc62b..1466c67707 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToForceChangeRateExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToForceChangeRateExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToForceChangeRate /// public static class NumberToForceChangeRateExtensions { - /// + /// public static ForceChangeRate CentinewtonsPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static ForceChangeRate CentinewtonsPerSecond(this T value) #endif => ForceChangeRate.FromCentinewtonsPerSecond(Convert.ToDouble(value)); - /// + /// public static ForceChangeRate DecanewtonsPerMinute(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static ForceChangeRate DecanewtonsPerMinute(this T value) #endif => ForceChangeRate.FromDecanewtonsPerMinute(Convert.ToDouble(value)); - /// + /// public static ForceChangeRate DecanewtonsPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static ForceChangeRate DecanewtonsPerSecond(this T value) #endif => ForceChangeRate.FromDecanewtonsPerSecond(Convert.ToDouble(value)); - /// + /// public static ForceChangeRate DecinewtonsPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static ForceChangeRate DecinewtonsPerSecond(this T value) #endif => ForceChangeRate.FromDecinewtonsPerSecond(Convert.ToDouble(value)); - /// + /// public static ForceChangeRate KilonewtonsPerMinute(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -72,7 +72,7 @@ public static ForceChangeRate KilonewtonsPerMinute(this T value) #endif => ForceChangeRate.FromKilonewtonsPerMinute(Convert.ToDouble(value)); - /// + /// public static ForceChangeRate KilonewtonsPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -80,7 +80,7 @@ public static ForceChangeRate KilonewtonsPerSecond(this T value) #endif => ForceChangeRate.FromKilonewtonsPerSecond(Convert.ToDouble(value)); - /// + /// public static ForceChangeRate KilopoundsForcePerMinute(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -88,7 +88,7 @@ public static ForceChangeRate KilopoundsForcePerMinute(this T value) #endif => ForceChangeRate.FromKilopoundsForcePerMinute(Convert.ToDouble(value)); - /// + /// public static ForceChangeRate KilopoundsForcePerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -96,7 +96,7 @@ public static ForceChangeRate KilopoundsForcePerSecond(this T value) #endif => ForceChangeRate.FromKilopoundsForcePerSecond(Convert.ToDouble(value)); - /// + /// public static ForceChangeRate MicronewtonsPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -104,7 +104,7 @@ public static ForceChangeRate MicronewtonsPerSecond(this T value) #endif => ForceChangeRate.FromMicronewtonsPerSecond(Convert.ToDouble(value)); - /// + /// public static ForceChangeRate MillinewtonsPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -112,7 +112,7 @@ public static ForceChangeRate MillinewtonsPerSecond(this T value) #endif => ForceChangeRate.FromMillinewtonsPerSecond(Convert.ToDouble(value)); - /// + /// public static ForceChangeRate NanonewtonsPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -120,7 +120,7 @@ public static ForceChangeRate NanonewtonsPerSecond(this T value) #endif => ForceChangeRate.FromNanonewtonsPerSecond(Convert.ToDouble(value)); - /// + /// public static ForceChangeRate NewtonsPerMinute(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -128,7 +128,7 @@ public static ForceChangeRate NewtonsPerMinute(this T value) #endif => ForceChangeRate.FromNewtonsPerMinute(Convert.ToDouble(value)); - /// + /// public static ForceChangeRate NewtonsPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -136,7 +136,7 @@ public static ForceChangeRate NewtonsPerSecond(this T value) #endif => ForceChangeRate.FromNewtonsPerSecond(Convert.ToDouble(value)); - /// + /// public static ForceChangeRate PoundsForcePerMinute(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -144,7 +144,7 @@ public static ForceChangeRate PoundsForcePerMinute(this T value) #endif => ForceChangeRate.FromPoundsForcePerMinute(Convert.ToDouble(value)); - /// + /// public static ForceChangeRate PoundsForcePerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToForceExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToForceExtensions.g.cs index 3c27f851da..85f4b75944 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToForceExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToForceExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToForce /// public static class NumberToForceExtensions { - /// + /// public static Force Decanewtons(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static Force Decanewtons(this T value) #endif => Force.FromDecanewtons(Convert.ToDouble(value)); - /// + /// public static Force Dyne(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static Force Dyne(this T value) #endif => Force.FromDyne(Convert.ToDouble(value)); - /// + /// public static Force KilogramsForce(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static Force KilogramsForce(this T value) #endif => Force.FromKilogramsForce(Convert.ToDouble(value)); - /// + /// public static Force Kilonewtons(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static Force Kilonewtons(this T value) #endif => Force.FromKilonewtons(Convert.ToDouble(value)); - /// + /// public static Force KiloPonds(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -72,7 +72,7 @@ public static Force KiloPonds(this T value) #endif => Force.FromKiloPonds(Convert.ToDouble(value)); - /// + /// public static Force KilopoundsForce(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -80,7 +80,7 @@ public static Force KilopoundsForce(this T value) #endif => Force.FromKilopoundsForce(Convert.ToDouble(value)); - /// + /// public static Force Meganewtons(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -88,7 +88,7 @@ public static Force Meganewtons(this T value) #endif => Force.FromMeganewtons(Convert.ToDouble(value)); - /// + /// public static Force Micronewtons(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -96,7 +96,7 @@ public static Force Micronewtons(this T value) #endif => Force.FromMicronewtons(Convert.ToDouble(value)); - /// + /// public static Force Millinewtons(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -104,7 +104,7 @@ public static Force Millinewtons(this T value) #endif => Force.FromMillinewtons(Convert.ToDouble(value)); - /// + /// public static Force Newtons(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -112,7 +112,7 @@ public static Force Newtons(this T value) #endif => Force.FromNewtons(Convert.ToDouble(value)); - /// + /// public static Force OunceForce(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -120,7 +120,7 @@ public static Force OunceForce(this T value) #endif => Force.FromOunceForce(Convert.ToDouble(value)); - /// + /// public static Force Poundals(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -128,7 +128,7 @@ public static Force Poundals(this T value) #endif => Force.FromPoundals(Convert.ToDouble(value)); - /// + /// public static Force PoundsForce(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -136,7 +136,7 @@ public static Force PoundsForce(this T value) #endif => Force.FromPoundsForce(Convert.ToDouble(value)); - /// + /// public static Force ShortTonsForce(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -144,7 +144,7 @@ public static Force ShortTonsForce(this T value) #endif => Force.FromShortTonsForce(Convert.ToDouble(value)); - /// + /// public static Force TonnesForce(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToForcePerLengthExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToForcePerLengthExtensions.g.cs index ee3a0f03b6..d506a693a6 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToForcePerLengthExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToForcePerLengthExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToForcePerLength /// public static class NumberToForcePerLengthExtensions { - /// + /// public static ForcePerLength CentinewtonsPerCentimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static ForcePerLength CentinewtonsPerCentimeter(this T value) #endif => ForcePerLength.FromCentinewtonsPerCentimeter(Convert.ToDouble(value)); - /// + /// public static ForcePerLength CentinewtonsPerMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static ForcePerLength CentinewtonsPerMeter(this T value) #endif => ForcePerLength.FromCentinewtonsPerMeter(Convert.ToDouble(value)); - /// + /// public static ForcePerLength CentinewtonsPerMillimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static ForcePerLength CentinewtonsPerMillimeter(this T value) #endif => ForcePerLength.FromCentinewtonsPerMillimeter(Convert.ToDouble(value)); - /// + /// public static ForcePerLength DecanewtonsPerCentimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static ForcePerLength DecanewtonsPerCentimeter(this T value) #endif => ForcePerLength.FromDecanewtonsPerCentimeter(Convert.ToDouble(value)); - /// + /// public static ForcePerLength DecanewtonsPerMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -72,7 +72,7 @@ public static ForcePerLength DecanewtonsPerMeter(this T value) #endif => ForcePerLength.FromDecanewtonsPerMeter(Convert.ToDouble(value)); - /// + /// public static ForcePerLength DecanewtonsPerMillimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -80,7 +80,7 @@ public static ForcePerLength DecanewtonsPerMillimeter(this T value) #endif => ForcePerLength.FromDecanewtonsPerMillimeter(Convert.ToDouble(value)); - /// + /// public static ForcePerLength DecinewtonsPerCentimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -88,7 +88,7 @@ public static ForcePerLength DecinewtonsPerCentimeter(this T value) #endif => ForcePerLength.FromDecinewtonsPerCentimeter(Convert.ToDouble(value)); - /// + /// public static ForcePerLength DecinewtonsPerMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -96,7 +96,7 @@ public static ForcePerLength DecinewtonsPerMeter(this T value) #endif => ForcePerLength.FromDecinewtonsPerMeter(Convert.ToDouble(value)); - /// + /// public static ForcePerLength DecinewtonsPerMillimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -104,7 +104,7 @@ public static ForcePerLength DecinewtonsPerMillimeter(this T value) #endif => ForcePerLength.FromDecinewtonsPerMillimeter(Convert.ToDouble(value)); - /// + /// public static ForcePerLength KilogramsForcePerCentimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -112,7 +112,7 @@ public static ForcePerLength KilogramsForcePerCentimeter(this T value) #endif => ForcePerLength.FromKilogramsForcePerCentimeter(Convert.ToDouble(value)); - /// + /// public static ForcePerLength KilogramsForcePerMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -120,7 +120,7 @@ public static ForcePerLength KilogramsForcePerMeter(this T value) #endif => ForcePerLength.FromKilogramsForcePerMeter(Convert.ToDouble(value)); - /// + /// public static ForcePerLength KilogramsForcePerMillimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -128,7 +128,7 @@ public static ForcePerLength KilogramsForcePerMillimeter(this T value) #endif => ForcePerLength.FromKilogramsForcePerMillimeter(Convert.ToDouble(value)); - /// + /// public static ForcePerLength KilonewtonsPerCentimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -136,7 +136,7 @@ public static ForcePerLength KilonewtonsPerCentimeter(this T value) #endif => ForcePerLength.FromKilonewtonsPerCentimeter(Convert.ToDouble(value)); - /// + /// public static ForcePerLength KilonewtonsPerMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -144,7 +144,7 @@ public static ForcePerLength KilonewtonsPerMeter(this T value) #endif => ForcePerLength.FromKilonewtonsPerMeter(Convert.ToDouble(value)); - /// + /// public static ForcePerLength KilonewtonsPerMillimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -152,7 +152,7 @@ public static ForcePerLength KilonewtonsPerMillimeter(this T value) #endif => ForcePerLength.FromKilonewtonsPerMillimeter(Convert.ToDouble(value)); - /// + /// public static ForcePerLength KilopoundsForcePerFoot(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -160,7 +160,7 @@ public static ForcePerLength KilopoundsForcePerFoot(this T value) #endif => ForcePerLength.FromKilopoundsForcePerFoot(Convert.ToDouble(value)); - /// + /// public static ForcePerLength KilopoundsForcePerInch(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -168,7 +168,7 @@ public static ForcePerLength KilopoundsForcePerInch(this T value) #endif => ForcePerLength.FromKilopoundsForcePerInch(Convert.ToDouble(value)); - /// + /// public static ForcePerLength MeganewtonsPerCentimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -176,7 +176,7 @@ public static ForcePerLength MeganewtonsPerCentimeter(this T value) #endif => ForcePerLength.FromMeganewtonsPerCentimeter(Convert.ToDouble(value)); - /// + /// public static ForcePerLength MeganewtonsPerMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -184,7 +184,7 @@ public static ForcePerLength MeganewtonsPerMeter(this T value) #endif => ForcePerLength.FromMeganewtonsPerMeter(Convert.ToDouble(value)); - /// + /// public static ForcePerLength MeganewtonsPerMillimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -192,7 +192,7 @@ public static ForcePerLength MeganewtonsPerMillimeter(this T value) #endif => ForcePerLength.FromMeganewtonsPerMillimeter(Convert.ToDouble(value)); - /// + /// public static ForcePerLength MicronewtonsPerCentimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -200,7 +200,7 @@ public static ForcePerLength MicronewtonsPerCentimeter(this T value) #endif => ForcePerLength.FromMicronewtonsPerCentimeter(Convert.ToDouble(value)); - /// + /// public static ForcePerLength MicronewtonsPerMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -208,7 +208,7 @@ public static ForcePerLength MicronewtonsPerMeter(this T value) #endif => ForcePerLength.FromMicronewtonsPerMeter(Convert.ToDouble(value)); - /// + /// public static ForcePerLength MicronewtonsPerMillimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -216,7 +216,7 @@ public static ForcePerLength MicronewtonsPerMillimeter(this T value) #endif => ForcePerLength.FromMicronewtonsPerMillimeter(Convert.ToDouble(value)); - /// + /// public static ForcePerLength MillinewtonsPerCentimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -224,7 +224,7 @@ public static ForcePerLength MillinewtonsPerCentimeter(this T value) #endif => ForcePerLength.FromMillinewtonsPerCentimeter(Convert.ToDouble(value)); - /// + /// public static ForcePerLength MillinewtonsPerMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -232,7 +232,7 @@ public static ForcePerLength MillinewtonsPerMeter(this T value) #endif => ForcePerLength.FromMillinewtonsPerMeter(Convert.ToDouble(value)); - /// + /// public static ForcePerLength MillinewtonsPerMillimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -240,7 +240,7 @@ public static ForcePerLength MillinewtonsPerMillimeter(this T value) #endif => ForcePerLength.FromMillinewtonsPerMillimeter(Convert.ToDouble(value)); - /// + /// public static ForcePerLength NanonewtonsPerCentimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -248,7 +248,7 @@ public static ForcePerLength NanonewtonsPerCentimeter(this T value) #endif => ForcePerLength.FromNanonewtonsPerCentimeter(Convert.ToDouble(value)); - /// + /// public static ForcePerLength NanonewtonsPerMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -256,7 +256,7 @@ public static ForcePerLength NanonewtonsPerMeter(this T value) #endif => ForcePerLength.FromNanonewtonsPerMeter(Convert.ToDouble(value)); - /// + /// public static ForcePerLength NanonewtonsPerMillimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -264,7 +264,7 @@ public static ForcePerLength NanonewtonsPerMillimeter(this T value) #endif => ForcePerLength.FromNanonewtonsPerMillimeter(Convert.ToDouble(value)); - /// + /// public static ForcePerLength NewtonsPerCentimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -272,7 +272,7 @@ public static ForcePerLength NewtonsPerCentimeter(this T value) #endif => ForcePerLength.FromNewtonsPerCentimeter(Convert.ToDouble(value)); - /// + /// public static ForcePerLength NewtonsPerMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -280,7 +280,7 @@ public static ForcePerLength NewtonsPerMeter(this T value) #endif => ForcePerLength.FromNewtonsPerMeter(Convert.ToDouble(value)); - /// + /// public static ForcePerLength NewtonsPerMillimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -288,7 +288,7 @@ public static ForcePerLength NewtonsPerMillimeter(this T value) #endif => ForcePerLength.FromNewtonsPerMillimeter(Convert.ToDouble(value)); - /// + /// public static ForcePerLength PoundsForcePerFoot(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -296,7 +296,7 @@ public static ForcePerLength PoundsForcePerFoot(this T value) #endif => ForcePerLength.FromPoundsForcePerFoot(Convert.ToDouble(value)); - /// + /// public static ForcePerLength PoundsForcePerInch(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -304,7 +304,7 @@ public static ForcePerLength PoundsForcePerInch(this T value) #endif => ForcePerLength.FromPoundsForcePerInch(Convert.ToDouble(value)); - /// + /// public static ForcePerLength PoundsForcePerYard(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -312,7 +312,7 @@ public static ForcePerLength PoundsForcePerYard(this T value) #endif => ForcePerLength.FromPoundsForcePerYard(Convert.ToDouble(value)); - /// + /// public static ForcePerLength TonnesForcePerCentimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -320,7 +320,7 @@ public static ForcePerLength TonnesForcePerCentimeter(this T value) #endif => ForcePerLength.FromTonnesForcePerCentimeter(Convert.ToDouble(value)); - /// + /// public static ForcePerLength TonnesForcePerMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -328,7 +328,7 @@ public static ForcePerLength TonnesForcePerMeter(this T value) #endif => ForcePerLength.FromTonnesForcePerMeter(Convert.ToDouble(value)); - /// + /// public static ForcePerLength TonnesForcePerMillimeter(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToFrequencyExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToFrequencyExtensions.g.cs index 9c2b622b1c..3839b85f8b 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToFrequencyExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToFrequencyExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToFrequency /// public static class NumberToFrequencyExtensions { - /// + /// public static Frequency BeatsPerMinute(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static Frequency BeatsPerMinute(this T value) #endif => Frequency.FromBeatsPerMinute(Convert.ToDouble(value)); - /// + /// public static Frequency BUnits(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static Frequency BUnits(this T value) #endif => Frequency.FromBUnits(Convert.ToDouble(value)); - /// + /// public static Frequency CyclesPerHour(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static Frequency CyclesPerHour(this T value) #endif => Frequency.FromCyclesPerHour(Convert.ToDouble(value)); - /// + /// public static Frequency CyclesPerMinute(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static Frequency CyclesPerMinute(this T value) #endif => Frequency.FromCyclesPerMinute(Convert.ToDouble(value)); - /// + /// public static Frequency Gigahertz(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -72,7 +72,7 @@ public static Frequency Gigahertz(this T value) #endif => Frequency.FromGigahertz(Convert.ToDouble(value)); - /// + /// public static Frequency Hertz(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -80,7 +80,7 @@ public static Frequency Hertz(this T value) #endif => Frequency.FromHertz(Convert.ToDouble(value)); - /// + /// public static Frequency Kilohertz(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -88,7 +88,7 @@ public static Frequency Kilohertz(this T value) #endif => Frequency.FromKilohertz(Convert.ToDouble(value)); - /// + /// public static Frequency Megahertz(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -96,7 +96,7 @@ public static Frequency Megahertz(this T value) #endif => Frequency.FromMegahertz(Convert.ToDouble(value)); - /// + /// public static Frequency Microhertz(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -104,7 +104,7 @@ public static Frequency Microhertz(this T value) #endif => Frequency.FromMicrohertz(Convert.ToDouble(value)); - /// + /// public static Frequency Millihertz(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -112,7 +112,7 @@ public static Frequency Millihertz(this T value) #endif => Frequency.FromMillihertz(Convert.ToDouble(value)); - /// + /// public static Frequency PerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -120,7 +120,7 @@ public static Frequency PerSecond(this T value) #endif => Frequency.FromPerSecond(Convert.ToDouble(value)); - /// + /// public static Frequency RadiansPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -128,7 +128,7 @@ public static Frequency RadiansPerSecond(this T value) #endif => Frequency.FromRadiansPerSecond(Convert.ToDouble(value)); - /// + /// public static Frequency Terahertz(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToFuelEfficiencyExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToFuelEfficiencyExtensions.g.cs index e7681b8ef9..c2db1d3139 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToFuelEfficiencyExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToFuelEfficiencyExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToFuelEfficiency /// public static class NumberToFuelEfficiencyExtensions { - /// + /// public static FuelEfficiency KilometersPerLiter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static FuelEfficiency KilometersPerLiter(this T value) #endif => FuelEfficiency.FromKilometersPerLiter(Convert.ToDouble(value)); - /// + /// public static FuelEfficiency LitersPer100Kilometers(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static FuelEfficiency LitersPer100Kilometers(this T value) #endif => FuelEfficiency.FromLitersPer100Kilometers(Convert.ToDouble(value)); - /// + /// public static FuelEfficiency MilesPerUkGallon(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static FuelEfficiency MilesPerUkGallon(this T value) #endif => FuelEfficiency.FromMilesPerUkGallon(Convert.ToDouble(value)); - /// + /// public static FuelEfficiency MilesPerUsGallon(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToHeatFluxExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToHeatFluxExtensions.g.cs index 7ee2a64422..6039addde3 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToHeatFluxExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToHeatFluxExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToHeatFlux /// public static class NumberToHeatFluxExtensions { - /// + /// public static HeatFlux BtusPerHourSquareFoot(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static HeatFlux BtusPerHourSquareFoot(this T value) #endif => HeatFlux.FromBtusPerHourSquareFoot(Convert.ToDouble(value)); - /// + /// public static HeatFlux BtusPerMinuteSquareFoot(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static HeatFlux BtusPerMinuteSquareFoot(this T value) #endif => HeatFlux.FromBtusPerMinuteSquareFoot(Convert.ToDouble(value)); - /// + /// public static HeatFlux BtusPerSecondSquareFoot(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static HeatFlux BtusPerSecondSquareFoot(this T value) #endif => HeatFlux.FromBtusPerSecondSquareFoot(Convert.ToDouble(value)); - /// + /// public static HeatFlux BtusPerSecondSquareInch(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static HeatFlux BtusPerSecondSquareInch(this T value) #endif => HeatFlux.FromBtusPerSecondSquareInch(Convert.ToDouble(value)); - /// + /// public static HeatFlux CaloriesPerSecondSquareCentimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -72,7 +72,7 @@ public static HeatFlux CaloriesPerSecondSquareCentimeter(this T value) #endif => HeatFlux.FromCaloriesPerSecondSquareCentimeter(Convert.ToDouble(value)); - /// + /// public static HeatFlux CentiwattsPerSquareMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -80,7 +80,7 @@ public static HeatFlux CentiwattsPerSquareMeter(this T value) #endif => HeatFlux.FromCentiwattsPerSquareMeter(Convert.ToDouble(value)); - /// + /// public static HeatFlux DeciwattsPerSquareMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -88,7 +88,7 @@ public static HeatFlux DeciwattsPerSquareMeter(this T value) #endif => HeatFlux.FromDeciwattsPerSquareMeter(Convert.ToDouble(value)); - /// + /// public static HeatFlux KilocaloriesPerHourSquareMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -96,7 +96,7 @@ public static HeatFlux KilocaloriesPerHourSquareMeter(this T value) #endif => HeatFlux.FromKilocaloriesPerHourSquareMeter(Convert.ToDouble(value)); - /// + /// public static HeatFlux KilocaloriesPerSecondSquareCentimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -104,7 +104,7 @@ public static HeatFlux KilocaloriesPerSecondSquareCentimeter(this T value) #endif => HeatFlux.FromKilocaloriesPerSecondSquareCentimeter(Convert.ToDouble(value)); - /// + /// public static HeatFlux KilowattsPerSquareMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -112,7 +112,7 @@ public static HeatFlux KilowattsPerSquareMeter(this T value) #endif => HeatFlux.FromKilowattsPerSquareMeter(Convert.ToDouble(value)); - /// + /// public static HeatFlux MicrowattsPerSquareMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -120,7 +120,7 @@ public static HeatFlux MicrowattsPerSquareMeter(this T value) #endif => HeatFlux.FromMicrowattsPerSquareMeter(Convert.ToDouble(value)); - /// + /// public static HeatFlux MilliwattsPerSquareMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -128,7 +128,7 @@ public static HeatFlux MilliwattsPerSquareMeter(this T value) #endif => HeatFlux.FromMilliwattsPerSquareMeter(Convert.ToDouble(value)); - /// + /// public static HeatFlux NanowattsPerSquareMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -136,7 +136,7 @@ public static HeatFlux NanowattsPerSquareMeter(this T value) #endif => HeatFlux.FromNanowattsPerSquareMeter(Convert.ToDouble(value)); - /// + /// public static HeatFlux PoundsForcePerFootSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -144,7 +144,7 @@ public static HeatFlux PoundsForcePerFootSecond(this T value) #endif => HeatFlux.FromPoundsForcePerFootSecond(Convert.ToDouble(value)); - /// + /// public static HeatFlux PoundsPerSecondCubed(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -152,7 +152,7 @@ public static HeatFlux PoundsPerSecondCubed(this T value) #endif => HeatFlux.FromPoundsPerSecondCubed(Convert.ToDouble(value)); - /// + /// public static HeatFlux WattsPerSquareFoot(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -160,7 +160,7 @@ public static HeatFlux WattsPerSquareFoot(this T value) #endif => HeatFlux.FromWattsPerSquareFoot(Convert.ToDouble(value)); - /// + /// public static HeatFlux WattsPerSquareInch(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -168,7 +168,7 @@ public static HeatFlux WattsPerSquareInch(this T value) #endif => HeatFlux.FromWattsPerSquareInch(Convert.ToDouble(value)); - /// + /// public static HeatFlux WattsPerSquareMeter(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToHeatTransferCoefficientExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToHeatTransferCoefficientExtensions.g.cs index d0beae1f96..d53c217c5f 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToHeatTransferCoefficientExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToHeatTransferCoefficientExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToHeatTransferCoefficient /// public static class NumberToHeatTransferCoefficientExtensions { - /// + /// public static HeatTransferCoefficient BtusPerHourSquareFootDegreeFahrenheit(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static HeatTransferCoefficient BtusPerHourSquareFootDegreeFahrenheit(t #endif => HeatTransferCoefficient.FromBtusPerHourSquareFootDegreeFahrenheit(Convert.ToDouble(value)); - /// + /// [Obsolete("The name of this definition incorrectly omitted time as divisor, please use BtuPerHourSquareFootDegreeFahrenheit instead")] public static HeatTransferCoefficient BtusPerSquareFootDegreeFahrenheit(this T value) where T : notnull @@ -49,7 +49,7 @@ public static HeatTransferCoefficient BtusPerSquareFootDegreeFahrenheit(this #endif => HeatTransferCoefficient.FromBtusPerSquareFootDegreeFahrenheit(Convert.ToDouble(value)); - /// + /// public static HeatTransferCoefficient CaloriesPerHourSquareMeterDegreeCelsius(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -57,7 +57,7 @@ public static HeatTransferCoefficient CaloriesPerHourSquareMeterDegreeCelsius #endif => HeatTransferCoefficient.FromCaloriesPerHourSquareMeterDegreeCelsius(Convert.ToDouble(value)); - /// + /// public static HeatTransferCoefficient KilocaloriesPerHourSquareMeterDegreeCelsius(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -65,7 +65,7 @@ public static HeatTransferCoefficient KilocaloriesPerHourSquareMeterDegreeCelsiu #endif => HeatTransferCoefficient.FromKilocaloriesPerHourSquareMeterDegreeCelsius(Convert.ToDouble(value)); - /// + /// public static HeatTransferCoefficient WattsPerSquareMeterCelsius(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -73,7 +73,7 @@ public static HeatTransferCoefficient WattsPerSquareMeterCelsius(this T value #endif => HeatTransferCoefficient.FromWattsPerSquareMeterCelsius(Convert.ToDouble(value)); - /// + /// public static HeatTransferCoefficient WattsPerSquareMeterKelvin(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToIlluminanceExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToIlluminanceExtensions.g.cs index 9e16ed4717..e901c49a6a 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToIlluminanceExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToIlluminanceExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToIlluminance /// public static class NumberToIlluminanceExtensions { - /// + /// public static Illuminance Kilolux(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static Illuminance Kilolux(this T value) #endif => Illuminance.FromKilolux(Convert.ToDouble(value)); - /// + /// public static Illuminance Lux(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static Illuminance Lux(this T value) #endif => Illuminance.FromLux(Convert.ToDouble(value)); - /// + /// public static Illuminance Megalux(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static Illuminance Megalux(this T value) #endif => Illuminance.FromMegalux(Convert.ToDouble(value)); - /// + /// public static Illuminance Millilux(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToImpulseExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToImpulseExtensions.g.cs index f72852c086..8e48e38d3a 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToImpulseExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToImpulseExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToImpulse /// public static class NumberToImpulseExtensions { - /// + /// public static Impulse CentinewtonSeconds(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static Impulse CentinewtonSeconds(this T value) #endif => Impulse.FromCentinewtonSeconds(Convert.ToDouble(value)); - /// + /// public static Impulse DecanewtonSeconds(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static Impulse DecanewtonSeconds(this T value) #endif => Impulse.FromDecanewtonSeconds(Convert.ToDouble(value)); - /// + /// public static Impulse DecinewtonSeconds(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static Impulse DecinewtonSeconds(this T value) #endif => Impulse.FromDecinewtonSeconds(Convert.ToDouble(value)); - /// + /// public static Impulse KilogramMetersPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static Impulse KilogramMetersPerSecond(this T value) #endif => Impulse.FromKilogramMetersPerSecond(Convert.ToDouble(value)); - /// + /// public static Impulse KilonewtonSeconds(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -72,7 +72,7 @@ public static Impulse KilonewtonSeconds(this T value) #endif => Impulse.FromKilonewtonSeconds(Convert.ToDouble(value)); - /// + /// public static Impulse MeganewtonSeconds(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -80,7 +80,7 @@ public static Impulse MeganewtonSeconds(this T value) #endif => Impulse.FromMeganewtonSeconds(Convert.ToDouble(value)); - /// + /// public static Impulse MicronewtonSeconds(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -88,7 +88,7 @@ public static Impulse MicronewtonSeconds(this T value) #endif => Impulse.FromMicronewtonSeconds(Convert.ToDouble(value)); - /// + /// public static Impulse MillinewtonSeconds(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -96,7 +96,7 @@ public static Impulse MillinewtonSeconds(this T value) #endif => Impulse.FromMillinewtonSeconds(Convert.ToDouble(value)); - /// + /// public static Impulse NanonewtonSeconds(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -104,7 +104,7 @@ public static Impulse NanonewtonSeconds(this T value) #endif => Impulse.FromNanonewtonSeconds(Convert.ToDouble(value)); - /// + /// public static Impulse NewtonSeconds(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -112,7 +112,7 @@ public static Impulse NewtonSeconds(this T value) #endif => Impulse.FromNewtonSeconds(Convert.ToDouble(value)); - /// + /// public static Impulse PoundFeetPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -120,7 +120,7 @@ public static Impulse PoundFeetPerSecond(this T value) #endif => Impulse.FromPoundFeetPerSecond(Convert.ToDouble(value)); - /// + /// public static Impulse PoundForceSeconds(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -128,7 +128,7 @@ public static Impulse PoundForceSeconds(this T value) #endif => Impulse.FromPoundForceSeconds(Convert.ToDouble(value)); - /// + /// public static Impulse SlugFeetPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToInformationExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToInformationExtensions.g.cs index d43d63c0a4..f8251dc677 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToInformationExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToInformationExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToInformation /// public static class NumberToInformationExtensions { - /// + /// public static Information Bits(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static Information Bits(this T value) #endif => Information.FromBits(Convert.ToDouble(value)); - /// + /// public static Information Bytes(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static Information Bytes(this T value) #endif => Information.FromBytes(Convert.ToDouble(value)); - /// + /// public static Information Exabits(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static Information Exabits(this T value) #endif => Information.FromExabits(Convert.ToDouble(value)); - /// + /// public static Information Exabytes(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static Information Exabytes(this T value) #endif => Information.FromExabytes(Convert.ToDouble(value)); - /// + /// public static Information Exbibits(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -72,7 +72,7 @@ public static Information Exbibits(this T value) #endif => Information.FromExbibits(Convert.ToDouble(value)); - /// + /// public static Information Exbibytes(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -80,7 +80,7 @@ public static Information Exbibytes(this T value) #endif => Information.FromExbibytes(Convert.ToDouble(value)); - /// + /// public static Information Gibibits(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -88,7 +88,7 @@ public static Information Gibibits(this T value) #endif => Information.FromGibibits(Convert.ToDouble(value)); - /// + /// public static Information Gibibytes(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -96,7 +96,7 @@ public static Information Gibibytes(this T value) #endif => Information.FromGibibytes(Convert.ToDouble(value)); - /// + /// public static Information Gigabits(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -104,7 +104,7 @@ public static Information Gigabits(this T value) #endif => Information.FromGigabits(Convert.ToDouble(value)); - /// + /// public static Information Gigabytes(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -112,7 +112,7 @@ public static Information Gigabytes(this T value) #endif => Information.FromGigabytes(Convert.ToDouble(value)); - /// + /// public static Information Kibibits(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -120,7 +120,7 @@ public static Information Kibibits(this T value) #endif => Information.FromKibibits(Convert.ToDouble(value)); - /// + /// public static Information Kibibytes(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -128,7 +128,7 @@ public static Information Kibibytes(this T value) #endif => Information.FromKibibytes(Convert.ToDouble(value)); - /// + /// public static Information Kilobits(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -136,7 +136,7 @@ public static Information Kilobits(this T value) #endif => Information.FromKilobits(Convert.ToDouble(value)); - /// + /// public static Information Kilobytes(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -144,7 +144,7 @@ public static Information Kilobytes(this T value) #endif => Information.FromKilobytes(Convert.ToDouble(value)); - /// + /// public static Information Mebibits(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -152,7 +152,7 @@ public static Information Mebibits(this T value) #endif => Information.FromMebibits(Convert.ToDouble(value)); - /// + /// public static Information Mebibytes(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -160,7 +160,7 @@ public static Information Mebibytes(this T value) #endif => Information.FromMebibytes(Convert.ToDouble(value)); - /// + /// public static Information Megabits(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -168,7 +168,7 @@ public static Information Megabits(this T value) #endif => Information.FromMegabits(Convert.ToDouble(value)); - /// + /// public static Information Megabytes(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -176,7 +176,7 @@ public static Information Megabytes(this T value) #endif => Information.FromMegabytes(Convert.ToDouble(value)); - /// + /// public static Information Pebibits(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -184,7 +184,7 @@ public static Information Pebibits(this T value) #endif => Information.FromPebibits(Convert.ToDouble(value)); - /// + /// public static Information Pebibytes(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -192,7 +192,7 @@ public static Information Pebibytes(this T value) #endif => Information.FromPebibytes(Convert.ToDouble(value)); - /// + /// public static Information Petabits(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -200,7 +200,7 @@ public static Information Petabits(this T value) #endif => Information.FromPetabits(Convert.ToDouble(value)); - /// + /// public static Information Petabytes(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -208,7 +208,7 @@ public static Information Petabytes(this T value) #endif => Information.FromPetabytes(Convert.ToDouble(value)); - /// + /// public static Information Tebibits(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -216,7 +216,7 @@ public static Information Tebibits(this T value) #endif => Information.FromTebibits(Convert.ToDouble(value)); - /// + /// public static Information Tebibytes(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -224,7 +224,7 @@ public static Information Tebibytes(this T value) #endif => Information.FromTebibytes(Convert.ToDouble(value)); - /// + /// public static Information Terabits(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -232,7 +232,7 @@ public static Information Terabits(this T value) #endif => Information.FromTerabits(Convert.ToDouble(value)); - /// + /// public static Information Terabytes(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToIrradianceExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToIrradianceExtensions.g.cs index 90074f863a..cd54959d81 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToIrradianceExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToIrradianceExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToIrradiance /// public static class NumberToIrradianceExtensions { - /// + /// public static Irradiance KilowattsPerSquareCentimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static Irradiance KilowattsPerSquareCentimeter(this T value) #endif => Irradiance.FromKilowattsPerSquareCentimeter(Convert.ToDouble(value)); - /// + /// public static Irradiance KilowattsPerSquareMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static Irradiance KilowattsPerSquareMeter(this T value) #endif => Irradiance.FromKilowattsPerSquareMeter(Convert.ToDouble(value)); - /// + /// public static Irradiance MegawattsPerSquareCentimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static Irradiance MegawattsPerSquareCentimeter(this T value) #endif => Irradiance.FromMegawattsPerSquareCentimeter(Convert.ToDouble(value)); - /// + /// public static Irradiance MegawattsPerSquareMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static Irradiance MegawattsPerSquareMeter(this T value) #endif => Irradiance.FromMegawattsPerSquareMeter(Convert.ToDouble(value)); - /// + /// public static Irradiance MicrowattsPerSquareCentimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -72,7 +72,7 @@ public static Irradiance MicrowattsPerSquareCentimeter(this T value) #endif => Irradiance.FromMicrowattsPerSquareCentimeter(Convert.ToDouble(value)); - /// + /// public static Irradiance MicrowattsPerSquareMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -80,7 +80,7 @@ public static Irradiance MicrowattsPerSquareMeter(this T value) #endif => Irradiance.FromMicrowattsPerSquareMeter(Convert.ToDouble(value)); - /// + /// public static Irradiance MilliwattsPerSquareCentimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -88,7 +88,7 @@ public static Irradiance MilliwattsPerSquareCentimeter(this T value) #endif => Irradiance.FromMilliwattsPerSquareCentimeter(Convert.ToDouble(value)); - /// + /// public static Irradiance MilliwattsPerSquareMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -96,7 +96,7 @@ public static Irradiance MilliwattsPerSquareMeter(this T value) #endif => Irradiance.FromMilliwattsPerSquareMeter(Convert.ToDouble(value)); - /// + /// public static Irradiance NanowattsPerSquareCentimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -104,7 +104,7 @@ public static Irradiance NanowattsPerSquareCentimeter(this T value) #endif => Irradiance.FromNanowattsPerSquareCentimeter(Convert.ToDouble(value)); - /// + /// public static Irradiance NanowattsPerSquareMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -112,7 +112,7 @@ public static Irradiance NanowattsPerSquareMeter(this T value) #endif => Irradiance.FromNanowattsPerSquareMeter(Convert.ToDouble(value)); - /// + /// public static Irradiance PicowattsPerSquareCentimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -120,7 +120,7 @@ public static Irradiance PicowattsPerSquareCentimeter(this T value) #endif => Irradiance.FromPicowattsPerSquareCentimeter(Convert.ToDouble(value)); - /// + /// public static Irradiance PicowattsPerSquareMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -128,7 +128,7 @@ public static Irradiance PicowattsPerSquareMeter(this T value) #endif => Irradiance.FromPicowattsPerSquareMeter(Convert.ToDouble(value)); - /// + /// public static Irradiance WattsPerSquareCentimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -136,7 +136,7 @@ public static Irradiance WattsPerSquareCentimeter(this T value) #endif => Irradiance.FromWattsPerSquareCentimeter(Convert.ToDouble(value)); - /// + /// public static Irradiance WattsPerSquareMeter(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToIrradiationExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToIrradiationExtensions.g.cs index 6d9d3433b5..56c114cc94 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToIrradiationExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToIrradiationExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToIrradiation /// public static class NumberToIrradiationExtensions { - /// + /// public static Irradiation JoulesPerSquareCentimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static Irradiation JoulesPerSquareCentimeter(this T value) #endif => Irradiation.FromJoulesPerSquareCentimeter(Convert.ToDouble(value)); - /// + /// public static Irradiation JoulesPerSquareMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static Irradiation JoulesPerSquareMeter(this T value) #endif => Irradiation.FromJoulesPerSquareMeter(Convert.ToDouble(value)); - /// + /// public static Irradiation JoulesPerSquareMillimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static Irradiation JoulesPerSquareMillimeter(this T value) #endif => Irradiation.FromJoulesPerSquareMillimeter(Convert.ToDouble(value)); - /// + /// public static Irradiation KilojoulesPerSquareMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static Irradiation KilojoulesPerSquareMeter(this T value) #endif => Irradiation.FromKilojoulesPerSquareMeter(Convert.ToDouble(value)); - /// + /// public static Irradiation KilowattHoursPerSquareMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -72,7 +72,7 @@ public static Irradiation KilowattHoursPerSquareMeter(this T value) #endif => Irradiation.FromKilowattHoursPerSquareMeter(Convert.ToDouble(value)); - /// + /// public static Irradiation MillijoulesPerSquareCentimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -80,7 +80,7 @@ public static Irradiation MillijoulesPerSquareCentimeter(this T value) #endif => Irradiation.FromMillijoulesPerSquareCentimeter(Convert.ToDouble(value)); - /// + /// public static Irradiation WattHoursPerSquareMeter(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToJerkExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToJerkExtensions.g.cs index 00c604449c..fca1b8986b 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToJerkExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToJerkExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToJerk /// public static class NumberToJerkExtensions { - /// + /// public static Jerk CentimetersPerSecondCubed(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static Jerk CentimetersPerSecondCubed(this T value) #endif => Jerk.FromCentimetersPerSecondCubed(Convert.ToDouble(value)); - /// + /// public static Jerk DecimetersPerSecondCubed(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static Jerk DecimetersPerSecondCubed(this T value) #endif => Jerk.FromDecimetersPerSecondCubed(Convert.ToDouble(value)); - /// + /// public static Jerk FeetPerSecondCubed(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static Jerk FeetPerSecondCubed(this T value) #endif => Jerk.FromFeetPerSecondCubed(Convert.ToDouble(value)); - /// + /// public static Jerk InchesPerSecondCubed(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static Jerk InchesPerSecondCubed(this T value) #endif => Jerk.FromInchesPerSecondCubed(Convert.ToDouble(value)); - /// + /// public static Jerk KilometersPerSecondCubed(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -72,7 +72,7 @@ public static Jerk KilometersPerSecondCubed(this T value) #endif => Jerk.FromKilometersPerSecondCubed(Convert.ToDouble(value)); - /// + /// public static Jerk MetersPerSecondCubed(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -80,7 +80,7 @@ public static Jerk MetersPerSecondCubed(this T value) #endif => Jerk.FromMetersPerSecondCubed(Convert.ToDouble(value)); - /// + /// public static Jerk MicrometersPerSecondCubed(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -88,7 +88,7 @@ public static Jerk MicrometersPerSecondCubed(this T value) #endif => Jerk.FromMicrometersPerSecondCubed(Convert.ToDouble(value)); - /// + /// public static Jerk MillimetersPerSecondCubed(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -96,7 +96,7 @@ public static Jerk MillimetersPerSecondCubed(this T value) #endif => Jerk.FromMillimetersPerSecondCubed(Convert.ToDouble(value)); - /// + /// public static Jerk MillistandardGravitiesPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -104,7 +104,7 @@ public static Jerk MillistandardGravitiesPerSecond(this T value) #endif => Jerk.FromMillistandardGravitiesPerSecond(Convert.ToDouble(value)); - /// + /// public static Jerk NanometersPerSecondCubed(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -112,7 +112,7 @@ public static Jerk NanometersPerSecondCubed(this T value) #endif => Jerk.FromNanometersPerSecondCubed(Convert.ToDouble(value)); - /// + /// public static Jerk StandardGravitiesPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToKinematicViscosityExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToKinematicViscosityExtensions.g.cs index c6f8cb7b69..c6f829f8cd 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToKinematicViscosityExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToKinematicViscosityExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToKinematicViscosity /// public static class NumberToKinematicViscosityExtensions { - /// + /// public static KinematicViscosity Centistokes(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static KinematicViscosity Centistokes(this T value) #endif => KinematicViscosity.FromCentistokes(Convert.ToDouble(value)); - /// + /// public static KinematicViscosity Decistokes(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static KinematicViscosity Decistokes(this T value) #endif => KinematicViscosity.FromDecistokes(Convert.ToDouble(value)); - /// + /// public static KinematicViscosity Kilostokes(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static KinematicViscosity Kilostokes(this T value) #endif => KinematicViscosity.FromKilostokes(Convert.ToDouble(value)); - /// + /// public static KinematicViscosity Microstokes(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static KinematicViscosity Microstokes(this T value) #endif => KinematicViscosity.FromMicrostokes(Convert.ToDouble(value)); - /// + /// public static KinematicViscosity Millistokes(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -72,7 +72,7 @@ public static KinematicViscosity Millistokes(this T value) #endif => KinematicViscosity.FromMillistokes(Convert.ToDouble(value)); - /// + /// public static KinematicViscosity Nanostokes(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -80,7 +80,7 @@ public static KinematicViscosity Nanostokes(this T value) #endif => KinematicViscosity.FromNanostokes(Convert.ToDouble(value)); - /// + /// public static KinematicViscosity SquareFeetPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -88,7 +88,7 @@ public static KinematicViscosity SquareFeetPerSecond(this T value) #endif => KinematicViscosity.FromSquareFeetPerSecond(Convert.ToDouble(value)); - /// + /// public static KinematicViscosity SquareMetersPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -96,7 +96,7 @@ public static KinematicViscosity SquareMetersPerSecond(this T value) #endif => KinematicViscosity.FromSquareMetersPerSecond(Convert.ToDouble(value)); - /// + /// public static KinematicViscosity Stokes(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToLeakRateExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToLeakRateExtensions.g.cs index 16d6906baf..da9bdbf25d 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToLeakRateExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToLeakRateExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToLeakRate /// public static class NumberToLeakRateExtensions { - /// + /// public static LeakRate MillibarLitersPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static LeakRate MillibarLitersPerSecond(this T value) #endif => LeakRate.FromMillibarLitersPerSecond(Convert.ToDouble(value)); - /// + /// public static LeakRate PascalCubicMetersPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static LeakRate PascalCubicMetersPerSecond(this T value) #endif => LeakRate.FromPascalCubicMetersPerSecond(Convert.ToDouble(value)); - /// + /// public static LeakRate TorrLitersPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToLengthExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToLengthExtensions.g.cs index 43fd3f376a..d15563ea80 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToLengthExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToLengthExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToLength /// public static class NumberToLengthExtensions { - /// + /// public static Length Angstroms(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static Length Angstroms(this T value) #endif => Length.FromAngstroms(Convert.ToDouble(value)); - /// + /// public static Length AstronomicalUnits(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static Length AstronomicalUnits(this T value) #endif => Length.FromAstronomicalUnits(Convert.ToDouble(value)); - /// + /// public static Length Centimeters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static Length Centimeters(this T value) #endif => Length.FromCentimeters(Convert.ToDouble(value)); - /// + /// public static Length Chains(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static Length Chains(this T value) #endif => Length.FromChains(Convert.ToDouble(value)); - /// + /// public static Length DataMiles(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -72,7 +72,7 @@ public static Length DataMiles(this T value) #endif => Length.FromDataMiles(Convert.ToDouble(value)); - /// + /// public static Length Decameters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -80,7 +80,7 @@ public static Length Decameters(this T value) #endif => Length.FromDecameters(Convert.ToDouble(value)); - /// + /// public static Length Decimeters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -88,7 +88,7 @@ public static Length Decimeters(this T value) #endif => Length.FromDecimeters(Convert.ToDouble(value)); - /// + /// public static Length DtpPicas(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -96,7 +96,7 @@ public static Length DtpPicas(this T value) #endif => Length.FromDtpPicas(Convert.ToDouble(value)); - /// + /// public static Length DtpPoints(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -104,7 +104,7 @@ public static Length DtpPoints(this T value) #endif => Length.FromDtpPoints(Convert.ToDouble(value)); - /// + /// public static Length Fathoms(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -112,7 +112,7 @@ public static Length Fathoms(this T value) #endif => Length.FromFathoms(Convert.ToDouble(value)); - /// + /// public static Length Femtometers(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -120,7 +120,7 @@ public static Length Femtometers(this T value) #endif => Length.FromFemtometers(Convert.ToDouble(value)); - /// + /// public static Length Feet(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -128,7 +128,7 @@ public static Length Feet(this T value) #endif => Length.FromFeet(Convert.ToDouble(value)); - /// + /// public static Length Gigameters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -136,7 +136,7 @@ public static Length Gigameters(this T value) #endif => Length.FromGigameters(Convert.ToDouble(value)); - /// + /// public static Length Hands(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -144,7 +144,7 @@ public static Length Hands(this T value) #endif => Length.FromHands(Convert.ToDouble(value)); - /// + /// public static Length Hectometers(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -152,7 +152,7 @@ public static Length Hectometers(this T value) #endif => Length.FromHectometers(Convert.ToDouble(value)); - /// + /// public static Length Inches(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -160,7 +160,7 @@ public static Length Inches(this T value) #endif => Length.FromInches(Convert.ToDouble(value)); - /// + /// public static Length Kilofeet(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -168,7 +168,7 @@ public static Length Kilofeet(this T value) #endif => Length.FromKilofeet(Convert.ToDouble(value)); - /// + /// public static Length KilolightYears(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -176,7 +176,7 @@ public static Length KilolightYears(this T value) #endif => Length.FromKilolightYears(Convert.ToDouble(value)); - /// + /// public static Length Kilometers(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -184,7 +184,7 @@ public static Length Kilometers(this T value) #endif => Length.FromKilometers(Convert.ToDouble(value)); - /// + /// public static Length Kiloparsecs(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -192,7 +192,7 @@ public static Length Kiloparsecs(this T value) #endif => Length.FromKiloparsecs(Convert.ToDouble(value)); - /// + /// public static Length Kiloyards(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -200,7 +200,7 @@ public static Length Kiloyards(this T value) #endif => Length.FromKiloyards(Convert.ToDouble(value)); - /// + /// public static Length LightYears(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -208,7 +208,7 @@ public static Length LightYears(this T value) #endif => Length.FromLightYears(Convert.ToDouble(value)); - /// + /// public static Length MegalightYears(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -216,7 +216,7 @@ public static Length MegalightYears(this T value) #endif => Length.FromMegalightYears(Convert.ToDouble(value)); - /// + /// public static Length Megameters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -224,7 +224,7 @@ public static Length Megameters(this T value) #endif => Length.FromMegameters(Convert.ToDouble(value)); - /// + /// public static Length Megaparsecs(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -232,7 +232,7 @@ public static Length Megaparsecs(this T value) #endif => Length.FromMegaparsecs(Convert.ToDouble(value)); - /// + /// public static Length Meters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -240,7 +240,7 @@ public static Length Meters(this T value) #endif => Length.FromMeters(Convert.ToDouble(value)); - /// + /// public static Length Microinches(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -248,7 +248,7 @@ public static Length Microinches(this T value) #endif => Length.FromMicroinches(Convert.ToDouble(value)); - /// + /// public static Length Micrometers(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -256,7 +256,7 @@ public static Length Micrometers(this T value) #endif => Length.FromMicrometers(Convert.ToDouble(value)); - /// + /// public static Length Mils(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -264,7 +264,7 @@ public static Length Mils(this T value) #endif => Length.FromMils(Convert.ToDouble(value)); - /// + /// public static Length Miles(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -272,7 +272,7 @@ public static Length Miles(this T value) #endif => Length.FromMiles(Convert.ToDouble(value)); - /// + /// public static Length Millimeters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -280,7 +280,7 @@ public static Length Millimeters(this T value) #endif => Length.FromMillimeters(Convert.ToDouble(value)); - /// + /// public static Length Nanometers(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -288,7 +288,7 @@ public static Length Nanometers(this T value) #endif => Length.FromNanometers(Convert.ToDouble(value)); - /// + /// public static Length NauticalMiles(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -296,7 +296,7 @@ public static Length NauticalMiles(this T value) #endif => Length.FromNauticalMiles(Convert.ToDouble(value)); - /// + /// public static Length Parsecs(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -304,7 +304,7 @@ public static Length Parsecs(this T value) #endif => Length.FromParsecs(Convert.ToDouble(value)); - /// + /// public static Length Picometers(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -312,7 +312,7 @@ public static Length Picometers(this T value) #endif => Length.FromPicometers(Convert.ToDouble(value)); - /// + /// public static Length PrinterPicas(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -320,7 +320,7 @@ public static Length PrinterPicas(this T value) #endif => Length.FromPrinterPicas(Convert.ToDouble(value)); - /// + /// public static Length PrinterPoints(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -328,7 +328,7 @@ public static Length PrinterPoints(this T value) #endif => Length.FromPrinterPoints(Convert.ToDouble(value)); - /// + /// public static Length Shackles(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -336,7 +336,7 @@ public static Length Shackles(this T value) #endif => Length.FromShackles(Convert.ToDouble(value)); - /// + /// public static Length SolarRadiuses(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -344,7 +344,7 @@ public static Length SolarRadiuses(this T value) #endif => Length.FromSolarRadiuses(Convert.ToDouble(value)); - /// + /// public static Length Twips(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -352,7 +352,7 @@ public static Length Twips(this T value) #endif => Length.FromTwips(Convert.ToDouble(value)); - /// + /// public static Length UsSurveyFeet(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -360,7 +360,7 @@ public static Length UsSurveyFeet(this T value) #endif => Length.FromUsSurveyFeet(Convert.ToDouble(value)); - /// + /// public static Length Yards(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToLevelExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToLevelExtensions.g.cs index a07a57052c..3d1c71a5c6 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToLevelExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToLevelExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToLevel /// public static class NumberToLevelExtensions { - /// + /// public static Level Decibels(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static Level Decibels(this T value) #endif => Level.FromDecibels(Convert.ToDouble(value)); - /// + /// public static Level Nepers(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToLinearDensityExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToLinearDensityExtensions.g.cs index 10064dcb4c..b86df0fd24 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToLinearDensityExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToLinearDensityExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToLinearDensity /// public static class NumberToLinearDensityExtensions { - /// + /// public static LinearDensity GramsPerCentimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static LinearDensity GramsPerCentimeter(this T value) #endif => LinearDensity.FromGramsPerCentimeter(Convert.ToDouble(value)); - /// + /// public static LinearDensity GramsPerMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static LinearDensity GramsPerMeter(this T value) #endif => LinearDensity.FromGramsPerMeter(Convert.ToDouble(value)); - /// + /// public static LinearDensity GramsPerMillimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static LinearDensity GramsPerMillimeter(this T value) #endif => LinearDensity.FromGramsPerMillimeter(Convert.ToDouble(value)); - /// + /// public static LinearDensity KilogramsPerCentimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static LinearDensity KilogramsPerCentimeter(this T value) #endif => LinearDensity.FromKilogramsPerCentimeter(Convert.ToDouble(value)); - /// + /// public static LinearDensity KilogramsPerMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -72,7 +72,7 @@ public static LinearDensity KilogramsPerMeter(this T value) #endif => LinearDensity.FromKilogramsPerMeter(Convert.ToDouble(value)); - /// + /// public static LinearDensity KilogramsPerMillimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -80,7 +80,7 @@ public static LinearDensity KilogramsPerMillimeter(this T value) #endif => LinearDensity.FromKilogramsPerMillimeter(Convert.ToDouble(value)); - /// + /// public static LinearDensity MicrogramsPerCentimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -88,7 +88,7 @@ public static LinearDensity MicrogramsPerCentimeter(this T value) #endif => LinearDensity.FromMicrogramsPerCentimeter(Convert.ToDouble(value)); - /// + /// public static LinearDensity MicrogramsPerMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -96,7 +96,7 @@ public static LinearDensity MicrogramsPerMeter(this T value) #endif => LinearDensity.FromMicrogramsPerMeter(Convert.ToDouble(value)); - /// + /// public static LinearDensity MicrogramsPerMillimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -104,7 +104,7 @@ public static LinearDensity MicrogramsPerMillimeter(this T value) #endif => LinearDensity.FromMicrogramsPerMillimeter(Convert.ToDouble(value)); - /// + /// public static LinearDensity MilligramsPerCentimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -112,7 +112,7 @@ public static LinearDensity MilligramsPerCentimeter(this T value) #endif => LinearDensity.FromMilligramsPerCentimeter(Convert.ToDouble(value)); - /// + /// public static LinearDensity MilligramsPerMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -120,7 +120,7 @@ public static LinearDensity MilligramsPerMeter(this T value) #endif => LinearDensity.FromMilligramsPerMeter(Convert.ToDouble(value)); - /// + /// public static LinearDensity MilligramsPerMillimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -128,7 +128,7 @@ public static LinearDensity MilligramsPerMillimeter(this T value) #endif => LinearDensity.FromMilligramsPerMillimeter(Convert.ToDouble(value)); - /// + /// public static LinearDensity PoundsPerFoot(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -136,7 +136,7 @@ public static LinearDensity PoundsPerFoot(this T value) #endif => LinearDensity.FromPoundsPerFoot(Convert.ToDouble(value)); - /// + /// public static LinearDensity PoundsPerInch(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToLinearPowerDensityExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToLinearPowerDensityExtensions.g.cs index a41f134023..053dfdd3bb 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToLinearPowerDensityExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToLinearPowerDensityExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToLinearPowerDensity /// public static class NumberToLinearPowerDensityExtensions { - /// + /// public static LinearPowerDensity GigawattsPerCentimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static LinearPowerDensity GigawattsPerCentimeter(this T value) #endif => LinearPowerDensity.FromGigawattsPerCentimeter(Convert.ToDouble(value)); - /// + /// public static LinearPowerDensity GigawattsPerFoot(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static LinearPowerDensity GigawattsPerFoot(this T value) #endif => LinearPowerDensity.FromGigawattsPerFoot(Convert.ToDouble(value)); - /// + /// public static LinearPowerDensity GigawattsPerInch(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static LinearPowerDensity GigawattsPerInch(this T value) #endif => LinearPowerDensity.FromGigawattsPerInch(Convert.ToDouble(value)); - /// + /// public static LinearPowerDensity GigawattsPerMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static LinearPowerDensity GigawattsPerMeter(this T value) #endif => LinearPowerDensity.FromGigawattsPerMeter(Convert.ToDouble(value)); - /// + /// public static LinearPowerDensity GigawattsPerMillimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -72,7 +72,7 @@ public static LinearPowerDensity GigawattsPerMillimeter(this T value) #endif => LinearPowerDensity.FromGigawattsPerMillimeter(Convert.ToDouble(value)); - /// + /// public static LinearPowerDensity KilowattsPerCentimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -80,7 +80,7 @@ public static LinearPowerDensity KilowattsPerCentimeter(this T value) #endif => LinearPowerDensity.FromKilowattsPerCentimeter(Convert.ToDouble(value)); - /// + /// public static LinearPowerDensity KilowattsPerFoot(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -88,7 +88,7 @@ public static LinearPowerDensity KilowattsPerFoot(this T value) #endif => LinearPowerDensity.FromKilowattsPerFoot(Convert.ToDouble(value)); - /// + /// public static LinearPowerDensity KilowattsPerInch(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -96,7 +96,7 @@ public static LinearPowerDensity KilowattsPerInch(this T value) #endif => LinearPowerDensity.FromKilowattsPerInch(Convert.ToDouble(value)); - /// + /// public static LinearPowerDensity KilowattsPerMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -104,7 +104,7 @@ public static LinearPowerDensity KilowattsPerMeter(this T value) #endif => LinearPowerDensity.FromKilowattsPerMeter(Convert.ToDouble(value)); - /// + /// public static LinearPowerDensity KilowattsPerMillimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -112,7 +112,7 @@ public static LinearPowerDensity KilowattsPerMillimeter(this T value) #endif => LinearPowerDensity.FromKilowattsPerMillimeter(Convert.ToDouble(value)); - /// + /// public static LinearPowerDensity MegawattsPerCentimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -120,7 +120,7 @@ public static LinearPowerDensity MegawattsPerCentimeter(this T value) #endif => LinearPowerDensity.FromMegawattsPerCentimeter(Convert.ToDouble(value)); - /// + /// public static LinearPowerDensity MegawattsPerFoot(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -128,7 +128,7 @@ public static LinearPowerDensity MegawattsPerFoot(this T value) #endif => LinearPowerDensity.FromMegawattsPerFoot(Convert.ToDouble(value)); - /// + /// public static LinearPowerDensity MegawattsPerInch(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -136,7 +136,7 @@ public static LinearPowerDensity MegawattsPerInch(this T value) #endif => LinearPowerDensity.FromMegawattsPerInch(Convert.ToDouble(value)); - /// + /// public static LinearPowerDensity MegawattsPerMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -144,7 +144,7 @@ public static LinearPowerDensity MegawattsPerMeter(this T value) #endif => LinearPowerDensity.FromMegawattsPerMeter(Convert.ToDouble(value)); - /// + /// public static LinearPowerDensity MegawattsPerMillimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -152,7 +152,7 @@ public static LinearPowerDensity MegawattsPerMillimeter(this T value) #endif => LinearPowerDensity.FromMegawattsPerMillimeter(Convert.ToDouble(value)); - /// + /// public static LinearPowerDensity MilliwattsPerCentimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -160,7 +160,7 @@ public static LinearPowerDensity MilliwattsPerCentimeter(this T value) #endif => LinearPowerDensity.FromMilliwattsPerCentimeter(Convert.ToDouble(value)); - /// + /// public static LinearPowerDensity MilliwattsPerFoot(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -168,7 +168,7 @@ public static LinearPowerDensity MilliwattsPerFoot(this T value) #endif => LinearPowerDensity.FromMilliwattsPerFoot(Convert.ToDouble(value)); - /// + /// public static LinearPowerDensity MilliwattsPerInch(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -176,7 +176,7 @@ public static LinearPowerDensity MilliwattsPerInch(this T value) #endif => LinearPowerDensity.FromMilliwattsPerInch(Convert.ToDouble(value)); - /// + /// public static LinearPowerDensity MilliwattsPerMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -184,7 +184,7 @@ public static LinearPowerDensity MilliwattsPerMeter(this T value) #endif => LinearPowerDensity.FromMilliwattsPerMeter(Convert.ToDouble(value)); - /// + /// public static LinearPowerDensity MilliwattsPerMillimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -192,7 +192,7 @@ public static LinearPowerDensity MilliwattsPerMillimeter(this T value) #endif => LinearPowerDensity.FromMilliwattsPerMillimeter(Convert.ToDouble(value)); - /// + /// public static LinearPowerDensity WattsPerCentimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -200,7 +200,7 @@ public static LinearPowerDensity WattsPerCentimeter(this T value) #endif => LinearPowerDensity.FromWattsPerCentimeter(Convert.ToDouble(value)); - /// + /// public static LinearPowerDensity WattsPerFoot(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -208,7 +208,7 @@ public static LinearPowerDensity WattsPerFoot(this T value) #endif => LinearPowerDensity.FromWattsPerFoot(Convert.ToDouble(value)); - /// + /// public static LinearPowerDensity WattsPerInch(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -216,7 +216,7 @@ public static LinearPowerDensity WattsPerInch(this T value) #endif => LinearPowerDensity.FromWattsPerInch(Convert.ToDouble(value)); - /// + /// public static LinearPowerDensity WattsPerMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -224,7 +224,7 @@ public static LinearPowerDensity WattsPerMeter(this T value) #endif => LinearPowerDensity.FromWattsPerMeter(Convert.ToDouble(value)); - /// + /// public static LinearPowerDensity WattsPerMillimeter(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToLuminanceExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToLuminanceExtensions.g.cs index a76c6723f4..8a465149e9 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToLuminanceExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToLuminanceExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToLuminance /// public static class NumberToLuminanceExtensions { - /// + /// public static Luminance CandelasPerSquareFoot(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static Luminance CandelasPerSquareFoot(this T value) #endif => Luminance.FromCandelasPerSquareFoot(Convert.ToDouble(value)); - /// + /// public static Luminance CandelasPerSquareInch(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static Luminance CandelasPerSquareInch(this T value) #endif => Luminance.FromCandelasPerSquareInch(Convert.ToDouble(value)); - /// + /// public static Luminance CandelasPerSquareMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static Luminance CandelasPerSquareMeter(this T value) #endif => Luminance.FromCandelasPerSquareMeter(Convert.ToDouble(value)); - /// + /// public static Luminance CenticandelasPerSquareMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static Luminance CenticandelasPerSquareMeter(this T value) #endif => Luminance.FromCenticandelasPerSquareMeter(Convert.ToDouble(value)); - /// + /// public static Luminance DecicandelasPerSquareMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -72,7 +72,7 @@ public static Luminance DecicandelasPerSquareMeter(this T value) #endif => Luminance.FromDecicandelasPerSquareMeter(Convert.ToDouble(value)); - /// + /// public static Luminance KilocandelasPerSquareMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -80,7 +80,7 @@ public static Luminance KilocandelasPerSquareMeter(this T value) #endif => Luminance.FromKilocandelasPerSquareMeter(Convert.ToDouble(value)); - /// + /// public static Luminance MicrocandelasPerSquareMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -88,7 +88,7 @@ public static Luminance MicrocandelasPerSquareMeter(this T value) #endif => Luminance.FromMicrocandelasPerSquareMeter(Convert.ToDouble(value)); - /// + /// public static Luminance MillicandelasPerSquareMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -96,7 +96,7 @@ public static Luminance MillicandelasPerSquareMeter(this T value) #endif => Luminance.FromMillicandelasPerSquareMeter(Convert.ToDouble(value)); - /// + /// public static Luminance NanocandelasPerSquareMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -104,7 +104,7 @@ public static Luminance NanocandelasPerSquareMeter(this T value) #endif => Luminance.FromNanocandelasPerSquareMeter(Convert.ToDouble(value)); - /// + /// public static Luminance Nits(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToLuminosityExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToLuminosityExtensions.g.cs index 90f2813248..36b11e2995 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToLuminosityExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToLuminosityExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToLuminosity /// public static class NumberToLuminosityExtensions { - /// + /// public static Luminosity Decawatts(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static Luminosity Decawatts(this T value) #endif => Luminosity.FromDecawatts(Convert.ToDouble(value)); - /// + /// public static Luminosity Deciwatts(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static Luminosity Deciwatts(this T value) #endif => Luminosity.FromDeciwatts(Convert.ToDouble(value)); - /// + /// public static Luminosity Femtowatts(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static Luminosity Femtowatts(this T value) #endif => Luminosity.FromFemtowatts(Convert.ToDouble(value)); - /// + /// public static Luminosity Gigawatts(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static Luminosity Gigawatts(this T value) #endif => Luminosity.FromGigawatts(Convert.ToDouble(value)); - /// + /// public static Luminosity Kilowatts(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -72,7 +72,7 @@ public static Luminosity Kilowatts(this T value) #endif => Luminosity.FromKilowatts(Convert.ToDouble(value)); - /// + /// public static Luminosity Megawatts(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -80,7 +80,7 @@ public static Luminosity Megawatts(this T value) #endif => Luminosity.FromMegawatts(Convert.ToDouble(value)); - /// + /// public static Luminosity Microwatts(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -88,7 +88,7 @@ public static Luminosity Microwatts(this T value) #endif => Luminosity.FromMicrowatts(Convert.ToDouble(value)); - /// + /// public static Luminosity Milliwatts(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -96,7 +96,7 @@ public static Luminosity Milliwatts(this T value) #endif => Luminosity.FromMilliwatts(Convert.ToDouble(value)); - /// + /// public static Luminosity Nanowatts(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -104,7 +104,7 @@ public static Luminosity Nanowatts(this T value) #endif => Luminosity.FromNanowatts(Convert.ToDouble(value)); - /// + /// public static Luminosity Petawatts(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -112,7 +112,7 @@ public static Luminosity Petawatts(this T value) #endif => Luminosity.FromPetawatts(Convert.ToDouble(value)); - /// + /// public static Luminosity Picowatts(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -120,7 +120,7 @@ public static Luminosity Picowatts(this T value) #endif => Luminosity.FromPicowatts(Convert.ToDouble(value)); - /// + /// public static Luminosity SolarLuminosities(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -128,7 +128,7 @@ public static Luminosity SolarLuminosities(this T value) #endif => Luminosity.FromSolarLuminosities(Convert.ToDouble(value)); - /// + /// public static Luminosity Terawatts(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -136,7 +136,7 @@ public static Luminosity Terawatts(this T value) #endif => Luminosity.FromTerawatts(Convert.ToDouble(value)); - /// + /// public static Luminosity Watts(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToLuminousFluxExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToLuminousFluxExtensions.g.cs index a4f7ea6ae4..dd13f7f308 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToLuminousFluxExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToLuminousFluxExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToLuminousFlux /// public static class NumberToLuminousFluxExtensions { - /// + /// public static LuminousFlux Lumens(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToLuminousIntensityExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToLuminousIntensityExtensions.g.cs index 95d8ba6679..724e6f1f69 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToLuminousIntensityExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToLuminousIntensityExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToLuminousIntensity /// public static class NumberToLuminousIntensityExtensions { - /// + /// public static LuminousIntensity Candela(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToMagneticFieldExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToMagneticFieldExtensions.g.cs index ac4482003a..67043e22b6 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToMagneticFieldExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToMagneticFieldExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToMagneticField /// public static class NumberToMagneticFieldExtensions { - /// + /// public static MagneticField Gausses(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static MagneticField Gausses(this T value) #endif => MagneticField.FromGausses(Convert.ToDouble(value)); - /// + /// public static MagneticField Microteslas(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static MagneticField Microteslas(this T value) #endif => MagneticField.FromMicroteslas(Convert.ToDouble(value)); - /// + /// public static MagneticField Milligausses(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static MagneticField Milligausses(this T value) #endif => MagneticField.FromMilligausses(Convert.ToDouble(value)); - /// + /// public static MagneticField Milliteslas(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static MagneticField Milliteslas(this T value) #endif => MagneticField.FromMilliteslas(Convert.ToDouble(value)); - /// + /// public static MagneticField Nanoteslas(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -72,7 +72,7 @@ public static MagneticField Nanoteslas(this T value) #endif => MagneticField.FromNanoteslas(Convert.ToDouble(value)); - /// + /// public static MagneticField Teslas(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToMagneticFluxExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToMagneticFluxExtensions.g.cs index 266b22cd19..2c6e19b2b2 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToMagneticFluxExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToMagneticFluxExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToMagneticFlux /// public static class NumberToMagneticFluxExtensions { - /// + /// public static MagneticFlux Webers(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToMagnetizationExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToMagnetizationExtensions.g.cs index eed6e1c03c..114346ec96 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToMagnetizationExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToMagnetizationExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToMagnetization /// public static class NumberToMagnetizationExtensions { - /// + /// public static Magnetization AmperesPerMeter(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToMassConcentrationExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToMassConcentrationExtensions.g.cs index ea999dee49..6f8b73c46f 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToMassConcentrationExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToMassConcentrationExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToMassConcentration /// public static class NumberToMassConcentrationExtensions { - /// + /// public static MassConcentration CentigramsPerDeciliter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static MassConcentration CentigramsPerDeciliter(this T value) #endif => MassConcentration.FromCentigramsPerDeciliter(Convert.ToDouble(value)); - /// + /// public static MassConcentration CentigramsPerLiter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static MassConcentration CentigramsPerLiter(this T value) #endif => MassConcentration.FromCentigramsPerLiter(Convert.ToDouble(value)); - /// + /// public static MassConcentration CentigramsPerMicroliter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static MassConcentration CentigramsPerMicroliter(this T value) #endif => MassConcentration.FromCentigramsPerMicroliter(Convert.ToDouble(value)); - /// + /// public static MassConcentration CentigramsPerMilliliter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static MassConcentration CentigramsPerMilliliter(this T value) #endif => MassConcentration.FromCentigramsPerMilliliter(Convert.ToDouble(value)); - /// + /// public static MassConcentration DecigramsPerDeciliter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -72,7 +72,7 @@ public static MassConcentration DecigramsPerDeciliter(this T value) #endif => MassConcentration.FromDecigramsPerDeciliter(Convert.ToDouble(value)); - /// + /// public static MassConcentration DecigramsPerLiter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -80,7 +80,7 @@ public static MassConcentration DecigramsPerLiter(this T value) #endif => MassConcentration.FromDecigramsPerLiter(Convert.ToDouble(value)); - /// + /// public static MassConcentration DecigramsPerMicroliter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -88,7 +88,7 @@ public static MassConcentration DecigramsPerMicroliter(this T value) #endif => MassConcentration.FromDecigramsPerMicroliter(Convert.ToDouble(value)); - /// + /// public static MassConcentration DecigramsPerMilliliter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -96,7 +96,7 @@ public static MassConcentration DecigramsPerMilliliter(this T value) #endif => MassConcentration.FromDecigramsPerMilliliter(Convert.ToDouble(value)); - /// + /// public static MassConcentration GramsPerCubicCentimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -104,7 +104,7 @@ public static MassConcentration GramsPerCubicCentimeter(this T value) #endif => MassConcentration.FromGramsPerCubicCentimeter(Convert.ToDouble(value)); - /// + /// public static MassConcentration GramsPerCubicMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -112,7 +112,7 @@ public static MassConcentration GramsPerCubicMeter(this T value) #endif => MassConcentration.FromGramsPerCubicMeter(Convert.ToDouble(value)); - /// + /// public static MassConcentration GramsPerCubicMillimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -120,7 +120,7 @@ public static MassConcentration GramsPerCubicMillimeter(this T value) #endif => MassConcentration.FromGramsPerCubicMillimeter(Convert.ToDouble(value)); - /// + /// public static MassConcentration GramsPerDeciliter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -128,7 +128,7 @@ public static MassConcentration GramsPerDeciliter(this T value) #endif => MassConcentration.FromGramsPerDeciliter(Convert.ToDouble(value)); - /// + /// public static MassConcentration GramsPerLiter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -136,7 +136,7 @@ public static MassConcentration GramsPerLiter(this T value) #endif => MassConcentration.FromGramsPerLiter(Convert.ToDouble(value)); - /// + /// public static MassConcentration GramsPerMicroliter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -144,7 +144,7 @@ public static MassConcentration GramsPerMicroliter(this T value) #endif => MassConcentration.FromGramsPerMicroliter(Convert.ToDouble(value)); - /// + /// public static MassConcentration GramsPerMilliliter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -152,7 +152,7 @@ public static MassConcentration GramsPerMilliliter(this T value) #endif => MassConcentration.FromGramsPerMilliliter(Convert.ToDouble(value)); - /// + /// public static MassConcentration KilogramsPerCubicCentimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -160,7 +160,7 @@ public static MassConcentration KilogramsPerCubicCentimeter(this T value) #endif => MassConcentration.FromKilogramsPerCubicCentimeter(Convert.ToDouble(value)); - /// + /// public static MassConcentration KilogramsPerCubicMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -168,7 +168,7 @@ public static MassConcentration KilogramsPerCubicMeter(this T value) #endif => MassConcentration.FromKilogramsPerCubicMeter(Convert.ToDouble(value)); - /// + /// public static MassConcentration KilogramsPerCubicMillimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -176,7 +176,7 @@ public static MassConcentration KilogramsPerCubicMillimeter(this T value) #endif => MassConcentration.FromKilogramsPerCubicMillimeter(Convert.ToDouble(value)); - /// + /// public static MassConcentration KilogramsPerLiter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -184,7 +184,7 @@ public static MassConcentration KilogramsPerLiter(this T value) #endif => MassConcentration.FromKilogramsPerLiter(Convert.ToDouble(value)); - /// + /// public static MassConcentration KilopoundsPerCubicFoot(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -192,7 +192,7 @@ public static MassConcentration KilopoundsPerCubicFoot(this T value) #endif => MassConcentration.FromKilopoundsPerCubicFoot(Convert.ToDouble(value)); - /// + /// public static MassConcentration KilopoundsPerCubicInch(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -200,7 +200,7 @@ public static MassConcentration KilopoundsPerCubicInch(this T value) #endif => MassConcentration.FromKilopoundsPerCubicInch(Convert.ToDouble(value)); - /// + /// public static MassConcentration MicrogramsPerCubicMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -208,7 +208,7 @@ public static MassConcentration MicrogramsPerCubicMeter(this T value) #endif => MassConcentration.FromMicrogramsPerCubicMeter(Convert.ToDouble(value)); - /// + /// public static MassConcentration MicrogramsPerDeciliter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -216,7 +216,7 @@ public static MassConcentration MicrogramsPerDeciliter(this T value) #endif => MassConcentration.FromMicrogramsPerDeciliter(Convert.ToDouble(value)); - /// + /// public static MassConcentration MicrogramsPerLiter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -224,7 +224,7 @@ public static MassConcentration MicrogramsPerLiter(this T value) #endif => MassConcentration.FromMicrogramsPerLiter(Convert.ToDouble(value)); - /// + /// public static MassConcentration MicrogramsPerMicroliter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -232,7 +232,7 @@ public static MassConcentration MicrogramsPerMicroliter(this T value) #endif => MassConcentration.FromMicrogramsPerMicroliter(Convert.ToDouble(value)); - /// + /// public static MassConcentration MicrogramsPerMilliliter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -240,7 +240,7 @@ public static MassConcentration MicrogramsPerMilliliter(this T value) #endif => MassConcentration.FromMicrogramsPerMilliliter(Convert.ToDouble(value)); - /// + /// public static MassConcentration MilligramsPerCubicMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -248,7 +248,7 @@ public static MassConcentration MilligramsPerCubicMeter(this T value) #endif => MassConcentration.FromMilligramsPerCubicMeter(Convert.ToDouble(value)); - /// + /// public static MassConcentration MilligramsPerDeciliter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -256,7 +256,7 @@ public static MassConcentration MilligramsPerDeciliter(this T value) #endif => MassConcentration.FromMilligramsPerDeciliter(Convert.ToDouble(value)); - /// + /// public static MassConcentration MilligramsPerLiter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -264,7 +264,7 @@ public static MassConcentration MilligramsPerLiter(this T value) #endif => MassConcentration.FromMilligramsPerLiter(Convert.ToDouble(value)); - /// + /// public static MassConcentration MilligramsPerMicroliter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -272,7 +272,7 @@ public static MassConcentration MilligramsPerMicroliter(this T value) #endif => MassConcentration.FromMilligramsPerMicroliter(Convert.ToDouble(value)); - /// + /// public static MassConcentration MilligramsPerMilliliter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -280,7 +280,7 @@ public static MassConcentration MilligramsPerMilliliter(this T value) #endif => MassConcentration.FromMilligramsPerMilliliter(Convert.ToDouble(value)); - /// + /// public static MassConcentration NanogramsPerDeciliter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -288,7 +288,7 @@ public static MassConcentration NanogramsPerDeciliter(this T value) #endif => MassConcentration.FromNanogramsPerDeciliter(Convert.ToDouble(value)); - /// + /// public static MassConcentration NanogramsPerLiter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -296,7 +296,7 @@ public static MassConcentration NanogramsPerLiter(this T value) #endif => MassConcentration.FromNanogramsPerLiter(Convert.ToDouble(value)); - /// + /// public static MassConcentration NanogramsPerMicroliter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -304,7 +304,7 @@ public static MassConcentration NanogramsPerMicroliter(this T value) #endif => MassConcentration.FromNanogramsPerMicroliter(Convert.ToDouble(value)); - /// + /// public static MassConcentration NanogramsPerMilliliter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -312,7 +312,7 @@ public static MassConcentration NanogramsPerMilliliter(this T value) #endif => MassConcentration.FromNanogramsPerMilliliter(Convert.ToDouble(value)); - /// + /// public static MassConcentration OuncesPerImperialGallon(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -320,7 +320,7 @@ public static MassConcentration OuncesPerImperialGallon(this T value) #endif => MassConcentration.FromOuncesPerImperialGallon(Convert.ToDouble(value)); - /// + /// public static MassConcentration OuncesPerUSGallon(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -328,7 +328,7 @@ public static MassConcentration OuncesPerUSGallon(this T value) #endif => MassConcentration.FromOuncesPerUSGallon(Convert.ToDouble(value)); - /// + /// public static MassConcentration PicogramsPerDeciliter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -336,7 +336,7 @@ public static MassConcentration PicogramsPerDeciliter(this T value) #endif => MassConcentration.FromPicogramsPerDeciliter(Convert.ToDouble(value)); - /// + /// public static MassConcentration PicogramsPerLiter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -344,7 +344,7 @@ public static MassConcentration PicogramsPerLiter(this T value) #endif => MassConcentration.FromPicogramsPerLiter(Convert.ToDouble(value)); - /// + /// public static MassConcentration PicogramsPerMicroliter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -352,7 +352,7 @@ public static MassConcentration PicogramsPerMicroliter(this T value) #endif => MassConcentration.FromPicogramsPerMicroliter(Convert.ToDouble(value)); - /// + /// public static MassConcentration PicogramsPerMilliliter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -360,7 +360,7 @@ public static MassConcentration PicogramsPerMilliliter(this T value) #endif => MassConcentration.FromPicogramsPerMilliliter(Convert.ToDouble(value)); - /// + /// public static MassConcentration PoundsPerCubicFoot(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -368,7 +368,7 @@ public static MassConcentration PoundsPerCubicFoot(this T value) #endif => MassConcentration.FromPoundsPerCubicFoot(Convert.ToDouble(value)); - /// + /// public static MassConcentration PoundsPerCubicInch(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -376,7 +376,7 @@ public static MassConcentration PoundsPerCubicInch(this T value) #endif => MassConcentration.FromPoundsPerCubicInch(Convert.ToDouble(value)); - /// + /// public static MassConcentration PoundsPerImperialGallon(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -384,7 +384,7 @@ public static MassConcentration PoundsPerImperialGallon(this T value) #endif => MassConcentration.FromPoundsPerImperialGallon(Convert.ToDouble(value)); - /// + /// public static MassConcentration PoundsPerUSGallon(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -392,7 +392,7 @@ public static MassConcentration PoundsPerUSGallon(this T value) #endif => MassConcentration.FromPoundsPerUSGallon(Convert.ToDouble(value)); - /// + /// public static MassConcentration SlugsPerCubicFoot(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -400,7 +400,7 @@ public static MassConcentration SlugsPerCubicFoot(this T value) #endif => MassConcentration.FromSlugsPerCubicFoot(Convert.ToDouble(value)); - /// + /// public static MassConcentration TonnesPerCubicCentimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -408,7 +408,7 @@ public static MassConcentration TonnesPerCubicCentimeter(this T value) #endif => MassConcentration.FromTonnesPerCubicCentimeter(Convert.ToDouble(value)); - /// + /// public static MassConcentration TonnesPerCubicMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -416,7 +416,7 @@ public static MassConcentration TonnesPerCubicMeter(this T value) #endif => MassConcentration.FromTonnesPerCubicMeter(Convert.ToDouble(value)); - /// + /// public static MassConcentration TonnesPerCubicMillimeter(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToMassExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToMassExtensions.g.cs index ebad988d59..f170ad547f 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToMassExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToMassExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToMass /// public static class NumberToMassExtensions { - /// + /// public static Mass Centigrams(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static Mass Centigrams(this T value) #endif => Mass.FromCentigrams(Convert.ToDouble(value)); - /// + /// public static Mass Decagrams(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static Mass Decagrams(this T value) #endif => Mass.FromDecagrams(Convert.ToDouble(value)); - /// + /// public static Mass Decigrams(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static Mass Decigrams(this T value) #endif => Mass.FromDecigrams(Convert.ToDouble(value)); - /// + /// public static Mass EarthMasses(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static Mass EarthMasses(this T value) #endif => Mass.FromEarthMasses(Convert.ToDouble(value)); - /// + /// public static Mass Femtograms(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -72,7 +72,7 @@ public static Mass Femtograms(this T value) #endif => Mass.FromFemtograms(Convert.ToDouble(value)); - /// + /// public static Mass Grains(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -80,7 +80,7 @@ public static Mass Grains(this T value) #endif => Mass.FromGrains(Convert.ToDouble(value)); - /// + /// public static Mass Grams(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -88,7 +88,7 @@ public static Mass Grams(this T value) #endif => Mass.FromGrams(Convert.ToDouble(value)); - /// + /// public static Mass Hectograms(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -96,7 +96,7 @@ public static Mass Hectograms(this T value) #endif => Mass.FromHectograms(Convert.ToDouble(value)); - /// + /// public static Mass Kilograms(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -104,7 +104,7 @@ public static Mass Kilograms(this T value) #endif => Mass.FromKilograms(Convert.ToDouble(value)); - /// + /// public static Mass Kilopounds(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -112,7 +112,7 @@ public static Mass Kilopounds(this T value) #endif => Mass.FromKilopounds(Convert.ToDouble(value)); - /// + /// public static Mass Kilotonnes(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -120,7 +120,7 @@ public static Mass Kilotonnes(this T value) #endif => Mass.FromKilotonnes(Convert.ToDouble(value)); - /// + /// public static Mass LongHundredweight(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -128,7 +128,7 @@ public static Mass LongHundredweight(this T value) #endif => Mass.FromLongHundredweight(Convert.ToDouble(value)); - /// + /// public static Mass LongTons(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -136,7 +136,7 @@ public static Mass LongTons(this T value) #endif => Mass.FromLongTons(Convert.ToDouble(value)); - /// + /// public static Mass Megapounds(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -144,7 +144,7 @@ public static Mass Megapounds(this T value) #endif => Mass.FromMegapounds(Convert.ToDouble(value)); - /// + /// public static Mass Megatonnes(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -152,7 +152,7 @@ public static Mass Megatonnes(this T value) #endif => Mass.FromMegatonnes(Convert.ToDouble(value)); - /// + /// public static Mass Micrograms(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -160,7 +160,7 @@ public static Mass Micrograms(this T value) #endif => Mass.FromMicrograms(Convert.ToDouble(value)); - /// + /// public static Mass Milligrams(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -168,7 +168,7 @@ public static Mass Milligrams(this T value) #endif => Mass.FromMilligrams(Convert.ToDouble(value)); - /// + /// public static Mass Nanograms(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -176,7 +176,7 @@ public static Mass Nanograms(this T value) #endif => Mass.FromNanograms(Convert.ToDouble(value)); - /// + /// public static Mass Ounces(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -184,7 +184,7 @@ public static Mass Ounces(this T value) #endif => Mass.FromOunces(Convert.ToDouble(value)); - /// + /// public static Mass Picograms(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -192,7 +192,7 @@ public static Mass Picograms(this T value) #endif => Mass.FromPicograms(Convert.ToDouble(value)); - /// + /// public static Mass Pounds(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -200,7 +200,7 @@ public static Mass Pounds(this T value) #endif => Mass.FromPounds(Convert.ToDouble(value)); - /// + /// public static Mass ShortHundredweight(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -208,7 +208,7 @@ public static Mass ShortHundredweight(this T value) #endif => Mass.FromShortHundredweight(Convert.ToDouble(value)); - /// + /// public static Mass ShortTons(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -216,7 +216,7 @@ public static Mass ShortTons(this T value) #endif => Mass.FromShortTons(Convert.ToDouble(value)); - /// + /// public static Mass Slugs(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -224,7 +224,7 @@ public static Mass Slugs(this T value) #endif => Mass.FromSlugs(Convert.ToDouble(value)); - /// + /// public static Mass SolarMasses(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -232,7 +232,7 @@ public static Mass SolarMasses(this T value) #endif => Mass.FromSolarMasses(Convert.ToDouble(value)); - /// + /// public static Mass Stone(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -240,7 +240,7 @@ public static Mass Stone(this T value) #endif => Mass.FromStone(Convert.ToDouble(value)); - /// + /// public static Mass Tonnes(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToMassFlowExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToMassFlowExtensions.g.cs index e7678f0598..3f75371a85 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToMassFlowExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToMassFlowExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToMassFlow /// public static class NumberToMassFlowExtensions { - /// + /// public static MassFlow CentigramsPerDay(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static MassFlow CentigramsPerDay(this T value) #endif => MassFlow.FromCentigramsPerDay(Convert.ToDouble(value)); - /// + /// public static MassFlow CentigramsPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static MassFlow CentigramsPerSecond(this T value) #endif => MassFlow.FromCentigramsPerSecond(Convert.ToDouble(value)); - /// + /// public static MassFlow DecagramsPerDay(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static MassFlow DecagramsPerDay(this T value) #endif => MassFlow.FromDecagramsPerDay(Convert.ToDouble(value)); - /// + /// public static MassFlow DecagramsPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static MassFlow DecagramsPerSecond(this T value) #endif => MassFlow.FromDecagramsPerSecond(Convert.ToDouble(value)); - /// + /// public static MassFlow DecigramsPerDay(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -72,7 +72,7 @@ public static MassFlow DecigramsPerDay(this T value) #endif => MassFlow.FromDecigramsPerDay(Convert.ToDouble(value)); - /// + /// public static MassFlow DecigramsPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -80,7 +80,7 @@ public static MassFlow DecigramsPerSecond(this T value) #endif => MassFlow.FromDecigramsPerSecond(Convert.ToDouble(value)); - /// + /// public static MassFlow GramsPerDay(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -88,7 +88,7 @@ public static MassFlow GramsPerDay(this T value) #endif => MassFlow.FromGramsPerDay(Convert.ToDouble(value)); - /// + /// public static MassFlow GramsPerHour(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -96,7 +96,7 @@ public static MassFlow GramsPerHour(this T value) #endif => MassFlow.FromGramsPerHour(Convert.ToDouble(value)); - /// + /// public static MassFlow GramsPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -104,7 +104,7 @@ public static MassFlow GramsPerSecond(this T value) #endif => MassFlow.FromGramsPerSecond(Convert.ToDouble(value)); - /// + /// public static MassFlow HectogramsPerDay(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -112,7 +112,7 @@ public static MassFlow HectogramsPerDay(this T value) #endif => MassFlow.FromHectogramsPerDay(Convert.ToDouble(value)); - /// + /// public static MassFlow HectogramsPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -120,7 +120,7 @@ public static MassFlow HectogramsPerSecond(this T value) #endif => MassFlow.FromHectogramsPerSecond(Convert.ToDouble(value)); - /// + /// public static MassFlow KilogramsPerDay(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -128,7 +128,7 @@ public static MassFlow KilogramsPerDay(this T value) #endif => MassFlow.FromKilogramsPerDay(Convert.ToDouble(value)); - /// + /// public static MassFlow KilogramsPerHour(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -136,7 +136,7 @@ public static MassFlow KilogramsPerHour(this T value) #endif => MassFlow.FromKilogramsPerHour(Convert.ToDouble(value)); - /// + /// public static MassFlow KilogramsPerMinute(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -144,7 +144,7 @@ public static MassFlow KilogramsPerMinute(this T value) #endif => MassFlow.FromKilogramsPerMinute(Convert.ToDouble(value)); - /// + /// public static MassFlow KilogramsPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -152,7 +152,7 @@ public static MassFlow KilogramsPerSecond(this T value) #endif => MassFlow.FromKilogramsPerSecond(Convert.ToDouble(value)); - /// + /// public static MassFlow MegagramsPerDay(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -160,7 +160,7 @@ public static MassFlow MegagramsPerDay(this T value) #endif => MassFlow.FromMegagramsPerDay(Convert.ToDouble(value)); - /// + /// public static MassFlow MegapoundsPerDay(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -168,7 +168,7 @@ public static MassFlow MegapoundsPerDay(this T value) #endif => MassFlow.FromMegapoundsPerDay(Convert.ToDouble(value)); - /// + /// public static MassFlow MegapoundsPerHour(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -176,7 +176,7 @@ public static MassFlow MegapoundsPerHour(this T value) #endif => MassFlow.FromMegapoundsPerHour(Convert.ToDouble(value)); - /// + /// public static MassFlow MegapoundsPerMinute(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -184,7 +184,7 @@ public static MassFlow MegapoundsPerMinute(this T value) #endif => MassFlow.FromMegapoundsPerMinute(Convert.ToDouble(value)); - /// + /// public static MassFlow MegapoundsPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -192,7 +192,7 @@ public static MassFlow MegapoundsPerSecond(this T value) #endif => MassFlow.FromMegapoundsPerSecond(Convert.ToDouble(value)); - /// + /// public static MassFlow MicrogramsPerDay(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -200,7 +200,7 @@ public static MassFlow MicrogramsPerDay(this T value) #endif => MassFlow.FromMicrogramsPerDay(Convert.ToDouble(value)); - /// + /// public static MassFlow MicrogramsPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -208,7 +208,7 @@ public static MassFlow MicrogramsPerSecond(this T value) #endif => MassFlow.FromMicrogramsPerSecond(Convert.ToDouble(value)); - /// + /// public static MassFlow MilligramsPerDay(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -216,7 +216,7 @@ public static MassFlow MilligramsPerDay(this T value) #endif => MassFlow.FromMilligramsPerDay(Convert.ToDouble(value)); - /// + /// public static MassFlow MilligramsPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -224,7 +224,7 @@ public static MassFlow MilligramsPerSecond(this T value) #endif => MassFlow.FromMilligramsPerSecond(Convert.ToDouble(value)); - /// + /// public static MassFlow NanogramsPerDay(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -232,7 +232,7 @@ public static MassFlow NanogramsPerDay(this T value) #endif => MassFlow.FromNanogramsPerDay(Convert.ToDouble(value)); - /// + /// public static MassFlow NanogramsPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -240,7 +240,7 @@ public static MassFlow NanogramsPerSecond(this T value) #endif => MassFlow.FromNanogramsPerSecond(Convert.ToDouble(value)); - /// + /// public static MassFlow PoundsPerDay(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -248,7 +248,7 @@ public static MassFlow PoundsPerDay(this T value) #endif => MassFlow.FromPoundsPerDay(Convert.ToDouble(value)); - /// + /// public static MassFlow PoundsPerHour(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -256,7 +256,7 @@ public static MassFlow PoundsPerHour(this T value) #endif => MassFlow.FromPoundsPerHour(Convert.ToDouble(value)); - /// + /// public static MassFlow PoundsPerMinute(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -264,7 +264,7 @@ public static MassFlow PoundsPerMinute(this T value) #endif => MassFlow.FromPoundsPerMinute(Convert.ToDouble(value)); - /// + /// public static MassFlow PoundsPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -272,7 +272,7 @@ public static MassFlow PoundsPerSecond(this T value) #endif => MassFlow.FromPoundsPerSecond(Convert.ToDouble(value)); - /// + /// public static MassFlow ShortTonsPerHour(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -280,7 +280,7 @@ public static MassFlow ShortTonsPerHour(this T value) #endif => MassFlow.FromShortTonsPerHour(Convert.ToDouble(value)); - /// + /// public static MassFlow TonnesPerDay(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -288,7 +288,7 @@ public static MassFlow TonnesPerDay(this T value) #endif => MassFlow.FromTonnesPerDay(Convert.ToDouble(value)); - /// + /// public static MassFlow TonnesPerHour(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToMassFluxExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToMassFluxExtensions.g.cs index bde8e8d1d9..2e8c63df81 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToMassFluxExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToMassFluxExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToMassFlux /// public static class NumberToMassFluxExtensions { - /// + /// public static MassFlux GramsPerHourPerSquareCentimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static MassFlux GramsPerHourPerSquareCentimeter(this T value) #endif => MassFlux.FromGramsPerHourPerSquareCentimeter(Convert.ToDouble(value)); - /// + /// public static MassFlux GramsPerHourPerSquareMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static MassFlux GramsPerHourPerSquareMeter(this T value) #endif => MassFlux.FromGramsPerHourPerSquareMeter(Convert.ToDouble(value)); - /// + /// public static MassFlux GramsPerHourPerSquareMillimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static MassFlux GramsPerHourPerSquareMillimeter(this T value) #endif => MassFlux.FromGramsPerHourPerSquareMillimeter(Convert.ToDouble(value)); - /// + /// public static MassFlux GramsPerSecondPerSquareCentimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static MassFlux GramsPerSecondPerSquareCentimeter(this T value) #endif => MassFlux.FromGramsPerSecondPerSquareCentimeter(Convert.ToDouble(value)); - /// + /// public static MassFlux GramsPerSecondPerSquareMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -72,7 +72,7 @@ public static MassFlux GramsPerSecondPerSquareMeter(this T value) #endif => MassFlux.FromGramsPerSecondPerSquareMeter(Convert.ToDouble(value)); - /// + /// public static MassFlux GramsPerSecondPerSquareMillimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -80,7 +80,7 @@ public static MassFlux GramsPerSecondPerSquareMillimeter(this T value) #endif => MassFlux.FromGramsPerSecondPerSquareMillimeter(Convert.ToDouble(value)); - /// + /// public static MassFlux KilogramsPerHourPerSquareCentimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -88,7 +88,7 @@ public static MassFlux KilogramsPerHourPerSquareCentimeter(this T value) #endif => MassFlux.FromKilogramsPerHourPerSquareCentimeter(Convert.ToDouble(value)); - /// + /// public static MassFlux KilogramsPerHourPerSquareMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -96,7 +96,7 @@ public static MassFlux KilogramsPerHourPerSquareMeter(this T value) #endif => MassFlux.FromKilogramsPerHourPerSquareMeter(Convert.ToDouble(value)); - /// + /// public static MassFlux KilogramsPerHourPerSquareMillimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -104,7 +104,7 @@ public static MassFlux KilogramsPerHourPerSquareMillimeter(this T value) #endif => MassFlux.FromKilogramsPerHourPerSquareMillimeter(Convert.ToDouble(value)); - /// + /// public static MassFlux KilogramsPerSecondPerSquareCentimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -112,7 +112,7 @@ public static MassFlux KilogramsPerSecondPerSquareCentimeter(this T value) #endif => MassFlux.FromKilogramsPerSecondPerSquareCentimeter(Convert.ToDouble(value)); - /// + /// public static MassFlux KilogramsPerSecondPerSquareMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -120,7 +120,7 @@ public static MassFlux KilogramsPerSecondPerSquareMeter(this T value) #endif => MassFlux.FromKilogramsPerSecondPerSquareMeter(Convert.ToDouble(value)); - /// + /// public static MassFlux KilogramsPerSecondPerSquareMillimeter(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToMassFractionExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToMassFractionExtensions.g.cs index 2e63ff2006..6f499b2090 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToMassFractionExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToMassFractionExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToMassFraction /// public static class NumberToMassFractionExtensions { - /// + /// public static MassFraction CentigramsPerGram(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static MassFraction CentigramsPerGram(this T value) #endif => MassFraction.FromCentigramsPerGram(Convert.ToDouble(value)); - /// + /// public static MassFraction CentigramsPerKilogram(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static MassFraction CentigramsPerKilogram(this T value) #endif => MassFraction.FromCentigramsPerKilogram(Convert.ToDouble(value)); - /// + /// public static MassFraction DecagramsPerGram(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static MassFraction DecagramsPerGram(this T value) #endif => MassFraction.FromDecagramsPerGram(Convert.ToDouble(value)); - /// + /// public static MassFraction DecagramsPerKilogram(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static MassFraction DecagramsPerKilogram(this T value) #endif => MassFraction.FromDecagramsPerKilogram(Convert.ToDouble(value)); - /// + /// public static MassFraction DecigramsPerGram(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -72,7 +72,7 @@ public static MassFraction DecigramsPerGram(this T value) #endif => MassFraction.FromDecigramsPerGram(Convert.ToDouble(value)); - /// + /// public static MassFraction DecigramsPerKilogram(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -80,7 +80,7 @@ public static MassFraction DecigramsPerKilogram(this T value) #endif => MassFraction.FromDecigramsPerKilogram(Convert.ToDouble(value)); - /// + /// public static MassFraction DecimalFractions(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -88,7 +88,7 @@ public static MassFraction DecimalFractions(this T value) #endif => MassFraction.FromDecimalFractions(Convert.ToDouble(value)); - /// + /// public static MassFraction GramsPerGram(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -96,7 +96,7 @@ public static MassFraction GramsPerGram(this T value) #endif => MassFraction.FromGramsPerGram(Convert.ToDouble(value)); - /// + /// public static MassFraction GramsPerKilogram(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -104,7 +104,7 @@ public static MassFraction GramsPerKilogram(this T value) #endif => MassFraction.FromGramsPerKilogram(Convert.ToDouble(value)); - /// + /// public static MassFraction HectogramsPerGram(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -112,7 +112,7 @@ public static MassFraction HectogramsPerGram(this T value) #endif => MassFraction.FromHectogramsPerGram(Convert.ToDouble(value)); - /// + /// public static MassFraction HectogramsPerKilogram(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -120,7 +120,7 @@ public static MassFraction HectogramsPerKilogram(this T value) #endif => MassFraction.FromHectogramsPerKilogram(Convert.ToDouble(value)); - /// + /// public static MassFraction KilogramsPerGram(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -128,7 +128,7 @@ public static MassFraction KilogramsPerGram(this T value) #endif => MassFraction.FromKilogramsPerGram(Convert.ToDouble(value)); - /// + /// public static MassFraction KilogramsPerKilogram(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -136,7 +136,7 @@ public static MassFraction KilogramsPerKilogram(this T value) #endif => MassFraction.FromKilogramsPerKilogram(Convert.ToDouble(value)); - /// + /// public static MassFraction MicrogramsPerGram(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -144,7 +144,7 @@ public static MassFraction MicrogramsPerGram(this T value) #endif => MassFraction.FromMicrogramsPerGram(Convert.ToDouble(value)); - /// + /// public static MassFraction MicrogramsPerKilogram(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -152,7 +152,7 @@ public static MassFraction MicrogramsPerKilogram(this T value) #endif => MassFraction.FromMicrogramsPerKilogram(Convert.ToDouble(value)); - /// + /// public static MassFraction MilligramsPerGram(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -160,7 +160,7 @@ public static MassFraction MilligramsPerGram(this T value) #endif => MassFraction.FromMilligramsPerGram(Convert.ToDouble(value)); - /// + /// public static MassFraction MilligramsPerKilogram(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -168,7 +168,7 @@ public static MassFraction MilligramsPerKilogram(this T value) #endif => MassFraction.FromMilligramsPerKilogram(Convert.ToDouble(value)); - /// + /// public static MassFraction NanogramsPerGram(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -176,7 +176,7 @@ public static MassFraction NanogramsPerGram(this T value) #endif => MassFraction.FromNanogramsPerGram(Convert.ToDouble(value)); - /// + /// public static MassFraction NanogramsPerKilogram(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -184,7 +184,7 @@ public static MassFraction NanogramsPerKilogram(this T value) #endif => MassFraction.FromNanogramsPerKilogram(Convert.ToDouble(value)); - /// + /// public static MassFraction PartsPerBillion(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -192,7 +192,7 @@ public static MassFraction PartsPerBillion(this T value) #endif => MassFraction.FromPartsPerBillion(Convert.ToDouble(value)); - /// + /// public static MassFraction PartsPerMillion(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -200,7 +200,7 @@ public static MassFraction PartsPerMillion(this T value) #endif => MassFraction.FromPartsPerMillion(Convert.ToDouble(value)); - /// + /// public static MassFraction PartsPerThousand(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -208,7 +208,7 @@ public static MassFraction PartsPerThousand(this T value) #endif => MassFraction.FromPartsPerThousand(Convert.ToDouble(value)); - /// + /// public static MassFraction PartsPerTrillion(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -216,7 +216,7 @@ public static MassFraction PartsPerTrillion(this T value) #endif => MassFraction.FromPartsPerTrillion(Convert.ToDouble(value)); - /// + /// public static MassFraction Percent(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToMassMomentOfInertiaExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToMassMomentOfInertiaExtensions.g.cs index 9f31d01532..1aae922769 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToMassMomentOfInertiaExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToMassMomentOfInertiaExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToMassMomentOfInertia /// public static class NumberToMassMomentOfInertiaExtensions { - /// + /// public static MassMomentOfInertia GramSquareCentimeters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static MassMomentOfInertia GramSquareCentimeters(this T value) #endif => MassMomentOfInertia.FromGramSquareCentimeters(Convert.ToDouble(value)); - /// + /// public static MassMomentOfInertia GramSquareDecimeters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static MassMomentOfInertia GramSquareDecimeters(this T value) #endif => MassMomentOfInertia.FromGramSquareDecimeters(Convert.ToDouble(value)); - /// + /// public static MassMomentOfInertia GramSquareMeters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static MassMomentOfInertia GramSquareMeters(this T value) #endif => MassMomentOfInertia.FromGramSquareMeters(Convert.ToDouble(value)); - /// + /// public static MassMomentOfInertia GramSquareMillimeters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static MassMomentOfInertia GramSquareMillimeters(this T value) #endif => MassMomentOfInertia.FromGramSquareMillimeters(Convert.ToDouble(value)); - /// + /// public static MassMomentOfInertia KilogramSquareCentimeters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -72,7 +72,7 @@ public static MassMomentOfInertia KilogramSquareCentimeters(this T value) #endif => MassMomentOfInertia.FromKilogramSquareCentimeters(Convert.ToDouble(value)); - /// + /// public static MassMomentOfInertia KilogramSquareDecimeters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -80,7 +80,7 @@ public static MassMomentOfInertia KilogramSquareDecimeters(this T value) #endif => MassMomentOfInertia.FromKilogramSquareDecimeters(Convert.ToDouble(value)); - /// + /// public static MassMomentOfInertia KilogramSquareMeters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -88,7 +88,7 @@ public static MassMomentOfInertia KilogramSquareMeters(this T value) #endif => MassMomentOfInertia.FromKilogramSquareMeters(Convert.ToDouble(value)); - /// + /// public static MassMomentOfInertia KilogramSquareMillimeters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -96,7 +96,7 @@ public static MassMomentOfInertia KilogramSquareMillimeters(this T value) #endif => MassMomentOfInertia.FromKilogramSquareMillimeters(Convert.ToDouble(value)); - /// + /// public static MassMomentOfInertia KilotonneSquareCentimeters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -104,7 +104,7 @@ public static MassMomentOfInertia KilotonneSquareCentimeters(this T value) #endif => MassMomentOfInertia.FromKilotonneSquareCentimeters(Convert.ToDouble(value)); - /// + /// public static MassMomentOfInertia KilotonneSquareDecimeters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -112,7 +112,7 @@ public static MassMomentOfInertia KilotonneSquareDecimeters(this T value) #endif => MassMomentOfInertia.FromKilotonneSquareDecimeters(Convert.ToDouble(value)); - /// + /// public static MassMomentOfInertia KilotonneSquareMeters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -120,7 +120,7 @@ public static MassMomentOfInertia KilotonneSquareMeters(this T value) #endif => MassMomentOfInertia.FromKilotonneSquareMeters(Convert.ToDouble(value)); - /// + /// public static MassMomentOfInertia KilotonneSquareMilimeters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -128,7 +128,7 @@ public static MassMomentOfInertia KilotonneSquareMilimeters(this T value) #endif => MassMomentOfInertia.FromKilotonneSquareMilimeters(Convert.ToDouble(value)); - /// + /// public static MassMomentOfInertia MegatonneSquareCentimeters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -136,7 +136,7 @@ public static MassMomentOfInertia MegatonneSquareCentimeters(this T value) #endif => MassMomentOfInertia.FromMegatonneSquareCentimeters(Convert.ToDouble(value)); - /// + /// public static MassMomentOfInertia MegatonneSquareDecimeters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -144,7 +144,7 @@ public static MassMomentOfInertia MegatonneSquareDecimeters(this T value) #endif => MassMomentOfInertia.FromMegatonneSquareDecimeters(Convert.ToDouble(value)); - /// + /// public static MassMomentOfInertia MegatonneSquareMeters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -152,7 +152,7 @@ public static MassMomentOfInertia MegatonneSquareMeters(this T value) #endif => MassMomentOfInertia.FromMegatonneSquareMeters(Convert.ToDouble(value)); - /// + /// public static MassMomentOfInertia MegatonneSquareMilimeters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -160,7 +160,7 @@ public static MassMomentOfInertia MegatonneSquareMilimeters(this T value) #endif => MassMomentOfInertia.FromMegatonneSquareMilimeters(Convert.ToDouble(value)); - /// + /// public static MassMomentOfInertia MilligramSquareCentimeters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -168,7 +168,7 @@ public static MassMomentOfInertia MilligramSquareCentimeters(this T value) #endif => MassMomentOfInertia.FromMilligramSquareCentimeters(Convert.ToDouble(value)); - /// + /// public static MassMomentOfInertia MilligramSquareDecimeters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -176,7 +176,7 @@ public static MassMomentOfInertia MilligramSquareDecimeters(this T value) #endif => MassMomentOfInertia.FromMilligramSquareDecimeters(Convert.ToDouble(value)); - /// + /// public static MassMomentOfInertia MilligramSquareMeters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -184,7 +184,7 @@ public static MassMomentOfInertia MilligramSquareMeters(this T value) #endif => MassMomentOfInertia.FromMilligramSquareMeters(Convert.ToDouble(value)); - /// + /// public static MassMomentOfInertia MilligramSquareMillimeters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -192,7 +192,7 @@ public static MassMomentOfInertia MilligramSquareMillimeters(this T value) #endif => MassMomentOfInertia.FromMilligramSquareMillimeters(Convert.ToDouble(value)); - /// + /// public static MassMomentOfInertia PoundSquareFeet(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -200,7 +200,7 @@ public static MassMomentOfInertia PoundSquareFeet(this T value) #endif => MassMomentOfInertia.FromPoundSquareFeet(Convert.ToDouble(value)); - /// + /// public static MassMomentOfInertia PoundSquareInches(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -208,7 +208,7 @@ public static MassMomentOfInertia PoundSquareInches(this T value) #endif => MassMomentOfInertia.FromPoundSquareInches(Convert.ToDouble(value)); - /// + /// public static MassMomentOfInertia SlugSquareFeet(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -216,7 +216,7 @@ public static MassMomentOfInertia SlugSquareFeet(this T value) #endif => MassMomentOfInertia.FromSlugSquareFeet(Convert.ToDouble(value)); - /// + /// public static MassMomentOfInertia SlugSquareInches(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -224,7 +224,7 @@ public static MassMomentOfInertia SlugSquareInches(this T value) #endif => MassMomentOfInertia.FromSlugSquareInches(Convert.ToDouble(value)); - /// + /// public static MassMomentOfInertia TonneSquareCentimeters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -232,7 +232,7 @@ public static MassMomentOfInertia TonneSquareCentimeters(this T value) #endif => MassMomentOfInertia.FromTonneSquareCentimeters(Convert.ToDouble(value)); - /// + /// public static MassMomentOfInertia TonneSquareDecimeters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -240,7 +240,7 @@ public static MassMomentOfInertia TonneSquareDecimeters(this T value) #endif => MassMomentOfInertia.FromTonneSquareDecimeters(Convert.ToDouble(value)); - /// + /// public static MassMomentOfInertia TonneSquareMeters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -248,7 +248,7 @@ public static MassMomentOfInertia TonneSquareMeters(this T value) #endif => MassMomentOfInertia.FromTonneSquareMeters(Convert.ToDouble(value)); - /// + /// public static MassMomentOfInertia TonneSquareMilimeters(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToMolalityExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToMolalityExtensions.g.cs index 5082f28861..ce9fd27d4a 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToMolalityExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToMolalityExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToMolality /// public static class NumberToMolalityExtensions { - /// + /// public static Molality MolesPerGram(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static Molality MolesPerGram(this T value) #endif => Molality.FromMolesPerGram(Convert.ToDouble(value)); - /// + /// public static Molality MolesPerKilogram(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToMolarEnergyExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToMolarEnergyExtensions.g.cs index fca5e9f60a..caf2e58733 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToMolarEnergyExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToMolarEnergyExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToMolarEnergy /// public static class NumberToMolarEnergyExtensions { - /// + /// public static MolarEnergy JoulesPerMole(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static MolarEnergy JoulesPerMole(this T value) #endif => MolarEnergy.FromJoulesPerMole(Convert.ToDouble(value)); - /// + /// public static MolarEnergy KilojoulesPerMole(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static MolarEnergy KilojoulesPerMole(this T value) #endif => MolarEnergy.FromKilojoulesPerMole(Convert.ToDouble(value)); - /// + /// public static MolarEnergy MegajoulesPerMole(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToMolarEntropyExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToMolarEntropyExtensions.g.cs index 19d7ed5549..27264a55b3 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToMolarEntropyExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToMolarEntropyExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToMolarEntropy /// public static class NumberToMolarEntropyExtensions { - /// + /// public static MolarEntropy JoulesPerMoleKelvin(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static MolarEntropy JoulesPerMoleKelvin(this T value) #endif => MolarEntropy.FromJoulesPerMoleKelvin(Convert.ToDouble(value)); - /// + /// public static MolarEntropy KilojoulesPerMoleKelvin(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static MolarEntropy KilojoulesPerMoleKelvin(this T value) #endif => MolarEntropy.FromKilojoulesPerMoleKelvin(Convert.ToDouble(value)); - /// + /// public static MolarEntropy MegajoulesPerMoleKelvin(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToMolarFlowExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToMolarFlowExtensions.g.cs index ec94516d59..0b2ab19d42 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToMolarFlowExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToMolarFlowExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToMolarFlow /// public static class NumberToMolarFlowExtensions { - /// + /// public static MolarFlow KilomolesPerHour(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static MolarFlow KilomolesPerHour(this T value) #endif => MolarFlow.FromKilomolesPerHour(Convert.ToDouble(value)); - /// + /// public static MolarFlow KilomolesPerMinute(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static MolarFlow KilomolesPerMinute(this T value) #endif => MolarFlow.FromKilomolesPerMinute(Convert.ToDouble(value)); - /// + /// public static MolarFlow KilomolesPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static MolarFlow KilomolesPerSecond(this T value) #endif => MolarFlow.FromKilomolesPerSecond(Convert.ToDouble(value)); - /// + /// public static MolarFlow MolesPerHour(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static MolarFlow MolesPerHour(this T value) #endif => MolarFlow.FromMolesPerHour(Convert.ToDouble(value)); - /// + /// public static MolarFlow MolesPerMinute(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -72,7 +72,7 @@ public static MolarFlow MolesPerMinute(this T value) #endif => MolarFlow.FromMolesPerMinute(Convert.ToDouble(value)); - /// + /// public static MolarFlow MolesPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -80,7 +80,7 @@ public static MolarFlow MolesPerSecond(this T value) #endif => MolarFlow.FromMolesPerSecond(Convert.ToDouble(value)); - /// + /// public static MolarFlow PoundMolesPerHour(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -88,7 +88,7 @@ public static MolarFlow PoundMolesPerHour(this T value) #endif => MolarFlow.FromPoundMolesPerHour(Convert.ToDouble(value)); - /// + /// public static MolarFlow PoundMolesPerMinute(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -96,7 +96,7 @@ public static MolarFlow PoundMolesPerMinute(this T value) #endif => MolarFlow.FromPoundMolesPerMinute(Convert.ToDouble(value)); - /// + /// public static MolarFlow PoundMolesPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToMolarMassExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToMolarMassExtensions.g.cs index 118a9eb220..42daf96a91 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToMolarMassExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToMolarMassExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToMolarMass /// public static class NumberToMolarMassExtensions { - /// + /// public static MolarMass CentigramsPerMole(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static MolarMass CentigramsPerMole(this T value) #endif => MolarMass.FromCentigramsPerMole(Convert.ToDouble(value)); - /// + /// public static MolarMass DecagramsPerMole(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static MolarMass DecagramsPerMole(this T value) #endif => MolarMass.FromDecagramsPerMole(Convert.ToDouble(value)); - /// + /// public static MolarMass DecigramsPerMole(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static MolarMass DecigramsPerMole(this T value) #endif => MolarMass.FromDecigramsPerMole(Convert.ToDouble(value)); - /// + /// public static MolarMass GramsPerMole(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static MolarMass GramsPerMole(this T value) #endif => MolarMass.FromGramsPerMole(Convert.ToDouble(value)); - /// + /// public static MolarMass HectogramsPerMole(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -72,7 +72,7 @@ public static MolarMass HectogramsPerMole(this T value) #endif => MolarMass.FromHectogramsPerMole(Convert.ToDouble(value)); - /// + /// public static MolarMass KilogramsPerKilomole(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -80,7 +80,7 @@ public static MolarMass KilogramsPerKilomole(this T value) #endif => MolarMass.FromKilogramsPerKilomole(Convert.ToDouble(value)); - /// + /// public static MolarMass KilogramsPerMole(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -88,7 +88,7 @@ public static MolarMass KilogramsPerMole(this T value) #endif => MolarMass.FromKilogramsPerMole(Convert.ToDouble(value)); - /// + /// public static MolarMass KilopoundsPerMole(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -96,7 +96,7 @@ public static MolarMass KilopoundsPerMole(this T value) #endif => MolarMass.FromKilopoundsPerMole(Convert.ToDouble(value)); - /// + /// public static MolarMass MegapoundsPerMole(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -104,7 +104,7 @@ public static MolarMass MegapoundsPerMole(this T value) #endif => MolarMass.FromMegapoundsPerMole(Convert.ToDouble(value)); - /// + /// public static MolarMass MicrogramsPerMole(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -112,7 +112,7 @@ public static MolarMass MicrogramsPerMole(this T value) #endif => MolarMass.FromMicrogramsPerMole(Convert.ToDouble(value)); - /// + /// public static MolarMass MilligramsPerMole(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -120,7 +120,7 @@ public static MolarMass MilligramsPerMole(this T value) #endif => MolarMass.FromMilligramsPerMole(Convert.ToDouble(value)); - /// + /// public static MolarMass NanogramsPerMole(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -128,7 +128,7 @@ public static MolarMass NanogramsPerMole(this T value) #endif => MolarMass.FromNanogramsPerMole(Convert.ToDouble(value)); - /// + /// public static MolarMass PoundsPerMole(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToMolarityExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToMolarityExtensions.g.cs index 60ed5bf178..eb2f51f2bb 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToMolarityExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToMolarityExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToMolarity /// public static class NumberToMolarityExtensions { - /// + /// public static Molarity CentimolesPerLiter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static Molarity CentimolesPerLiter(this T value) #endif => Molarity.FromCentimolesPerLiter(Convert.ToDouble(value)); - /// + /// public static Molarity DecimolesPerLiter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static Molarity DecimolesPerLiter(this T value) #endif => Molarity.FromDecimolesPerLiter(Convert.ToDouble(value)); - /// + /// public static Molarity FemtomolesPerLiter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static Molarity FemtomolesPerLiter(this T value) #endif => Molarity.FromFemtomolesPerLiter(Convert.ToDouble(value)); - /// + /// public static Molarity KilomolesPerCubicMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static Molarity KilomolesPerCubicMeter(this T value) #endif => Molarity.FromKilomolesPerCubicMeter(Convert.ToDouble(value)); - /// + /// public static Molarity MicromolesPerLiter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -72,7 +72,7 @@ public static Molarity MicromolesPerLiter(this T value) #endif => Molarity.FromMicromolesPerLiter(Convert.ToDouble(value)); - /// + /// public static Molarity MillimolesPerLiter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -80,7 +80,7 @@ public static Molarity MillimolesPerLiter(this T value) #endif => Molarity.FromMillimolesPerLiter(Convert.ToDouble(value)); - /// + /// public static Molarity MolesPerCubicMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -88,7 +88,7 @@ public static Molarity MolesPerCubicMeter(this T value) #endif => Molarity.FromMolesPerCubicMeter(Convert.ToDouble(value)); - /// + /// public static Molarity MolesPerLiter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -96,7 +96,7 @@ public static Molarity MolesPerLiter(this T value) #endif => Molarity.FromMolesPerLiter(Convert.ToDouble(value)); - /// + /// public static Molarity NanomolesPerLiter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -104,7 +104,7 @@ public static Molarity NanomolesPerLiter(this T value) #endif => Molarity.FromNanomolesPerLiter(Convert.ToDouble(value)); - /// + /// public static Molarity PicomolesPerLiter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -112,7 +112,7 @@ public static Molarity PicomolesPerLiter(this T value) #endif => Molarity.FromPicomolesPerLiter(Convert.ToDouble(value)); - /// + /// public static Molarity PoundMolesPerCubicFoot(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToPermeabilityExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToPermeabilityExtensions.g.cs index 8ca254bcf0..c1c5f1b458 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToPermeabilityExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToPermeabilityExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToPermeability /// public static class NumberToPermeabilityExtensions { - /// + /// public static Permeability HenriesPerMeter(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToPermittivityExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToPermittivityExtensions.g.cs index a1165291c5..1c3b83a7b7 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToPermittivityExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToPermittivityExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToPermittivity /// public static class NumberToPermittivityExtensions { - /// + /// public static Permittivity FaradsPerMeter(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToPorousMediumPermeabilityExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToPorousMediumPermeabilityExtensions.g.cs index 5ec99c071f..9198d7c7c3 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToPorousMediumPermeabilityExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToPorousMediumPermeabilityExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToPorousMediumPermeability /// public static class NumberToPorousMediumPermeabilityExtensions { - /// + /// public static PorousMediumPermeability Darcys(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static PorousMediumPermeability Darcys(this T value) #endif => PorousMediumPermeability.FromDarcys(Convert.ToDouble(value)); - /// + /// public static PorousMediumPermeability Microdarcys(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static PorousMediumPermeability Microdarcys(this T value) #endif => PorousMediumPermeability.FromMicrodarcys(Convert.ToDouble(value)); - /// + /// public static PorousMediumPermeability Millidarcys(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static PorousMediumPermeability Millidarcys(this T value) #endif => PorousMediumPermeability.FromMillidarcys(Convert.ToDouble(value)); - /// + /// public static PorousMediumPermeability SquareCentimeters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static PorousMediumPermeability SquareCentimeters(this T value) #endif => PorousMediumPermeability.FromSquareCentimeters(Convert.ToDouble(value)); - /// + /// public static PorousMediumPermeability SquareMeters(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToPowerDensityExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToPowerDensityExtensions.g.cs index 7fa748166c..847b8babbe 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToPowerDensityExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToPowerDensityExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToPowerDensity /// public static class NumberToPowerDensityExtensions { - /// + /// public static PowerDensity DecawattsPerCubicFoot(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static PowerDensity DecawattsPerCubicFoot(this T value) #endif => PowerDensity.FromDecawattsPerCubicFoot(Convert.ToDouble(value)); - /// + /// public static PowerDensity DecawattsPerCubicInch(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static PowerDensity DecawattsPerCubicInch(this T value) #endif => PowerDensity.FromDecawattsPerCubicInch(Convert.ToDouble(value)); - /// + /// public static PowerDensity DecawattsPerCubicMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static PowerDensity DecawattsPerCubicMeter(this T value) #endif => PowerDensity.FromDecawattsPerCubicMeter(Convert.ToDouble(value)); - /// + /// public static PowerDensity DecawattsPerLiter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static PowerDensity DecawattsPerLiter(this T value) #endif => PowerDensity.FromDecawattsPerLiter(Convert.ToDouble(value)); - /// + /// public static PowerDensity DeciwattsPerCubicFoot(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -72,7 +72,7 @@ public static PowerDensity DeciwattsPerCubicFoot(this T value) #endif => PowerDensity.FromDeciwattsPerCubicFoot(Convert.ToDouble(value)); - /// + /// public static PowerDensity DeciwattsPerCubicInch(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -80,7 +80,7 @@ public static PowerDensity DeciwattsPerCubicInch(this T value) #endif => PowerDensity.FromDeciwattsPerCubicInch(Convert.ToDouble(value)); - /// + /// public static PowerDensity DeciwattsPerCubicMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -88,7 +88,7 @@ public static PowerDensity DeciwattsPerCubicMeter(this T value) #endif => PowerDensity.FromDeciwattsPerCubicMeter(Convert.ToDouble(value)); - /// + /// public static PowerDensity DeciwattsPerLiter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -96,7 +96,7 @@ public static PowerDensity DeciwattsPerLiter(this T value) #endif => PowerDensity.FromDeciwattsPerLiter(Convert.ToDouble(value)); - /// + /// public static PowerDensity GigawattsPerCubicFoot(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -104,7 +104,7 @@ public static PowerDensity GigawattsPerCubicFoot(this T value) #endif => PowerDensity.FromGigawattsPerCubicFoot(Convert.ToDouble(value)); - /// + /// public static PowerDensity GigawattsPerCubicInch(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -112,7 +112,7 @@ public static PowerDensity GigawattsPerCubicInch(this T value) #endif => PowerDensity.FromGigawattsPerCubicInch(Convert.ToDouble(value)); - /// + /// public static PowerDensity GigawattsPerCubicMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -120,7 +120,7 @@ public static PowerDensity GigawattsPerCubicMeter(this T value) #endif => PowerDensity.FromGigawattsPerCubicMeter(Convert.ToDouble(value)); - /// + /// public static PowerDensity GigawattsPerLiter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -128,7 +128,7 @@ public static PowerDensity GigawattsPerLiter(this T value) #endif => PowerDensity.FromGigawattsPerLiter(Convert.ToDouble(value)); - /// + /// public static PowerDensity KilowattsPerCubicFoot(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -136,7 +136,7 @@ public static PowerDensity KilowattsPerCubicFoot(this T value) #endif => PowerDensity.FromKilowattsPerCubicFoot(Convert.ToDouble(value)); - /// + /// public static PowerDensity KilowattsPerCubicInch(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -144,7 +144,7 @@ public static PowerDensity KilowattsPerCubicInch(this T value) #endif => PowerDensity.FromKilowattsPerCubicInch(Convert.ToDouble(value)); - /// + /// public static PowerDensity KilowattsPerCubicMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -152,7 +152,7 @@ public static PowerDensity KilowattsPerCubicMeter(this T value) #endif => PowerDensity.FromKilowattsPerCubicMeter(Convert.ToDouble(value)); - /// + /// public static PowerDensity KilowattsPerLiter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -160,7 +160,7 @@ public static PowerDensity KilowattsPerLiter(this T value) #endif => PowerDensity.FromKilowattsPerLiter(Convert.ToDouble(value)); - /// + /// public static PowerDensity MegawattsPerCubicFoot(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -168,7 +168,7 @@ public static PowerDensity MegawattsPerCubicFoot(this T value) #endif => PowerDensity.FromMegawattsPerCubicFoot(Convert.ToDouble(value)); - /// + /// public static PowerDensity MegawattsPerCubicInch(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -176,7 +176,7 @@ public static PowerDensity MegawattsPerCubicInch(this T value) #endif => PowerDensity.FromMegawattsPerCubicInch(Convert.ToDouble(value)); - /// + /// public static PowerDensity MegawattsPerCubicMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -184,7 +184,7 @@ public static PowerDensity MegawattsPerCubicMeter(this T value) #endif => PowerDensity.FromMegawattsPerCubicMeter(Convert.ToDouble(value)); - /// + /// public static PowerDensity MegawattsPerLiter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -192,7 +192,7 @@ public static PowerDensity MegawattsPerLiter(this T value) #endif => PowerDensity.FromMegawattsPerLiter(Convert.ToDouble(value)); - /// + /// public static PowerDensity MicrowattsPerCubicFoot(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -200,7 +200,7 @@ public static PowerDensity MicrowattsPerCubicFoot(this T value) #endif => PowerDensity.FromMicrowattsPerCubicFoot(Convert.ToDouble(value)); - /// + /// public static PowerDensity MicrowattsPerCubicInch(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -208,7 +208,7 @@ public static PowerDensity MicrowattsPerCubicInch(this T value) #endif => PowerDensity.FromMicrowattsPerCubicInch(Convert.ToDouble(value)); - /// + /// public static PowerDensity MicrowattsPerCubicMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -216,7 +216,7 @@ public static PowerDensity MicrowattsPerCubicMeter(this T value) #endif => PowerDensity.FromMicrowattsPerCubicMeter(Convert.ToDouble(value)); - /// + /// public static PowerDensity MicrowattsPerLiter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -224,7 +224,7 @@ public static PowerDensity MicrowattsPerLiter(this T value) #endif => PowerDensity.FromMicrowattsPerLiter(Convert.ToDouble(value)); - /// + /// public static PowerDensity MilliwattsPerCubicFoot(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -232,7 +232,7 @@ public static PowerDensity MilliwattsPerCubicFoot(this T value) #endif => PowerDensity.FromMilliwattsPerCubicFoot(Convert.ToDouble(value)); - /// + /// public static PowerDensity MilliwattsPerCubicInch(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -240,7 +240,7 @@ public static PowerDensity MilliwattsPerCubicInch(this T value) #endif => PowerDensity.FromMilliwattsPerCubicInch(Convert.ToDouble(value)); - /// + /// public static PowerDensity MilliwattsPerCubicMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -248,7 +248,7 @@ public static PowerDensity MilliwattsPerCubicMeter(this T value) #endif => PowerDensity.FromMilliwattsPerCubicMeter(Convert.ToDouble(value)); - /// + /// public static PowerDensity MilliwattsPerLiter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -256,7 +256,7 @@ public static PowerDensity MilliwattsPerLiter(this T value) #endif => PowerDensity.FromMilliwattsPerLiter(Convert.ToDouble(value)); - /// + /// public static PowerDensity NanowattsPerCubicFoot(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -264,7 +264,7 @@ public static PowerDensity NanowattsPerCubicFoot(this T value) #endif => PowerDensity.FromNanowattsPerCubicFoot(Convert.ToDouble(value)); - /// + /// public static PowerDensity NanowattsPerCubicInch(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -272,7 +272,7 @@ public static PowerDensity NanowattsPerCubicInch(this T value) #endif => PowerDensity.FromNanowattsPerCubicInch(Convert.ToDouble(value)); - /// + /// public static PowerDensity NanowattsPerCubicMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -280,7 +280,7 @@ public static PowerDensity NanowattsPerCubicMeter(this T value) #endif => PowerDensity.FromNanowattsPerCubicMeter(Convert.ToDouble(value)); - /// + /// public static PowerDensity NanowattsPerLiter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -288,7 +288,7 @@ public static PowerDensity NanowattsPerLiter(this T value) #endif => PowerDensity.FromNanowattsPerLiter(Convert.ToDouble(value)); - /// + /// public static PowerDensity PicowattsPerCubicFoot(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -296,7 +296,7 @@ public static PowerDensity PicowattsPerCubicFoot(this T value) #endif => PowerDensity.FromPicowattsPerCubicFoot(Convert.ToDouble(value)); - /// + /// public static PowerDensity PicowattsPerCubicInch(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -304,7 +304,7 @@ public static PowerDensity PicowattsPerCubicInch(this T value) #endif => PowerDensity.FromPicowattsPerCubicInch(Convert.ToDouble(value)); - /// + /// public static PowerDensity PicowattsPerCubicMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -312,7 +312,7 @@ public static PowerDensity PicowattsPerCubicMeter(this T value) #endif => PowerDensity.FromPicowattsPerCubicMeter(Convert.ToDouble(value)); - /// + /// public static PowerDensity PicowattsPerLiter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -320,7 +320,7 @@ public static PowerDensity PicowattsPerLiter(this T value) #endif => PowerDensity.FromPicowattsPerLiter(Convert.ToDouble(value)); - /// + /// public static PowerDensity TerawattsPerCubicFoot(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -328,7 +328,7 @@ public static PowerDensity TerawattsPerCubicFoot(this T value) #endif => PowerDensity.FromTerawattsPerCubicFoot(Convert.ToDouble(value)); - /// + /// public static PowerDensity TerawattsPerCubicInch(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -336,7 +336,7 @@ public static PowerDensity TerawattsPerCubicInch(this T value) #endif => PowerDensity.FromTerawattsPerCubicInch(Convert.ToDouble(value)); - /// + /// public static PowerDensity TerawattsPerCubicMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -344,7 +344,7 @@ public static PowerDensity TerawattsPerCubicMeter(this T value) #endif => PowerDensity.FromTerawattsPerCubicMeter(Convert.ToDouble(value)); - /// + /// public static PowerDensity TerawattsPerLiter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -352,7 +352,7 @@ public static PowerDensity TerawattsPerLiter(this T value) #endif => PowerDensity.FromTerawattsPerLiter(Convert.ToDouble(value)); - /// + /// public static PowerDensity WattsPerCubicFoot(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -360,7 +360,7 @@ public static PowerDensity WattsPerCubicFoot(this T value) #endif => PowerDensity.FromWattsPerCubicFoot(Convert.ToDouble(value)); - /// + /// public static PowerDensity WattsPerCubicInch(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -368,7 +368,7 @@ public static PowerDensity WattsPerCubicInch(this T value) #endif => PowerDensity.FromWattsPerCubicInch(Convert.ToDouble(value)); - /// + /// public static PowerDensity WattsPerCubicMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -376,7 +376,7 @@ public static PowerDensity WattsPerCubicMeter(this T value) #endif => PowerDensity.FromWattsPerCubicMeter(Convert.ToDouble(value)); - /// + /// public static PowerDensity WattsPerLiter(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToPowerExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToPowerExtensions.g.cs index 2b5d37b0d8..8889adcf42 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToPowerExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToPowerExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToPower /// public static class NumberToPowerExtensions { - /// + /// public static Power BoilerHorsepower(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static Power BoilerHorsepower(this T value) #endif => Power.FromBoilerHorsepower(Convert.ToDouble(value)); - /// + /// public static Power BritishThermalUnitsPerHour(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static Power BritishThermalUnitsPerHour(this T value) #endif => Power.FromBritishThermalUnitsPerHour(Convert.ToDouble(value)); - /// + /// public static Power Decawatts(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static Power Decawatts(this T value) #endif => Power.FromDecawatts(Convert.ToDouble(value)); - /// + /// public static Power Deciwatts(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static Power Deciwatts(this T value) #endif => Power.FromDeciwatts(Convert.ToDouble(value)); - /// + /// public static Power ElectricalHorsepower(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -72,7 +72,7 @@ public static Power ElectricalHorsepower(this T value) #endif => Power.FromElectricalHorsepower(Convert.ToDouble(value)); - /// + /// public static Power Femtowatts(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -80,7 +80,7 @@ public static Power Femtowatts(this T value) #endif => Power.FromFemtowatts(Convert.ToDouble(value)); - /// + /// public static Power GigajoulesPerHour(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -88,7 +88,7 @@ public static Power GigajoulesPerHour(this T value) #endif => Power.FromGigajoulesPerHour(Convert.ToDouble(value)); - /// + /// public static Power Gigawatts(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -96,7 +96,7 @@ public static Power Gigawatts(this T value) #endif => Power.FromGigawatts(Convert.ToDouble(value)); - /// + /// public static Power HydraulicHorsepower(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -104,7 +104,7 @@ public static Power HydraulicHorsepower(this T value) #endif => Power.FromHydraulicHorsepower(Convert.ToDouble(value)); - /// + /// public static Power JoulesPerHour(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -112,7 +112,7 @@ public static Power JoulesPerHour(this T value) #endif => Power.FromJoulesPerHour(Convert.ToDouble(value)); - /// + /// public static Power KilobritishThermalUnitsPerHour(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -120,7 +120,7 @@ public static Power KilobritishThermalUnitsPerHour(this T value) #endif => Power.FromKilobritishThermalUnitsPerHour(Convert.ToDouble(value)); - /// + /// public static Power KilojoulesPerHour(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -128,7 +128,7 @@ public static Power KilojoulesPerHour(this T value) #endif => Power.FromKilojoulesPerHour(Convert.ToDouble(value)); - /// + /// public static Power Kilowatts(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -136,7 +136,7 @@ public static Power Kilowatts(this T value) #endif => Power.FromKilowatts(Convert.ToDouble(value)); - /// + /// public static Power MechanicalHorsepower(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -144,7 +144,7 @@ public static Power MechanicalHorsepower(this T value) #endif => Power.FromMechanicalHorsepower(Convert.ToDouble(value)); - /// + /// public static Power MegabritishThermalUnitsPerHour(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -152,7 +152,7 @@ public static Power MegabritishThermalUnitsPerHour(this T value) #endif => Power.FromMegabritishThermalUnitsPerHour(Convert.ToDouble(value)); - /// + /// public static Power MegajoulesPerHour(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -160,7 +160,7 @@ public static Power MegajoulesPerHour(this T value) #endif => Power.FromMegajoulesPerHour(Convert.ToDouble(value)); - /// + /// public static Power Megawatts(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -168,7 +168,7 @@ public static Power Megawatts(this T value) #endif => Power.FromMegawatts(Convert.ToDouble(value)); - /// + /// public static Power MetricHorsepower(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -176,7 +176,7 @@ public static Power MetricHorsepower(this T value) #endif => Power.FromMetricHorsepower(Convert.ToDouble(value)); - /// + /// public static Power Microwatts(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -184,7 +184,7 @@ public static Power Microwatts(this T value) #endif => Power.FromMicrowatts(Convert.ToDouble(value)); - /// + /// public static Power MillijoulesPerHour(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -192,7 +192,7 @@ public static Power MillijoulesPerHour(this T value) #endif => Power.FromMillijoulesPerHour(Convert.ToDouble(value)); - /// + /// public static Power Milliwatts(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -200,7 +200,7 @@ public static Power Milliwatts(this T value) #endif => Power.FromMilliwatts(Convert.ToDouble(value)); - /// + /// public static Power Nanowatts(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -208,7 +208,7 @@ public static Power Nanowatts(this T value) #endif => Power.FromNanowatts(Convert.ToDouble(value)); - /// + /// public static Power Petawatts(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -216,7 +216,7 @@ public static Power Petawatts(this T value) #endif => Power.FromPetawatts(Convert.ToDouble(value)); - /// + /// public static Power Picowatts(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -224,7 +224,7 @@ public static Power Picowatts(this T value) #endif => Power.FromPicowatts(Convert.ToDouble(value)); - /// + /// public static Power Terawatts(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -232,7 +232,7 @@ public static Power Terawatts(this T value) #endif => Power.FromTerawatts(Convert.ToDouble(value)); - /// + /// public static Power Watts(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToPowerRatioExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToPowerRatioExtensions.g.cs index 37ccf44b67..19128fa14d 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToPowerRatioExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToPowerRatioExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToPowerRatio /// public static class NumberToPowerRatioExtensions { - /// + /// public static PowerRatio DecibelMilliwatts(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static PowerRatio DecibelMilliwatts(this T value) #endif => PowerRatio.FromDecibelMilliwatts(Convert.ToDouble(value)); - /// + /// public static PowerRatio DecibelWatts(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToPressureChangeRateExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToPressureChangeRateExtensions.g.cs index 586878daa4..3cc38f1321 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToPressureChangeRateExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToPressureChangeRateExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToPressureChangeRate /// public static class NumberToPressureChangeRateExtensions { - /// + /// public static PressureChangeRate AtmospheresPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static PressureChangeRate AtmospheresPerSecond(this T value) #endif => PressureChangeRate.FromAtmospheresPerSecond(Convert.ToDouble(value)); - /// + /// public static PressureChangeRate BarsPerMinute(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static PressureChangeRate BarsPerMinute(this T value) #endif => PressureChangeRate.FromBarsPerMinute(Convert.ToDouble(value)); - /// + /// public static PressureChangeRate BarsPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static PressureChangeRate BarsPerSecond(this T value) #endif => PressureChangeRate.FromBarsPerSecond(Convert.ToDouble(value)); - /// + /// public static PressureChangeRate KilopascalsPerMinute(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static PressureChangeRate KilopascalsPerMinute(this T value) #endif => PressureChangeRate.FromKilopascalsPerMinute(Convert.ToDouble(value)); - /// + /// public static PressureChangeRate KilopascalsPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -72,7 +72,7 @@ public static PressureChangeRate KilopascalsPerSecond(this T value) #endif => PressureChangeRate.FromKilopascalsPerSecond(Convert.ToDouble(value)); - /// + /// public static PressureChangeRate KilopoundsForcePerSquareInchPerMinute(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -80,7 +80,7 @@ public static PressureChangeRate KilopoundsForcePerSquareInchPerMinute(this T #endif => PressureChangeRate.FromKilopoundsForcePerSquareInchPerMinute(Convert.ToDouble(value)); - /// + /// public static PressureChangeRate KilopoundsForcePerSquareInchPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -88,7 +88,7 @@ public static PressureChangeRate KilopoundsForcePerSquareInchPerSecond(this T #endif => PressureChangeRate.FromKilopoundsForcePerSquareInchPerSecond(Convert.ToDouble(value)); - /// + /// public static PressureChangeRate MegapascalsPerMinute(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -96,7 +96,7 @@ public static PressureChangeRate MegapascalsPerMinute(this T value) #endif => PressureChangeRate.FromMegapascalsPerMinute(Convert.ToDouble(value)); - /// + /// public static PressureChangeRate MegapascalsPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -104,7 +104,7 @@ public static PressureChangeRate MegapascalsPerSecond(this T value) #endif => PressureChangeRate.FromMegapascalsPerSecond(Convert.ToDouble(value)); - /// + /// public static PressureChangeRate MegapoundsForcePerSquareInchPerMinute(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -112,7 +112,7 @@ public static PressureChangeRate MegapoundsForcePerSquareInchPerMinute(this T #endif => PressureChangeRate.FromMegapoundsForcePerSquareInchPerMinute(Convert.ToDouble(value)); - /// + /// public static PressureChangeRate MegapoundsForcePerSquareInchPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -120,7 +120,7 @@ public static PressureChangeRate MegapoundsForcePerSquareInchPerSecond(this T #endif => PressureChangeRate.FromMegapoundsForcePerSquareInchPerSecond(Convert.ToDouble(value)); - /// + /// public static PressureChangeRate MillibarsPerMinute(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -128,7 +128,7 @@ public static PressureChangeRate MillibarsPerMinute(this T value) #endif => PressureChangeRate.FromMillibarsPerMinute(Convert.ToDouble(value)); - /// + /// public static PressureChangeRate MillibarsPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -136,7 +136,7 @@ public static PressureChangeRate MillibarsPerSecond(this T value) #endif => PressureChangeRate.FromMillibarsPerSecond(Convert.ToDouble(value)); - /// + /// public static PressureChangeRate MillimetersOfMercuryPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -144,7 +144,7 @@ public static PressureChangeRate MillimetersOfMercuryPerSecond(this T value) #endif => PressureChangeRate.FromMillimetersOfMercuryPerSecond(Convert.ToDouble(value)); - /// + /// public static PressureChangeRate PascalsPerMinute(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -152,7 +152,7 @@ public static PressureChangeRate PascalsPerMinute(this T value) #endif => PressureChangeRate.FromPascalsPerMinute(Convert.ToDouble(value)); - /// + /// public static PressureChangeRate PascalsPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -160,7 +160,7 @@ public static PressureChangeRate PascalsPerSecond(this T value) #endif => PressureChangeRate.FromPascalsPerSecond(Convert.ToDouble(value)); - /// + /// public static PressureChangeRate PoundsForcePerSquareInchPerMinute(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -168,7 +168,7 @@ public static PressureChangeRate PoundsForcePerSquareInchPerMinute(this T val #endif => PressureChangeRate.FromPoundsForcePerSquareInchPerMinute(Convert.ToDouble(value)); - /// + /// public static PressureChangeRate PoundsForcePerSquareInchPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToPressureExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToPressureExtensions.g.cs index 54cc9e7da8..3f3ef204b5 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToPressureExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToPressureExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToPressure /// public static class NumberToPressureExtensions { - /// + /// public static Pressure Atmospheres(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static Pressure Atmospheres(this T value) #endif => Pressure.FromAtmospheres(Convert.ToDouble(value)); - /// + /// public static Pressure Bars(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static Pressure Bars(this T value) #endif => Pressure.FromBars(Convert.ToDouble(value)); - /// + /// public static Pressure Centibars(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static Pressure Centibars(this T value) #endif => Pressure.FromCentibars(Convert.ToDouble(value)); - /// + /// public static Pressure CentimetersOfWaterColumn(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static Pressure CentimetersOfWaterColumn(this T value) #endif => Pressure.FromCentimetersOfWaterColumn(Convert.ToDouble(value)); - /// + /// public static Pressure Decapascals(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -72,7 +72,7 @@ public static Pressure Decapascals(this T value) #endif => Pressure.FromDecapascals(Convert.ToDouble(value)); - /// + /// public static Pressure Decibars(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -80,7 +80,7 @@ public static Pressure Decibars(this T value) #endif => Pressure.FromDecibars(Convert.ToDouble(value)); - /// + /// public static Pressure DynesPerSquareCentimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -88,7 +88,7 @@ public static Pressure DynesPerSquareCentimeter(this T value) #endif => Pressure.FromDynesPerSquareCentimeter(Convert.ToDouble(value)); - /// + /// public static Pressure FeetOfElevation(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -96,7 +96,7 @@ public static Pressure FeetOfElevation(this T value) #endif => Pressure.FromFeetOfElevation(Convert.ToDouble(value)); - /// + /// public static Pressure FeetOfHead(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -104,7 +104,7 @@ public static Pressure FeetOfHead(this T value) #endif => Pressure.FromFeetOfHead(Convert.ToDouble(value)); - /// + /// public static Pressure Gigapascals(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -112,7 +112,7 @@ public static Pressure Gigapascals(this T value) #endif => Pressure.FromGigapascals(Convert.ToDouble(value)); - /// + /// public static Pressure Hectopascals(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -120,7 +120,7 @@ public static Pressure Hectopascals(this T value) #endif => Pressure.FromHectopascals(Convert.ToDouble(value)); - /// + /// public static Pressure InchesOfMercury(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -128,7 +128,7 @@ public static Pressure InchesOfMercury(this T value) #endif => Pressure.FromInchesOfMercury(Convert.ToDouble(value)); - /// + /// public static Pressure InchesOfWaterColumn(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -136,7 +136,7 @@ public static Pressure InchesOfWaterColumn(this T value) #endif => Pressure.FromInchesOfWaterColumn(Convert.ToDouble(value)); - /// + /// public static Pressure Kilobars(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -144,7 +144,7 @@ public static Pressure Kilobars(this T value) #endif => Pressure.FromKilobars(Convert.ToDouble(value)); - /// + /// public static Pressure KilogramsForcePerSquareCentimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -152,7 +152,7 @@ public static Pressure KilogramsForcePerSquareCentimeter(this T value) #endif => Pressure.FromKilogramsForcePerSquareCentimeter(Convert.ToDouble(value)); - /// + /// public static Pressure KilogramsForcePerSquareMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -160,7 +160,7 @@ public static Pressure KilogramsForcePerSquareMeter(this T value) #endif => Pressure.FromKilogramsForcePerSquareMeter(Convert.ToDouble(value)); - /// + /// public static Pressure KilogramsForcePerSquareMillimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -168,7 +168,7 @@ public static Pressure KilogramsForcePerSquareMillimeter(this T value) #endif => Pressure.FromKilogramsForcePerSquareMillimeter(Convert.ToDouble(value)); - /// + /// public static Pressure KilonewtonsPerSquareCentimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -176,7 +176,7 @@ public static Pressure KilonewtonsPerSquareCentimeter(this T value) #endif => Pressure.FromKilonewtonsPerSquareCentimeter(Convert.ToDouble(value)); - /// + /// public static Pressure KilonewtonsPerSquareMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -184,7 +184,7 @@ public static Pressure KilonewtonsPerSquareMeter(this T value) #endif => Pressure.FromKilonewtonsPerSquareMeter(Convert.ToDouble(value)); - /// + /// public static Pressure KilonewtonsPerSquareMillimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -192,7 +192,7 @@ public static Pressure KilonewtonsPerSquareMillimeter(this T value) #endif => Pressure.FromKilonewtonsPerSquareMillimeter(Convert.ToDouble(value)); - /// + /// public static Pressure Kilopascals(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -200,7 +200,7 @@ public static Pressure Kilopascals(this T value) #endif => Pressure.FromKilopascals(Convert.ToDouble(value)); - /// + /// public static Pressure KilopoundsForcePerSquareFoot(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -208,7 +208,7 @@ public static Pressure KilopoundsForcePerSquareFoot(this T value) #endif => Pressure.FromKilopoundsForcePerSquareFoot(Convert.ToDouble(value)); - /// + /// public static Pressure KilopoundsForcePerSquareInch(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -216,7 +216,7 @@ public static Pressure KilopoundsForcePerSquareInch(this T value) #endif => Pressure.FromKilopoundsForcePerSquareInch(Convert.ToDouble(value)); - /// + /// public static Pressure KilopoundsForcePerSquareMil(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -224,7 +224,7 @@ public static Pressure KilopoundsForcePerSquareMil(this T value) #endif => Pressure.FromKilopoundsForcePerSquareMil(Convert.ToDouble(value)); - /// + /// public static Pressure Megabars(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -232,7 +232,7 @@ public static Pressure Megabars(this T value) #endif => Pressure.FromMegabars(Convert.ToDouble(value)); - /// + /// public static Pressure MeganewtonsPerSquareMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -240,7 +240,7 @@ public static Pressure MeganewtonsPerSquareMeter(this T value) #endif => Pressure.FromMeganewtonsPerSquareMeter(Convert.ToDouble(value)); - /// + /// public static Pressure Megapascals(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -248,7 +248,7 @@ public static Pressure Megapascals(this T value) #endif => Pressure.FromMegapascals(Convert.ToDouble(value)); - /// + /// public static Pressure MetersOfElevation(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -256,7 +256,7 @@ public static Pressure MetersOfElevation(this T value) #endif => Pressure.FromMetersOfElevation(Convert.ToDouble(value)); - /// + /// public static Pressure MetersOfHead(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -264,7 +264,7 @@ public static Pressure MetersOfHead(this T value) #endif => Pressure.FromMetersOfHead(Convert.ToDouble(value)); - /// + /// public static Pressure MetersOfWaterColumn(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -272,7 +272,7 @@ public static Pressure MetersOfWaterColumn(this T value) #endif => Pressure.FromMetersOfWaterColumn(Convert.ToDouble(value)); - /// + /// public static Pressure Microbars(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -280,7 +280,7 @@ public static Pressure Microbars(this T value) #endif => Pressure.FromMicrobars(Convert.ToDouble(value)); - /// + /// public static Pressure Micropascals(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -288,7 +288,7 @@ public static Pressure Micropascals(this T value) #endif => Pressure.FromMicropascals(Convert.ToDouble(value)); - /// + /// public static Pressure Millibars(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -296,7 +296,7 @@ public static Pressure Millibars(this T value) #endif => Pressure.FromMillibars(Convert.ToDouble(value)); - /// + /// public static Pressure MillimetersOfMercury(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -304,7 +304,7 @@ public static Pressure MillimetersOfMercury(this T value) #endif => Pressure.FromMillimetersOfMercury(Convert.ToDouble(value)); - /// + /// public static Pressure MillimetersOfWaterColumn(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -312,7 +312,7 @@ public static Pressure MillimetersOfWaterColumn(this T value) #endif => Pressure.FromMillimetersOfWaterColumn(Convert.ToDouble(value)); - /// + /// public static Pressure Millipascals(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -320,7 +320,7 @@ public static Pressure Millipascals(this T value) #endif => Pressure.FromMillipascals(Convert.ToDouble(value)); - /// + /// public static Pressure NewtonsPerSquareCentimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -328,7 +328,7 @@ public static Pressure NewtonsPerSquareCentimeter(this T value) #endif => Pressure.FromNewtonsPerSquareCentimeter(Convert.ToDouble(value)); - /// + /// public static Pressure NewtonsPerSquareMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -336,7 +336,7 @@ public static Pressure NewtonsPerSquareMeter(this T value) #endif => Pressure.FromNewtonsPerSquareMeter(Convert.ToDouble(value)); - /// + /// public static Pressure NewtonsPerSquareMillimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -344,7 +344,7 @@ public static Pressure NewtonsPerSquareMillimeter(this T value) #endif => Pressure.FromNewtonsPerSquareMillimeter(Convert.ToDouble(value)); - /// + /// public static Pressure Pascals(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -352,7 +352,7 @@ public static Pressure Pascals(this T value) #endif => Pressure.FromPascals(Convert.ToDouble(value)); - /// + /// public static Pressure PoundsForcePerSquareFoot(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -360,7 +360,7 @@ public static Pressure PoundsForcePerSquareFoot(this T value) #endif => Pressure.FromPoundsForcePerSquareFoot(Convert.ToDouble(value)); - /// + /// public static Pressure PoundsForcePerSquareInch(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -368,7 +368,7 @@ public static Pressure PoundsForcePerSquareInch(this T value) #endif => Pressure.FromPoundsForcePerSquareInch(Convert.ToDouble(value)); - /// + /// public static Pressure PoundsForcePerSquareMil(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -376,7 +376,7 @@ public static Pressure PoundsForcePerSquareMil(this T value) #endif => Pressure.FromPoundsForcePerSquareMil(Convert.ToDouble(value)); - /// + /// public static Pressure PoundsPerInchSecondSquared(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -384,7 +384,7 @@ public static Pressure PoundsPerInchSecondSquared(this T value) #endif => Pressure.FromPoundsPerInchSecondSquared(Convert.ToDouble(value)); - /// + /// public static Pressure TechnicalAtmospheres(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -392,7 +392,7 @@ public static Pressure TechnicalAtmospheres(this T value) #endif => Pressure.FromTechnicalAtmospheres(Convert.ToDouble(value)); - /// + /// public static Pressure TonnesForcePerSquareCentimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -400,7 +400,7 @@ public static Pressure TonnesForcePerSquareCentimeter(this T value) #endif => Pressure.FromTonnesForcePerSquareCentimeter(Convert.ToDouble(value)); - /// + /// public static Pressure TonnesForcePerSquareMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -408,7 +408,7 @@ public static Pressure TonnesForcePerSquareMeter(this T value) #endif => Pressure.FromTonnesForcePerSquareMeter(Convert.ToDouble(value)); - /// + /// public static Pressure TonnesForcePerSquareMillimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -416,7 +416,7 @@ public static Pressure TonnesForcePerSquareMillimeter(this T value) #endif => Pressure.FromTonnesForcePerSquareMillimeter(Convert.ToDouble(value)); - /// + /// public static Pressure Torrs(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToRadiationExposureExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToRadiationExposureExtensions.g.cs index d24f2b7f0a..643106c73b 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToRadiationExposureExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToRadiationExposureExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToRadiationExposure /// public static class NumberToRadiationExposureExtensions { - /// + /// public static RadiationExposure CoulombsPerKilogram(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static RadiationExposure CoulombsPerKilogram(this T value) #endif => RadiationExposure.FromCoulombsPerKilogram(Convert.ToDouble(value)); - /// + /// public static RadiationExposure MicrocoulombsPerKilogram(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static RadiationExposure MicrocoulombsPerKilogram(this T value) #endif => RadiationExposure.FromMicrocoulombsPerKilogram(Convert.ToDouble(value)); - /// + /// public static RadiationExposure Microroentgens(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static RadiationExposure Microroentgens(this T value) #endif => RadiationExposure.FromMicroroentgens(Convert.ToDouble(value)); - /// + /// public static RadiationExposure MillicoulombsPerKilogram(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static RadiationExposure MillicoulombsPerKilogram(this T value) #endif => RadiationExposure.FromMillicoulombsPerKilogram(Convert.ToDouble(value)); - /// + /// public static RadiationExposure Milliroentgens(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -72,7 +72,7 @@ public static RadiationExposure Milliroentgens(this T value) #endif => RadiationExposure.FromMilliroentgens(Convert.ToDouble(value)); - /// + /// public static RadiationExposure NanocoulombsPerKilogram(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -80,7 +80,7 @@ public static RadiationExposure NanocoulombsPerKilogram(this T value) #endif => RadiationExposure.FromNanocoulombsPerKilogram(Convert.ToDouble(value)); - /// + /// public static RadiationExposure PicocoulombsPerKilogram(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -88,7 +88,7 @@ public static RadiationExposure PicocoulombsPerKilogram(this T value) #endif => RadiationExposure.FromPicocoulombsPerKilogram(Convert.ToDouble(value)); - /// + /// public static RadiationExposure Roentgens(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToRadioactivityExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToRadioactivityExtensions.g.cs index 59c3401ab6..b9ecd03de3 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToRadioactivityExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToRadioactivityExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToRadioactivity /// public static class NumberToRadioactivityExtensions { - /// + /// public static Radioactivity Becquerels(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static Radioactivity Becquerels(this T value) #endif => Radioactivity.FromBecquerels(Convert.ToDouble(value)); - /// + /// public static Radioactivity Curies(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static Radioactivity Curies(this T value) #endif => Radioactivity.FromCuries(Convert.ToDouble(value)); - /// + /// public static Radioactivity Exabecquerels(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static Radioactivity Exabecquerels(this T value) #endif => Radioactivity.FromExabecquerels(Convert.ToDouble(value)); - /// + /// public static Radioactivity Gigabecquerels(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static Radioactivity Gigabecquerels(this T value) #endif => Radioactivity.FromGigabecquerels(Convert.ToDouble(value)); - /// + /// public static Radioactivity Gigacuries(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -72,7 +72,7 @@ public static Radioactivity Gigacuries(this T value) #endif => Radioactivity.FromGigacuries(Convert.ToDouble(value)); - /// + /// public static Radioactivity Gigarutherfords(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -80,7 +80,7 @@ public static Radioactivity Gigarutherfords(this T value) #endif => Radioactivity.FromGigarutherfords(Convert.ToDouble(value)); - /// + /// public static Radioactivity Kilobecquerels(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -88,7 +88,7 @@ public static Radioactivity Kilobecquerels(this T value) #endif => Radioactivity.FromKilobecquerels(Convert.ToDouble(value)); - /// + /// public static Radioactivity Kilocuries(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -96,7 +96,7 @@ public static Radioactivity Kilocuries(this T value) #endif => Radioactivity.FromKilocuries(Convert.ToDouble(value)); - /// + /// public static Radioactivity Kilorutherfords(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -104,7 +104,7 @@ public static Radioactivity Kilorutherfords(this T value) #endif => Radioactivity.FromKilorutherfords(Convert.ToDouble(value)); - /// + /// public static Radioactivity Megabecquerels(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -112,7 +112,7 @@ public static Radioactivity Megabecquerels(this T value) #endif => Radioactivity.FromMegabecquerels(Convert.ToDouble(value)); - /// + /// public static Radioactivity Megacuries(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -120,7 +120,7 @@ public static Radioactivity Megacuries(this T value) #endif => Radioactivity.FromMegacuries(Convert.ToDouble(value)); - /// + /// public static Radioactivity Megarutherfords(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -128,7 +128,7 @@ public static Radioactivity Megarutherfords(this T value) #endif => Radioactivity.FromMegarutherfords(Convert.ToDouble(value)); - /// + /// public static Radioactivity Microbecquerels(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -136,7 +136,7 @@ public static Radioactivity Microbecquerels(this T value) #endif => Radioactivity.FromMicrobecquerels(Convert.ToDouble(value)); - /// + /// public static Radioactivity Microcuries(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -144,7 +144,7 @@ public static Radioactivity Microcuries(this T value) #endif => Radioactivity.FromMicrocuries(Convert.ToDouble(value)); - /// + /// public static Radioactivity Microrutherfords(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -152,7 +152,7 @@ public static Radioactivity Microrutherfords(this T value) #endif => Radioactivity.FromMicrorutherfords(Convert.ToDouble(value)); - /// + /// public static Radioactivity Millibecquerels(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -160,7 +160,7 @@ public static Radioactivity Millibecquerels(this T value) #endif => Radioactivity.FromMillibecquerels(Convert.ToDouble(value)); - /// + /// public static Radioactivity Millicuries(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -168,7 +168,7 @@ public static Radioactivity Millicuries(this T value) #endif => Radioactivity.FromMillicuries(Convert.ToDouble(value)); - /// + /// public static Radioactivity Millirutherfords(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -176,7 +176,7 @@ public static Radioactivity Millirutherfords(this T value) #endif => Radioactivity.FromMillirutherfords(Convert.ToDouble(value)); - /// + /// public static Radioactivity Nanobecquerels(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -184,7 +184,7 @@ public static Radioactivity Nanobecquerels(this T value) #endif => Radioactivity.FromNanobecquerels(Convert.ToDouble(value)); - /// + /// public static Radioactivity Nanocuries(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -192,7 +192,7 @@ public static Radioactivity Nanocuries(this T value) #endif => Radioactivity.FromNanocuries(Convert.ToDouble(value)); - /// + /// public static Radioactivity Nanorutherfords(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -200,7 +200,7 @@ public static Radioactivity Nanorutherfords(this T value) #endif => Radioactivity.FromNanorutherfords(Convert.ToDouble(value)); - /// + /// public static Radioactivity Petabecquerels(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -208,7 +208,7 @@ public static Radioactivity Petabecquerels(this T value) #endif => Radioactivity.FromPetabecquerels(Convert.ToDouble(value)); - /// + /// public static Radioactivity Picobecquerels(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -216,7 +216,7 @@ public static Radioactivity Picobecquerels(this T value) #endif => Radioactivity.FromPicobecquerels(Convert.ToDouble(value)); - /// + /// public static Radioactivity Picocuries(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -224,7 +224,7 @@ public static Radioactivity Picocuries(this T value) #endif => Radioactivity.FromPicocuries(Convert.ToDouble(value)); - /// + /// public static Radioactivity Picorutherfords(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -232,7 +232,7 @@ public static Radioactivity Picorutherfords(this T value) #endif => Radioactivity.FromPicorutherfords(Convert.ToDouble(value)); - /// + /// public static Radioactivity Rutherfords(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -240,7 +240,7 @@ public static Radioactivity Rutherfords(this T value) #endif => Radioactivity.FromRutherfords(Convert.ToDouble(value)); - /// + /// public static Radioactivity Terabecquerels(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -248,7 +248,7 @@ public static Radioactivity Terabecquerels(this T value) #endif => Radioactivity.FromTerabecquerels(Convert.ToDouble(value)); - /// + /// public static Radioactivity Teracuries(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -256,7 +256,7 @@ public static Radioactivity Teracuries(this T value) #endif => Radioactivity.FromTeracuries(Convert.ToDouble(value)); - /// + /// public static Radioactivity Terarutherfords(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToRatioChangeRateExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToRatioChangeRateExtensions.g.cs index cc38f32c1a..19bff685ff 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToRatioChangeRateExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToRatioChangeRateExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToRatioChangeRate /// public static class NumberToRatioChangeRateExtensions { - /// + /// public static RatioChangeRate DecimalFractionsPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static RatioChangeRate DecimalFractionsPerSecond(this T value) #endif => RatioChangeRate.FromDecimalFractionsPerSecond(Convert.ToDouble(value)); - /// + /// public static RatioChangeRate PercentsPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToRatioExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToRatioExtensions.g.cs index 77bd15e366..4e13937c48 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToRatioExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToRatioExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToRatio /// public static class NumberToRatioExtensions { - /// + /// public static Ratio DecimalFractions(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static Ratio DecimalFractions(this T value) #endif => Ratio.FromDecimalFractions(Convert.ToDouble(value)); - /// + /// public static Ratio PartsPerBillion(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static Ratio PartsPerBillion(this T value) #endif => Ratio.FromPartsPerBillion(Convert.ToDouble(value)); - /// + /// public static Ratio PartsPerMillion(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static Ratio PartsPerMillion(this T value) #endif => Ratio.FromPartsPerMillion(Convert.ToDouble(value)); - /// + /// public static Ratio PartsPerThousand(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static Ratio PartsPerThousand(this T value) #endif => Ratio.FromPartsPerThousand(Convert.ToDouble(value)); - /// + /// public static Ratio PartsPerTrillion(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -72,7 +72,7 @@ public static Ratio PartsPerTrillion(this T value) #endif => Ratio.FromPartsPerTrillion(Convert.ToDouble(value)); - /// + /// public static Ratio Percent(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToReactiveEnergyExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToReactiveEnergyExtensions.g.cs index 9d49cd8dc4..57e2c4ee3f 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToReactiveEnergyExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToReactiveEnergyExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToReactiveEnergy /// public static class NumberToReactiveEnergyExtensions { - /// + /// public static ReactiveEnergy KilovoltampereReactiveHours(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static ReactiveEnergy KilovoltampereReactiveHours(this T value) #endif => ReactiveEnergy.FromKilovoltampereReactiveHours(Convert.ToDouble(value)); - /// + /// public static ReactiveEnergy MegavoltampereReactiveHours(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static ReactiveEnergy MegavoltampereReactiveHours(this T value) #endif => ReactiveEnergy.FromMegavoltampereReactiveHours(Convert.ToDouble(value)); - /// + /// public static ReactiveEnergy VoltampereReactiveHours(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToReactivePowerExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToReactivePowerExtensions.g.cs index cd418da760..70ffc0b7b0 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToReactivePowerExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToReactivePowerExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToReactivePower /// public static class NumberToReactivePowerExtensions { - /// + /// public static ReactivePower GigavoltamperesReactive(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static ReactivePower GigavoltamperesReactive(this T value) #endif => ReactivePower.FromGigavoltamperesReactive(Convert.ToDouble(value)); - /// + /// public static ReactivePower KilovoltamperesReactive(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static ReactivePower KilovoltamperesReactive(this T value) #endif => ReactivePower.FromKilovoltamperesReactive(Convert.ToDouble(value)); - /// + /// public static ReactivePower MegavoltamperesReactive(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static ReactivePower MegavoltamperesReactive(this T value) #endif => ReactivePower.FromMegavoltamperesReactive(Convert.ToDouble(value)); - /// + /// public static ReactivePower VoltamperesReactive(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToReciprocalAreaExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToReciprocalAreaExtensions.g.cs index 3ed970eca1..85b4bb1803 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToReciprocalAreaExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToReciprocalAreaExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToReciprocalArea /// public static class NumberToReciprocalAreaExtensions { - /// + /// public static ReciprocalArea InverseSquareCentimeters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static ReciprocalArea InverseSquareCentimeters(this T value) #endif => ReciprocalArea.FromInverseSquareCentimeters(Convert.ToDouble(value)); - /// + /// public static ReciprocalArea InverseSquareDecimeters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static ReciprocalArea InverseSquareDecimeters(this T value) #endif => ReciprocalArea.FromInverseSquareDecimeters(Convert.ToDouble(value)); - /// + /// public static ReciprocalArea InverseSquareFeet(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static ReciprocalArea InverseSquareFeet(this T value) #endif => ReciprocalArea.FromInverseSquareFeet(Convert.ToDouble(value)); - /// + /// public static ReciprocalArea InverseSquareInches(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static ReciprocalArea InverseSquareInches(this T value) #endif => ReciprocalArea.FromInverseSquareInches(Convert.ToDouble(value)); - /// + /// public static ReciprocalArea InverseSquareKilometers(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -72,7 +72,7 @@ public static ReciprocalArea InverseSquareKilometers(this T value) #endif => ReciprocalArea.FromInverseSquareKilometers(Convert.ToDouble(value)); - /// + /// public static ReciprocalArea InverseSquareMeters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -80,7 +80,7 @@ public static ReciprocalArea InverseSquareMeters(this T value) #endif => ReciprocalArea.FromInverseSquareMeters(Convert.ToDouble(value)); - /// + /// public static ReciprocalArea InverseSquareMicrometers(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -88,7 +88,7 @@ public static ReciprocalArea InverseSquareMicrometers(this T value) #endif => ReciprocalArea.FromInverseSquareMicrometers(Convert.ToDouble(value)); - /// + /// public static ReciprocalArea InverseSquareMiles(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -96,7 +96,7 @@ public static ReciprocalArea InverseSquareMiles(this T value) #endif => ReciprocalArea.FromInverseSquareMiles(Convert.ToDouble(value)); - /// + /// public static ReciprocalArea InverseSquareMillimeters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -104,7 +104,7 @@ public static ReciprocalArea InverseSquareMillimeters(this T value) #endif => ReciprocalArea.FromInverseSquareMillimeters(Convert.ToDouble(value)); - /// + /// public static ReciprocalArea InverseSquareYards(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -112,7 +112,7 @@ public static ReciprocalArea InverseSquareYards(this T value) #endif => ReciprocalArea.FromInverseSquareYards(Convert.ToDouble(value)); - /// + /// public static ReciprocalArea InverseUsSurveySquareFeet(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToReciprocalLengthExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToReciprocalLengthExtensions.g.cs index ded85d91ed..961f505c4c 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToReciprocalLengthExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToReciprocalLengthExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToReciprocalLength /// public static class NumberToReciprocalLengthExtensions { - /// + /// public static ReciprocalLength InverseCentimeters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static ReciprocalLength InverseCentimeters(this T value) #endif => ReciprocalLength.FromInverseCentimeters(Convert.ToDouble(value)); - /// + /// public static ReciprocalLength InverseFeet(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static ReciprocalLength InverseFeet(this T value) #endif => ReciprocalLength.FromInverseFeet(Convert.ToDouble(value)); - /// + /// public static ReciprocalLength InverseInches(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static ReciprocalLength InverseInches(this T value) #endif => ReciprocalLength.FromInverseInches(Convert.ToDouble(value)); - /// + /// public static ReciprocalLength InverseMeters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static ReciprocalLength InverseMeters(this T value) #endif => ReciprocalLength.FromInverseMeters(Convert.ToDouble(value)); - /// + /// public static ReciprocalLength InverseMicroinches(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -72,7 +72,7 @@ public static ReciprocalLength InverseMicroinches(this T value) #endif => ReciprocalLength.FromInverseMicroinches(Convert.ToDouble(value)); - /// + /// public static ReciprocalLength InverseMils(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -80,7 +80,7 @@ public static ReciprocalLength InverseMils(this T value) #endif => ReciprocalLength.FromInverseMils(Convert.ToDouble(value)); - /// + /// public static ReciprocalLength InverseMiles(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -88,7 +88,7 @@ public static ReciprocalLength InverseMiles(this T value) #endif => ReciprocalLength.FromInverseMiles(Convert.ToDouble(value)); - /// + /// public static ReciprocalLength InverseMillimeters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -96,7 +96,7 @@ public static ReciprocalLength InverseMillimeters(this T value) #endif => ReciprocalLength.FromInverseMillimeters(Convert.ToDouble(value)); - /// + /// public static ReciprocalLength InverseUsSurveyFeet(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -104,7 +104,7 @@ public static ReciprocalLength InverseUsSurveyFeet(this T value) #endif => ReciprocalLength.FromInverseUsSurveyFeet(Convert.ToDouble(value)); - /// + /// public static ReciprocalLength InverseYards(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToRelativeHumidityExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToRelativeHumidityExtensions.g.cs index cd2a097145..a218c2130e 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToRelativeHumidityExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToRelativeHumidityExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToRelativeHumidity /// public static class NumberToRelativeHumidityExtensions { - /// + /// public static RelativeHumidity Percent(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToRotationalAccelerationExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToRotationalAccelerationExtensions.g.cs index 3a31967bf4..2fb64ce3fa 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToRotationalAccelerationExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToRotationalAccelerationExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToRotationalAcceleration /// public static class NumberToRotationalAccelerationExtensions { - /// + /// public static RotationalAcceleration DegreesPerSecondSquared(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static RotationalAcceleration DegreesPerSecondSquared(this T value) #endif => RotationalAcceleration.FromDegreesPerSecondSquared(Convert.ToDouble(value)); - /// + /// public static RotationalAcceleration RadiansPerSecondSquared(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static RotationalAcceleration RadiansPerSecondSquared(this T value) #endif => RotationalAcceleration.FromRadiansPerSecondSquared(Convert.ToDouble(value)); - /// + /// public static RotationalAcceleration RevolutionsPerMinutePerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static RotationalAcceleration RevolutionsPerMinutePerSecond(this T val #endif => RotationalAcceleration.FromRevolutionsPerMinutePerSecond(Convert.ToDouble(value)); - /// + /// public static RotationalAcceleration RevolutionsPerSecondSquared(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToRotationalSpeedExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToRotationalSpeedExtensions.g.cs index a112c55846..2435e30aa9 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToRotationalSpeedExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToRotationalSpeedExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToRotationalSpeed /// public static class NumberToRotationalSpeedExtensions { - /// + /// public static RotationalSpeed CentiradiansPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static RotationalSpeed CentiradiansPerSecond(this T value) #endif => RotationalSpeed.FromCentiradiansPerSecond(Convert.ToDouble(value)); - /// + /// public static RotationalSpeed DeciradiansPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static RotationalSpeed DeciradiansPerSecond(this T value) #endif => RotationalSpeed.FromDeciradiansPerSecond(Convert.ToDouble(value)); - /// + /// public static RotationalSpeed DegreesPerMinute(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static RotationalSpeed DegreesPerMinute(this T value) #endif => RotationalSpeed.FromDegreesPerMinute(Convert.ToDouble(value)); - /// + /// public static RotationalSpeed DegreesPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static RotationalSpeed DegreesPerSecond(this T value) #endif => RotationalSpeed.FromDegreesPerSecond(Convert.ToDouble(value)); - /// + /// public static RotationalSpeed MicrodegreesPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -72,7 +72,7 @@ public static RotationalSpeed MicrodegreesPerSecond(this T value) #endif => RotationalSpeed.FromMicrodegreesPerSecond(Convert.ToDouble(value)); - /// + /// public static RotationalSpeed MicroradiansPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -80,7 +80,7 @@ public static RotationalSpeed MicroradiansPerSecond(this T value) #endif => RotationalSpeed.FromMicroradiansPerSecond(Convert.ToDouble(value)); - /// + /// public static RotationalSpeed MillidegreesPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -88,7 +88,7 @@ public static RotationalSpeed MillidegreesPerSecond(this T value) #endif => RotationalSpeed.FromMillidegreesPerSecond(Convert.ToDouble(value)); - /// + /// public static RotationalSpeed MilliradiansPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -96,7 +96,7 @@ public static RotationalSpeed MilliradiansPerSecond(this T value) #endif => RotationalSpeed.FromMilliradiansPerSecond(Convert.ToDouble(value)); - /// + /// public static RotationalSpeed NanodegreesPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -104,7 +104,7 @@ public static RotationalSpeed NanodegreesPerSecond(this T value) #endif => RotationalSpeed.FromNanodegreesPerSecond(Convert.ToDouble(value)); - /// + /// public static RotationalSpeed NanoradiansPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -112,7 +112,7 @@ public static RotationalSpeed NanoradiansPerSecond(this T value) #endif => RotationalSpeed.FromNanoradiansPerSecond(Convert.ToDouble(value)); - /// + /// public static RotationalSpeed RadiansPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -120,7 +120,7 @@ public static RotationalSpeed RadiansPerSecond(this T value) #endif => RotationalSpeed.FromRadiansPerSecond(Convert.ToDouble(value)); - /// + /// public static RotationalSpeed RevolutionsPerMinute(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -128,7 +128,7 @@ public static RotationalSpeed RevolutionsPerMinute(this T value) #endif => RotationalSpeed.FromRevolutionsPerMinute(Convert.ToDouble(value)); - /// + /// public static RotationalSpeed RevolutionsPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToRotationalStiffnessExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToRotationalStiffnessExtensions.g.cs index 98179dc575..fa713661cb 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToRotationalStiffnessExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToRotationalStiffnessExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToRotationalStiffness /// public static class NumberToRotationalStiffnessExtensions { - /// + /// public static RotationalStiffness CentinewtonMetersPerDegree(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static RotationalStiffness CentinewtonMetersPerDegree(this T value) #endif => RotationalStiffness.FromCentinewtonMetersPerDegree(Convert.ToDouble(value)); - /// + /// public static RotationalStiffness CentinewtonMillimetersPerDegree(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static RotationalStiffness CentinewtonMillimetersPerDegree(this T valu #endif => RotationalStiffness.FromCentinewtonMillimetersPerDegree(Convert.ToDouble(value)); - /// + /// public static RotationalStiffness CentinewtonMillimetersPerRadian(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static RotationalStiffness CentinewtonMillimetersPerRadian(this T valu #endif => RotationalStiffness.FromCentinewtonMillimetersPerRadian(Convert.ToDouble(value)); - /// + /// public static RotationalStiffness DecanewtonMetersPerDegree(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static RotationalStiffness DecanewtonMetersPerDegree(this T value) #endif => RotationalStiffness.FromDecanewtonMetersPerDegree(Convert.ToDouble(value)); - /// + /// public static RotationalStiffness DecanewtonMillimetersPerDegree(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -72,7 +72,7 @@ public static RotationalStiffness DecanewtonMillimetersPerDegree(this T value #endif => RotationalStiffness.FromDecanewtonMillimetersPerDegree(Convert.ToDouble(value)); - /// + /// public static RotationalStiffness DecanewtonMillimetersPerRadian(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -80,7 +80,7 @@ public static RotationalStiffness DecanewtonMillimetersPerRadian(this T value #endif => RotationalStiffness.FromDecanewtonMillimetersPerRadian(Convert.ToDouble(value)); - /// + /// public static RotationalStiffness DecinewtonMetersPerDegree(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -88,7 +88,7 @@ public static RotationalStiffness DecinewtonMetersPerDegree(this T value) #endif => RotationalStiffness.FromDecinewtonMetersPerDegree(Convert.ToDouble(value)); - /// + /// public static RotationalStiffness DecinewtonMillimetersPerDegree(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -96,7 +96,7 @@ public static RotationalStiffness DecinewtonMillimetersPerDegree(this T value #endif => RotationalStiffness.FromDecinewtonMillimetersPerDegree(Convert.ToDouble(value)); - /// + /// public static RotationalStiffness DecinewtonMillimetersPerRadian(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -104,7 +104,7 @@ public static RotationalStiffness DecinewtonMillimetersPerRadian(this T value #endif => RotationalStiffness.FromDecinewtonMillimetersPerRadian(Convert.ToDouble(value)); - /// + /// public static RotationalStiffness KilonewtonMetersPerDegree(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -112,7 +112,7 @@ public static RotationalStiffness KilonewtonMetersPerDegree(this T value) #endif => RotationalStiffness.FromKilonewtonMetersPerDegree(Convert.ToDouble(value)); - /// + /// public static RotationalStiffness KilonewtonMetersPerRadian(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -120,7 +120,7 @@ public static RotationalStiffness KilonewtonMetersPerRadian(this T value) #endif => RotationalStiffness.FromKilonewtonMetersPerRadian(Convert.ToDouble(value)); - /// + /// public static RotationalStiffness KilonewtonMillimetersPerDegree(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -128,7 +128,7 @@ public static RotationalStiffness KilonewtonMillimetersPerDegree(this T value #endif => RotationalStiffness.FromKilonewtonMillimetersPerDegree(Convert.ToDouble(value)); - /// + /// public static RotationalStiffness KilonewtonMillimetersPerRadian(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -136,7 +136,7 @@ public static RotationalStiffness KilonewtonMillimetersPerRadian(this T value #endif => RotationalStiffness.FromKilonewtonMillimetersPerRadian(Convert.ToDouble(value)); - /// + /// public static RotationalStiffness KilopoundForceFeetPerDegrees(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -144,7 +144,7 @@ public static RotationalStiffness KilopoundForceFeetPerDegrees(this T value) #endif => RotationalStiffness.FromKilopoundForceFeetPerDegrees(Convert.ToDouble(value)); - /// + /// public static RotationalStiffness MeganewtonMetersPerDegree(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -152,7 +152,7 @@ public static RotationalStiffness MeganewtonMetersPerDegree(this T value) #endif => RotationalStiffness.FromMeganewtonMetersPerDegree(Convert.ToDouble(value)); - /// + /// public static RotationalStiffness MeganewtonMetersPerRadian(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -160,7 +160,7 @@ public static RotationalStiffness MeganewtonMetersPerRadian(this T value) #endif => RotationalStiffness.FromMeganewtonMetersPerRadian(Convert.ToDouble(value)); - /// + /// public static RotationalStiffness MeganewtonMillimetersPerDegree(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -168,7 +168,7 @@ public static RotationalStiffness MeganewtonMillimetersPerDegree(this T value #endif => RotationalStiffness.FromMeganewtonMillimetersPerDegree(Convert.ToDouble(value)); - /// + /// public static RotationalStiffness MeganewtonMillimetersPerRadian(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -176,7 +176,7 @@ public static RotationalStiffness MeganewtonMillimetersPerRadian(this T value #endif => RotationalStiffness.FromMeganewtonMillimetersPerRadian(Convert.ToDouble(value)); - /// + /// public static RotationalStiffness MicronewtonMetersPerDegree(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -184,7 +184,7 @@ public static RotationalStiffness MicronewtonMetersPerDegree(this T value) #endif => RotationalStiffness.FromMicronewtonMetersPerDegree(Convert.ToDouble(value)); - /// + /// public static RotationalStiffness MicronewtonMillimetersPerDegree(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -192,7 +192,7 @@ public static RotationalStiffness MicronewtonMillimetersPerDegree(this T valu #endif => RotationalStiffness.FromMicronewtonMillimetersPerDegree(Convert.ToDouble(value)); - /// + /// public static RotationalStiffness MicronewtonMillimetersPerRadian(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -200,7 +200,7 @@ public static RotationalStiffness MicronewtonMillimetersPerRadian(this T valu #endif => RotationalStiffness.FromMicronewtonMillimetersPerRadian(Convert.ToDouble(value)); - /// + /// public static RotationalStiffness MillinewtonMetersPerDegree(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -208,7 +208,7 @@ public static RotationalStiffness MillinewtonMetersPerDegree(this T value) #endif => RotationalStiffness.FromMillinewtonMetersPerDegree(Convert.ToDouble(value)); - /// + /// public static RotationalStiffness MillinewtonMillimetersPerDegree(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -216,7 +216,7 @@ public static RotationalStiffness MillinewtonMillimetersPerDegree(this T valu #endif => RotationalStiffness.FromMillinewtonMillimetersPerDegree(Convert.ToDouble(value)); - /// + /// public static RotationalStiffness MillinewtonMillimetersPerRadian(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -224,7 +224,7 @@ public static RotationalStiffness MillinewtonMillimetersPerRadian(this T valu #endif => RotationalStiffness.FromMillinewtonMillimetersPerRadian(Convert.ToDouble(value)); - /// + /// public static RotationalStiffness NanonewtonMetersPerDegree(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -232,7 +232,7 @@ public static RotationalStiffness NanonewtonMetersPerDegree(this T value) #endif => RotationalStiffness.FromNanonewtonMetersPerDegree(Convert.ToDouble(value)); - /// + /// public static RotationalStiffness NanonewtonMillimetersPerDegree(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -240,7 +240,7 @@ public static RotationalStiffness NanonewtonMillimetersPerDegree(this T value #endif => RotationalStiffness.FromNanonewtonMillimetersPerDegree(Convert.ToDouble(value)); - /// + /// public static RotationalStiffness NanonewtonMillimetersPerRadian(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -248,7 +248,7 @@ public static RotationalStiffness NanonewtonMillimetersPerRadian(this T value #endif => RotationalStiffness.FromNanonewtonMillimetersPerRadian(Convert.ToDouble(value)); - /// + /// public static RotationalStiffness NewtonMetersPerDegree(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -256,7 +256,7 @@ public static RotationalStiffness NewtonMetersPerDegree(this T value) #endif => RotationalStiffness.FromNewtonMetersPerDegree(Convert.ToDouble(value)); - /// + /// public static RotationalStiffness NewtonMetersPerRadian(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -264,7 +264,7 @@ public static RotationalStiffness NewtonMetersPerRadian(this T value) #endif => RotationalStiffness.FromNewtonMetersPerRadian(Convert.ToDouble(value)); - /// + /// public static RotationalStiffness NewtonMillimetersPerDegree(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -272,7 +272,7 @@ public static RotationalStiffness NewtonMillimetersPerDegree(this T value) #endif => RotationalStiffness.FromNewtonMillimetersPerDegree(Convert.ToDouble(value)); - /// + /// public static RotationalStiffness NewtonMillimetersPerRadian(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -280,7 +280,7 @@ public static RotationalStiffness NewtonMillimetersPerRadian(this T value) #endif => RotationalStiffness.FromNewtonMillimetersPerRadian(Convert.ToDouble(value)); - /// + /// public static RotationalStiffness PoundForceFeetPerRadian(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -288,7 +288,7 @@ public static RotationalStiffness PoundForceFeetPerRadian(this T value) #endif => RotationalStiffness.FromPoundForceFeetPerRadian(Convert.ToDouble(value)); - /// + /// public static RotationalStiffness PoundForceFeetPerDegrees(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToRotationalStiffnessPerLengthExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToRotationalStiffnessPerLengthExtensions.g.cs index 26735a3ef5..61ca08cb9e 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToRotationalStiffnessPerLengthExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToRotationalStiffnessPerLengthExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToRotationalStiffnessPerLength /// public static class NumberToRotationalStiffnessPerLengthExtensions { - /// + /// public static RotationalStiffnessPerLength KilonewtonMetersPerRadianPerMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static RotationalStiffnessPerLength KilonewtonMetersPerRadianPerMeter( #endif => RotationalStiffnessPerLength.FromKilonewtonMetersPerRadianPerMeter(Convert.ToDouble(value)); - /// + /// public static RotationalStiffnessPerLength KilopoundForceFeetPerDegreesPerFeet(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static RotationalStiffnessPerLength KilopoundForceFeetPerDegreesPerFeet RotationalStiffnessPerLength.FromKilopoundForceFeetPerDegreesPerFeet(Convert.ToDouble(value)); - /// + /// public static RotationalStiffnessPerLength MeganewtonMetersPerRadianPerMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static RotationalStiffnessPerLength MeganewtonMetersPerRadianPerMeter( #endif => RotationalStiffnessPerLength.FromMeganewtonMetersPerRadianPerMeter(Convert.ToDouble(value)); - /// + /// public static RotationalStiffnessPerLength NewtonMetersPerRadianPerMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static RotationalStiffnessPerLength NewtonMetersPerRadianPerMeter(this #endif => RotationalStiffnessPerLength.FromNewtonMetersPerRadianPerMeter(Convert.ToDouble(value)); - /// + /// public static RotationalStiffnessPerLength PoundForceFeetPerDegreesPerFeet(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToScalarExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToScalarExtensions.g.cs index d5a54edf99..36ff683ac4 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToScalarExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToScalarExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToScalar /// public static class NumberToScalarExtensions { - /// + /// public static Scalar Amount(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToSolidAngleExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToSolidAngleExtensions.g.cs index 8fe95801c6..769ebf0a67 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToSolidAngleExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToSolidAngleExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToSolidAngle /// public static class NumberToSolidAngleExtensions { - /// + /// public static SolidAngle Steradians(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToSpecificEnergyExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToSpecificEnergyExtensions.g.cs index 2c4351e123..f94c47ccc1 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToSpecificEnergyExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToSpecificEnergyExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToSpecificEnergy /// public static class NumberToSpecificEnergyExtensions { - /// + /// public static SpecificEnergy BtuPerPound(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static SpecificEnergy BtuPerPound(this T value) #endif => SpecificEnergy.FromBtuPerPound(Convert.ToDouble(value)); - /// + /// public static SpecificEnergy CaloriesPerGram(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static SpecificEnergy CaloriesPerGram(this T value) #endif => SpecificEnergy.FromCaloriesPerGram(Convert.ToDouble(value)); - /// + /// public static SpecificEnergy GigawattDaysPerKilogram(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static SpecificEnergy GigawattDaysPerKilogram(this T value) #endif => SpecificEnergy.FromGigawattDaysPerKilogram(Convert.ToDouble(value)); - /// + /// public static SpecificEnergy GigawattDaysPerShortTon(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static SpecificEnergy GigawattDaysPerShortTon(this T value) #endif => SpecificEnergy.FromGigawattDaysPerShortTon(Convert.ToDouble(value)); - /// + /// public static SpecificEnergy GigawattDaysPerTonne(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -72,7 +72,7 @@ public static SpecificEnergy GigawattDaysPerTonne(this T value) #endif => SpecificEnergy.FromGigawattDaysPerTonne(Convert.ToDouble(value)); - /// + /// public static SpecificEnergy GigawattHoursPerKilogram(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -80,7 +80,7 @@ public static SpecificEnergy GigawattHoursPerKilogram(this T value) #endif => SpecificEnergy.FromGigawattHoursPerKilogram(Convert.ToDouble(value)); - /// + /// public static SpecificEnergy GigawattHoursPerPound(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -88,7 +88,7 @@ public static SpecificEnergy GigawattHoursPerPound(this T value) #endif => SpecificEnergy.FromGigawattHoursPerPound(Convert.ToDouble(value)); - /// + /// public static SpecificEnergy JoulesPerKilogram(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -96,7 +96,7 @@ public static SpecificEnergy JoulesPerKilogram(this T value) #endif => SpecificEnergy.FromJoulesPerKilogram(Convert.ToDouble(value)); - /// + /// public static SpecificEnergy KilocaloriesPerGram(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -104,7 +104,7 @@ public static SpecificEnergy KilocaloriesPerGram(this T value) #endif => SpecificEnergy.FromKilocaloriesPerGram(Convert.ToDouble(value)); - /// + /// public static SpecificEnergy KilojoulesPerKilogram(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -112,7 +112,7 @@ public static SpecificEnergy KilojoulesPerKilogram(this T value) #endif => SpecificEnergy.FromKilojoulesPerKilogram(Convert.ToDouble(value)); - /// + /// public static SpecificEnergy KilowattDaysPerKilogram(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -120,7 +120,7 @@ public static SpecificEnergy KilowattDaysPerKilogram(this T value) #endif => SpecificEnergy.FromKilowattDaysPerKilogram(Convert.ToDouble(value)); - /// + /// public static SpecificEnergy KilowattDaysPerShortTon(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -128,7 +128,7 @@ public static SpecificEnergy KilowattDaysPerShortTon(this T value) #endif => SpecificEnergy.FromKilowattDaysPerShortTon(Convert.ToDouble(value)); - /// + /// public static SpecificEnergy KilowattDaysPerTonne(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -136,7 +136,7 @@ public static SpecificEnergy KilowattDaysPerTonne(this T value) #endif => SpecificEnergy.FromKilowattDaysPerTonne(Convert.ToDouble(value)); - /// + /// public static SpecificEnergy KilowattHoursPerKilogram(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -144,7 +144,7 @@ public static SpecificEnergy KilowattHoursPerKilogram(this T value) #endif => SpecificEnergy.FromKilowattHoursPerKilogram(Convert.ToDouble(value)); - /// + /// public static SpecificEnergy KilowattHoursPerPound(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -152,7 +152,7 @@ public static SpecificEnergy KilowattHoursPerPound(this T value) #endif => SpecificEnergy.FromKilowattHoursPerPound(Convert.ToDouble(value)); - /// + /// public static SpecificEnergy MegajoulesPerKilogram(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -160,7 +160,7 @@ public static SpecificEnergy MegajoulesPerKilogram(this T value) #endif => SpecificEnergy.FromMegajoulesPerKilogram(Convert.ToDouble(value)); - /// + /// public static SpecificEnergy MegaJoulesPerTonne(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -168,7 +168,7 @@ public static SpecificEnergy MegaJoulesPerTonne(this T value) #endif => SpecificEnergy.FromMegaJoulesPerTonne(Convert.ToDouble(value)); - /// + /// public static SpecificEnergy MegawattDaysPerKilogram(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -176,7 +176,7 @@ public static SpecificEnergy MegawattDaysPerKilogram(this T value) #endif => SpecificEnergy.FromMegawattDaysPerKilogram(Convert.ToDouble(value)); - /// + /// public static SpecificEnergy MegawattDaysPerShortTon(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -184,7 +184,7 @@ public static SpecificEnergy MegawattDaysPerShortTon(this T value) #endif => SpecificEnergy.FromMegawattDaysPerShortTon(Convert.ToDouble(value)); - /// + /// public static SpecificEnergy MegawattDaysPerTonne(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -192,7 +192,7 @@ public static SpecificEnergy MegawattDaysPerTonne(this T value) #endif => SpecificEnergy.FromMegawattDaysPerTonne(Convert.ToDouble(value)); - /// + /// public static SpecificEnergy MegawattHoursPerKilogram(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -200,7 +200,7 @@ public static SpecificEnergy MegawattHoursPerKilogram(this T value) #endif => SpecificEnergy.FromMegawattHoursPerKilogram(Convert.ToDouble(value)); - /// + /// public static SpecificEnergy MegawattHoursPerPound(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -208,7 +208,7 @@ public static SpecificEnergy MegawattHoursPerPound(this T value) #endif => SpecificEnergy.FromMegawattHoursPerPound(Convert.ToDouble(value)); - /// + /// public static SpecificEnergy TerawattDaysPerKilogram(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -216,7 +216,7 @@ public static SpecificEnergy TerawattDaysPerKilogram(this T value) #endif => SpecificEnergy.FromTerawattDaysPerKilogram(Convert.ToDouble(value)); - /// + /// public static SpecificEnergy TerawattDaysPerShortTon(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -224,7 +224,7 @@ public static SpecificEnergy TerawattDaysPerShortTon(this T value) #endif => SpecificEnergy.FromTerawattDaysPerShortTon(Convert.ToDouble(value)); - /// + /// public static SpecificEnergy TerawattDaysPerTonne(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -232,7 +232,7 @@ public static SpecificEnergy TerawattDaysPerTonne(this T value) #endif => SpecificEnergy.FromTerawattDaysPerTonne(Convert.ToDouble(value)); - /// + /// public static SpecificEnergy WattDaysPerKilogram(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -240,7 +240,7 @@ public static SpecificEnergy WattDaysPerKilogram(this T value) #endif => SpecificEnergy.FromWattDaysPerKilogram(Convert.ToDouble(value)); - /// + /// public static SpecificEnergy WattDaysPerShortTon(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -248,7 +248,7 @@ public static SpecificEnergy WattDaysPerShortTon(this T value) #endif => SpecificEnergy.FromWattDaysPerShortTon(Convert.ToDouble(value)); - /// + /// public static SpecificEnergy WattDaysPerTonne(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -256,7 +256,7 @@ public static SpecificEnergy WattDaysPerTonne(this T value) #endif => SpecificEnergy.FromWattDaysPerTonne(Convert.ToDouble(value)); - /// + /// public static SpecificEnergy WattHoursPerKilogram(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -264,7 +264,7 @@ public static SpecificEnergy WattHoursPerKilogram(this T value) #endif => SpecificEnergy.FromWattHoursPerKilogram(Convert.ToDouble(value)); - /// + /// public static SpecificEnergy WattHoursPerPound(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToSpecificEntropyExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToSpecificEntropyExtensions.g.cs index bf2479f834..b84168a527 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToSpecificEntropyExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToSpecificEntropyExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToSpecificEntropy /// public static class NumberToSpecificEntropyExtensions { - /// + /// public static SpecificEntropy BtusPerPoundFahrenheit(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static SpecificEntropy BtusPerPoundFahrenheit(this T value) #endif => SpecificEntropy.FromBtusPerPoundFahrenheit(Convert.ToDouble(value)); - /// + /// public static SpecificEntropy CaloriesPerGramKelvin(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static SpecificEntropy CaloriesPerGramKelvin(this T value) #endif => SpecificEntropy.FromCaloriesPerGramKelvin(Convert.ToDouble(value)); - /// + /// public static SpecificEntropy JoulesPerKilogramDegreeCelsius(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static SpecificEntropy JoulesPerKilogramDegreeCelsius(this T value) #endif => SpecificEntropy.FromJoulesPerKilogramDegreeCelsius(Convert.ToDouble(value)); - /// + /// public static SpecificEntropy JoulesPerKilogramKelvin(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static SpecificEntropy JoulesPerKilogramKelvin(this T value) #endif => SpecificEntropy.FromJoulesPerKilogramKelvin(Convert.ToDouble(value)); - /// + /// public static SpecificEntropy KilocaloriesPerGramKelvin(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -72,7 +72,7 @@ public static SpecificEntropy KilocaloriesPerGramKelvin(this T value) #endif => SpecificEntropy.FromKilocaloriesPerGramKelvin(Convert.ToDouble(value)); - /// + /// public static SpecificEntropy KilojoulesPerKilogramDegreeCelsius(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -80,7 +80,7 @@ public static SpecificEntropy KilojoulesPerKilogramDegreeCelsius(this T value #endif => SpecificEntropy.FromKilojoulesPerKilogramDegreeCelsius(Convert.ToDouble(value)); - /// + /// public static SpecificEntropy KilojoulesPerKilogramKelvin(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -88,7 +88,7 @@ public static SpecificEntropy KilojoulesPerKilogramKelvin(this T value) #endif => SpecificEntropy.FromKilojoulesPerKilogramKelvin(Convert.ToDouble(value)); - /// + /// public static SpecificEntropy MegajoulesPerKilogramDegreeCelsius(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -96,7 +96,7 @@ public static SpecificEntropy MegajoulesPerKilogramDegreeCelsius(this T value #endif => SpecificEntropy.FromMegajoulesPerKilogramDegreeCelsius(Convert.ToDouble(value)); - /// + /// public static SpecificEntropy MegajoulesPerKilogramKelvin(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToSpecificFuelConsumptionExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToSpecificFuelConsumptionExtensions.g.cs index 4dd990820b..0d6dc5a674 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToSpecificFuelConsumptionExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToSpecificFuelConsumptionExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToSpecificFuelConsumption /// public static class NumberToSpecificFuelConsumptionExtensions { - /// + /// public static SpecificFuelConsumption GramsPerKiloNewtonSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static SpecificFuelConsumption GramsPerKiloNewtonSecond(this T value) #endif => SpecificFuelConsumption.FromGramsPerKiloNewtonSecond(Convert.ToDouble(value)); - /// + /// public static SpecificFuelConsumption KilogramsPerKilogramForceHour(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static SpecificFuelConsumption KilogramsPerKilogramForceHour(this T va #endif => SpecificFuelConsumption.FromKilogramsPerKilogramForceHour(Convert.ToDouble(value)); - /// + /// public static SpecificFuelConsumption KilogramsPerKiloNewtonSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static SpecificFuelConsumption KilogramsPerKiloNewtonSecond(this T val #endif => SpecificFuelConsumption.FromKilogramsPerKiloNewtonSecond(Convert.ToDouble(value)); - /// + /// public static SpecificFuelConsumption PoundsMassPerPoundForceHour(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToSpecificVolumeExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToSpecificVolumeExtensions.g.cs index f6224fa844..786ff59b03 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToSpecificVolumeExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToSpecificVolumeExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToSpecificVolume /// public static class NumberToSpecificVolumeExtensions { - /// + /// public static SpecificVolume CubicFeetPerPound(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static SpecificVolume CubicFeetPerPound(this T value) #endif => SpecificVolume.FromCubicFeetPerPound(Convert.ToDouble(value)); - /// + /// public static SpecificVolume CubicMetersPerKilogram(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static SpecificVolume CubicMetersPerKilogram(this T value) #endif => SpecificVolume.FromCubicMetersPerKilogram(Convert.ToDouble(value)); - /// + /// public static SpecificVolume MillicubicMetersPerKilogram(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToSpecificWeightExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToSpecificWeightExtensions.g.cs index aa28a83c2a..5a77413b77 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToSpecificWeightExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToSpecificWeightExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToSpecificWeight /// public static class NumberToSpecificWeightExtensions { - /// + /// public static SpecificWeight KilogramsForcePerCubicCentimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static SpecificWeight KilogramsForcePerCubicCentimeter(this T value) #endif => SpecificWeight.FromKilogramsForcePerCubicCentimeter(Convert.ToDouble(value)); - /// + /// public static SpecificWeight KilogramsForcePerCubicMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static SpecificWeight KilogramsForcePerCubicMeter(this T value) #endif => SpecificWeight.FromKilogramsForcePerCubicMeter(Convert.ToDouble(value)); - /// + /// public static SpecificWeight KilogramsForcePerCubicMillimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static SpecificWeight KilogramsForcePerCubicMillimeter(this T value) #endif => SpecificWeight.FromKilogramsForcePerCubicMillimeter(Convert.ToDouble(value)); - /// + /// public static SpecificWeight KilonewtonsPerCubicCentimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static SpecificWeight KilonewtonsPerCubicCentimeter(this T value) #endif => SpecificWeight.FromKilonewtonsPerCubicCentimeter(Convert.ToDouble(value)); - /// + /// public static SpecificWeight KilonewtonsPerCubicMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -72,7 +72,7 @@ public static SpecificWeight KilonewtonsPerCubicMeter(this T value) #endif => SpecificWeight.FromKilonewtonsPerCubicMeter(Convert.ToDouble(value)); - /// + /// public static SpecificWeight KilonewtonsPerCubicMillimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -80,7 +80,7 @@ public static SpecificWeight KilonewtonsPerCubicMillimeter(this T value) #endif => SpecificWeight.FromKilonewtonsPerCubicMillimeter(Convert.ToDouble(value)); - /// + /// public static SpecificWeight KilopoundsForcePerCubicFoot(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -88,7 +88,7 @@ public static SpecificWeight KilopoundsForcePerCubicFoot(this T value) #endif => SpecificWeight.FromKilopoundsForcePerCubicFoot(Convert.ToDouble(value)); - /// + /// public static SpecificWeight KilopoundsForcePerCubicInch(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -96,7 +96,7 @@ public static SpecificWeight KilopoundsForcePerCubicInch(this T value) #endif => SpecificWeight.FromKilopoundsForcePerCubicInch(Convert.ToDouble(value)); - /// + /// public static SpecificWeight MeganewtonsPerCubicMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -104,7 +104,7 @@ public static SpecificWeight MeganewtonsPerCubicMeter(this T value) #endif => SpecificWeight.FromMeganewtonsPerCubicMeter(Convert.ToDouble(value)); - /// + /// public static SpecificWeight NewtonsPerCubicCentimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -112,7 +112,7 @@ public static SpecificWeight NewtonsPerCubicCentimeter(this T value) #endif => SpecificWeight.FromNewtonsPerCubicCentimeter(Convert.ToDouble(value)); - /// + /// public static SpecificWeight NewtonsPerCubicMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -120,7 +120,7 @@ public static SpecificWeight NewtonsPerCubicMeter(this T value) #endif => SpecificWeight.FromNewtonsPerCubicMeter(Convert.ToDouble(value)); - /// + /// public static SpecificWeight NewtonsPerCubicMillimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -128,7 +128,7 @@ public static SpecificWeight NewtonsPerCubicMillimeter(this T value) #endif => SpecificWeight.FromNewtonsPerCubicMillimeter(Convert.ToDouble(value)); - /// + /// public static SpecificWeight PoundsForcePerCubicFoot(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -136,7 +136,7 @@ public static SpecificWeight PoundsForcePerCubicFoot(this T value) #endif => SpecificWeight.FromPoundsForcePerCubicFoot(Convert.ToDouble(value)); - /// + /// public static SpecificWeight PoundsForcePerCubicInch(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -144,7 +144,7 @@ public static SpecificWeight PoundsForcePerCubicInch(this T value) #endif => SpecificWeight.FromPoundsForcePerCubicInch(Convert.ToDouble(value)); - /// + /// public static SpecificWeight TonnesForcePerCubicCentimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -152,7 +152,7 @@ public static SpecificWeight TonnesForcePerCubicCentimeter(this T value) #endif => SpecificWeight.FromTonnesForcePerCubicCentimeter(Convert.ToDouble(value)); - /// + /// public static SpecificWeight TonnesForcePerCubicMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -160,7 +160,7 @@ public static SpecificWeight TonnesForcePerCubicMeter(this T value) #endif => SpecificWeight.FromTonnesForcePerCubicMeter(Convert.ToDouble(value)); - /// + /// public static SpecificWeight TonnesForcePerCubicMillimeter(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToSpeedExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToSpeedExtensions.g.cs index 956e9ae248..eacd11c94f 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToSpeedExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToSpeedExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToSpeed /// public static class NumberToSpeedExtensions { - /// + /// public static Speed CentimetersPerHour(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static Speed CentimetersPerHour(this T value) #endif => Speed.FromCentimetersPerHour(Convert.ToDouble(value)); - /// + /// public static Speed CentimetersPerMinute(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static Speed CentimetersPerMinute(this T value) #endif => Speed.FromCentimetersPerMinute(Convert.ToDouble(value)); - /// + /// public static Speed CentimetersPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static Speed CentimetersPerSecond(this T value) #endif => Speed.FromCentimetersPerSecond(Convert.ToDouble(value)); - /// + /// public static Speed DecimetersPerMinute(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static Speed DecimetersPerMinute(this T value) #endif => Speed.FromDecimetersPerMinute(Convert.ToDouble(value)); - /// + /// public static Speed DecimetersPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -72,7 +72,7 @@ public static Speed DecimetersPerSecond(this T value) #endif => Speed.FromDecimetersPerSecond(Convert.ToDouble(value)); - /// + /// public static Speed FeetPerHour(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -80,7 +80,7 @@ public static Speed FeetPerHour(this T value) #endif => Speed.FromFeetPerHour(Convert.ToDouble(value)); - /// + /// public static Speed FeetPerMinute(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -88,7 +88,7 @@ public static Speed FeetPerMinute(this T value) #endif => Speed.FromFeetPerMinute(Convert.ToDouble(value)); - /// + /// public static Speed FeetPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -96,7 +96,7 @@ public static Speed FeetPerSecond(this T value) #endif => Speed.FromFeetPerSecond(Convert.ToDouble(value)); - /// + /// public static Speed InchesPerHour(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -104,7 +104,7 @@ public static Speed InchesPerHour(this T value) #endif => Speed.FromInchesPerHour(Convert.ToDouble(value)); - /// + /// public static Speed InchesPerMinute(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -112,7 +112,7 @@ public static Speed InchesPerMinute(this T value) #endif => Speed.FromInchesPerMinute(Convert.ToDouble(value)); - /// + /// public static Speed InchesPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -120,7 +120,7 @@ public static Speed InchesPerSecond(this T value) #endif => Speed.FromInchesPerSecond(Convert.ToDouble(value)); - /// + /// public static Speed KilometersPerHour(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -128,7 +128,7 @@ public static Speed KilometersPerHour(this T value) #endif => Speed.FromKilometersPerHour(Convert.ToDouble(value)); - /// + /// public static Speed KilometersPerMinute(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -136,7 +136,7 @@ public static Speed KilometersPerMinute(this T value) #endif => Speed.FromKilometersPerMinute(Convert.ToDouble(value)); - /// + /// public static Speed KilometersPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -144,7 +144,7 @@ public static Speed KilometersPerSecond(this T value) #endif => Speed.FromKilometersPerSecond(Convert.ToDouble(value)); - /// + /// public static Speed Knots(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -152,7 +152,7 @@ public static Speed Knots(this T value) #endif => Speed.FromKnots(Convert.ToDouble(value)); - /// + /// public static Speed Mach(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -160,7 +160,7 @@ public static Speed Mach(this T value) #endif => Speed.FromMach(Convert.ToDouble(value)); - /// + /// public static Speed MetersPerHour(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -168,7 +168,7 @@ public static Speed MetersPerHour(this T value) #endif => Speed.FromMetersPerHour(Convert.ToDouble(value)); - /// + /// public static Speed MetersPerMinute(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -176,7 +176,7 @@ public static Speed MetersPerMinute(this T value) #endif => Speed.FromMetersPerMinute(Convert.ToDouble(value)); - /// + /// public static Speed MetersPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -184,7 +184,7 @@ public static Speed MetersPerSecond(this T value) #endif => Speed.FromMetersPerSecond(Convert.ToDouble(value)); - /// + /// public static Speed MicrometersPerMinute(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -192,7 +192,7 @@ public static Speed MicrometersPerMinute(this T value) #endif => Speed.FromMicrometersPerMinute(Convert.ToDouble(value)); - /// + /// public static Speed MicrometersPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -200,7 +200,7 @@ public static Speed MicrometersPerSecond(this T value) #endif => Speed.FromMicrometersPerSecond(Convert.ToDouble(value)); - /// + /// public static Speed MilesPerHour(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -208,7 +208,7 @@ public static Speed MilesPerHour(this T value) #endif => Speed.FromMilesPerHour(Convert.ToDouble(value)); - /// + /// public static Speed MillimetersPerHour(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -216,7 +216,7 @@ public static Speed MillimetersPerHour(this T value) #endif => Speed.FromMillimetersPerHour(Convert.ToDouble(value)); - /// + /// public static Speed MillimetersPerMinute(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -224,7 +224,7 @@ public static Speed MillimetersPerMinute(this T value) #endif => Speed.FromMillimetersPerMinute(Convert.ToDouble(value)); - /// + /// public static Speed MillimetersPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -232,7 +232,7 @@ public static Speed MillimetersPerSecond(this T value) #endif => Speed.FromMillimetersPerSecond(Convert.ToDouble(value)); - /// + /// public static Speed NanometersPerMinute(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -240,7 +240,7 @@ public static Speed NanometersPerMinute(this T value) #endif => Speed.FromNanometersPerMinute(Convert.ToDouble(value)); - /// + /// public static Speed NanometersPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -248,7 +248,7 @@ public static Speed NanometersPerSecond(this T value) #endif => Speed.FromNanometersPerSecond(Convert.ToDouble(value)); - /// + /// public static Speed UsSurveyFeetPerHour(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -256,7 +256,7 @@ public static Speed UsSurveyFeetPerHour(this T value) #endif => Speed.FromUsSurveyFeetPerHour(Convert.ToDouble(value)); - /// + /// public static Speed UsSurveyFeetPerMinute(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -264,7 +264,7 @@ public static Speed UsSurveyFeetPerMinute(this T value) #endif => Speed.FromUsSurveyFeetPerMinute(Convert.ToDouble(value)); - /// + /// public static Speed UsSurveyFeetPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -272,7 +272,7 @@ public static Speed UsSurveyFeetPerSecond(this T value) #endif => Speed.FromUsSurveyFeetPerSecond(Convert.ToDouble(value)); - /// + /// public static Speed YardsPerHour(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -280,7 +280,7 @@ public static Speed YardsPerHour(this T value) #endif => Speed.FromYardsPerHour(Convert.ToDouble(value)); - /// + /// public static Speed YardsPerMinute(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -288,7 +288,7 @@ public static Speed YardsPerMinute(this T value) #endif => Speed.FromYardsPerMinute(Convert.ToDouble(value)); - /// + /// public static Speed YardsPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToStandardVolumeFlowExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToStandardVolumeFlowExtensions.g.cs index 5d6d12ebb6..f16a65fe3b 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToStandardVolumeFlowExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToStandardVolumeFlowExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToStandardVolumeFlow /// public static class NumberToStandardVolumeFlowExtensions { - /// + /// public static StandardVolumeFlow StandardCubicCentimetersPerMinute(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static StandardVolumeFlow StandardCubicCentimetersPerMinute(this T val #endif => StandardVolumeFlow.FromStandardCubicCentimetersPerMinute(Convert.ToDouble(value)); - /// + /// public static StandardVolumeFlow StandardCubicFeetPerHour(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static StandardVolumeFlow StandardCubicFeetPerHour(this T value) #endif => StandardVolumeFlow.FromStandardCubicFeetPerHour(Convert.ToDouble(value)); - /// + /// public static StandardVolumeFlow StandardCubicFeetPerMinute(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static StandardVolumeFlow StandardCubicFeetPerMinute(this T value) #endif => StandardVolumeFlow.FromStandardCubicFeetPerMinute(Convert.ToDouble(value)); - /// + /// public static StandardVolumeFlow StandardCubicFeetPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static StandardVolumeFlow StandardCubicFeetPerSecond(this T value) #endif => StandardVolumeFlow.FromStandardCubicFeetPerSecond(Convert.ToDouble(value)); - /// + /// public static StandardVolumeFlow StandardCubicMetersPerDay(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -72,7 +72,7 @@ public static StandardVolumeFlow StandardCubicMetersPerDay(this T value) #endif => StandardVolumeFlow.FromStandardCubicMetersPerDay(Convert.ToDouble(value)); - /// + /// public static StandardVolumeFlow StandardCubicMetersPerHour(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -80,7 +80,7 @@ public static StandardVolumeFlow StandardCubicMetersPerHour(this T value) #endif => StandardVolumeFlow.FromStandardCubicMetersPerHour(Convert.ToDouble(value)); - /// + /// public static StandardVolumeFlow StandardCubicMetersPerMinute(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -88,7 +88,7 @@ public static StandardVolumeFlow StandardCubicMetersPerMinute(this T value) #endif => StandardVolumeFlow.FromStandardCubicMetersPerMinute(Convert.ToDouble(value)); - /// + /// public static StandardVolumeFlow StandardCubicMetersPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -96,7 +96,7 @@ public static StandardVolumeFlow StandardCubicMetersPerSecond(this T value) #endif => StandardVolumeFlow.FromStandardCubicMetersPerSecond(Convert.ToDouble(value)); - /// + /// public static StandardVolumeFlow StandardLitersPerMinute(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToTemperatureChangeRateExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToTemperatureChangeRateExtensions.g.cs index 98d8dfae29..c54cba19b9 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToTemperatureChangeRateExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToTemperatureChangeRateExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToTemperatureChangeRate /// public static class NumberToTemperatureChangeRateExtensions { - /// + /// public static TemperatureChangeRate CentidegreesCelsiusPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static TemperatureChangeRate CentidegreesCelsiusPerSecond(this T value #endif => TemperatureChangeRate.FromCentidegreesCelsiusPerSecond(Convert.ToDouble(value)); - /// + /// public static TemperatureChangeRate DecadegreesCelsiusPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static TemperatureChangeRate DecadegreesCelsiusPerSecond(this T value) #endif => TemperatureChangeRate.FromDecadegreesCelsiusPerSecond(Convert.ToDouble(value)); - /// + /// public static TemperatureChangeRate DecidegreesCelsiusPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static TemperatureChangeRate DecidegreesCelsiusPerSecond(this T value) #endif => TemperatureChangeRate.FromDecidegreesCelsiusPerSecond(Convert.ToDouble(value)); - /// + /// public static TemperatureChangeRate DegreesCelsiusPerMinute(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static TemperatureChangeRate DegreesCelsiusPerMinute(this T value) #endif => TemperatureChangeRate.FromDegreesCelsiusPerMinute(Convert.ToDouble(value)); - /// + /// public static TemperatureChangeRate DegreesCelsiusPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -72,7 +72,7 @@ public static TemperatureChangeRate DegreesCelsiusPerSecond(this T value) #endif => TemperatureChangeRate.FromDegreesCelsiusPerSecond(Convert.ToDouble(value)); - /// + /// public static TemperatureChangeRate HectodegreesCelsiusPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -80,7 +80,7 @@ public static TemperatureChangeRate HectodegreesCelsiusPerSecond(this T value #endif => TemperatureChangeRate.FromHectodegreesCelsiusPerSecond(Convert.ToDouble(value)); - /// + /// public static TemperatureChangeRate KilodegreesCelsiusPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -88,7 +88,7 @@ public static TemperatureChangeRate KilodegreesCelsiusPerSecond(this T value) #endif => TemperatureChangeRate.FromKilodegreesCelsiusPerSecond(Convert.ToDouble(value)); - /// + /// public static TemperatureChangeRate MicrodegreesCelsiusPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -96,7 +96,7 @@ public static TemperatureChangeRate MicrodegreesCelsiusPerSecond(this T value #endif => TemperatureChangeRate.FromMicrodegreesCelsiusPerSecond(Convert.ToDouble(value)); - /// + /// public static TemperatureChangeRate MillidegreesCelsiusPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -104,7 +104,7 @@ public static TemperatureChangeRate MillidegreesCelsiusPerSecond(this T value #endif => TemperatureChangeRate.FromMillidegreesCelsiusPerSecond(Convert.ToDouble(value)); - /// + /// public static TemperatureChangeRate NanodegreesCelsiusPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToTemperatureDeltaExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToTemperatureDeltaExtensions.g.cs index dd92e8f190..1411f8e573 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToTemperatureDeltaExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToTemperatureDeltaExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToTemperatureDelta /// public static class NumberToTemperatureDeltaExtensions { - /// + /// public static TemperatureDelta DegreesCelsius(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static TemperatureDelta DegreesCelsius(this T value) #endif => TemperatureDelta.FromDegreesCelsius(Convert.ToDouble(value)); - /// + /// public static TemperatureDelta DegreesDelisle(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static TemperatureDelta DegreesDelisle(this T value) #endif => TemperatureDelta.FromDegreesDelisle(Convert.ToDouble(value)); - /// + /// public static TemperatureDelta DegreesFahrenheit(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static TemperatureDelta DegreesFahrenheit(this T value) #endif => TemperatureDelta.FromDegreesFahrenheit(Convert.ToDouble(value)); - /// + /// public static TemperatureDelta DegreesNewton(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static TemperatureDelta DegreesNewton(this T value) #endif => TemperatureDelta.FromDegreesNewton(Convert.ToDouble(value)); - /// + /// public static TemperatureDelta DegreesRankine(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -72,7 +72,7 @@ public static TemperatureDelta DegreesRankine(this T value) #endif => TemperatureDelta.FromDegreesRankine(Convert.ToDouble(value)); - /// + /// public static TemperatureDelta DegreesReaumur(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -80,7 +80,7 @@ public static TemperatureDelta DegreesReaumur(this T value) #endif => TemperatureDelta.FromDegreesReaumur(Convert.ToDouble(value)); - /// + /// public static TemperatureDelta DegreesRoemer(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -88,7 +88,7 @@ public static TemperatureDelta DegreesRoemer(this T value) #endif => TemperatureDelta.FromDegreesRoemer(Convert.ToDouble(value)); - /// + /// public static TemperatureDelta Kelvins(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -96,7 +96,7 @@ public static TemperatureDelta Kelvins(this T value) #endif => TemperatureDelta.FromKelvins(Convert.ToDouble(value)); - /// + /// public static TemperatureDelta MillidegreesCelsius(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToTemperatureExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToTemperatureExtensions.g.cs index c739bab623..c49aa4c8a2 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToTemperatureExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToTemperatureExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToTemperature /// public static class NumberToTemperatureExtensions { - /// + /// public static Temperature DegreesCelsius(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static Temperature DegreesCelsius(this T value) #endif => Temperature.FromDegreesCelsius(Convert.ToDouble(value)); - /// + /// public static Temperature DegreesDelisle(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static Temperature DegreesDelisle(this T value) #endif => Temperature.FromDegreesDelisle(Convert.ToDouble(value)); - /// + /// public static Temperature DegreesFahrenheit(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static Temperature DegreesFahrenheit(this T value) #endif => Temperature.FromDegreesFahrenheit(Convert.ToDouble(value)); - /// + /// public static Temperature DegreesNewton(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static Temperature DegreesNewton(this T value) #endif => Temperature.FromDegreesNewton(Convert.ToDouble(value)); - /// + /// public static Temperature DegreesRankine(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -72,7 +72,7 @@ public static Temperature DegreesRankine(this T value) #endif => Temperature.FromDegreesRankine(Convert.ToDouble(value)); - /// + /// public static Temperature DegreesReaumur(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -80,7 +80,7 @@ public static Temperature DegreesReaumur(this T value) #endif => Temperature.FromDegreesReaumur(Convert.ToDouble(value)); - /// + /// public static Temperature DegreesRoemer(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -88,7 +88,7 @@ public static Temperature DegreesRoemer(this T value) #endif => Temperature.FromDegreesRoemer(Convert.ToDouble(value)); - /// + /// public static Temperature Kelvins(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -96,7 +96,7 @@ public static Temperature Kelvins(this T value) #endif => Temperature.FromKelvins(Convert.ToDouble(value)); - /// + /// public static Temperature MillidegreesCelsius(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -104,7 +104,7 @@ public static Temperature MillidegreesCelsius(this T value) #endif => Temperature.FromMillidegreesCelsius(Convert.ToDouble(value)); - /// + /// public static Temperature SolarTemperatures(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToTemperatureGradientExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToTemperatureGradientExtensions.g.cs index b12ee6e3bb..72f787a472 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToTemperatureGradientExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToTemperatureGradientExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToTemperatureGradient /// public static class NumberToTemperatureGradientExtensions { - /// + /// public static TemperatureGradient DegreesCelsiusPerKilometer(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static TemperatureGradient DegreesCelsiusPerKilometer(this T value) #endif => TemperatureGradient.FromDegreesCelsiusPerKilometer(Convert.ToDouble(value)); - /// + /// public static TemperatureGradient DegreesCelsiusPerMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static TemperatureGradient DegreesCelsiusPerMeter(this T value) #endif => TemperatureGradient.FromDegreesCelsiusPerMeter(Convert.ToDouble(value)); - /// + /// public static TemperatureGradient DegreesFahrenheitPerFoot(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static TemperatureGradient DegreesFahrenheitPerFoot(this T value) #endif => TemperatureGradient.FromDegreesFahrenheitPerFoot(Convert.ToDouble(value)); - /// + /// public static TemperatureGradient KelvinsPerMeter(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToThermalConductivityExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToThermalConductivityExtensions.g.cs index c516bf8fa2..1342e6ed08 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToThermalConductivityExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToThermalConductivityExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToThermalConductivity /// public static class NumberToThermalConductivityExtensions { - /// + /// public static ThermalConductivity BtusPerHourFootFahrenheit(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static ThermalConductivity BtusPerHourFootFahrenheit(this T value) #endif => ThermalConductivity.FromBtusPerHourFootFahrenheit(Convert.ToDouble(value)); - /// + /// public static ThermalConductivity WattsPerMeterKelvin(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToThermalResistanceExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToThermalResistanceExtensions.g.cs index 2751d33ad0..c2750af1da 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToThermalResistanceExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToThermalResistanceExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToThermalResistance /// public static class NumberToThermalResistanceExtensions { - /// + /// public static ThermalResistance HourSquareFeetDegreesFahrenheitPerBtu(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static ThermalResistance HourSquareFeetDegreesFahrenheitPerBtu(this T #endif => ThermalResistance.FromHourSquareFeetDegreesFahrenheitPerBtu(Convert.ToDouble(value)); - /// + /// public static ThermalResistance SquareCentimeterHourDegreesCelsiusPerKilocalorie(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static ThermalResistance SquareCentimeterHourDegreesCelsiusPerKilocalorie #endif => ThermalResistance.FromSquareCentimeterHourDegreesCelsiusPerKilocalorie(Convert.ToDouble(value)); - /// + /// public static ThermalResistance SquareCentimeterKelvinsPerWatt(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static ThermalResistance SquareCentimeterKelvinsPerWatt(this T value) #endif => ThermalResistance.FromSquareCentimeterKelvinsPerWatt(Convert.ToDouble(value)); - /// + /// public static ThermalResistance SquareMeterDegreesCelsiusPerWatt(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static ThermalResistance SquareMeterDegreesCelsiusPerWatt(this T value #endif => ThermalResistance.FromSquareMeterDegreesCelsiusPerWatt(Convert.ToDouble(value)); - /// + /// public static ThermalResistance SquareMeterKelvinsPerKilowatt(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -72,7 +72,7 @@ public static ThermalResistance SquareMeterKelvinsPerKilowatt(this T value) #endif => ThermalResistance.FromSquareMeterKelvinsPerKilowatt(Convert.ToDouble(value)); - /// + /// public static ThermalResistance SquareMeterKelvinsPerWatt(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToTorqueExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToTorqueExtensions.g.cs index 098becfff5..b3cee45718 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToTorqueExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToTorqueExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToTorque /// public static class NumberToTorqueExtensions { - /// + /// public static Torque GramForceCentimeters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static Torque GramForceCentimeters(this T value) #endif => Torque.FromGramForceCentimeters(Convert.ToDouble(value)); - /// + /// public static Torque GramForceMeters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static Torque GramForceMeters(this T value) #endif => Torque.FromGramForceMeters(Convert.ToDouble(value)); - /// + /// public static Torque GramForceMillimeters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static Torque GramForceMillimeters(this T value) #endif => Torque.FromGramForceMillimeters(Convert.ToDouble(value)); - /// + /// public static Torque KilogramForceCentimeters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static Torque KilogramForceCentimeters(this T value) #endif => Torque.FromKilogramForceCentimeters(Convert.ToDouble(value)); - /// + /// public static Torque KilogramForceMeters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -72,7 +72,7 @@ public static Torque KilogramForceMeters(this T value) #endif => Torque.FromKilogramForceMeters(Convert.ToDouble(value)); - /// + /// public static Torque KilogramForceMillimeters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -80,7 +80,7 @@ public static Torque KilogramForceMillimeters(this T value) #endif => Torque.FromKilogramForceMillimeters(Convert.ToDouble(value)); - /// + /// public static Torque KilonewtonCentimeters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -88,7 +88,7 @@ public static Torque KilonewtonCentimeters(this T value) #endif => Torque.FromKilonewtonCentimeters(Convert.ToDouble(value)); - /// + /// public static Torque KilonewtonMeters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -96,7 +96,7 @@ public static Torque KilonewtonMeters(this T value) #endif => Torque.FromKilonewtonMeters(Convert.ToDouble(value)); - /// + /// public static Torque KilonewtonMillimeters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -104,7 +104,7 @@ public static Torque KilonewtonMillimeters(this T value) #endif => Torque.FromKilonewtonMillimeters(Convert.ToDouble(value)); - /// + /// public static Torque KilopoundForceFeet(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -112,7 +112,7 @@ public static Torque KilopoundForceFeet(this T value) #endif => Torque.FromKilopoundForceFeet(Convert.ToDouble(value)); - /// + /// public static Torque KilopoundForceInches(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -120,7 +120,7 @@ public static Torque KilopoundForceInches(this T value) #endif => Torque.FromKilopoundForceInches(Convert.ToDouble(value)); - /// + /// public static Torque MeganewtonCentimeters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -128,7 +128,7 @@ public static Torque MeganewtonCentimeters(this T value) #endif => Torque.FromMeganewtonCentimeters(Convert.ToDouble(value)); - /// + /// public static Torque MeganewtonMeters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -136,7 +136,7 @@ public static Torque MeganewtonMeters(this T value) #endif => Torque.FromMeganewtonMeters(Convert.ToDouble(value)); - /// + /// public static Torque MeganewtonMillimeters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -144,7 +144,7 @@ public static Torque MeganewtonMillimeters(this T value) #endif => Torque.FromMeganewtonMillimeters(Convert.ToDouble(value)); - /// + /// public static Torque MegapoundForceFeet(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -152,7 +152,7 @@ public static Torque MegapoundForceFeet(this T value) #endif => Torque.FromMegapoundForceFeet(Convert.ToDouble(value)); - /// + /// public static Torque MegapoundForceInches(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -160,7 +160,7 @@ public static Torque MegapoundForceInches(this T value) #endif => Torque.FromMegapoundForceInches(Convert.ToDouble(value)); - /// + /// public static Torque NewtonCentimeters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -168,7 +168,7 @@ public static Torque NewtonCentimeters(this T value) #endif => Torque.FromNewtonCentimeters(Convert.ToDouble(value)); - /// + /// public static Torque NewtonMeters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -176,7 +176,7 @@ public static Torque NewtonMeters(this T value) #endif => Torque.FromNewtonMeters(Convert.ToDouble(value)); - /// + /// public static Torque NewtonMillimeters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -184,7 +184,7 @@ public static Torque NewtonMillimeters(this T value) #endif => Torque.FromNewtonMillimeters(Convert.ToDouble(value)); - /// + /// public static Torque PoundalFeet(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -192,7 +192,7 @@ public static Torque PoundalFeet(this T value) #endif => Torque.FromPoundalFeet(Convert.ToDouble(value)); - /// + /// public static Torque PoundForceFeet(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -200,7 +200,7 @@ public static Torque PoundForceFeet(this T value) #endif => Torque.FromPoundForceFeet(Convert.ToDouble(value)); - /// + /// public static Torque PoundForceInches(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -208,7 +208,7 @@ public static Torque PoundForceInches(this T value) #endif => Torque.FromPoundForceInches(Convert.ToDouble(value)); - /// + /// public static Torque TonneForceCentimeters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -216,7 +216,7 @@ public static Torque TonneForceCentimeters(this T value) #endif => Torque.FromTonneForceCentimeters(Convert.ToDouble(value)); - /// + /// public static Torque TonneForceMeters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -224,7 +224,7 @@ public static Torque TonneForceMeters(this T value) #endif => Torque.FromTonneForceMeters(Convert.ToDouble(value)); - /// + /// public static Torque TonneForceMillimeters(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToTorquePerLengthExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToTorquePerLengthExtensions.g.cs index feecde6375..c5d1cb1107 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToTorquePerLengthExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToTorquePerLengthExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToTorquePerLength /// public static class NumberToTorquePerLengthExtensions { - /// + /// public static TorquePerLength KilogramForceCentimetersPerMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static TorquePerLength KilogramForceCentimetersPerMeter(this T value) #endif => TorquePerLength.FromKilogramForceCentimetersPerMeter(Convert.ToDouble(value)); - /// + /// public static TorquePerLength KilogramForceMetersPerMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static TorquePerLength KilogramForceMetersPerMeter(this T value) #endif => TorquePerLength.FromKilogramForceMetersPerMeter(Convert.ToDouble(value)); - /// + /// public static TorquePerLength KilogramForceMillimetersPerMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static TorquePerLength KilogramForceMillimetersPerMeter(this T value) #endif => TorquePerLength.FromKilogramForceMillimetersPerMeter(Convert.ToDouble(value)); - /// + /// public static TorquePerLength KilonewtonCentimetersPerMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static TorquePerLength KilonewtonCentimetersPerMeter(this T value) #endif => TorquePerLength.FromKilonewtonCentimetersPerMeter(Convert.ToDouble(value)); - /// + /// public static TorquePerLength KilonewtonMetersPerMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -72,7 +72,7 @@ public static TorquePerLength KilonewtonMetersPerMeter(this T value) #endif => TorquePerLength.FromKilonewtonMetersPerMeter(Convert.ToDouble(value)); - /// + /// public static TorquePerLength KilonewtonMillimetersPerMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -80,7 +80,7 @@ public static TorquePerLength KilonewtonMillimetersPerMeter(this T value) #endif => TorquePerLength.FromKilonewtonMillimetersPerMeter(Convert.ToDouble(value)); - /// + /// public static TorquePerLength KilopoundForceFeetPerFoot(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -88,7 +88,7 @@ public static TorquePerLength KilopoundForceFeetPerFoot(this T value) #endif => TorquePerLength.FromKilopoundForceFeetPerFoot(Convert.ToDouble(value)); - /// + /// public static TorquePerLength KilopoundForceInchesPerFoot(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -96,7 +96,7 @@ public static TorquePerLength KilopoundForceInchesPerFoot(this T value) #endif => TorquePerLength.FromKilopoundForceInchesPerFoot(Convert.ToDouble(value)); - /// + /// public static TorquePerLength MeganewtonCentimetersPerMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -104,7 +104,7 @@ public static TorquePerLength MeganewtonCentimetersPerMeter(this T value) #endif => TorquePerLength.FromMeganewtonCentimetersPerMeter(Convert.ToDouble(value)); - /// + /// public static TorquePerLength MeganewtonMetersPerMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -112,7 +112,7 @@ public static TorquePerLength MeganewtonMetersPerMeter(this T value) #endif => TorquePerLength.FromMeganewtonMetersPerMeter(Convert.ToDouble(value)); - /// + /// public static TorquePerLength MeganewtonMillimetersPerMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -120,7 +120,7 @@ public static TorquePerLength MeganewtonMillimetersPerMeter(this T value) #endif => TorquePerLength.FromMeganewtonMillimetersPerMeter(Convert.ToDouble(value)); - /// + /// public static TorquePerLength MegapoundForceFeetPerFoot(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -128,7 +128,7 @@ public static TorquePerLength MegapoundForceFeetPerFoot(this T value) #endif => TorquePerLength.FromMegapoundForceFeetPerFoot(Convert.ToDouble(value)); - /// + /// public static TorquePerLength MegapoundForceInchesPerFoot(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -136,7 +136,7 @@ public static TorquePerLength MegapoundForceInchesPerFoot(this T value) #endif => TorquePerLength.FromMegapoundForceInchesPerFoot(Convert.ToDouble(value)); - /// + /// public static TorquePerLength NewtonCentimetersPerMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -144,7 +144,7 @@ public static TorquePerLength NewtonCentimetersPerMeter(this T value) #endif => TorquePerLength.FromNewtonCentimetersPerMeter(Convert.ToDouble(value)); - /// + /// public static TorquePerLength NewtonMetersPerMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -152,7 +152,7 @@ public static TorquePerLength NewtonMetersPerMeter(this T value) #endif => TorquePerLength.FromNewtonMetersPerMeter(Convert.ToDouble(value)); - /// + /// public static TorquePerLength NewtonMillimetersPerMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -160,7 +160,7 @@ public static TorquePerLength NewtonMillimetersPerMeter(this T value) #endif => TorquePerLength.FromNewtonMillimetersPerMeter(Convert.ToDouble(value)); - /// + /// public static TorquePerLength PoundForceFeetPerFoot(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -168,7 +168,7 @@ public static TorquePerLength PoundForceFeetPerFoot(this T value) #endif => TorquePerLength.FromPoundForceFeetPerFoot(Convert.ToDouble(value)); - /// + /// public static TorquePerLength PoundForceInchesPerFoot(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -176,7 +176,7 @@ public static TorquePerLength PoundForceInchesPerFoot(this T value) #endif => TorquePerLength.FromPoundForceInchesPerFoot(Convert.ToDouble(value)); - /// + /// public static TorquePerLength TonneForceCentimetersPerMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -184,7 +184,7 @@ public static TorquePerLength TonneForceCentimetersPerMeter(this T value) #endif => TorquePerLength.FromTonneForceCentimetersPerMeter(Convert.ToDouble(value)); - /// + /// public static TorquePerLength TonneForceMetersPerMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -192,7 +192,7 @@ public static TorquePerLength TonneForceMetersPerMeter(this T value) #endif => TorquePerLength.FromTonneForceMetersPerMeter(Convert.ToDouble(value)); - /// + /// public static TorquePerLength TonneForceMillimetersPerMeter(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToTurbidityExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToTurbidityExtensions.g.cs index 03d97b2d24..a5f16f99cc 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToTurbidityExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToTurbidityExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToTurbidity /// public static class NumberToTurbidityExtensions { - /// + /// public static Turbidity NTU(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToVitaminAExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToVitaminAExtensions.g.cs index b46ea29956..ff518abba9 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToVitaminAExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToVitaminAExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToVitaminA /// public static class NumberToVitaminAExtensions { - /// + /// public static VitaminA InternationalUnits(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToVolumeConcentrationExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToVolumeConcentrationExtensions.g.cs index 20c9d9e30c..d3faaab660 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToVolumeConcentrationExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToVolumeConcentrationExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToVolumeConcentration /// public static class NumberToVolumeConcentrationExtensions { - /// + /// public static VolumeConcentration CentilitersPerLiter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static VolumeConcentration CentilitersPerLiter(this T value) #endif => VolumeConcentration.FromCentilitersPerLiter(Convert.ToDouble(value)); - /// + /// public static VolumeConcentration CentilitersPerMililiter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static VolumeConcentration CentilitersPerMililiter(this T value) #endif => VolumeConcentration.FromCentilitersPerMililiter(Convert.ToDouble(value)); - /// + /// public static VolumeConcentration DecilitersPerLiter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static VolumeConcentration DecilitersPerLiter(this T value) #endif => VolumeConcentration.FromDecilitersPerLiter(Convert.ToDouble(value)); - /// + /// public static VolumeConcentration DecilitersPerMililiter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static VolumeConcentration DecilitersPerMililiter(this T value) #endif => VolumeConcentration.FromDecilitersPerMililiter(Convert.ToDouble(value)); - /// + /// public static VolumeConcentration DecimalFractions(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -72,7 +72,7 @@ public static VolumeConcentration DecimalFractions(this T value) #endif => VolumeConcentration.FromDecimalFractions(Convert.ToDouble(value)); - /// + /// public static VolumeConcentration LitersPerLiter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -80,7 +80,7 @@ public static VolumeConcentration LitersPerLiter(this T value) #endif => VolumeConcentration.FromLitersPerLiter(Convert.ToDouble(value)); - /// + /// public static VolumeConcentration LitersPerMililiter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -88,7 +88,7 @@ public static VolumeConcentration LitersPerMililiter(this T value) #endif => VolumeConcentration.FromLitersPerMililiter(Convert.ToDouble(value)); - /// + /// public static VolumeConcentration MicrolitersPerLiter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -96,7 +96,7 @@ public static VolumeConcentration MicrolitersPerLiter(this T value) #endif => VolumeConcentration.FromMicrolitersPerLiter(Convert.ToDouble(value)); - /// + /// public static VolumeConcentration MicrolitersPerMililiter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -104,7 +104,7 @@ public static VolumeConcentration MicrolitersPerMililiter(this T value) #endif => VolumeConcentration.FromMicrolitersPerMililiter(Convert.ToDouble(value)); - /// + /// public static VolumeConcentration MillilitersPerLiter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -112,7 +112,7 @@ public static VolumeConcentration MillilitersPerLiter(this T value) #endif => VolumeConcentration.FromMillilitersPerLiter(Convert.ToDouble(value)); - /// + /// public static VolumeConcentration MillilitersPerMililiter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -120,7 +120,7 @@ public static VolumeConcentration MillilitersPerMililiter(this T value) #endif => VolumeConcentration.FromMillilitersPerMililiter(Convert.ToDouble(value)); - /// + /// public static VolumeConcentration NanolitersPerLiter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -128,7 +128,7 @@ public static VolumeConcentration NanolitersPerLiter(this T value) #endif => VolumeConcentration.FromNanolitersPerLiter(Convert.ToDouble(value)); - /// + /// public static VolumeConcentration NanolitersPerMililiter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -136,7 +136,7 @@ public static VolumeConcentration NanolitersPerMililiter(this T value) #endif => VolumeConcentration.FromNanolitersPerMililiter(Convert.ToDouble(value)); - /// + /// public static VolumeConcentration PartsPerBillion(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -144,7 +144,7 @@ public static VolumeConcentration PartsPerBillion(this T value) #endif => VolumeConcentration.FromPartsPerBillion(Convert.ToDouble(value)); - /// + /// public static VolumeConcentration PartsPerMillion(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -152,7 +152,7 @@ public static VolumeConcentration PartsPerMillion(this T value) #endif => VolumeConcentration.FromPartsPerMillion(Convert.ToDouble(value)); - /// + /// public static VolumeConcentration PartsPerThousand(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -160,7 +160,7 @@ public static VolumeConcentration PartsPerThousand(this T value) #endif => VolumeConcentration.FromPartsPerThousand(Convert.ToDouble(value)); - /// + /// public static VolumeConcentration PartsPerTrillion(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -168,7 +168,7 @@ public static VolumeConcentration PartsPerTrillion(this T value) #endif => VolumeConcentration.FromPartsPerTrillion(Convert.ToDouble(value)); - /// + /// public static VolumeConcentration Percent(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -176,7 +176,7 @@ public static VolumeConcentration Percent(this T value) #endif => VolumeConcentration.FromPercent(Convert.ToDouble(value)); - /// + /// public static VolumeConcentration PicolitersPerLiter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -184,7 +184,7 @@ public static VolumeConcentration PicolitersPerLiter(this T value) #endif => VolumeConcentration.FromPicolitersPerLiter(Convert.ToDouble(value)); - /// + /// public static VolumeConcentration PicolitersPerMililiter(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToVolumeExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToVolumeExtensions.g.cs index 11501f8015..c979f5644b 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToVolumeExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToVolumeExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToVolume /// public static class NumberToVolumeExtensions { - /// + /// public static Volume AcreFeet(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static Volume AcreFeet(this T value) #endif => Volume.FromAcreFeet(Convert.ToDouble(value)); - /// + /// public static Volume AuTablespoons(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static Volume AuTablespoons(this T value) #endif => Volume.FromAuTablespoons(Convert.ToDouble(value)); - /// + /// public static Volume BoardFeet(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static Volume BoardFeet(this T value) #endif => Volume.FromBoardFeet(Convert.ToDouble(value)); - /// + /// public static Volume Centiliters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static Volume Centiliters(this T value) #endif => Volume.FromCentiliters(Convert.ToDouble(value)); - /// + /// public static Volume CubicCentimeters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -72,7 +72,7 @@ public static Volume CubicCentimeters(this T value) #endif => Volume.FromCubicCentimeters(Convert.ToDouble(value)); - /// + /// public static Volume CubicDecimeters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -80,7 +80,7 @@ public static Volume CubicDecimeters(this T value) #endif => Volume.FromCubicDecimeters(Convert.ToDouble(value)); - /// + /// public static Volume CubicFeet(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -88,7 +88,7 @@ public static Volume CubicFeet(this T value) #endif => Volume.FromCubicFeet(Convert.ToDouble(value)); - /// + /// public static Volume CubicHectometers(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -96,7 +96,7 @@ public static Volume CubicHectometers(this T value) #endif => Volume.FromCubicHectometers(Convert.ToDouble(value)); - /// + /// public static Volume CubicInches(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -104,7 +104,7 @@ public static Volume CubicInches(this T value) #endif => Volume.FromCubicInches(Convert.ToDouble(value)); - /// + /// public static Volume CubicKilometers(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -112,7 +112,7 @@ public static Volume CubicKilometers(this T value) #endif => Volume.FromCubicKilometers(Convert.ToDouble(value)); - /// + /// public static Volume CubicMeters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -120,7 +120,7 @@ public static Volume CubicMeters(this T value) #endif => Volume.FromCubicMeters(Convert.ToDouble(value)); - /// + /// public static Volume CubicMicrometers(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -128,7 +128,7 @@ public static Volume CubicMicrometers(this T value) #endif => Volume.FromCubicMicrometers(Convert.ToDouble(value)); - /// + /// public static Volume CubicMiles(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -136,7 +136,7 @@ public static Volume CubicMiles(this T value) #endif => Volume.FromCubicMiles(Convert.ToDouble(value)); - /// + /// public static Volume CubicMillimeters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -144,7 +144,7 @@ public static Volume CubicMillimeters(this T value) #endif => Volume.FromCubicMillimeters(Convert.ToDouble(value)); - /// + /// public static Volume CubicYards(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -152,7 +152,7 @@ public static Volume CubicYards(this T value) #endif => Volume.FromCubicYards(Convert.ToDouble(value)); - /// + /// public static Volume Decaliters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -160,7 +160,7 @@ public static Volume Decaliters(this T value) #endif => Volume.FromDecaliters(Convert.ToDouble(value)); - /// + /// public static Volume DecausGallons(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -168,7 +168,7 @@ public static Volume DecausGallons(this T value) #endif => Volume.FromDecausGallons(Convert.ToDouble(value)); - /// + /// public static Volume Deciliters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -176,7 +176,7 @@ public static Volume Deciliters(this T value) #endif => Volume.FromDeciliters(Convert.ToDouble(value)); - /// + /// public static Volume DeciusGallons(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -184,7 +184,7 @@ public static Volume DeciusGallons(this T value) #endif => Volume.FromDeciusGallons(Convert.ToDouble(value)); - /// + /// public static Volume HectocubicFeet(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -192,7 +192,7 @@ public static Volume HectocubicFeet(this T value) #endif => Volume.FromHectocubicFeet(Convert.ToDouble(value)); - /// + /// public static Volume HectocubicMeters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -200,7 +200,7 @@ public static Volume HectocubicMeters(this T value) #endif => Volume.FromHectocubicMeters(Convert.ToDouble(value)); - /// + /// public static Volume Hectoliters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -208,7 +208,7 @@ public static Volume Hectoliters(this T value) #endif => Volume.FromHectoliters(Convert.ToDouble(value)); - /// + /// public static Volume HectousGallons(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -216,7 +216,7 @@ public static Volume HectousGallons(this T value) #endif => Volume.FromHectousGallons(Convert.ToDouble(value)); - /// + /// public static Volume ImperialBeerBarrels(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -224,7 +224,7 @@ public static Volume ImperialBeerBarrels(this T value) #endif => Volume.FromImperialBeerBarrels(Convert.ToDouble(value)); - /// + /// public static Volume ImperialGallons(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -232,7 +232,7 @@ public static Volume ImperialGallons(this T value) #endif => Volume.FromImperialGallons(Convert.ToDouble(value)); - /// + /// public static Volume ImperialOunces(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -240,7 +240,7 @@ public static Volume ImperialOunces(this T value) #endif => Volume.FromImperialOunces(Convert.ToDouble(value)); - /// + /// public static Volume ImperialPints(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -248,7 +248,7 @@ public static Volume ImperialPints(this T value) #endif => Volume.FromImperialPints(Convert.ToDouble(value)); - /// + /// public static Volume ImperialQuarts(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -256,7 +256,7 @@ public static Volume ImperialQuarts(this T value) #endif => Volume.FromImperialQuarts(Convert.ToDouble(value)); - /// + /// public static Volume KilocubicFeet(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -264,7 +264,7 @@ public static Volume KilocubicFeet(this T value) #endif => Volume.FromKilocubicFeet(Convert.ToDouble(value)); - /// + /// public static Volume KilocubicMeters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -272,7 +272,7 @@ public static Volume KilocubicMeters(this T value) #endif => Volume.FromKilocubicMeters(Convert.ToDouble(value)); - /// + /// public static Volume KiloimperialGallons(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -280,7 +280,7 @@ public static Volume KiloimperialGallons(this T value) #endif => Volume.FromKiloimperialGallons(Convert.ToDouble(value)); - /// + /// public static Volume Kiloliters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -288,7 +288,7 @@ public static Volume Kiloliters(this T value) #endif => Volume.FromKiloliters(Convert.ToDouble(value)); - /// + /// public static Volume KilousGallons(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -296,7 +296,7 @@ public static Volume KilousGallons(this T value) #endif => Volume.FromKilousGallons(Convert.ToDouble(value)); - /// + /// public static Volume Liters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -304,7 +304,7 @@ public static Volume Liters(this T value) #endif => Volume.FromLiters(Convert.ToDouble(value)); - /// + /// public static Volume MegacubicFeet(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -312,7 +312,7 @@ public static Volume MegacubicFeet(this T value) #endif => Volume.FromMegacubicFeet(Convert.ToDouble(value)); - /// + /// public static Volume MegaimperialGallons(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -320,7 +320,7 @@ public static Volume MegaimperialGallons(this T value) #endif => Volume.FromMegaimperialGallons(Convert.ToDouble(value)); - /// + /// public static Volume Megaliters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -328,7 +328,7 @@ public static Volume Megaliters(this T value) #endif => Volume.FromMegaliters(Convert.ToDouble(value)); - /// + /// public static Volume MegausGallons(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -336,7 +336,7 @@ public static Volume MegausGallons(this T value) #endif => Volume.FromMegausGallons(Convert.ToDouble(value)); - /// + /// public static Volume MetricCups(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -344,7 +344,7 @@ public static Volume MetricCups(this T value) #endif => Volume.FromMetricCups(Convert.ToDouble(value)); - /// + /// public static Volume MetricTeaspoons(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -352,7 +352,7 @@ public static Volume MetricTeaspoons(this T value) #endif => Volume.FromMetricTeaspoons(Convert.ToDouble(value)); - /// + /// public static Volume Microliters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -360,7 +360,7 @@ public static Volume Microliters(this T value) #endif => Volume.FromMicroliters(Convert.ToDouble(value)); - /// + /// public static Volume Milliliters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -368,7 +368,7 @@ public static Volume Milliliters(this T value) #endif => Volume.FromMilliliters(Convert.ToDouble(value)); - /// + /// public static Volume Nanoliters(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -376,7 +376,7 @@ public static Volume Nanoliters(this T value) #endif => Volume.FromNanoliters(Convert.ToDouble(value)); - /// + /// public static Volume OilBarrels(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -384,7 +384,7 @@ public static Volume OilBarrels(this T value) #endif => Volume.FromOilBarrels(Convert.ToDouble(value)); - /// + /// public static Volume UkTablespoons(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -392,7 +392,7 @@ public static Volume UkTablespoons(this T value) #endif => Volume.FromUkTablespoons(Convert.ToDouble(value)); - /// + /// public static Volume UsBeerBarrels(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -400,7 +400,7 @@ public static Volume UsBeerBarrels(this T value) #endif => Volume.FromUsBeerBarrels(Convert.ToDouble(value)); - /// + /// public static Volume UsCustomaryCups(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -408,7 +408,7 @@ public static Volume UsCustomaryCups(this T value) #endif => Volume.FromUsCustomaryCups(Convert.ToDouble(value)); - /// + /// public static Volume UsGallons(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -416,7 +416,7 @@ public static Volume UsGallons(this T value) #endif => Volume.FromUsGallons(Convert.ToDouble(value)); - /// + /// public static Volume UsLegalCups(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -424,7 +424,7 @@ public static Volume UsLegalCups(this T value) #endif => Volume.FromUsLegalCups(Convert.ToDouble(value)); - /// + /// public static Volume UsOunces(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -432,7 +432,7 @@ public static Volume UsOunces(this T value) #endif => Volume.FromUsOunces(Convert.ToDouble(value)); - /// + /// public static Volume UsPints(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -440,7 +440,7 @@ public static Volume UsPints(this T value) #endif => Volume.FromUsPints(Convert.ToDouble(value)); - /// + /// public static Volume UsQuarts(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -448,7 +448,7 @@ public static Volume UsQuarts(this T value) #endif => Volume.FromUsQuarts(Convert.ToDouble(value)); - /// + /// public static Volume UsTablespoons(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -456,7 +456,7 @@ public static Volume UsTablespoons(this T value) #endif => Volume.FromUsTablespoons(Convert.ToDouble(value)); - /// + /// public static Volume UsTeaspoons(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToVolumeFlowExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToVolumeFlowExtensions.g.cs index 4542ca2890..0640c22d9f 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToVolumeFlowExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToVolumeFlowExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToVolumeFlow /// public static class NumberToVolumeFlowExtensions { - /// + /// public static VolumeFlow AcreFeetPerDay(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static VolumeFlow AcreFeetPerDay(this T value) #endif => VolumeFlow.FromAcreFeetPerDay(Convert.ToDouble(value)); - /// + /// public static VolumeFlow AcreFeetPerHour(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static VolumeFlow AcreFeetPerHour(this T value) #endif => VolumeFlow.FromAcreFeetPerHour(Convert.ToDouble(value)); - /// + /// public static VolumeFlow AcreFeetPerMinute(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static VolumeFlow AcreFeetPerMinute(this T value) #endif => VolumeFlow.FromAcreFeetPerMinute(Convert.ToDouble(value)); - /// + /// public static VolumeFlow AcreFeetPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static VolumeFlow AcreFeetPerSecond(this T value) #endif => VolumeFlow.FromAcreFeetPerSecond(Convert.ToDouble(value)); - /// + /// public static VolumeFlow CentilitersPerDay(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -72,7 +72,7 @@ public static VolumeFlow CentilitersPerDay(this T value) #endif => VolumeFlow.FromCentilitersPerDay(Convert.ToDouble(value)); - /// + /// public static VolumeFlow CentilitersPerHour(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -80,7 +80,7 @@ public static VolumeFlow CentilitersPerHour(this T value) #endif => VolumeFlow.FromCentilitersPerHour(Convert.ToDouble(value)); - /// + /// public static VolumeFlow CentilitersPerMinute(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -88,7 +88,7 @@ public static VolumeFlow CentilitersPerMinute(this T value) #endif => VolumeFlow.FromCentilitersPerMinute(Convert.ToDouble(value)); - /// + /// public static VolumeFlow CentilitersPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -96,7 +96,7 @@ public static VolumeFlow CentilitersPerSecond(this T value) #endif => VolumeFlow.FromCentilitersPerSecond(Convert.ToDouble(value)); - /// + /// public static VolumeFlow CubicCentimetersPerMinute(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -104,7 +104,7 @@ public static VolumeFlow CubicCentimetersPerMinute(this T value) #endif => VolumeFlow.FromCubicCentimetersPerMinute(Convert.ToDouble(value)); - /// + /// public static VolumeFlow CubicDecimetersPerMinute(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -112,7 +112,7 @@ public static VolumeFlow CubicDecimetersPerMinute(this T value) #endif => VolumeFlow.FromCubicDecimetersPerMinute(Convert.ToDouble(value)); - /// + /// public static VolumeFlow CubicFeetPerHour(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -120,7 +120,7 @@ public static VolumeFlow CubicFeetPerHour(this T value) #endif => VolumeFlow.FromCubicFeetPerHour(Convert.ToDouble(value)); - /// + /// public static VolumeFlow CubicFeetPerMinute(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -128,7 +128,7 @@ public static VolumeFlow CubicFeetPerMinute(this T value) #endif => VolumeFlow.FromCubicFeetPerMinute(Convert.ToDouble(value)); - /// + /// public static VolumeFlow CubicFeetPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -136,7 +136,7 @@ public static VolumeFlow CubicFeetPerSecond(this T value) #endif => VolumeFlow.FromCubicFeetPerSecond(Convert.ToDouble(value)); - /// + /// public static VolumeFlow CubicMetersPerDay(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -144,7 +144,7 @@ public static VolumeFlow CubicMetersPerDay(this T value) #endif => VolumeFlow.FromCubicMetersPerDay(Convert.ToDouble(value)); - /// + /// public static VolumeFlow CubicMetersPerHour(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -152,7 +152,7 @@ public static VolumeFlow CubicMetersPerHour(this T value) #endif => VolumeFlow.FromCubicMetersPerHour(Convert.ToDouble(value)); - /// + /// public static VolumeFlow CubicMetersPerMinute(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -160,7 +160,7 @@ public static VolumeFlow CubicMetersPerMinute(this T value) #endif => VolumeFlow.FromCubicMetersPerMinute(Convert.ToDouble(value)); - /// + /// public static VolumeFlow CubicMetersPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -168,7 +168,7 @@ public static VolumeFlow CubicMetersPerSecond(this T value) #endif => VolumeFlow.FromCubicMetersPerSecond(Convert.ToDouble(value)); - /// + /// public static VolumeFlow CubicMillimetersPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -176,7 +176,7 @@ public static VolumeFlow CubicMillimetersPerSecond(this T value) #endif => VolumeFlow.FromCubicMillimetersPerSecond(Convert.ToDouble(value)); - /// + /// public static VolumeFlow CubicYardsPerDay(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -184,7 +184,7 @@ public static VolumeFlow CubicYardsPerDay(this T value) #endif => VolumeFlow.FromCubicYardsPerDay(Convert.ToDouble(value)); - /// + /// public static VolumeFlow CubicYardsPerHour(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -192,7 +192,7 @@ public static VolumeFlow CubicYardsPerHour(this T value) #endif => VolumeFlow.FromCubicYardsPerHour(Convert.ToDouble(value)); - /// + /// public static VolumeFlow CubicYardsPerMinute(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -200,7 +200,7 @@ public static VolumeFlow CubicYardsPerMinute(this T value) #endif => VolumeFlow.FromCubicYardsPerMinute(Convert.ToDouble(value)); - /// + /// public static VolumeFlow CubicYardsPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -208,7 +208,7 @@ public static VolumeFlow CubicYardsPerSecond(this T value) #endif => VolumeFlow.FromCubicYardsPerSecond(Convert.ToDouble(value)); - /// + /// public static VolumeFlow DecilitersPerDay(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -216,7 +216,7 @@ public static VolumeFlow DecilitersPerDay(this T value) #endif => VolumeFlow.FromDecilitersPerDay(Convert.ToDouble(value)); - /// + /// public static VolumeFlow DecilitersPerHour(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -224,7 +224,7 @@ public static VolumeFlow DecilitersPerHour(this T value) #endif => VolumeFlow.FromDecilitersPerHour(Convert.ToDouble(value)); - /// + /// public static VolumeFlow DecilitersPerMinute(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -232,7 +232,7 @@ public static VolumeFlow DecilitersPerMinute(this T value) #endif => VolumeFlow.FromDecilitersPerMinute(Convert.ToDouble(value)); - /// + /// public static VolumeFlow DecilitersPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -240,7 +240,7 @@ public static VolumeFlow DecilitersPerSecond(this T value) #endif => VolumeFlow.FromDecilitersPerSecond(Convert.ToDouble(value)); - /// + /// public static VolumeFlow KilolitersPerDay(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -248,7 +248,7 @@ public static VolumeFlow KilolitersPerDay(this T value) #endif => VolumeFlow.FromKilolitersPerDay(Convert.ToDouble(value)); - /// + /// public static VolumeFlow KilolitersPerHour(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -256,7 +256,7 @@ public static VolumeFlow KilolitersPerHour(this T value) #endif => VolumeFlow.FromKilolitersPerHour(Convert.ToDouble(value)); - /// + /// public static VolumeFlow KilolitersPerMinute(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -264,7 +264,7 @@ public static VolumeFlow KilolitersPerMinute(this T value) #endif => VolumeFlow.FromKilolitersPerMinute(Convert.ToDouble(value)); - /// + /// public static VolumeFlow KilolitersPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -272,7 +272,7 @@ public static VolumeFlow KilolitersPerSecond(this T value) #endif => VolumeFlow.FromKilolitersPerSecond(Convert.ToDouble(value)); - /// + /// public static VolumeFlow KilousGallonsPerMinute(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -280,7 +280,7 @@ public static VolumeFlow KilousGallonsPerMinute(this T value) #endif => VolumeFlow.FromKilousGallonsPerMinute(Convert.ToDouble(value)); - /// + /// public static VolumeFlow LitersPerDay(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -288,7 +288,7 @@ public static VolumeFlow LitersPerDay(this T value) #endif => VolumeFlow.FromLitersPerDay(Convert.ToDouble(value)); - /// + /// public static VolumeFlow LitersPerHour(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -296,7 +296,7 @@ public static VolumeFlow LitersPerHour(this T value) #endif => VolumeFlow.FromLitersPerHour(Convert.ToDouble(value)); - /// + /// public static VolumeFlow LitersPerMinute(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -304,7 +304,7 @@ public static VolumeFlow LitersPerMinute(this T value) #endif => VolumeFlow.FromLitersPerMinute(Convert.ToDouble(value)); - /// + /// public static VolumeFlow LitersPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -312,7 +312,7 @@ public static VolumeFlow LitersPerSecond(this T value) #endif => VolumeFlow.FromLitersPerSecond(Convert.ToDouble(value)); - /// + /// public static VolumeFlow MegalitersPerDay(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -320,7 +320,7 @@ public static VolumeFlow MegalitersPerDay(this T value) #endif => VolumeFlow.FromMegalitersPerDay(Convert.ToDouble(value)); - /// + /// public static VolumeFlow MegalitersPerHour(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -328,7 +328,7 @@ public static VolumeFlow MegalitersPerHour(this T value) #endif => VolumeFlow.FromMegalitersPerHour(Convert.ToDouble(value)); - /// + /// public static VolumeFlow MegalitersPerMinute(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -336,7 +336,7 @@ public static VolumeFlow MegalitersPerMinute(this T value) #endif => VolumeFlow.FromMegalitersPerMinute(Convert.ToDouble(value)); - /// + /// public static VolumeFlow MegalitersPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -344,7 +344,7 @@ public static VolumeFlow MegalitersPerSecond(this T value) #endif => VolumeFlow.FromMegalitersPerSecond(Convert.ToDouble(value)); - /// + /// public static VolumeFlow MegaukGallonsPerDay(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -352,7 +352,7 @@ public static VolumeFlow MegaukGallonsPerDay(this T value) #endif => VolumeFlow.FromMegaukGallonsPerDay(Convert.ToDouble(value)); - /// + /// public static VolumeFlow MegaukGallonsPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -360,7 +360,7 @@ public static VolumeFlow MegaukGallonsPerSecond(this T value) #endif => VolumeFlow.FromMegaukGallonsPerSecond(Convert.ToDouble(value)); - /// + /// public static VolumeFlow MegausGallonsPerDay(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -368,7 +368,7 @@ public static VolumeFlow MegausGallonsPerDay(this T value) #endif => VolumeFlow.FromMegausGallonsPerDay(Convert.ToDouble(value)); - /// + /// public static VolumeFlow MicrolitersPerDay(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -376,7 +376,7 @@ public static VolumeFlow MicrolitersPerDay(this T value) #endif => VolumeFlow.FromMicrolitersPerDay(Convert.ToDouble(value)); - /// + /// public static VolumeFlow MicrolitersPerHour(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -384,7 +384,7 @@ public static VolumeFlow MicrolitersPerHour(this T value) #endif => VolumeFlow.FromMicrolitersPerHour(Convert.ToDouble(value)); - /// + /// public static VolumeFlow MicrolitersPerMinute(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -392,7 +392,7 @@ public static VolumeFlow MicrolitersPerMinute(this T value) #endif => VolumeFlow.FromMicrolitersPerMinute(Convert.ToDouble(value)); - /// + /// public static VolumeFlow MicrolitersPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -400,7 +400,7 @@ public static VolumeFlow MicrolitersPerSecond(this T value) #endif => VolumeFlow.FromMicrolitersPerSecond(Convert.ToDouble(value)); - /// + /// public static VolumeFlow MillilitersPerDay(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -408,7 +408,7 @@ public static VolumeFlow MillilitersPerDay(this T value) #endif => VolumeFlow.FromMillilitersPerDay(Convert.ToDouble(value)); - /// + /// public static VolumeFlow MillilitersPerHour(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -416,7 +416,7 @@ public static VolumeFlow MillilitersPerHour(this T value) #endif => VolumeFlow.FromMillilitersPerHour(Convert.ToDouble(value)); - /// + /// public static VolumeFlow MillilitersPerMinute(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -424,7 +424,7 @@ public static VolumeFlow MillilitersPerMinute(this T value) #endif => VolumeFlow.FromMillilitersPerMinute(Convert.ToDouble(value)); - /// + /// public static VolumeFlow MillilitersPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -432,7 +432,7 @@ public static VolumeFlow MillilitersPerSecond(this T value) #endif => VolumeFlow.FromMillilitersPerSecond(Convert.ToDouble(value)); - /// + /// public static VolumeFlow MillionUsGallonsPerDay(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -440,7 +440,7 @@ public static VolumeFlow MillionUsGallonsPerDay(this T value) #endif => VolumeFlow.FromMillionUsGallonsPerDay(Convert.ToDouble(value)); - /// + /// public static VolumeFlow NanolitersPerDay(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -448,7 +448,7 @@ public static VolumeFlow NanolitersPerDay(this T value) #endif => VolumeFlow.FromNanolitersPerDay(Convert.ToDouble(value)); - /// + /// public static VolumeFlow NanolitersPerHour(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -456,7 +456,7 @@ public static VolumeFlow NanolitersPerHour(this T value) #endif => VolumeFlow.FromNanolitersPerHour(Convert.ToDouble(value)); - /// + /// public static VolumeFlow NanolitersPerMinute(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -464,7 +464,7 @@ public static VolumeFlow NanolitersPerMinute(this T value) #endif => VolumeFlow.FromNanolitersPerMinute(Convert.ToDouble(value)); - /// + /// public static VolumeFlow NanolitersPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -472,7 +472,7 @@ public static VolumeFlow NanolitersPerSecond(this T value) #endif => VolumeFlow.FromNanolitersPerSecond(Convert.ToDouble(value)); - /// + /// public static VolumeFlow OilBarrelsPerDay(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -480,7 +480,7 @@ public static VolumeFlow OilBarrelsPerDay(this T value) #endif => VolumeFlow.FromOilBarrelsPerDay(Convert.ToDouble(value)); - /// + /// public static VolumeFlow OilBarrelsPerHour(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -488,7 +488,7 @@ public static VolumeFlow OilBarrelsPerHour(this T value) #endif => VolumeFlow.FromOilBarrelsPerHour(Convert.ToDouble(value)); - /// + /// public static VolumeFlow OilBarrelsPerMinute(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -496,7 +496,7 @@ public static VolumeFlow OilBarrelsPerMinute(this T value) #endif => VolumeFlow.FromOilBarrelsPerMinute(Convert.ToDouble(value)); - /// + /// public static VolumeFlow OilBarrelsPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -504,7 +504,7 @@ public static VolumeFlow OilBarrelsPerSecond(this T value) #endif => VolumeFlow.FromOilBarrelsPerSecond(Convert.ToDouble(value)); - /// + /// public static VolumeFlow UkGallonsPerDay(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -512,7 +512,7 @@ public static VolumeFlow UkGallonsPerDay(this T value) #endif => VolumeFlow.FromUkGallonsPerDay(Convert.ToDouble(value)); - /// + /// public static VolumeFlow UkGallonsPerHour(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -520,7 +520,7 @@ public static VolumeFlow UkGallonsPerHour(this T value) #endif => VolumeFlow.FromUkGallonsPerHour(Convert.ToDouble(value)); - /// + /// public static VolumeFlow UkGallonsPerMinute(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -528,7 +528,7 @@ public static VolumeFlow UkGallonsPerMinute(this T value) #endif => VolumeFlow.FromUkGallonsPerMinute(Convert.ToDouble(value)); - /// + /// public static VolumeFlow UkGallonsPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -536,7 +536,7 @@ public static VolumeFlow UkGallonsPerSecond(this T value) #endif => VolumeFlow.FromUkGallonsPerSecond(Convert.ToDouble(value)); - /// + /// public static VolumeFlow UsGallonsPerDay(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -544,7 +544,7 @@ public static VolumeFlow UsGallonsPerDay(this T value) #endif => VolumeFlow.FromUsGallonsPerDay(Convert.ToDouble(value)); - /// + /// public static VolumeFlow UsGallonsPerHour(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -552,7 +552,7 @@ public static VolumeFlow UsGallonsPerHour(this T value) #endif => VolumeFlow.FromUsGallonsPerHour(Convert.ToDouble(value)); - /// + /// public static VolumeFlow UsGallonsPerMinute(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -560,7 +560,7 @@ public static VolumeFlow UsGallonsPerMinute(this T value) #endif => VolumeFlow.FromUsGallonsPerMinute(Convert.ToDouble(value)); - /// + /// public static VolumeFlow UsGallonsPerSecond(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToVolumeFlowPerAreaExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToVolumeFlowPerAreaExtensions.g.cs index baeb644a4d..a51f32978a 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToVolumeFlowPerAreaExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToVolumeFlowPerAreaExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToVolumeFlowPerArea /// public static class NumberToVolumeFlowPerAreaExtensions { - /// + /// public static VolumeFlowPerArea CubicFeetPerMinutePerSquareFoot(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static VolumeFlowPerArea CubicFeetPerMinutePerSquareFoot(this T value) #endif => VolumeFlowPerArea.FromCubicFeetPerMinutePerSquareFoot(Convert.ToDouble(value)); - /// + /// public static VolumeFlowPerArea CubicMetersPerSecondPerSquareMeter(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToVolumePerLengthExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToVolumePerLengthExtensions.g.cs index 39ee688498..c464b0668a 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToVolumePerLengthExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToVolumePerLengthExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToVolumePerLength /// public static class NumberToVolumePerLengthExtensions { - /// + /// public static VolumePerLength CubicMetersPerMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static VolumePerLength CubicMetersPerMeter(this T value) #endif => VolumePerLength.FromCubicMetersPerMeter(Convert.ToDouble(value)); - /// + /// public static VolumePerLength CubicYardsPerFoot(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static VolumePerLength CubicYardsPerFoot(this T value) #endif => VolumePerLength.FromCubicYardsPerFoot(Convert.ToDouble(value)); - /// + /// public static VolumePerLength CubicYardsPerUsSurveyFoot(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static VolumePerLength CubicYardsPerUsSurveyFoot(this T value) #endif => VolumePerLength.FromCubicYardsPerUsSurveyFoot(Convert.ToDouble(value)); - /// + /// public static VolumePerLength ImperialGallonsPerMile(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static VolumePerLength ImperialGallonsPerMile(this T value) #endif => VolumePerLength.FromImperialGallonsPerMile(Convert.ToDouble(value)); - /// + /// public static VolumePerLength LitersPerKilometer(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -72,7 +72,7 @@ public static VolumePerLength LitersPerKilometer(this T value) #endif => VolumePerLength.FromLitersPerKilometer(Convert.ToDouble(value)); - /// + /// public static VolumePerLength LitersPerMeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -80,7 +80,7 @@ public static VolumePerLength LitersPerMeter(this T value) #endif => VolumePerLength.FromLitersPerMeter(Convert.ToDouble(value)); - /// + /// public static VolumePerLength LitersPerMillimeter(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -88,7 +88,7 @@ public static VolumePerLength LitersPerMillimeter(this T value) #endif => VolumePerLength.FromLitersPerMillimeter(Convert.ToDouble(value)); - /// + /// public static VolumePerLength OilBarrelsPerFoot(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -96,7 +96,7 @@ public static VolumePerLength OilBarrelsPerFoot(this T value) #endif => VolumePerLength.FromOilBarrelsPerFoot(Convert.ToDouble(value)); - /// + /// public static VolumePerLength UsGallonsPerMile(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToVolumetricHeatCapacityExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToVolumetricHeatCapacityExtensions.g.cs index 1ca2f92b3f..14f3017903 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToVolumetricHeatCapacityExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToVolumetricHeatCapacityExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToVolumetricHeatCapacity /// public static class NumberToVolumetricHeatCapacityExtensions { - /// + /// public static VolumetricHeatCapacity BtusPerCubicFootDegreeFahrenheit(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static VolumetricHeatCapacity BtusPerCubicFootDegreeFahrenheit(this T #endif => VolumetricHeatCapacity.FromBtusPerCubicFootDegreeFahrenheit(Convert.ToDouble(value)); - /// + /// public static VolumetricHeatCapacity CaloriesPerCubicCentimeterDegreeCelsius(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static VolumetricHeatCapacity CaloriesPerCubicCentimeterDegreeCelsius( #endif => VolumetricHeatCapacity.FromCaloriesPerCubicCentimeterDegreeCelsius(Convert.ToDouble(value)); - /// + /// public static VolumetricHeatCapacity JoulesPerCubicMeterDegreeCelsius(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static VolumetricHeatCapacity JoulesPerCubicMeterDegreeCelsius(this T #endif => VolumetricHeatCapacity.FromJoulesPerCubicMeterDegreeCelsius(Convert.ToDouble(value)); - /// + /// public static VolumetricHeatCapacity JoulesPerCubicMeterKelvin(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static VolumetricHeatCapacity JoulesPerCubicMeterKelvin(this T value) #endif => VolumetricHeatCapacity.FromJoulesPerCubicMeterKelvin(Convert.ToDouble(value)); - /// + /// public static VolumetricHeatCapacity KilocaloriesPerCubicCentimeterDegreeCelsius(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -72,7 +72,7 @@ public static VolumetricHeatCapacity KilocaloriesPerCubicCentimeterDegreeCelsius #endif => VolumetricHeatCapacity.FromKilocaloriesPerCubicCentimeterDegreeCelsius(Convert.ToDouble(value)); - /// + /// public static VolumetricHeatCapacity KilojoulesPerCubicMeterDegreeCelsius(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -80,7 +80,7 @@ public static VolumetricHeatCapacity KilojoulesPerCubicMeterDegreeCelsius(thi #endif => VolumetricHeatCapacity.FromKilojoulesPerCubicMeterDegreeCelsius(Convert.ToDouble(value)); - /// + /// public static VolumetricHeatCapacity KilojoulesPerCubicMeterKelvin(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -88,7 +88,7 @@ public static VolumetricHeatCapacity KilojoulesPerCubicMeterKelvin(this T val #endif => VolumetricHeatCapacity.FromKilojoulesPerCubicMeterKelvin(Convert.ToDouble(value)); - /// + /// public static VolumetricHeatCapacity MegajoulesPerCubicMeterDegreeCelsius(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -96,7 +96,7 @@ public static VolumetricHeatCapacity MegajoulesPerCubicMeterDegreeCelsius(thi #endif => VolumetricHeatCapacity.FromMegajoulesPerCubicMeterDegreeCelsius(Convert.ToDouble(value)); - /// + /// public static VolumetricHeatCapacity MegajoulesPerCubicMeterKelvin(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToWarpingMomentOfInertiaExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToWarpingMomentOfInertiaExtensions.g.cs index 8be95727fb..7979daed07 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToWarpingMomentOfInertiaExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToWarpingMomentOfInertiaExtensions.g.cs @@ -32,7 +32,7 @@ namespace UnitsNet.NumberExtensions.NumberToWarpingMomentOfInertia /// public static class NumberToWarpingMomentOfInertiaExtensions { - /// + /// public static WarpingMomentOfInertia CentimetersToTheSixth(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -40,7 +40,7 @@ public static WarpingMomentOfInertia CentimetersToTheSixth(this T value) #endif => WarpingMomentOfInertia.FromCentimetersToTheSixth(Convert.ToDouble(value)); - /// + /// public static WarpingMomentOfInertia DecimetersToTheSixth(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -48,7 +48,7 @@ public static WarpingMomentOfInertia DecimetersToTheSixth(this T value) #endif => WarpingMomentOfInertia.FromDecimetersToTheSixth(Convert.ToDouble(value)); - /// + /// public static WarpingMomentOfInertia FeetToTheSixth(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -56,7 +56,7 @@ public static WarpingMomentOfInertia FeetToTheSixth(this T value) #endif => WarpingMomentOfInertia.FromFeetToTheSixth(Convert.ToDouble(value)); - /// + /// public static WarpingMomentOfInertia InchesToTheSixth(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -64,7 +64,7 @@ public static WarpingMomentOfInertia InchesToTheSixth(this T value) #endif => WarpingMomentOfInertia.FromInchesToTheSixth(Convert.ToDouble(value)); - /// + /// public static WarpingMomentOfInertia MetersToTheSixth(this T value) where T : notnull #if NET7_0_OR_GREATER @@ -72,7 +72,7 @@ public static WarpingMomentOfInertia MetersToTheSixth(this T value) #endif => WarpingMomentOfInertia.FromMetersToTheSixth(Convert.ToDouble(value)); - /// + /// public static WarpingMomentOfInertia MillimetersToTheSixth(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet.Serialization.JsonNet.Tests/AbbreviatedUnitsConverterTests.cs b/UnitsNet.Serialization.JsonNet.Tests/AbbreviatedUnitsConverterTests.cs index 10de4f9a3c..5324f9a071 100644 --- a/UnitsNet.Serialization.JsonNet.Tests/AbbreviatedUnitsConverterTests.cs +++ b/UnitsNet.Serialization.JsonNet.Tests/AbbreviatedUnitsConverterTests.cs @@ -221,116 +221,6 @@ public void DoubleZeroBaseQuantity_DeserializedFromEmptyInput() Assert.Equal(Mass.BaseUnit, quantity.Unit); } - [Fact] - public void DecimalIQuantity_DeserializedFromDecimalValueAndAbbreviatedUnit() - { - var json = """{"Value":1.200,"Unit":"EB","Type":"Information"}"""; - - var quantity = (Information) DeserializeObject(json); - - Assert.Equal(1.200, quantity.Value); - Assert.Equal(InformationUnit.Exabyte, quantity.Unit); - } - - [Fact] - public void DecimalQuantity_DeserializedFromDecimalValueAndAbbreviatedUnit() - { - var json = """{"Value":1.200,"Unit":"EB"}"""; - - var quantity = DeserializeObject(json); - - Assert.Equal(1.200, quantity.Value); - Assert.Equal(InformationUnit.Exabyte, quantity.Unit); - } - - [Fact] - public void DecimalIQuantity_DeserializedFromQuotedDecimalValueAndAbbreviatedUnit() - { - var json = """{"Value":"1.200","Unit":"EB","Type":"Information"}"""; - - var quantity = (Information) DeserializeObject(json); - - Assert.Equal(1.200, quantity.Value); - Assert.Equal(InformationUnit.Exabyte, quantity.Unit); - } - - [Fact] - public void DecimalQuantity_DeserializedFromQuotedDecimalValueAndAbbreviatedUnit() - { - var json = """{"Value":"1.200","Unit":"EB"}"""; - - var quantity = DeserializeObject(json); - - Assert.Equal(1.200, quantity.Value); - Assert.Equal(InformationUnit.Exabyte, quantity.Unit); - } - - [Fact] - public void DecimalZeroIQuantity_DeserializedFromAbbreviatedUnitAndNoValue() - { - var json = """{"Unit":"EB","Type":"Information"}"""; - - var quantity = (Information)DeserializeObject(json); - - Assert.Equal(0, quantity.Value); - Assert.Equal(InformationUnit.Exabyte, quantity.Unit); - } - - [Fact] - public void DecimalZeroQuantity_DeserializedFromAbbreviatedUnitAndNoValue() - { - var json = """{"Unit":"EB"}"""; - - var quantity = DeserializeObject(json); - - Assert.Equal(0, quantity.Value); - Assert.Equal(InformationUnit.Exabyte, quantity.Unit); - } - - [Fact] - public void DecimalBaseUnitIQuantity_DeserializedFromDecimalValueAndNoUnit() - { - var json = """{"Value":1.200,"Type":"Information"}"""; - - var quantity = (Information)DeserializeObject(json); - - Assert.Equal(1.200, quantity.Value); - Assert.Equal(Information.BaseUnit, quantity.Unit); - } - - [Fact] - public void DecimalBaseUnitQuantity_DeserializedFromDecimalValueAndNoUnit() - { - var json = """{"Value":1.200}"""; - - var quantity = DeserializeObject(json); - - Assert.Equal(1.200, quantity.Value); - Assert.Equal(Information.BaseUnit, quantity.Unit); - } - - [Fact] - public void DecimalZeroBaseIQuantity_DeserializedFromQuantityTypeOnly() - { - var json = """{"Type":"Information"}"""; - - var quantity = (Information)DeserializeObject(json); - - Assert.Equal(0, quantity.Value); - Assert.Equal(Information.BaseUnit, quantity.Unit); - } - - [Fact] - public void DecimalZeroBaseQuantity_DeserializedFromEmptyInput() - { - var json = "{}"; - - var quantity = DeserializeObject(json); - - Assert.Equal(0, quantity.Value); - Assert.Equal(Information.BaseUnit, quantity.Unit); - } - #endregion #region Compatibility @@ -342,16 +232,6 @@ class PlainOldDoubleQuantity public string Unit { get; set; } } - [Fact] - public void LargeDecimalQuantity_DeserializedTo_PlainOldDoubleQuantity() - { - const string json = """{"Value":18446744073709551614,"Unit":"EB","Type":"Information"}"""; - var plainOldQuantity = JsonConvert.DeserializeObject(json); - - Assert.Equal(18446744073709551614d, plainOldQuantity.Value); - Assert.Equal("EB", plainOldQuantity.Unit); - } - #endregion } diff --git a/UnitsNet.Serialization.JsonNet.Tests/UnitsNetBaseJsonConverterTest.cs b/UnitsNet.Serialization.JsonNet.Tests/UnitsNetBaseJsonConverterTest.cs index ceb4481ec9..c438447b5f 100644 --- a/UnitsNet.Serialization.JsonNet.Tests/UnitsNetBaseJsonConverterTest.cs +++ b/UnitsNet.Serialization.JsonNet.Tests/UnitsNetBaseJsonConverterTest.cs @@ -3,7 +3,6 @@ using System; using System.Collections.Generic; -using System.Globalization; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; @@ -41,7 +40,7 @@ public void UnitsNetBaseJsonConverter_ConvertIQuantity_throws_ArgumentNullExcept [Fact] public void UnitsNetBaseJsonConverter_ConvertValueUnit_works_as_expected() { - var result = _sut.Test_ConvertDecimalValueUnit("PowerUnit.Watt", 10.2365m); + var result = _sut.Test_ConvertDoubleValueUnit("PowerUnit.Watt", 10.2365); Assert.NotNull(result); Assert.IsType(result); @@ -61,7 +60,7 @@ public void UnitsNetBaseJsonConverter_ConvertValueUnit_throws_UnitsNetException_ [Fact] public void UnitsNetBaseJsonConverter_ConvertValueUnit_throws_UnitsNetException_when_unit_is_in_unexpected_format() { - var result = Assert.Throws(() => _sut.Test_ConvertDecimalValueUnit("PowerUnit Watt", 10.2365m)); + var result = Assert.Throws(() => _sut.Test_ConvertDoubleValueUnit("PowerUnit Watt", 10.2365)); Assert.Equal("\"PowerUnit Watt\" is not a valid unit.", result.Message); Assert.True(result.Data.Contains("type")); @@ -107,16 +106,26 @@ public void UnitsNetBaseJsonConverter_ReadValueUnit_works_with_double_quantity() Assert.Equal(10.2365, result?.Value); } + /// + /// Testing backwards compatibility with deserializing based quantity JSON into based quantities. + ///

+ /// In v5 and below, there were 3 based quantities , and . + /// Since JSON does not support decimal values, the JSON schema emitted the value as a string instead of a number and included a 'ValueType' + /// discriminator to describe whether the value was double or decimal. + ///

+ /// based quantities were serialized with DTO, with double Value + string Unit properties.
+ /// based quantities were serialized with DTO, extending with ValueString and ValueType properties. + ///
[Fact] - public void UnitsNetBaseJsonConverter_ReadValueUnit_works_with_decimal_quantity() + public void UnitsNetBaseJsonConverter_ReadValueUnit_works_with_legacy_decimal_quantity() { - var token = new JObject {{"Unit", "PowerUnit.Watt"}, {"Value", 10.2365m}, {"ValueString", "10.2365"}, {"ValueType", "decimal"}}; + var token = new JObject {{"Unit", "PowerUnit.Watt"}, {"Value", 10.2365}, {"ValueString", "10.2365"}, {"ValueType", "decimal"}}; - var result = _sut.Test_ReadDecimalValueUnit(token); + var result = _sut.Test_ReadDoubleValueUnit(token); Assert.NotNull(result); Assert.Equal("PowerUnit.Watt", result?.Unit); - Assert.Equal(10.2365m, result?.Value); + Assert.Equal(10.2365, result?.Value); } [Fact] @@ -124,17 +133,7 @@ public void UnitsNetBaseJsonConverter_ReadValueUnit_returns_null_when_value_is_a { var token = new JObject {{"Unit", "PowerUnit.Watt"}, {"Value", "10.2365"}}; - var result = _sut.Test_ReadDecimalValueUnit(token); - - Assert.Null(result); - } - - [Fact] - public void UnitsNetBaseJsonConverter_ReadValueUnit_returns_null_when_value_type_is_not_a_string() - { - var token = new JObject {{"Unit", "PowerUnit.Watt"}, {"Value", 10.2365}, {"ValueType", 123}}; - - var result = _sut.Test_ReadDecimalValueUnit(token); + var result = _sut.Test_ReadDoubleValueUnit(token); Assert.Null(result); } @@ -163,39 +162,35 @@ public void UnitsNetBaseJsonConverter_ReadValueUnit_returns_null_when_unit_or_va if (withValue) { - token.Add("Value", 10.2365m); + token.Add("Value", 10.2365); } - var result = _sut.Test_ReadDecimalValueUnit(token); + var result = _sut.Test_ReadDoubleValueUnit(token); Assert.Null(result); } [Theory] - [InlineData("Unit", "Value", "ValueString", "ValueType")] - [InlineData("unit", "Value", "ValueString", "ValueType")] - [InlineData("Unit", "value", "valueString", "valueType")] - [InlineData("unit", "value", "valueString", "valueType")] - [InlineData("unIT", "vAlUe", "vAlUeString", "vAlUeType")] + [InlineData("Unit", "Value")] + [InlineData("unit", "Value")] + [InlineData("Unit", "value")] + [InlineData("unit", "value")] + [InlineData("unIT", "vAlUe")] public void UnitsNetBaseJsonConverter_ReadValueUnit_works_case_insensitive( string unitPropertyName, - string valuePropertyName, - string valueStringPropertyName, - string valueTypePropertyName) + string valuePropertyName) { var token = new JObject { {unitPropertyName, "PowerUnit.Watt"}, - {valuePropertyName, 10.2365m}, - {valueStringPropertyName, 10.2365m.ToString(CultureInfo.InvariantCulture)}, - {valueTypePropertyName, "decimal"} + {valuePropertyName, 10.2365}, }; - var result = _sut.Test_ReadDecimalValueUnit(token); + var result = _sut.Test_ReadDoubleValueUnit(token); Assert.NotNull(result); Assert.Equal("PowerUnit.Watt", result?.Unit); - Assert.Equal(10.2365m, result?.Value); + Assert.Equal(10.2365, result?.Value); } /// @@ -214,24 +209,8 @@ private class TestConverter : UnitsNetBaseJsonConverter return (result.Unit, result.Value); } - public (string Unit, decimal Value) Test_ConvertDecimalIQuantity(IQuantity value) - { - var result = ConvertIQuantity(value); - if (result is ExtendedValueUnit {ValueType: "decimal"} decimalResult) - { - return (result.Unit, decimal.Parse(decimalResult.ValueString, CultureInfo.InvariantCulture)); - } - - throw new ArgumentException("The quantity does not have a decimal value", nameof(value)); - } - public IQuantity Test_ConvertDoubleValueUnit(string unit, double value) => Test_ConvertValueUnit(new ValueUnit {Unit = unit, Value = value}); - public IQuantity Test_ConvertDecimalValueUnit(string unit, decimal value) => Test_ConvertValueUnit(new ExtendedValueUnit - { - Unit = unit, Value = (double) value, ValueString = value.ToString(CultureInfo.InvariantCulture), ValueType = "decimal" - }); - private IQuantity Test_ConvertValueUnit(ValueUnit valueUnit) => ConvertValueUnit(valueUnit); public JsonSerializer Test_CreateLocalSerializer(JsonSerializer serializer) => CreateLocalSerializer(serializer, this); @@ -246,19 +225,6 @@ public IQuantity Test_ConvertDecimalValueUnit(string unit, decimal value) => Tes return (result.Unit, result.Value); } - - public (string Unit, decimal Value)? Test_ReadDecimalValueUnit(JToken jsonToken) - { - var result = ReadValueUnit(jsonToken); - - if (result is ExtendedValueUnit {ValueType: "decimal"} decimalResult) - { - return (result.Unit, decimal.Parse(decimalResult.ValueString, CultureInfo.InvariantCulture)); - } - - return null; - } - } } } diff --git a/UnitsNet.Serialization.JsonNet/AbbreviatedUnitsConverter.cs b/UnitsNet.Serialization.JsonNet/AbbreviatedUnitsConverter.cs index ba06ab91d8..1eafb78ba5 100644 --- a/UnitsNet.Serialization.JsonNet/AbbreviatedUnitsConverter.cs +++ b/UnitsNet.Serialization.JsonNet/AbbreviatedUnitsConverter.cs @@ -79,15 +79,7 @@ public override void WriteJson(JsonWriter writer, IQuantity? quantity, JsonSeria // write the 'Value' using the actual type writer.WritePropertyName(ValueProperty); - if (quantity is IValueQuantity decimalQuantity) - { - // cannot use `writer.WriteValue(decimalQuantity.Value)`: there is a hidden EnsureDecimalPlace(..) method call inside it that converts '123' to '123.0' - writer.WriteRawValue(decimalQuantity.Value.ToString(CultureInfo.InvariantCulture)); - } - else - { - writer.WriteValue((double)quantity.Value); - } + writer.WriteValue((double)quantity.Value); // write the 'Unit' abbreviation writer.WritePropertyName(UnitProperty); @@ -172,15 +164,11 @@ protected string GetQuantityType(IQuantity quantity) unit = GetUnitOrDefault(unitAbbreviation, quantityInfo); } - QuantityValue value; + double value; if (valueToken is null) { value = default; } - else if (quantityInfo.Zero is IValueQuantity) - { - value = decimal.Parse(valueToken, CultureInfo.InvariantCulture); - } else { value = double.Parse(valueToken, CultureInfo.InvariantCulture); diff --git a/UnitsNet.Serialization.JsonNet/UnitsNetBaseJsonConverter.cs b/UnitsNet.Serialization.JsonNet/UnitsNetBaseJsonConverter.cs index b284f0ebae..6e9d2940bd 100644 --- a/UnitsNet.Serialization.JsonNet/UnitsNetBaseJsonConverter.cs +++ b/UnitsNet.Serialization.JsonNet/UnitsNetBaseJsonConverter.cs @@ -21,7 +21,7 @@ public abstract class UnitsNetBaseJsonConverter : JsonConverter /// /// Register custom types so that the converter can instantiate these quantities. - /// Instead of calling , the will be used to instantiate the object. + /// Instead of calling , the will be used to instantiate the object. /// It is therefore assumed that the constructor of is specified with new T(double value, typeof() unit). /// Registering the same multiple times, it will overwrite the one registered. /// @@ -57,38 +57,20 @@ public void RegisterCustomType(Type quantity, Type unit) var unit = jsonObject.GetValue(nameof(ValueUnit.Unit), StringComparison.OrdinalIgnoreCase); var value = jsonObject.GetValue(nameof(ValueUnit.Value), StringComparison.OrdinalIgnoreCase); - var valueType = jsonObject.GetValue(nameof(ExtendedValueUnit.ValueType), StringComparison.OrdinalIgnoreCase); - var valueString = jsonObject.GetValue(nameof(ExtendedValueUnit.ValueString), StringComparison.OrdinalIgnoreCase); if (unit == null || value == null) { return null; } - if (valueType == null) - { - if (value.Type != JTokenType.Float && value.Type != JTokenType.Integer) - { - return null; - } - - return new ValueUnit { - Unit = unit.Value() ?? throw new InvalidOperationException("Unit was not a string."), - Value = value.Value() - }; - } - - if (valueType.Type != JTokenType.String) + if (value.Type != JTokenType.Float && value.Type != JTokenType.Integer) { return null; } - return new ExtendedValueUnit - { + return new ValueUnit { Unit = unit.Value() ?? throw new InvalidOperationException("Unit was not a string."), - Value = value.Value(), - ValueType = valueType.Value(), - ValueString = valueString?.Value() + Value = value.Value() }; } @@ -113,11 +95,7 @@ protected IQuantity ConvertValueUnit(ValueUnit valueUnit) return (IQuantity)Activator.CreateInstance(registeredQuantity, valueUnit.Value, unit); } - return valueUnit switch - { - ExtendedValueUnit {ValueType: "decimal", ValueString: {}} extendedValueUnit => Quantity.From(decimal.Parse(extendedValueUnit.ValueString, CultureInfo.InvariantCulture), unit), - _ => Quantity.From(valueUnit.Value, unit) - }; + return Quantity.From(valueUnit.Value, unit); } private (Type? Quantity, Type? Unit) GetRegisteredType(string unit) @@ -182,18 +160,6 @@ protected ValueUnit ConvertIQuantity(IQuantity quantity) { quantity = quantity ?? throw new ArgumentNullException(nameof(quantity)); - if (quantity is IValueQuantity d) - { - return new ExtendedValueUnit - { - Unit = $"{quantity.QuantityInfo.UnitType.Name}.{quantity.Unit}", - // The type of "Value" is still double - Value = (double)quantity.Value, - ValueString = d.Value.ToString(CultureInfo.InvariantCulture), - ValueType = "decimal" - }; - } - return new ValueUnit {Value = (double)quantity.Value, Unit = $"{quantity.QuantityInfo.UnitType.Name}.{quantity.Unit}"}; } @@ -263,27 +229,5 @@ protected class ValueUnit [JsonProperty(Order = 2)] public double Value { get; set; } } - - /// - /// A structure used to serialize/deserialize non-double Units.NET unit instances. - /// - /// - /// This type was added for lossless serialization of quantities with values. - /// The type distinguishes between 100 and 100.00 but Json.NET does not, therefore we serialize decimal values as string. - /// - protected sealed class ExtendedValueUnit : ValueUnit - { - /// - /// The value as a string. - /// - [JsonProperty(Order = 3)] - public string? ValueString { get; set; } - - /// - /// The type of the value, e.g. "decimal". - /// - [JsonProperty(Order = 4)] - public string? ValueType { get; set; } - } } } diff --git a/UnitsNet.Tests/AssertEx.cs b/UnitsNet.Tests/AssertEx.cs index 229e4324e7..d052adfeec 100644 --- a/UnitsNet.Tests/AssertEx.cs +++ b/UnitsNet.Tests/AssertEx.cs @@ -25,23 +25,5 @@ public static void EqualTolerance(double expected, double actual, double toleran Assert.True( areEqual, $"Values are not equal within absolute tolerance: {tolerance}\nExpected: {expected}\nActual: {actual}\nDiff: {actual - expected:e}" ); } } - - public static void EqualTolerance(decimal expected, decimal actual, decimal tolerance, ComparisonType comparisonType = ComparisonType.Relative) - { - if (comparisonType == ComparisonType.Relative) - { - bool areEqual = Comparison.EqualsRelative(expected, actual, tolerance); - - decimal difference = Math.Abs(expected - actual); - decimal relativeDifference = difference / expected; - - Assert.True(areEqual, $"Values are not equal within relative tolerance: {tolerance:P4}\nExpected: {expected}\nActual: {actual}\nDiff: {relativeDifference:P4}"); - } - else if (comparisonType == ComparisonType.Absolute) - { - bool areEqual = Comparison.EqualsAbsolute(expected, actual, tolerance); - Assert.True(areEqual, $"Values are not equal within absolute tolerance: {tolerance}\nExpected: {expected}\nActual: {actual}\nDiff: {actual - expected:e}"); - } - } } } diff --git a/UnitsNet.Tests/CustomCode/IQuantityTests.cs b/UnitsNet.Tests/CustomCode/IQuantityTests.cs index 6333011d83..1193a838fa 100644 --- a/UnitsNet.Tests/CustomCode/IQuantityTests.cs +++ b/UnitsNet.Tests/CustomCode/IQuantityTests.cs @@ -57,27 +57,5 @@ public void ToUnit_GivenSIUnitSystem_ReturnsSIQuantity() Assert.Equal(0.0508, inSI.Value); Assert.Equal(LengthUnit.Meter, inSI.Unit); } - - - [Fact] - public void IQuantityTUnitDouble_Value_ReturnsDouble() - { - IQuantity doubleQuantity = Temperature.FromDegreesCelsius(1234.5); - Assert.IsType(doubleQuantity.Value); - } - - [Fact] - public void IQuantityTUnitDouble_AsEnum_ReturnsDouble() - { - IQuantity doubleQuantity = Temperature.FromDegreesCelsius(1234.5); - Assert.IsType(doubleQuantity.As(TemperatureUnit.Kelvin)); - } - - [Fact] - public void IQuantityTUnitDouble_AsUnitSystem_ReturnsDouble() - { - IQuantity doubleQuantity = Temperature.FromDegreesCelsius(1234.5); - Assert.IsType(doubleQuantity.As(UnitSystem.SI)); - } } } diff --git a/UnitsNet.Tests/CustomCode/PowerRatioTests.cs b/UnitsNet.Tests/CustomCode/PowerRatioTests.cs index adb1ee96fc..8dab3f359a 100644 --- a/UnitsNet.Tests/CustomCode/PowerRatioTests.cs +++ b/UnitsNet.Tests/CustomCode/PowerRatioTests.cs @@ -46,7 +46,6 @@ public void ExpectPowerConvertedCorrectly(double power, double expected) } [Theory] - // Note: Attribute arguments cannot be of type decimal. [InlineData(-20, 0.01)] [InlineData(-10, 0.1)] [InlineData(0, 1)] diff --git a/UnitsNet.Tests/CustomQuantities/HowMuch.cs b/UnitsNet.Tests/CustomQuantities/HowMuch.cs index 95456a9877..233c97b1f1 100644 --- a/UnitsNet.Tests/CustomQuantities/HowMuch.cs +++ b/UnitsNet.Tests/CustomQuantities/HowMuch.cs @@ -19,7 +19,7 @@ public HowMuch(double value, HowMuchUnit unit) Enum IQuantity.Unit => Unit; public HowMuchUnit Unit { get; } - public QuantityValue Value { get; } + public double Value { get; } #region IQuantity diff --git a/UnitsNet.Tests/DummyIQuantity.cs b/UnitsNet.Tests/DummyIQuantity.cs index 01a39f4eb3..cc15ec1af4 100644 --- a/UnitsNet.Tests/DummyIQuantity.cs +++ b/UnitsNet.Tests/DummyIQuantity.cs @@ -13,7 +13,7 @@ internal class DummyIQuantity : IQuantity public Enum Unit => throw new NotImplementedException(); - public QuantityValue Value => throw new NotImplementedException(); + public double Value => throw new NotImplementedException(); public double As(Enum unit ) => throw new NotImplementedException(); diff --git a/UnitsNet.Tests/IValueQuantityTests.cs b/UnitsNet.Tests/IValueQuantityTests.cs deleted file mode 100644 index ae8783c87b..0000000000 --- a/UnitsNet.Tests/IValueQuantityTests.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Licensed under MIT No Attribution, see LICENSE file at the root. -// Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet. - -using UnitsNet.Units; -using Xunit; - -namespace UnitsNet.Tests -{ - // ReSharper disable once InconsistentNaming - public class IValueQuantityTests - { - [Fact] - public void IValueQuantityTDouble_Value_ReturnsDouble() - { - IValueQuantity doubleQuantity = Temperature.FromDegreesCelsius(1234.5); - Assert.IsType(doubleQuantity.Value); - } - - [Fact] - public void IValueQuantityTDouble_AsEnum_ReturnsDouble() - { - IValueQuantity doubleQuantity = Temperature.FromDegreesCelsius(1234.5); - Assert.IsType(doubleQuantity.As(TemperatureUnit.Kelvin)); - } - - [Fact] - public void IValueQuantityTDouble_AsUnitSystem_ReturnsDouble() - { - IValueQuantity doubleQuantity = Temperature.FromDegreesCelsius(1234.5); - Assert.IsType(doubleQuantity.As(UnitSystem.SI)); - } - - [Fact] - public void IValueQuantityTDouble_ToUnitEnum_ReturnsIValueQuantityTDouble() - { - IValueQuantity doubleQuantity = Temperature.FromDegreesCelsius(1234.5); - Assert.IsAssignableFrom>(doubleQuantity.ToUnit(TemperatureUnit.Kelvin)); - } - - [Fact] - public void IValueQuantityTDouble_ToUnitUnitSystem_ReturnsIValueQuantityTDouble() - { - IValueQuantity doubleQuantity = Temperature.FromDegreesCelsius(1234.5); - Assert.IsAssignableFrom>(doubleQuantity.ToUnit(UnitSystem.SI)); - } - } -} diff --git a/UnitsNet.Tests/QuantityTests.cs b/UnitsNet.Tests/QuantityTests.cs index eac72fb99a..555153121c 100644 --- a/UnitsNet.Tests/QuantityTests.cs +++ b/UnitsNet.Tests/QuantityTests.cs @@ -31,9 +31,9 @@ public void GetHashCodeForDifferentQuantitiesWithSameValuesAreNotEqual() public void Equals_IGenericEquatableQuantity(string q1String, string q2String, string toleranceString, bool expectedEqual) { // This interfaces implements .NET generic math interfaces. - IQuantity q1 = ParseLength(q1String); - IQuantity q2 = ParseLength(q2String); - IQuantity tolerance = ParseLength(toleranceString); + IQuantity q1 = ParseLength(q1String); + IQuantity q2 = ParseLength(q2String); + IQuantity tolerance = ParseLength(toleranceString); Assert.Equal(expectedEqual, q1.Equals(q2, tolerance)); } @@ -88,9 +88,9 @@ public void Equals_IQuantity_ToleranceIsDifferentType_Throws() [Fact] public void Equals_GenericEquatableIQuantity_OtherIsNull_ReturnsFalse() { - IQuantity q1 = ParseLength("10 m"); - IQuantity? q2 = null; - IQuantity tolerance = ParseLength("0.1 m"); + IQuantity q1 = ParseLength("10 m"); + IQuantity? q2 = null; + IQuantity tolerance = ParseLength("0.1 m"); Assert.False(q1.Equals(q2, tolerance)); } diff --git a/UnitsNet/Comparison.cs b/UnitsNet/Comparison.cs index 6c5a405a9d..8971906b04 100644 --- a/UnitsNet/Comparison.cs +++ b/UnitsNet/Comparison.cs @@ -65,61 +65,6 @@ public static bool Equals(double referenceValue, double otherValue, double toler } } - /// - /// - /// Checks if two values are equal with a given relative or absolute tolerance. - /// - /// - /// Relative tolerance is defined as the maximum allowable absolute difference between - /// and - /// as a percentage of . A relative tolerance of - /// 0.01 means the - /// absolute difference of and must be within +/- - /// 1%. - /// - /// In this example, the two values will be equal if the value of b is within +/- 1% of a. - /// - /// Equals(a, b, 0.01, ComparisonType.Relative); - /// - /// - /// - /// - /// Absolute tolerance is defined as the maximum allowable absolute difference between - /// and - /// as a fixed number. - /// - /// In this example, the two values will be equal if abs( - - /// ) <= 0.01 - /// - /// Equals(a, b, 0.01, ComparisonType.Absolute); - /// - /// - /// - /// - /// - /// The reference value. If using relative tolerance, it is the value which the relative - /// tolerance will be calculated against. - /// - /// The value to compare to. - /// The absolute or relative tolerance value. Must be greater than or equal to 0. - /// Whether the tolerance is absolute or relative. - /// - public static bool Equals(decimal referenceValue, decimal otherValue, decimal tolerance, ComparisonType comparisonType) - { - if (tolerance < 0) - throw new ArgumentOutOfRangeException(nameof(tolerance), "Tolerance must be greater than or equal to 0"); - - switch (comparisonType) - { - case ComparisonType.Relative: - return EqualsRelative(referenceValue, otherValue, tolerance); - case ComparisonType.Absolute: - return EqualsAbsolute(referenceValue, otherValue, tolerance); - default: - throw new InvalidOperationException("The given ComparisonType is not supported."); - } - } - /// /// Checks if two values are equal with a given relative tolerance. /// @@ -150,36 +95,6 @@ public static bool EqualsRelative(double referenceValue, double otherValue, doub return Math.Abs(referenceValue - otherValue) <= maxVariation; } - /// - /// Checks if two values are equal with a given relative tolerance. - /// - /// Relative tolerance is defined as the maximum allowable absolute difference between - /// and - /// as a percentage of . A relative tolerance of - /// 0.01 means the - /// absolute difference of and must be within +/- - /// 1%. - /// - /// In this example, the two values will be equal if the value of b is within +/- 1% of a. - /// - /// EqualsRelative(a, b, 0.01); - /// - /// - /// - /// - /// The reference value which the tolerance will be calculated against. - /// The value to compare to. - /// The relative tolerance. Must be greater than or equal to 0. - /// True if the two values are equal within the given relative tolerance, otherwise false. - public static bool EqualsRelative(decimal referenceValue, decimal otherValue, decimal tolerance) - { - if (tolerance < 0) - throw new ArgumentOutOfRangeException(nameof(tolerance), "Tolerance must be greater than or equal to 0"); - - var maxVariation = Math.Abs(referenceValue * tolerance); - return Math.Abs(referenceValue - otherValue) <= maxVariation; - } - /// /// Checks if two values are equal with a given absolute tolerance. /// @@ -206,32 +121,5 @@ public static bool EqualsAbsolute(double value1, double value2, double tolerance return Math.Abs(value1 - value2) <= tolerance; } - - /// - /// Checks if two values are equal with a given absolute tolerance. - /// - /// Absolute tolerance is defined as the maximum allowable absolute difference between - /// and - /// as a fixed number. - /// - /// In this example, the two values will be equal if abs( - - /// ) <= 0.01 - /// - /// Equals(a, b, 0.01, ComparisonType.Absolute); - /// - /// - /// - /// - /// The first value. - /// The second value. - /// The absolute tolerance. Must be greater than or equal to 0. - /// True if the two values are equal within the given absolute tolerance, otherwise false. - public static bool EqualsAbsolute(decimal value1, decimal value2, decimal tolerance) - { - if (tolerance < 0) - throw new ArgumentOutOfRangeException(nameof(tolerance), "Tolerance must be greater than or equal to 0"); - - return Math.Abs(value1 - value2) <= tolerance; - } } } diff --git a/UnitsNet/CustomCode/Quantity.cs b/UnitsNet/CustomCode/Quantity.cs index 51afc17a5f..8d59082bcf 100644 --- a/UnitsNet/CustomCode/Quantity.cs +++ b/UnitsNet/CustomCode/Quantity.cs @@ -46,7 +46,7 @@ public static bool TryGetUnitInfo(Enum unitEnum, [NotNullWhen(true)] out UnitInf /// Unit enum value. /// An object. /// Unit value is not a known unit enum type. - public static IQuantity From(QuantityValue value, Enum unit) + public static IQuantity From(double value, Enum unit) { return TryFrom(value, unit, out IQuantity? quantity) ? quantity @@ -61,7 +61,7 @@ public static IQuantity From(QuantityValue value, Enum unit) /// The invariant unit enum name, such as "Meter". Does not support localization. /// An object. /// Unit value is not a known unit enum type. - public static IQuantity From(QuantityValue value, string quantityName, string unitName) + public static IQuantity From(double value, string quantityName, string unitName) { // Get enum value for this unit, f.ex. LengthUnit.Meter for unit name "Meter". return UnitConverter.TryParseUnit(quantityName, unitName, out Enum? unitValue) && @@ -78,14 +78,14 @@ public static IQuantity From(QuantityValue value, string quantityName, string un /// Unit abbreviation matching is case-insensitive.
///
/// This will fail if more than one unit across all quantities share the same unit abbreviation.
- /// Prefer or instead. + /// Prefer or instead. /// /// Numeric value. /// Unit abbreviation, such as "kg" for . /// An object. /// Unit abbreviation is not known. /// Multiple units found matching the given unit abbreviation. - public static IQuantity FromUnitAbbreviation(QuantityValue value, string unitAbbreviation) => FromUnitAbbreviation(null, value, unitAbbreviation); + public static IQuantity FromUnitAbbreviation(double value, string unitAbbreviation) => FromUnitAbbreviation(null, value, unitAbbreviation); /// /// Dynamically construct a quantity from a numeric value and a unit abbreviation. @@ -95,7 +95,7 @@ public static IQuantity From(QuantityValue value, string quantityName, string un /// Unit abbreviation matching is case-insensitive.
///
/// This will fail if more than one unit across all quantities share the same unit abbreviation.
- /// Prefer or instead. + /// Prefer or instead. /// /// The format provider to use for lookup. Defaults to if null. /// Numeric value. @@ -103,7 +103,7 @@ public static IQuantity From(QuantityValue value, string quantityName, string un /// An object. /// Unit abbreviation is not known. /// Multiple units found matching the given unit abbreviation. - public static IQuantity FromUnitAbbreviation(IFormatProvider? formatProvider, QuantityValue value, string unitAbbreviation) + public static IQuantity FromUnitAbbreviation(IFormatProvider? formatProvider, double value, string unitAbbreviation) { // TODO Optimize this with UnitValueAbbreviationLookup via UnitAbbreviationsCache.TryGetUnitValueAbbreviationLookup. List units = GetUnitsForAbbreviation(formatProvider, unitAbbreviation); @@ -121,16 +121,6 @@ public static IQuantity FromUnitAbbreviation(IFormatProvider? formatProvider, Qu return From(value, unit); } - /// - public static bool TryFrom(double value, Enum unit, [NotNullWhen(true)] out IQuantity? quantity) - { - quantity = default; - - // Implicit cast to QuantityValue would prevent TryFrom from being called, - // so we need to explicitly check this here for double arguments. - return TryFrom((QuantityValue)value, unit, out quantity); - } - /// /// Try to dynamically construct a quantity from a value, the quantity name and the unit name. /// @@ -155,14 +145,14 @@ public static bool TryFrom(double value, string quantityName, string unitName, [ /// Unit abbreviation matching is case-insensitive.
///
/// This will fail if more than one unit across all quantities share the same unit abbreviation.
- /// Prefer or instead. + /// Prefer or instead. /// /// Numeric value. /// Unit abbreviation, such as "kg" for . /// The quantity if successful, otherwise null. /// True if successful. /// Unit value is not a known unit enum type. - public static bool TryFromUnitAbbreviation(QuantityValue value, string unitAbbreviation, [NotNullWhen(true)] out IQuantity? quantity) => + public static bool TryFromUnitAbbreviation(double value, string unitAbbreviation, [NotNullWhen(true)] out IQuantity? quantity) => TryFromUnitAbbreviation(null, value, unitAbbreviation, out quantity); /// @@ -173,7 +163,7 @@ public static bool TryFromUnitAbbreviation(QuantityValue value, string unitAbbre /// Unit abbreviation matching is case-insensitive.
///
/// This will fail if more than one unit across all quantities share the same unit abbreviation.
- /// Prefer or instead. + /// Prefer or instead. /// /// The format provider to use for lookup. Defaults to if null. /// Numeric value. @@ -181,7 +171,7 @@ public static bool TryFromUnitAbbreviation(QuantityValue value, string unitAbbre /// The quantity if successful, otherwise null. /// True if successful. /// Unit value is not a known unit enum type. - public static bool TryFromUnitAbbreviation(IFormatProvider? formatProvider, QuantityValue value, string unitAbbreviation, [NotNullWhen(true)] out IQuantity? quantity) + public static bool TryFromUnitAbbreviation(IFormatProvider? formatProvider, double value, string unitAbbreviation, [NotNullWhen(true)] out IQuantity? quantity) { // TODO Optimize this with UnitValueAbbreviationLookup via UnitAbbreviationsCache.TryGetUnitValueAbbreviationLookup. List units = GetUnitsForAbbreviation(formatProvider, unitAbbreviation); diff --git a/UnitsNet/CustomCode/QuantityParser.cs b/UnitsNet/CustomCode/QuantityParser.cs index 9e003359e5..dfbea7a01b 100644 --- a/UnitsNet/CustomCode/QuantityParser.cs +++ b/UnitsNet/CustomCode/QuantityParser.cs @@ -17,7 +17,7 @@ namespace UnitsNet ///
/// The type of quantity to create, such as . /// The type of unit enum that belongs to this quantity, such as for . - public delegate TQuantity QuantityFromDelegate(QuantityValue value, TUnitType fromUnit) + public delegate TQuantity QuantityFromDelegate(double value, TUnitType fromUnit) where TQuantity : IQuantity where TUnitType : Enum; diff --git a/UnitsNet/GeneratedCode/Quantities/AbsorbedDoseOfIonizingRadiation.g.cs b/UnitsNet/GeneratedCode/Quantities/AbsorbedDoseOfIonizingRadiation.g.cs index da5528afdc..2946054ac8 100644 --- a/UnitsNet/GeneratedCode/Quantities/AbsorbedDoseOfIonizingRadiation.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AbsorbedDoseOfIonizingRadiation.g.cs @@ -40,7 +40,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct AbsorbedDoseOfIonizingRadiation : - IArithmeticQuantity, + IArithmeticQuantity, IComparable, IComparable, IConvertible, @@ -165,7 +165,7 @@ public AbsorbedDoseOfIonizingRadiation(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -344,9 +344,8 @@ public static string GetAbbreviation(AbsorbedDoseOfIonizingRadiationUnit unit, I /// Creates a from . ///
/// If value is NaN or Infinity. - public static AbsorbedDoseOfIonizingRadiation FromCentigrays(QuantityValue centigrays) + public static AbsorbedDoseOfIonizingRadiation FromCentigrays(double value) { - double value = (double) centigrays; return new AbsorbedDoseOfIonizingRadiation(value, AbsorbedDoseOfIonizingRadiationUnit.Centigray); } @@ -354,9 +353,8 @@ public static AbsorbedDoseOfIonizingRadiation FromCentigrays(QuantityValue centi /// Creates a from . ///
/// If value is NaN or Infinity. - public static AbsorbedDoseOfIonizingRadiation FromFemtograys(QuantityValue femtograys) + public static AbsorbedDoseOfIonizingRadiation FromFemtograys(double value) { - double value = (double) femtograys; return new AbsorbedDoseOfIonizingRadiation(value, AbsorbedDoseOfIonizingRadiationUnit.Femtogray); } @@ -364,9 +362,8 @@ public static AbsorbedDoseOfIonizingRadiation FromFemtograys(QuantityValue femto /// Creates a from . ///
/// If value is NaN or Infinity. - public static AbsorbedDoseOfIonizingRadiation FromGigagrays(QuantityValue gigagrays) + public static AbsorbedDoseOfIonizingRadiation FromGigagrays(double value) { - double value = (double) gigagrays; return new AbsorbedDoseOfIonizingRadiation(value, AbsorbedDoseOfIonizingRadiationUnit.Gigagray); } @@ -374,9 +371,8 @@ public static AbsorbedDoseOfIonizingRadiation FromGigagrays(QuantityValue gigagr /// Creates a from . ///
/// If value is NaN or Infinity. - public static AbsorbedDoseOfIonizingRadiation FromGrays(QuantityValue grays) + public static AbsorbedDoseOfIonizingRadiation FromGrays(double value) { - double value = (double) grays; return new AbsorbedDoseOfIonizingRadiation(value, AbsorbedDoseOfIonizingRadiationUnit.Gray); } @@ -384,9 +380,8 @@ public static AbsorbedDoseOfIonizingRadiation FromGrays(QuantityValue grays) /// Creates a from . /// /// If value is NaN or Infinity. - public static AbsorbedDoseOfIonizingRadiation FromKilograys(QuantityValue kilograys) + public static AbsorbedDoseOfIonizingRadiation FromKilograys(double value) { - double value = (double) kilograys; return new AbsorbedDoseOfIonizingRadiation(value, AbsorbedDoseOfIonizingRadiationUnit.Kilogray); } @@ -394,9 +389,8 @@ public static AbsorbedDoseOfIonizingRadiation FromKilograys(QuantityValue kilogr /// Creates a from . /// /// If value is NaN or Infinity. - public static AbsorbedDoseOfIonizingRadiation FromKilorads(QuantityValue kilorads) + public static AbsorbedDoseOfIonizingRadiation FromKilorads(double value) { - double value = (double) kilorads; return new AbsorbedDoseOfIonizingRadiation(value, AbsorbedDoseOfIonizingRadiationUnit.Kilorad); } @@ -404,9 +398,8 @@ public static AbsorbedDoseOfIonizingRadiation FromKilorads(QuantityValue kilorad /// Creates a from . /// /// If value is NaN or Infinity. - public static AbsorbedDoseOfIonizingRadiation FromMegagrays(QuantityValue megagrays) + public static AbsorbedDoseOfIonizingRadiation FromMegagrays(double value) { - double value = (double) megagrays; return new AbsorbedDoseOfIonizingRadiation(value, AbsorbedDoseOfIonizingRadiationUnit.Megagray); } @@ -414,9 +407,8 @@ public static AbsorbedDoseOfIonizingRadiation FromMegagrays(QuantityValue megagr /// Creates a from . /// /// If value is NaN or Infinity. - public static AbsorbedDoseOfIonizingRadiation FromMegarads(QuantityValue megarads) + public static AbsorbedDoseOfIonizingRadiation FromMegarads(double value) { - double value = (double) megarads; return new AbsorbedDoseOfIonizingRadiation(value, AbsorbedDoseOfIonizingRadiationUnit.Megarad); } @@ -424,9 +416,8 @@ public static AbsorbedDoseOfIonizingRadiation FromMegarads(QuantityValue megarad /// Creates a from . /// /// If value is NaN or Infinity. - public static AbsorbedDoseOfIonizingRadiation FromMicrograys(QuantityValue micrograys) + public static AbsorbedDoseOfIonizingRadiation FromMicrograys(double value) { - double value = (double) micrograys; return new AbsorbedDoseOfIonizingRadiation(value, AbsorbedDoseOfIonizingRadiationUnit.Microgray); } @@ -434,9 +425,8 @@ public static AbsorbedDoseOfIonizingRadiation FromMicrograys(QuantityValue micro /// Creates a from . /// /// If value is NaN or Infinity. - public static AbsorbedDoseOfIonizingRadiation FromMilligrays(QuantityValue milligrays) + public static AbsorbedDoseOfIonizingRadiation FromMilligrays(double value) { - double value = (double) milligrays; return new AbsorbedDoseOfIonizingRadiation(value, AbsorbedDoseOfIonizingRadiationUnit.Milligray); } @@ -444,9 +434,8 @@ public static AbsorbedDoseOfIonizingRadiation FromMilligrays(QuantityValue milli /// Creates a from . /// /// If value is NaN or Infinity. - public static AbsorbedDoseOfIonizingRadiation FromMillirads(QuantityValue millirads) + public static AbsorbedDoseOfIonizingRadiation FromMillirads(double value) { - double value = (double) millirads; return new AbsorbedDoseOfIonizingRadiation(value, AbsorbedDoseOfIonizingRadiationUnit.Millirad); } @@ -454,9 +443,8 @@ public static AbsorbedDoseOfIonizingRadiation FromMillirads(QuantityValue millir /// Creates a from . /// /// If value is NaN or Infinity. - public static AbsorbedDoseOfIonizingRadiation FromNanograys(QuantityValue nanograys) + public static AbsorbedDoseOfIonizingRadiation FromNanograys(double value) { - double value = (double) nanograys; return new AbsorbedDoseOfIonizingRadiation(value, AbsorbedDoseOfIonizingRadiationUnit.Nanogray); } @@ -464,9 +452,8 @@ public static AbsorbedDoseOfIonizingRadiation FromNanograys(QuantityValue nanogr /// Creates a from . /// /// If value is NaN or Infinity. - public static AbsorbedDoseOfIonizingRadiation FromPetagrays(QuantityValue petagrays) + public static AbsorbedDoseOfIonizingRadiation FromPetagrays(double value) { - double value = (double) petagrays; return new AbsorbedDoseOfIonizingRadiation(value, AbsorbedDoseOfIonizingRadiationUnit.Petagray); } @@ -474,9 +461,8 @@ public static AbsorbedDoseOfIonizingRadiation FromPetagrays(QuantityValue petagr /// Creates a from . /// /// If value is NaN or Infinity. - public static AbsorbedDoseOfIonizingRadiation FromPicograys(QuantityValue picograys) + public static AbsorbedDoseOfIonizingRadiation FromPicograys(double value) { - double value = (double) picograys; return new AbsorbedDoseOfIonizingRadiation(value, AbsorbedDoseOfIonizingRadiationUnit.Picogray); } @@ -484,9 +470,8 @@ public static AbsorbedDoseOfIonizingRadiation FromPicograys(QuantityValue picogr /// Creates a from . /// /// If value is NaN or Infinity. - public static AbsorbedDoseOfIonizingRadiation FromRads(QuantityValue rads) + public static AbsorbedDoseOfIonizingRadiation FromRads(double value) { - double value = (double) rads; return new AbsorbedDoseOfIonizingRadiation(value, AbsorbedDoseOfIonizingRadiationUnit.Rad); } @@ -494,9 +479,8 @@ public static AbsorbedDoseOfIonizingRadiation FromRads(QuantityValue rads) /// Creates a from . /// /// If value is NaN or Infinity. - public static AbsorbedDoseOfIonizingRadiation FromTeragrays(QuantityValue teragrays) + public static AbsorbedDoseOfIonizingRadiation FromTeragrays(double value) { - double value = (double) teragrays; return new AbsorbedDoseOfIonizingRadiation(value, AbsorbedDoseOfIonizingRadiationUnit.Teragray); } @@ -506,9 +490,9 @@ public static AbsorbedDoseOfIonizingRadiation FromTeragrays(QuantityValue teragr /// Value to convert from. /// Unit to convert from. /// AbsorbedDoseOfIonizingRadiation unit value. - public static AbsorbedDoseOfIonizingRadiation From(QuantityValue value, AbsorbedDoseOfIonizingRadiationUnit fromUnit) + public static AbsorbedDoseOfIonizingRadiation From(double value, AbsorbedDoseOfIonizingRadiationUnit fromUnit) { - return new AbsorbedDoseOfIonizingRadiation((double)value, fromUnit); + return new AbsorbedDoseOfIonizingRadiation(value, fromUnit); } #endregion @@ -919,15 +903,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is AbsorbedDoseOfIonizingRadiationUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(AbsorbedDoseOfIonizingRadiationUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is AbsorbedDoseOfIonizingRadiationUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(AbsorbedDoseOfIonizingRadiationUnit)} is supported.", nameof(unit)); @@ -1072,18 +1047,6 @@ public AbsorbedDoseOfIonizingRadiation ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not AbsorbedDoseOfIonizingRadiationUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(AbsorbedDoseOfIonizingRadiationUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs b/UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs index 72ac25caa1..9da774ea22 100644 --- a/UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs @@ -40,7 +40,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct Acceleration : - IArithmeticQuantity, + IArithmeticQuantity, #if NET7_0_OR_GREATER IMultiplyOperators, IDivisionOperators, @@ -171,7 +171,7 @@ public Acceleration(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -336,9 +336,8 @@ public static string GetAbbreviation(AccelerationUnit unit, IFormatProvider? pro /// Creates a from . /// /// If value is NaN or Infinity. - public static Acceleration FromCentimetersPerSecondSquared(QuantityValue centimeterspersecondsquared) + public static Acceleration FromCentimetersPerSecondSquared(double value) { - double value = (double) centimeterspersecondsquared; return new Acceleration(value, AccelerationUnit.CentimeterPerSecondSquared); } @@ -346,9 +345,8 @@ public static Acceleration FromCentimetersPerSecondSquared(QuantityValue centime /// Creates a from . /// /// If value is NaN or Infinity. - public static Acceleration FromDecimetersPerSecondSquared(QuantityValue decimeterspersecondsquared) + public static Acceleration FromDecimetersPerSecondSquared(double value) { - double value = (double) decimeterspersecondsquared; return new Acceleration(value, AccelerationUnit.DecimeterPerSecondSquared); } @@ -356,9 +354,8 @@ public static Acceleration FromDecimetersPerSecondSquared(QuantityValue decimete /// Creates a from . /// /// If value is NaN or Infinity. - public static Acceleration FromFeetPerSecondSquared(QuantityValue feetpersecondsquared) + public static Acceleration FromFeetPerSecondSquared(double value) { - double value = (double) feetpersecondsquared; return new Acceleration(value, AccelerationUnit.FootPerSecondSquared); } @@ -366,9 +363,8 @@ public static Acceleration FromFeetPerSecondSquared(QuantityValue feetperseconds /// Creates a from . /// /// If value is NaN or Infinity. - public static Acceleration FromInchesPerSecondSquared(QuantityValue inchespersecondsquared) + public static Acceleration FromInchesPerSecondSquared(double value) { - double value = (double) inchespersecondsquared; return new Acceleration(value, AccelerationUnit.InchPerSecondSquared); } @@ -376,9 +372,8 @@ public static Acceleration FromInchesPerSecondSquared(QuantityValue inchespersec /// Creates a from . /// /// If value is NaN or Infinity. - public static Acceleration FromKilometersPerSecondSquared(QuantityValue kilometerspersecondsquared) + public static Acceleration FromKilometersPerSecondSquared(double value) { - double value = (double) kilometerspersecondsquared; return new Acceleration(value, AccelerationUnit.KilometerPerSecondSquared); } @@ -386,9 +381,8 @@ public static Acceleration FromKilometersPerSecondSquared(QuantityValue kilomete /// Creates a from . /// /// If value is NaN or Infinity. - public static Acceleration FromKnotsPerHour(QuantityValue knotsperhour) + public static Acceleration FromKnotsPerHour(double value) { - double value = (double) knotsperhour; return new Acceleration(value, AccelerationUnit.KnotPerHour); } @@ -396,9 +390,8 @@ public static Acceleration FromKnotsPerHour(QuantityValue knotsperhour) /// Creates a from . /// /// If value is NaN or Infinity. - public static Acceleration FromKnotsPerMinute(QuantityValue knotsperminute) + public static Acceleration FromKnotsPerMinute(double value) { - double value = (double) knotsperminute; return new Acceleration(value, AccelerationUnit.KnotPerMinute); } @@ -406,9 +399,8 @@ public static Acceleration FromKnotsPerMinute(QuantityValue knotsperminute) /// Creates a from . /// /// If value is NaN or Infinity. - public static Acceleration FromKnotsPerSecond(QuantityValue knotspersecond) + public static Acceleration FromKnotsPerSecond(double value) { - double value = (double) knotspersecond; return new Acceleration(value, AccelerationUnit.KnotPerSecond); } @@ -416,9 +408,8 @@ public static Acceleration FromKnotsPerSecond(QuantityValue knotspersecond) /// Creates a from . /// /// If value is NaN or Infinity. - public static Acceleration FromMetersPerSecondSquared(QuantityValue meterspersecondsquared) + public static Acceleration FromMetersPerSecondSquared(double value) { - double value = (double) meterspersecondsquared; return new Acceleration(value, AccelerationUnit.MeterPerSecondSquared); } @@ -426,9 +417,8 @@ public static Acceleration FromMetersPerSecondSquared(QuantityValue meterspersec /// Creates a from . /// /// If value is NaN or Infinity. - public static Acceleration FromMicrometersPerSecondSquared(QuantityValue micrometerspersecondsquared) + public static Acceleration FromMicrometersPerSecondSquared(double value) { - double value = (double) micrometerspersecondsquared; return new Acceleration(value, AccelerationUnit.MicrometerPerSecondSquared); } @@ -436,9 +426,8 @@ public static Acceleration FromMicrometersPerSecondSquared(QuantityValue microme /// Creates a from . /// /// If value is NaN or Infinity. - public static Acceleration FromMillimetersPerSecondSquared(QuantityValue millimeterspersecondsquared) + public static Acceleration FromMillimetersPerSecondSquared(double value) { - double value = (double) millimeterspersecondsquared; return new Acceleration(value, AccelerationUnit.MillimeterPerSecondSquared); } @@ -446,9 +435,8 @@ public static Acceleration FromMillimetersPerSecondSquared(QuantityValue millime /// Creates a from . /// /// If value is NaN or Infinity. - public static Acceleration FromMillistandardGravity(QuantityValue millistandardgravity) + public static Acceleration FromMillistandardGravity(double value) { - double value = (double) millistandardgravity; return new Acceleration(value, AccelerationUnit.MillistandardGravity); } @@ -456,9 +444,8 @@ public static Acceleration FromMillistandardGravity(QuantityValue millistandardg /// Creates a from . /// /// If value is NaN or Infinity. - public static Acceleration FromNanometersPerSecondSquared(QuantityValue nanometerspersecondsquared) + public static Acceleration FromNanometersPerSecondSquared(double value) { - double value = (double) nanometerspersecondsquared; return new Acceleration(value, AccelerationUnit.NanometerPerSecondSquared); } @@ -466,9 +453,8 @@ public static Acceleration FromNanometersPerSecondSquared(QuantityValue nanomete /// Creates a from . /// /// If value is NaN or Infinity. - public static Acceleration FromStandardGravity(QuantityValue standardgravity) + public static Acceleration FromStandardGravity(double value) { - double value = (double) standardgravity; return new Acceleration(value, AccelerationUnit.StandardGravity); } @@ -478,9 +464,9 @@ public static Acceleration FromStandardGravity(QuantityValue standardgravity) /// Value to convert from. /// Unit to convert from. /// Acceleration unit value. - public static Acceleration From(QuantityValue value, AccelerationUnit fromUnit) + public static Acceleration From(double value, AccelerationUnit fromUnit) { - return new Acceleration((double)value, fromUnit); + return new Acceleration(value, fromUnit); } #endregion @@ -937,15 +923,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is AccelerationUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(AccelerationUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is AccelerationUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(AccelerationUnit)} is supported.", nameof(unit)); @@ -1086,18 +1063,6 @@ public Acceleration ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not AccelerationUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(AccelerationUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs b/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs index 40c6a00dd8..31bb489dc9 100644 --- a/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs @@ -40,7 +40,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct AmountOfSubstance : - IArithmeticQuantity, + IArithmeticQuantity, #if NET7_0_OR_GREATER IMultiplyOperators, IDivisionOperators, @@ -171,7 +171,7 @@ public AmountOfSubstance(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -357,9 +357,8 @@ public static string GetAbbreviation(AmountOfSubstanceUnit unit, IFormatProvider /// Creates a from . /// /// If value is NaN or Infinity. - public static AmountOfSubstance FromCentimoles(QuantityValue centimoles) + public static AmountOfSubstance FromCentimoles(double value) { - double value = (double) centimoles; return new AmountOfSubstance(value, AmountOfSubstanceUnit.Centimole); } @@ -367,9 +366,8 @@ public static AmountOfSubstance FromCentimoles(QuantityValue centimoles) /// Creates a from . /// /// If value is NaN or Infinity. - public static AmountOfSubstance FromCentipoundMoles(QuantityValue centipoundmoles) + public static AmountOfSubstance FromCentipoundMoles(double value) { - double value = (double) centipoundmoles; return new AmountOfSubstance(value, AmountOfSubstanceUnit.CentipoundMole); } @@ -377,9 +375,8 @@ public static AmountOfSubstance FromCentipoundMoles(QuantityValue centipoundmole /// Creates a from . /// /// If value is NaN or Infinity. - public static AmountOfSubstance FromDecimoles(QuantityValue decimoles) + public static AmountOfSubstance FromDecimoles(double value) { - double value = (double) decimoles; return new AmountOfSubstance(value, AmountOfSubstanceUnit.Decimole); } @@ -387,9 +384,8 @@ public static AmountOfSubstance FromDecimoles(QuantityValue decimoles) /// Creates a from . /// /// If value is NaN or Infinity. - public static AmountOfSubstance FromDecipoundMoles(QuantityValue decipoundmoles) + public static AmountOfSubstance FromDecipoundMoles(double value) { - double value = (double) decipoundmoles; return new AmountOfSubstance(value, AmountOfSubstanceUnit.DecipoundMole); } @@ -397,9 +393,8 @@ public static AmountOfSubstance FromDecipoundMoles(QuantityValue decipoundmoles) /// Creates a from . /// /// If value is NaN or Infinity. - public static AmountOfSubstance FromFemtomoles(QuantityValue femtomoles) + public static AmountOfSubstance FromFemtomoles(double value) { - double value = (double) femtomoles; return new AmountOfSubstance(value, AmountOfSubstanceUnit.Femtomole); } @@ -407,9 +402,8 @@ public static AmountOfSubstance FromFemtomoles(QuantityValue femtomoles) /// Creates a from . /// /// If value is NaN or Infinity. - public static AmountOfSubstance FromKilomoles(QuantityValue kilomoles) + public static AmountOfSubstance FromKilomoles(double value) { - double value = (double) kilomoles; return new AmountOfSubstance(value, AmountOfSubstanceUnit.Kilomole); } @@ -417,9 +411,8 @@ public static AmountOfSubstance FromKilomoles(QuantityValue kilomoles) /// Creates a from . /// /// If value is NaN or Infinity. - public static AmountOfSubstance FromKilopoundMoles(QuantityValue kilopoundmoles) + public static AmountOfSubstance FromKilopoundMoles(double value) { - double value = (double) kilopoundmoles; return new AmountOfSubstance(value, AmountOfSubstanceUnit.KilopoundMole); } @@ -427,9 +420,8 @@ public static AmountOfSubstance FromKilopoundMoles(QuantityValue kilopoundmoles) /// Creates a from . /// /// If value is NaN or Infinity. - public static AmountOfSubstance FromMegamoles(QuantityValue megamoles) + public static AmountOfSubstance FromMegamoles(double value) { - double value = (double) megamoles; return new AmountOfSubstance(value, AmountOfSubstanceUnit.Megamole); } @@ -437,9 +429,8 @@ public static AmountOfSubstance FromMegamoles(QuantityValue megamoles) /// Creates a from . /// /// If value is NaN or Infinity. - public static AmountOfSubstance FromMicromoles(QuantityValue micromoles) + public static AmountOfSubstance FromMicromoles(double value) { - double value = (double) micromoles; return new AmountOfSubstance(value, AmountOfSubstanceUnit.Micromole); } @@ -447,9 +438,8 @@ public static AmountOfSubstance FromMicromoles(QuantityValue micromoles) /// Creates a from . /// /// If value is NaN or Infinity. - public static AmountOfSubstance FromMicropoundMoles(QuantityValue micropoundmoles) + public static AmountOfSubstance FromMicropoundMoles(double value) { - double value = (double) micropoundmoles; return new AmountOfSubstance(value, AmountOfSubstanceUnit.MicropoundMole); } @@ -457,9 +447,8 @@ public static AmountOfSubstance FromMicropoundMoles(QuantityValue micropoundmole /// Creates a from . /// /// If value is NaN or Infinity. - public static AmountOfSubstance FromMillimoles(QuantityValue millimoles) + public static AmountOfSubstance FromMillimoles(double value) { - double value = (double) millimoles; return new AmountOfSubstance(value, AmountOfSubstanceUnit.Millimole); } @@ -467,9 +456,8 @@ public static AmountOfSubstance FromMillimoles(QuantityValue millimoles) /// Creates a from . /// /// If value is NaN or Infinity. - public static AmountOfSubstance FromMillipoundMoles(QuantityValue millipoundmoles) + public static AmountOfSubstance FromMillipoundMoles(double value) { - double value = (double) millipoundmoles; return new AmountOfSubstance(value, AmountOfSubstanceUnit.MillipoundMole); } @@ -477,9 +465,8 @@ public static AmountOfSubstance FromMillipoundMoles(QuantityValue millipoundmole /// Creates a from . /// /// If value is NaN or Infinity. - public static AmountOfSubstance FromMoles(QuantityValue moles) + public static AmountOfSubstance FromMoles(double value) { - double value = (double) moles; return new AmountOfSubstance(value, AmountOfSubstanceUnit.Mole); } @@ -487,9 +474,8 @@ public static AmountOfSubstance FromMoles(QuantityValue moles) /// Creates a from . /// /// If value is NaN or Infinity. - public static AmountOfSubstance FromNanomoles(QuantityValue nanomoles) + public static AmountOfSubstance FromNanomoles(double value) { - double value = (double) nanomoles; return new AmountOfSubstance(value, AmountOfSubstanceUnit.Nanomole); } @@ -497,9 +483,8 @@ public static AmountOfSubstance FromNanomoles(QuantityValue nanomoles) /// Creates a from . /// /// If value is NaN or Infinity. - public static AmountOfSubstance FromNanopoundMoles(QuantityValue nanopoundmoles) + public static AmountOfSubstance FromNanopoundMoles(double value) { - double value = (double) nanopoundmoles; return new AmountOfSubstance(value, AmountOfSubstanceUnit.NanopoundMole); } @@ -507,9 +492,8 @@ public static AmountOfSubstance FromNanopoundMoles(QuantityValue nanopoundmoles) /// Creates a from . /// /// If value is NaN or Infinity. - public static AmountOfSubstance FromPicomoles(QuantityValue picomoles) + public static AmountOfSubstance FromPicomoles(double value) { - double value = (double) picomoles; return new AmountOfSubstance(value, AmountOfSubstanceUnit.Picomole); } @@ -517,9 +501,8 @@ public static AmountOfSubstance FromPicomoles(QuantityValue picomoles) /// Creates a from . /// /// If value is NaN or Infinity. - public static AmountOfSubstance FromPoundMoles(QuantityValue poundmoles) + public static AmountOfSubstance FromPoundMoles(double value) { - double value = (double) poundmoles; return new AmountOfSubstance(value, AmountOfSubstanceUnit.PoundMole); } @@ -529,9 +512,9 @@ public static AmountOfSubstance FromPoundMoles(QuantityValue poundmoles) /// Value to convert from. /// Unit to convert from. /// AmountOfSubstance unit value. - public static AmountOfSubstance From(QuantityValue value, AmountOfSubstanceUnit fromUnit) + public static AmountOfSubstance From(double value, AmountOfSubstanceUnit fromUnit) { - return new AmountOfSubstance((double)value, fromUnit); + return new AmountOfSubstance(value, fromUnit); } #endregion @@ -964,15 +947,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is AmountOfSubstanceUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(AmountOfSubstanceUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is AmountOfSubstanceUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(AmountOfSubstanceUnit)} is supported.", nameof(unit)); @@ -1119,18 +1093,6 @@ public AmountOfSubstance ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not AmountOfSubstanceUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(AmountOfSubstanceUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.g.cs b/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.g.cs index 431a7e8427..80fd371fb9 100644 --- a/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.g.cs @@ -37,7 +37,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct AmplitudeRatio : - IArithmeticQuantity, + IArithmeticQuantity, IComparable, IComparable, IConvertible, @@ -150,7 +150,7 @@ public AmplitudeRatio(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -245,9 +245,8 @@ public static string GetAbbreviation(AmplitudeRatioUnit unit, IFormatProvider? p /// Creates a from . /// /// If value is NaN or Infinity. - public static AmplitudeRatio FromDecibelMicrovolts(QuantityValue decibelmicrovolts) + public static AmplitudeRatio FromDecibelMicrovolts(double value) { - double value = (double) decibelmicrovolts; return new AmplitudeRatio(value, AmplitudeRatioUnit.DecibelMicrovolt); } @@ -255,9 +254,8 @@ public static AmplitudeRatio FromDecibelMicrovolts(QuantityValue decibelmicrovol /// Creates a from . /// /// If value is NaN or Infinity. - public static AmplitudeRatio FromDecibelMillivolts(QuantityValue decibelmillivolts) + public static AmplitudeRatio FromDecibelMillivolts(double value) { - double value = (double) decibelmillivolts; return new AmplitudeRatio(value, AmplitudeRatioUnit.DecibelMillivolt); } @@ -265,9 +263,8 @@ public static AmplitudeRatio FromDecibelMillivolts(QuantityValue decibelmillivol /// Creates a from . /// /// If value is NaN or Infinity. - public static AmplitudeRatio FromDecibelsUnloaded(QuantityValue decibelsunloaded) + public static AmplitudeRatio FromDecibelsUnloaded(double value) { - double value = (double) decibelsunloaded; return new AmplitudeRatio(value, AmplitudeRatioUnit.DecibelUnloaded); } @@ -275,9 +272,8 @@ public static AmplitudeRatio FromDecibelsUnloaded(QuantityValue decibelsunloaded /// Creates a from . /// /// If value is NaN or Infinity. - public static AmplitudeRatio FromDecibelVolts(QuantityValue decibelvolts) + public static AmplitudeRatio FromDecibelVolts(double value) { - double value = (double) decibelvolts; return new AmplitudeRatio(value, AmplitudeRatioUnit.DecibelVolt); } @@ -287,9 +283,9 @@ public static AmplitudeRatio FromDecibelVolts(QuantityValue decibelvolts) /// Value to convert from. /// Unit to convert from. /// AmplitudeRatio unit value. - public static AmplitudeRatio From(QuantityValue value, AmplitudeRatioUnit fromUnit) + public static AmplitudeRatio From(double value, AmplitudeRatioUnit fromUnit) { - return new AmplitudeRatio((double)value, fromUnit); + return new AmplitudeRatio(value, fromUnit); } #endregion @@ -473,14 +469,14 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Ampli public static AmplitudeRatio operator *(AmplitudeRatio left, double right) { // Logarithmic multiplication = addition - return new AmplitudeRatio(left.Value + (double)right, left.Unit); + return new AmplitudeRatio(left.Value + right, left.Unit); } /// Get from logarithmic division of by value. public static AmplitudeRatio operator /(AmplitudeRatio left, double right) { // Logarithmic division = subtraction - return new AmplitudeRatio(left.Value - (double)right, left.Unit); + return new AmplitudeRatio(left.Value - right, left.Unit); } /// Get ratio value from logarithmic division of by . @@ -708,15 +704,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is AmplitudeRatioUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(AmplitudeRatioUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is AmplitudeRatioUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(AmplitudeRatioUnit)} is supported.", nameof(unit)); @@ -837,18 +824,6 @@ public AmplitudeRatio ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not AmplitudeRatioUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(AmplitudeRatioUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/Angle.g.cs b/UnitsNet/GeneratedCode/Quantities/Angle.g.cs index 346157c773..4a885a77a6 100644 --- a/UnitsNet/GeneratedCode/Quantities/Angle.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Angle.g.cs @@ -40,7 +40,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct Angle : - IArithmeticQuantity, + IArithmeticQuantity, #if NET7_0_OR_GREATER IDivisionOperators, IDivisionOperators, @@ -170,7 +170,7 @@ public Angle(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -349,9 +349,8 @@ public static string GetAbbreviation(AngleUnit unit, IFormatProvider? provider) /// Creates a from . /// /// If value is NaN or Infinity. - public static Angle FromArcminutes(QuantityValue arcminutes) + public static Angle FromArcminutes(double value) { - double value = (double) arcminutes; return new Angle(value, AngleUnit.Arcminute); } @@ -359,9 +358,8 @@ public static Angle FromArcminutes(QuantityValue arcminutes) /// Creates a from . /// /// If value is NaN or Infinity. - public static Angle FromArcseconds(QuantityValue arcseconds) + public static Angle FromArcseconds(double value) { - double value = (double) arcseconds; return new Angle(value, AngleUnit.Arcsecond); } @@ -369,9 +367,8 @@ public static Angle FromArcseconds(QuantityValue arcseconds) /// Creates a from . /// /// If value is NaN or Infinity. - public static Angle FromCentiradians(QuantityValue centiradians) + public static Angle FromCentiradians(double value) { - double value = (double) centiradians; return new Angle(value, AngleUnit.Centiradian); } @@ -379,9 +376,8 @@ public static Angle FromCentiradians(QuantityValue centiradians) /// Creates a from . /// /// If value is NaN or Infinity. - public static Angle FromDeciradians(QuantityValue deciradians) + public static Angle FromDeciradians(double value) { - double value = (double) deciradians; return new Angle(value, AngleUnit.Deciradian); } @@ -389,9 +385,8 @@ public static Angle FromDeciradians(QuantityValue deciradians) /// Creates a from . /// /// If value is NaN or Infinity. - public static Angle FromDegrees(QuantityValue degrees) + public static Angle FromDegrees(double value) { - double value = (double) degrees; return new Angle(value, AngleUnit.Degree); } @@ -399,9 +394,8 @@ public static Angle FromDegrees(QuantityValue degrees) /// Creates a from . /// /// If value is NaN or Infinity. - public static Angle FromGradians(QuantityValue gradians) + public static Angle FromGradians(double value) { - double value = (double) gradians; return new Angle(value, AngleUnit.Gradian); } @@ -409,9 +403,8 @@ public static Angle FromGradians(QuantityValue gradians) /// Creates a from . /// /// If value is NaN or Infinity. - public static Angle FromMicrodegrees(QuantityValue microdegrees) + public static Angle FromMicrodegrees(double value) { - double value = (double) microdegrees; return new Angle(value, AngleUnit.Microdegree); } @@ -419,9 +412,8 @@ public static Angle FromMicrodegrees(QuantityValue microdegrees) /// Creates a from . /// /// If value is NaN or Infinity. - public static Angle FromMicroradians(QuantityValue microradians) + public static Angle FromMicroradians(double value) { - double value = (double) microradians; return new Angle(value, AngleUnit.Microradian); } @@ -429,9 +421,8 @@ public static Angle FromMicroradians(QuantityValue microradians) /// Creates a from . /// /// If value is NaN or Infinity. - public static Angle FromMillidegrees(QuantityValue millidegrees) + public static Angle FromMillidegrees(double value) { - double value = (double) millidegrees; return new Angle(value, AngleUnit.Millidegree); } @@ -439,9 +430,8 @@ public static Angle FromMillidegrees(QuantityValue millidegrees) /// Creates a from . /// /// If value is NaN or Infinity. - public static Angle FromMilliradians(QuantityValue milliradians) + public static Angle FromMilliradians(double value) { - double value = (double) milliradians; return new Angle(value, AngleUnit.Milliradian); } @@ -449,9 +439,8 @@ public static Angle FromMilliradians(QuantityValue milliradians) /// Creates a from . /// /// If value is NaN or Infinity. - public static Angle FromNanodegrees(QuantityValue nanodegrees) + public static Angle FromNanodegrees(double value) { - double value = (double) nanodegrees; return new Angle(value, AngleUnit.Nanodegree); } @@ -459,9 +448,8 @@ public static Angle FromNanodegrees(QuantityValue nanodegrees) /// Creates a from . /// /// If value is NaN or Infinity. - public static Angle FromNanoradians(QuantityValue nanoradians) + public static Angle FromNanoradians(double value) { - double value = (double) nanoradians; return new Angle(value, AngleUnit.Nanoradian); } @@ -469,9 +457,8 @@ public static Angle FromNanoradians(QuantityValue nanoradians) /// Creates a from . /// /// If value is NaN or Infinity. - public static Angle FromNatoMils(QuantityValue natomils) + public static Angle FromNatoMils(double value) { - double value = (double) natomils; return new Angle(value, AngleUnit.NatoMil); } @@ -479,9 +466,8 @@ public static Angle FromNatoMils(QuantityValue natomils) /// Creates a from . /// /// If value is NaN or Infinity. - public static Angle FromRadians(QuantityValue radians) + public static Angle FromRadians(double value) { - double value = (double) radians; return new Angle(value, AngleUnit.Radian); } @@ -489,9 +475,8 @@ public static Angle FromRadians(QuantityValue radians) /// Creates a from . /// /// If value is NaN or Infinity. - public static Angle FromRevolutions(QuantityValue revolutions) + public static Angle FromRevolutions(double value) { - double value = (double) revolutions; return new Angle(value, AngleUnit.Revolution); } @@ -499,9 +484,8 @@ public static Angle FromRevolutions(QuantityValue revolutions) /// Creates a from . /// /// If value is NaN or Infinity. - public static Angle FromTilt(QuantityValue tilt) + public static Angle FromTilt(double value) { - double value = (double) tilt; return new Angle(value, AngleUnit.Tilt); } @@ -511,9 +495,9 @@ public static Angle FromTilt(QuantityValue tilt) /// Value to convert from. /// Unit to convert from. /// Angle unit value. - public static Angle From(QuantityValue value, AngleUnit fromUnit) + public static Angle From(double value, AngleUnit fromUnit) { - return new Angle((double)value, fromUnit); + return new Angle(value, fromUnit); } #endregion @@ -946,15 +930,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is AngleUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(AngleUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is AngleUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(AngleUnit)} is supported.", nameof(unit)); @@ -1099,18 +1074,6 @@ public Angle ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not AngleUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(AngleUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.g.cs b/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.g.cs index 37b8d8e526..dcd8442fbe 100644 --- a/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.g.cs @@ -37,7 +37,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct ApparentEnergy : - IArithmeticQuantity, + IArithmeticQuantity, IComparable, IComparable, IConvertible, @@ -149,7 +149,7 @@ public ApparentEnergy(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -237,9 +237,8 @@ public static string GetAbbreviation(ApparentEnergyUnit unit, IFormatProvider? p /// Creates a from . /// /// If value is NaN or Infinity. - public static ApparentEnergy FromKilovoltampereHours(QuantityValue kilovoltamperehours) + public static ApparentEnergy FromKilovoltampereHours(double value) { - double value = (double) kilovoltamperehours; return new ApparentEnergy(value, ApparentEnergyUnit.KilovoltampereHour); } @@ -247,9 +246,8 @@ public static ApparentEnergy FromKilovoltampereHours(QuantityValue kilovoltamper /// Creates a from . /// /// If value is NaN or Infinity. - public static ApparentEnergy FromMegavoltampereHours(QuantityValue megavoltamperehours) + public static ApparentEnergy FromMegavoltampereHours(double value) { - double value = (double) megavoltamperehours; return new ApparentEnergy(value, ApparentEnergyUnit.MegavoltampereHour); } @@ -257,9 +255,8 @@ public static ApparentEnergy FromMegavoltampereHours(QuantityValue megavoltamper /// Creates a from . /// /// If value is NaN or Infinity. - public static ApparentEnergy FromVoltampereHours(QuantityValue voltamperehours) + public static ApparentEnergy FromVoltampereHours(double value) { - double value = (double) voltamperehours; return new ApparentEnergy(value, ApparentEnergyUnit.VoltampereHour); } @@ -269,9 +266,9 @@ public static ApparentEnergy FromVoltampereHours(QuantityValue voltamperehours) /// Value to convert from. /// Unit to convert from. /// ApparentEnergy unit value. - public static ApparentEnergy From(QuantityValue value, ApparentEnergyUnit fromUnit) + public static ApparentEnergy From(double value, ApparentEnergyUnit fromUnit) { - return new ApparentEnergy((double)value, fromUnit); + return new ApparentEnergy(value, fromUnit); } #endregion @@ -682,15 +679,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is ApparentEnergyUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ApparentEnergyUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is ApparentEnergyUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ApparentEnergyUnit)} is supported.", nameof(unit)); @@ -809,18 +797,6 @@ public ApparentEnergy ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not ApparentEnergyUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ApparentEnergyUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/ApparentPower.g.cs b/UnitsNet/GeneratedCode/Quantities/ApparentPower.g.cs index f4096ac654..196fde0960 100644 --- a/UnitsNet/GeneratedCode/Quantities/ApparentPower.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ApparentPower.g.cs @@ -37,7 +37,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct ApparentPower : - IArithmeticQuantity, + IArithmeticQuantity, IComparable, IComparable, IConvertible, @@ -152,7 +152,7 @@ public ApparentPower(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -261,9 +261,8 @@ public static string GetAbbreviation(ApparentPowerUnit unit, IFormatProvider? pr /// Creates a from . /// /// If value is NaN or Infinity. - public static ApparentPower FromGigavoltamperes(QuantityValue gigavoltamperes) + public static ApparentPower FromGigavoltamperes(double value) { - double value = (double) gigavoltamperes; return new ApparentPower(value, ApparentPowerUnit.Gigavoltampere); } @@ -271,9 +270,8 @@ public static ApparentPower FromGigavoltamperes(QuantityValue gigavoltamperes) /// Creates a from . /// /// If value is NaN or Infinity. - public static ApparentPower FromKilovoltamperes(QuantityValue kilovoltamperes) + public static ApparentPower FromKilovoltamperes(double value) { - double value = (double) kilovoltamperes; return new ApparentPower(value, ApparentPowerUnit.Kilovoltampere); } @@ -281,9 +279,8 @@ public static ApparentPower FromKilovoltamperes(QuantityValue kilovoltamperes) /// Creates a from . /// /// If value is NaN or Infinity. - public static ApparentPower FromMegavoltamperes(QuantityValue megavoltamperes) + public static ApparentPower FromMegavoltamperes(double value) { - double value = (double) megavoltamperes; return new ApparentPower(value, ApparentPowerUnit.Megavoltampere); } @@ -291,9 +288,8 @@ public static ApparentPower FromMegavoltamperes(QuantityValue megavoltamperes) /// Creates a from . /// /// If value is NaN or Infinity. - public static ApparentPower FromMicrovoltamperes(QuantityValue microvoltamperes) + public static ApparentPower FromMicrovoltamperes(double value) { - double value = (double) microvoltamperes; return new ApparentPower(value, ApparentPowerUnit.Microvoltampere); } @@ -301,9 +297,8 @@ public static ApparentPower FromMicrovoltamperes(QuantityValue microvoltamperes) /// Creates a from . /// /// If value is NaN or Infinity. - public static ApparentPower FromMillivoltamperes(QuantityValue millivoltamperes) + public static ApparentPower FromMillivoltamperes(double value) { - double value = (double) millivoltamperes; return new ApparentPower(value, ApparentPowerUnit.Millivoltampere); } @@ -311,9 +306,8 @@ public static ApparentPower FromMillivoltamperes(QuantityValue millivoltamperes) /// Creates a from . /// /// If value is NaN or Infinity. - public static ApparentPower FromVoltamperes(QuantityValue voltamperes) + public static ApparentPower FromVoltamperes(double value) { - double value = (double) voltamperes; return new ApparentPower(value, ApparentPowerUnit.Voltampere); } @@ -323,9 +317,9 @@ public static ApparentPower FromVoltamperes(QuantityValue voltamperes) /// Value to convert from. /// Unit to convert from. /// ApparentPower unit value. - public static ApparentPower From(QuantityValue value, ApparentPowerUnit fromUnit) + public static ApparentPower From(double value, ApparentPowerUnit fromUnit) { - return new ApparentPower((double)value, fromUnit); + return new ApparentPower(value, fromUnit); } #endregion @@ -736,15 +730,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is ApparentPowerUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ApparentPowerUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is ApparentPowerUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ApparentPowerUnit)} is supported.", nameof(unit)); @@ -869,18 +854,6 @@ public ApparentPower ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not ApparentPowerUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ApparentPowerUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/Area.g.cs b/UnitsNet/GeneratedCode/Quantities/Area.g.cs index 613ed2e8dd..281f995046 100644 --- a/UnitsNet/GeneratedCode/Quantities/Area.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Area.g.cs @@ -40,7 +40,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct Area : - IArithmeticQuantity, + IArithmeticQuantity, #if NET7_0_OR_GREATER IMultiplyOperators, IMultiplyOperators, @@ -177,7 +177,7 @@ public Area(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -342,9 +342,8 @@ public static string GetAbbreviation(AreaUnit unit, IFormatProvider? provider) /// Creates a from . /// /// If value is NaN or Infinity. - public static Area FromAcres(QuantityValue acres) + public static Area FromAcres(double value) { - double value = (double) acres; return new Area(value, AreaUnit.Acre); } @@ -352,9 +351,8 @@ public static Area FromAcres(QuantityValue acres) /// Creates a from . /// /// If value is NaN or Infinity. - public static Area FromHectares(QuantityValue hectares) + public static Area FromHectares(double value) { - double value = (double) hectares; return new Area(value, AreaUnit.Hectare); } @@ -362,9 +360,8 @@ public static Area FromHectares(QuantityValue hectares) /// Creates a from . /// /// If value is NaN or Infinity. - public static Area FromSquareCentimeters(QuantityValue squarecentimeters) + public static Area FromSquareCentimeters(double value) { - double value = (double) squarecentimeters; return new Area(value, AreaUnit.SquareCentimeter); } @@ -372,9 +369,8 @@ public static Area FromSquareCentimeters(QuantityValue squarecentimeters) /// Creates a from . /// /// If value is NaN or Infinity. - public static Area FromSquareDecimeters(QuantityValue squaredecimeters) + public static Area FromSquareDecimeters(double value) { - double value = (double) squaredecimeters; return new Area(value, AreaUnit.SquareDecimeter); } @@ -382,9 +378,8 @@ public static Area FromSquareDecimeters(QuantityValue squaredecimeters) /// Creates a from . /// /// If value is NaN or Infinity. - public static Area FromSquareFeet(QuantityValue squarefeet) + public static Area FromSquareFeet(double value) { - double value = (double) squarefeet; return new Area(value, AreaUnit.SquareFoot); } @@ -392,9 +387,8 @@ public static Area FromSquareFeet(QuantityValue squarefeet) /// Creates a from . /// /// If value is NaN or Infinity. - public static Area FromSquareInches(QuantityValue squareinches) + public static Area FromSquareInches(double value) { - double value = (double) squareinches; return new Area(value, AreaUnit.SquareInch); } @@ -402,9 +396,8 @@ public static Area FromSquareInches(QuantityValue squareinches) /// Creates a from . /// /// If value is NaN or Infinity. - public static Area FromSquareKilometers(QuantityValue squarekilometers) + public static Area FromSquareKilometers(double value) { - double value = (double) squarekilometers; return new Area(value, AreaUnit.SquareKilometer); } @@ -412,9 +405,8 @@ public static Area FromSquareKilometers(QuantityValue squarekilometers) /// Creates a from . /// /// If value is NaN or Infinity. - public static Area FromSquareMeters(QuantityValue squaremeters) + public static Area FromSquareMeters(double value) { - double value = (double) squaremeters; return new Area(value, AreaUnit.SquareMeter); } @@ -422,9 +414,8 @@ public static Area FromSquareMeters(QuantityValue squaremeters) /// Creates a from . /// /// If value is NaN or Infinity. - public static Area FromSquareMicrometers(QuantityValue squaremicrometers) + public static Area FromSquareMicrometers(double value) { - double value = (double) squaremicrometers; return new Area(value, AreaUnit.SquareMicrometer); } @@ -432,9 +423,8 @@ public static Area FromSquareMicrometers(QuantityValue squaremicrometers) /// Creates a from . /// /// If value is NaN or Infinity. - public static Area FromSquareMiles(QuantityValue squaremiles) + public static Area FromSquareMiles(double value) { - double value = (double) squaremiles; return new Area(value, AreaUnit.SquareMile); } @@ -442,9 +432,8 @@ public static Area FromSquareMiles(QuantityValue squaremiles) /// Creates a from . /// /// If value is NaN or Infinity. - public static Area FromSquareMillimeters(QuantityValue squaremillimeters) + public static Area FromSquareMillimeters(double value) { - double value = (double) squaremillimeters; return new Area(value, AreaUnit.SquareMillimeter); } @@ -452,9 +441,8 @@ public static Area FromSquareMillimeters(QuantityValue squaremillimeters) /// Creates a from . /// /// If value is NaN or Infinity. - public static Area FromSquareNauticalMiles(QuantityValue squarenauticalmiles) + public static Area FromSquareNauticalMiles(double value) { - double value = (double) squarenauticalmiles; return new Area(value, AreaUnit.SquareNauticalMile); } @@ -462,9 +450,8 @@ public static Area FromSquareNauticalMiles(QuantityValue squarenauticalmiles) /// Creates a from . /// /// If value is NaN or Infinity. - public static Area FromSquareYards(QuantityValue squareyards) + public static Area FromSquareYards(double value) { - double value = (double) squareyards; return new Area(value, AreaUnit.SquareYard); } @@ -472,9 +459,8 @@ public static Area FromSquareYards(QuantityValue squareyards) /// Creates a from . /// /// If value is NaN or Infinity. - public static Area FromUsSurveySquareFeet(QuantityValue ussurveysquarefeet) + public static Area FromUsSurveySquareFeet(double value) { - double value = (double) ussurveysquarefeet; return new Area(value, AreaUnit.UsSurveySquareFoot); } @@ -484,9 +470,9 @@ public static Area FromUsSurveySquareFeet(QuantityValue ussurveysquarefeet) /// Value to convert from. /// Unit to convert from. /// Area unit value. - public static Area From(QuantityValue value, AreaUnit fromUnit) + public static Area From(double value, AreaUnit fromUnit) { - return new Area((double)value, fromUnit); + return new Area(value, fromUnit); } #endregion @@ -980,15 +966,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is AreaUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(AreaUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is AreaUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(AreaUnit)} is supported.", nameof(unit)); @@ -1129,18 +1106,6 @@ public Area ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not AreaUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(AreaUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/AreaDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/AreaDensity.g.cs index 2124570e77..557e60eb93 100644 --- a/UnitsNet/GeneratedCode/Quantities/AreaDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AreaDensity.g.cs @@ -40,7 +40,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct AreaDensity : - IArithmeticQuantity, + IArithmeticQuantity, #if NET7_0_OR_GREATER IMultiplyOperators, #endif @@ -155,7 +155,7 @@ public AreaDensity(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -243,9 +243,8 @@ public static string GetAbbreviation(AreaDensityUnit unit, IFormatProvider? prov /// Creates a from . /// /// If value is NaN or Infinity. - public static AreaDensity FromGramsPerSquareMeter(QuantityValue gramspersquaremeter) + public static AreaDensity FromGramsPerSquareMeter(double value) { - double value = (double) gramspersquaremeter; return new AreaDensity(value, AreaDensityUnit.GramPerSquareMeter); } @@ -253,9 +252,8 @@ public static AreaDensity FromGramsPerSquareMeter(QuantityValue gramspersquareme /// Creates a from . /// /// If value is NaN or Infinity. - public static AreaDensity FromKilogramsPerSquareMeter(QuantityValue kilogramspersquaremeter) + public static AreaDensity FromKilogramsPerSquareMeter(double value) { - double value = (double) kilogramspersquaremeter; return new AreaDensity(value, AreaDensityUnit.KilogramPerSquareMeter); } @@ -263,9 +261,8 @@ public static AreaDensity FromKilogramsPerSquareMeter(QuantityValue kilogramsper /// Creates a from . /// /// If value is NaN or Infinity. - public static AreaDensity FromMilligramsPerSquareMeter(QuantityValue milligramspersquaremeter) + public static AreaDensity FromMilligramsPerSquareMeter(double value) { - double value = (double) milligramspersquaremeter; return new AreaDensity(value, AreaDensityUnit.MilligramPerSquareMeter); } @@ -275,9 +272,9 @@ public static AreaDensity FromMilligramsPerSquareMeter(QuantityValue milligramsp /// Value to convert from. /// Unit to convert from. /// AreaDensity unit value. - public static AreaDensity From(QuantityValue value, AreaDensityUnit fromUnit) + public static AreaDensity From(double value, AreaDensityUnit fromUnit) { - return new AreaDensity((double)value, fromUnit); + return new AreaDensity(value, fromUnit); } #endregion @@ -698,15 +695,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is AreaDensityUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(AreaDensityUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is AreaDensityUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(AreaDensityUnit)} is supported.", nameof(unit)); @@ -825,18 +813,6 @@ public AreaDensity ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not AreaDensityUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(AreaDensityUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs b/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs index acfe0f659c..8ce16faf93 100644 --- a/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs @@ -40,7 +40,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct AreaMomentOfInertia : - IArithmeticQuantity, + IArithmeticQuantity, #if NET7_0_OR_GREATER IDivisionOperators, #endif @@ -158,7 +158,7 @@ public AreaMomentOfInertia(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -267,9 +267,8 @@ public static string GetAbbreviation(AreaMomentOfInertiaUnit unit, IFormatProvid /// Creates a from . /// /// If value is NaN or Infinity. - public static AreaMomentOfInertia FromCentimetersToTheFourth(QuantityValue centimeterstothefourth) + public static AreaMomentOfInertia FromCentimetersToTheFourth(double value) { - double value = (double) centimeterstothefourth; return new AreaMomentOfInertia(value, AreaMomentOfInertiaUnit.CentimeterToTheFourth); } @@ -277,9 +276,8 @@ public static AreaMomentOfInertia FromCentimetersToTheFourth(QuantityValue centi /// Creates a from . /// /// If value is NaN or Infinity. - public static AreaMomentOfInertia FromDecimetersToTheFourth(QuantityValue decimeterstothefourth) + public static AreaMomentOfInertia FromDecimetersToTheFourth(double value) { - double value = (double) decimeterstothefourth; return new AreaMomentOfInertia(value, AreaMomentOfInertiaUnit.DecimeterToTheFourth); } @@ -287,9 +285,8 @@ public static AreaMomentOfInertia FromDecimetersToTheFourth(QuantityValue decime /// Creates a from . /// /// If value is NaN or Infinity. - public static AreaMomentOfInertia FromFeetToTheFourth(QuantityValue feettothefourth) + public static AreaMomentOfInertia FromFeetToTheFourth(double value) { - double value = (double) feettothefourth; return new AreaMomentOfInertia(value, AreaMomentOfInertiaUnit.FootToTheFourth); } @@ -297,9 +294,8 @@ public static AreaMomentOfInertia FromFeetToTheFourth(QuantityValue feettothefou /// Creates a from . /// /// If value is NaN or Infinity. - public static AreaMomentOfInertia FromInchesToTheFourth(QuantityValue inchestothefourth) + public static AreaMomentOfInertia FromInchesToTheFourth(double value) { - double value = (double) inchestothefourth; return new AreaMomentOfInertia(value, AreaMomentOfInertiaUnit.InchToTheFourth); } @@ -307,9 +303,8 @@ public static AreaMomentOfInertia FromInchesToTheFourth(QuantityValue inchestoth /// Creates a from . /// /// If value is NaN or Infinity. - public static AreaMomentOfInertia FromMetersToTheFourth(QuantityValue meterstothefourth) + public static AreaMomentOfInertia FromMetersToTheFourth(double value) { - double value = (double) meterstothefourth; return new AreaMomentOfInertia(value, AreaMomentOfInertiaUnit.MeterToTheFourth); } @@ -317,9 +312,8 @@ public static AreaMomentOfInertia FromMetersToTheFourth(QuantityValue meterstoth /// Creates a from . /// /// If value is NaN or Infinity. - public static AreaMomentOfInertia FromMillimetersToTheFourth(QuantityValue millimeterstothefourth) + public static AreaMomentOfInertia FromMillimetersToTheFourth(double value) { - double value = (double) millimeterstothefourth; return new AreaMomentOfInertia(value, AreaMomentOfInertiaUnit.MillimeterToTheFourth); } @@ -329,9 +323,9 @@ public static AreaMomentOfInertia FromMillimetersToTheFourth(QuantityValue milli /// Value to convert from. /// Unit to convert from. /// AreaMomentOfInertia unit value. - public static AreaMomentOfInertia From(QuantityValue value, AreaMomentOfInertiaUnit fromUnit) + public static AreaMomentOfInertia From(double value, AreaMomentOfInertiaUnit fromUnit) { - return new AreaMomentOfInertia((double)value, fromUnit); + return new AreaMomentOfInertia(value, fromUnit); } #endregion @@ -752,15 +746,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is AreaMomentOfInertiaUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(AreaMomentOfInertiaUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is AreaMomentOfInertiaUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(AreaMomentOfInertiaUnit)} is supported.", nameof(unit)); @@ -885,18 +870,6 @@ public AreaMomentOfInertia ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not AreaMomentOfInertiaUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(AreaMomentOfInertiaUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/BitRate.g.cs b/UnitsNet/GeneratedCode/Quantities/BitRate.g.cs index 22ef4aa2fa..25e8ea4743 100644 --- a/UnitsNet/GeneratedCode/Quantities/BitRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/BitRate.g.cs @@ -40,7 +40,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct BitRate : - IArithmeticQuantity, + IArithmeticQuantity, IComparable, IComparable, IConvertible, @@ -175,7 +175,7 @@ public BitRate(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -424,9 +424,8 @@ public static string GetAbbreviation(BitRateUnit unit, IFormatProvider? provider /// Creates a from . /// /// If value is NaN or Infinity. - public static BitRate FromBitsPerSecond(QuantityValue bitspersecond) + public static BitRate FromBitsPerSecond(double value) { - double value = (double) bitspersecond; return new BitRate(value, BitRateUnit.BitPerSecond); } @@ -434,9 +433,8 @@ public static BitRate FromBitsPerSecond(QuantityValue bitspersecond) /// Creates a from . /// /// If value is NaN or Infinity. - public static BitRate FromBytesPerSecond(QuantityValue bytespersecond) + public static BitRate FromBytesPerSecond(double value) { - double value = (double) bytespersecond; return new BitRate(value, BitRateUnit.BytePerSecond); } @@ -444,9 +442,8 @@ public static BitRate FromBytesPerSecond(QuantityValue bytespersecond) /// Creates a from . /// /// If value is NaN or Infinity. - public static BitRate FromExabitsPerSecond(QuantityValue exabitspersecond) + public static BitRate FromExabitsPerSecond(double value) { - double value = (double) exabitspersecond; return new BitRate(value, BitRateUnit.ExabitPerSecond); } @@ -454,9 +451,8 @@ public static BitRate FromExabitsPerSecond(QuantityValue exabitspersecond) /// Creates a from . /// /// If value is NaN or Infinity. - public static BitRate FromExabytesPerSecond(QuantityValue exabytespersecond) + public static BitRate FromExabytesPerSecond(double value) { - double value = (double) exabytespersecond; return new BitRate(value, BitRateUnit.ExabytePerSecond); } @@ -464,9 +460,8 @@ public static BitRate FromExabytesPerSecond(QuantityValue exabytespersecond) /// Creates a from . /// /// If value is NaN or Infinity. - public static BitRate FromExbibitsPerSecond(QuantityValue exbibitspersecond) + public static BitRate FromExbibitsPerSecond(double value) { - double value = (double) exbibitspersecond; return new BitRate(value, BitRateUnit.ExbibitPerSecond); } @@ -474,9 +469,8 @@ public static BitRate FromExbibitsPerSecond(QuantityValue exbibitspersecond) /// Creates a from . /// /// If value is NaN or Infinity. - public static BitRate FromExbibytesPerSecond(QuantityValue exbibytespersecond) + public static BitRate FromExbibytesPerSecond(double value) { - double value = (double) exbibytespersecond; return new BitRate(value, BitRateUnit.ExbibytePerSecond); } @@ -484,9 +478,8 @@ public static BitRate FromExbibytesPerSecond(QuantityValue exbibytespersecond) /// Creates a from . /// /// If value is NaN or Infinity. - public static BitRate FromGibibitsPerSecond(QuantityValue gibibitspersecond) + public static BitRate FromGibibitsPerSecond(double value) { - double value = (double) gibibitspersecond; return new BitRate(value, BitRateUnit.GibibitPerSecond); } @@ -494,9 +487,8 @@ public static BitRate FromGibibitsPerSecond(QuantityValue gibibitspersecond) /// Creates a from . /// /// If value is NaN or Infinity. - public static BitRate FromGibibytesPerSecond(QuantityValue gibibytespersecond) + public static BitRate FromGibibytesPerSecond(double value) { - double value = (double) gibibytespersecond; return new BitRate(value, BitRateUnit.GibibytePerSecond); } @@ -504,9 +496,8 @@ public static BitRate FromGibibytesPerSecond(QuantityValue gibibytespersecond) /// Creates a from . /// /// If value is NaN or Infinity. - public static BitRate FromGigabitsPerSecond(QuantityValue gigabitspersecond) + public static BitRate FromGigabitsPerSecond(double value) { - double value = (double) gigabitspersecond; return new BitRate(value, BitRateUnit.GigabitPerSecond); } @@ -514,9 +505,8 @@ public static BitRate FromGigabitsPerSecond(QuantityValue gigabitspersecond) /// Creates a from . /// /// If value is NaN or Infinity. - public static BitRate FromGigabytesPerSecond(QuantityValue gigabytespersecond) + public static BitRate FromGigabytesPerSecond(double value) { - double value = (double) gigabytespersecond; return new BitRate(value, BitRateUnit.GigabytePerSecond); } @@ -524,9 +514,8 @@ public static BitRate FromGigabytesPerSecond(QuantityValue gigabytespersecond) /// Creates a from . /// /// If value is NaN or Infinity. - public static BitRate FromKibibitsPerSecond(QuantityValue kibibitspersecond) + public static BitRate FromKibibitsPerSecond(double value) { - double value = (double) kibibitspersecond; return new BitRate(value, BitRateUnit.KibibitPerSecond); } @@ -534,9 +523,8 @@ public static BitRate FromKibibitsPerSecond(QuantityValue kibibitspersecond) /// Creates a from . /// /// If value is NaN or Infinity. - public static BitRate FromKibibytesPerSecond(QuantityValue kibibytespersecond) + public static BitRate FromKibibytesPerSecond(double value) { - double value = (double) kibibytespersecond; return new BitRate(value, BitRateUnit.KibibytePerSecond); } @@ -544,9 +532,8 @@ public static BitRate FromKibibytesPerSecond(QuantityValue kibibytespersecond) /// Creates a from . /// /// If value is NaN or Infinity. - public static BitRate FromKilobitsPerSecond(QuantityValue kilobitspersecond) + public static BitRate FromKilobitsPerSecond(double value) { - double value = (double) kilobitspersecond; return new BitRate(value, BitRateUnit.KilobitPerSecond); } @@ -554,9 +541,8 @@ public static BitRate FromKilobitsPerSecond(QuantityValue kilobitspersecond) /// Creates a from . /// /// If value is NaN or Infinity. - public static BitRate FromKilobytesPerSecond(QuantityValue kilobytespersecond) + public static BitRate FromKilobytesPerSecond(double value) { - double value = (double) kilobytespersecond; return new BitRate(value, BitRateUnit.KilobytePerSecond); } @@ -564,9 +550,8 @@ public static BitRate FromKilobytesPerSecond(QuantityValue kilobytespersecond) /// Creates a from . /// /// If value is NaN or Infinity. - public static BitRate FromMebibitsPerSecond(QuantityValue mebibitspersecond) + public static BitRate FromMebibitsPerSecond(double value) { - double value = (double) mebibitspersecond; return new BitRate(value, BitRateUnit.MebibitPerSecond); } @@ -574,9 +559,8 @@ public static BitRate FromMebibitsPerSecond(QuantityValue mebibitspersecond) /// Creates a from . /// /// If value is NaN or Infinity. - public static BitRate FromMebibytesPerSecond(QuantityValue mebibytespersecond) + public static BitRate FromMebibytesPerSecond(double value) { - double value = (double) mebibytespersecond; return new BitRate(value, BitRateUnit.MebibytePerSecond); } @@ -584,9 +568,8 @@ public static BitRate FromMebibytesPerSecond(QuantityValue mebibytespersecond) /// Creates a from . /// /// If value is NaN or Infinity. - public static BitRate FromMegabitsPerSecond(QuantityValue megabitspersecond) + public static BitRate FromMegabitsPerSecond(double value) { - double value = (double) megabitspersecond; return new BitRate(value, BitRateUnit.MegabitPerSecond); } @@ -594,9 +577,8 @@ public static BitRate FromMegabitsPerSecond(QuantityValue megabitspersecond) /// Creates a from . /// /// If value is NaN or Infinity. - public static BitRate FromMegabytesPerSecond(QuantityValue megabytespersecond) + public static BitRate FromMegabytesPerSecond(double value) { - double value = (double) megabytespersecond; return new BitRate(value, BitRateUnit.MegabytePerSecond); } @@ -604,9 +586,8 @@ public static BitRate FromMegabytesPerSecond(QuantityValue megabytespersecond) /// Creates a from . /// /// If value is NaN or Infinity. - public static BitRate FromPebibitsPerSecond(QuantityValue pebibitspersecond) + public static BitRate FromPebibitsPerSecond(double value) { - double value = (double) pebibitspersecond; return new BitRate(value, BitRateUnit.PebibitPerSecond); } @@ -614,9 +595,8 @@ public static BitRate FromPebibitsPerSecond(QuantityValue pebibitspersecond) /// Creates a from . /// /// If value is NaN or Infinity. - public static BitRate FromPebibytesPerSecond(QuantityValue pebibytespersecond) + public static BitRate FromPebibytesPerSecond(double value) { - double value = (double) pebibytespersecond; return new BitRate(value, BitRateUnit.PebibytePerSecond); } @@ -624,9 +604,8 @@ public static BitRate FromPebibytesPerSecond(QuantityValue pebibytespersecond) /// Creates a from . /// /// If value is NaN or Infinity. - public static BitRate FromPetabitsPerSecond(QuantityValue petabitspersecond) + public static BitRate FromPetabitsPerSecond(double value) { - double value = (double) petabitspersecond; return new BitRate(value, BitRateUnit.PetabitPerSecond); } @@ -634,9 +613,8 @@ public static BitRate FromPetabitsPerSecond(QuantityValue petabitspersecond) /// Creates a from . /// /// If value is NaN or Infinity. - public static BitRate FromPetabytesPerSecond(QuantityValue petabytespersecond) + public static BitRate FromPetabytesPerSecond(double value) { - double value = (double) petabytespersecond; return new BitRate(value, BitRateUnit.PetabytePerSecond); } @@ -644,9 +622,8 @@ public static BitRate FromPetabytesPerSecond(QuantityValue petabytespersecond) /// Creates a from . /// /// If value is NaN or Infinity. - public static BitRate FromTebibitsPerSecond(QuantityValue tebibitspersecond) + public static BitRate FromTebibitsPerSecond(double value) { - double value = (double) tebibitspersecond; return new BitRate(value, BitRateUnit.TebibitPerSecond); } @@ -654,9 +631,8 @@ public static BitRate FromTebibitsPerSecond(QuantityValue tebibitspersecond) /// Creates a from . /// /// If value is NaN or Infinity. - public static BitRate FromTebibytesPerSecond(QuantityValue tebibytespersecond) + public static BitRate FromTebibytesPerSecond(double value) { - double value = (double) tebibytespersecond; return new BitRate(value, BitRateUnit.TebibytePerSecond); } @@ -664,9 +640,8 @@ public static BitRate FromTebibytesPerSecond(QuantityValue tebibytespersecond) /// Creates a from . /// /// If value is NaN or Infinity. - public static BitRate FromTerabitsPerSecond(QuantityValue terabitspersecond) + public static BitRate FromTerabitsPerSecond(double value) { - double value = (double) terabitspersecond; return new BitRate(value, BitRateUnit.TerabitPerSecond); } @@ -674,9 +649,8 @@ public static BitRate FromTerabitsPerSecond(QuantityValue terabitspersecond) /// Creates a from . /// /// If value is NaN or Infinity. - public static BitRate FromTerabytesPerSecond(QuantityValue terabytespersecond) + public static BitRate FromTerabytesPerSecond(double value) { - double value = (double) terabytespersecond; return new BitRate(value, BitRateUnit.TerabytePerSecond); } @@ -686,9 +660,9 @@ public static BitRate FromTerabytesPerSecond(QuantityValue terabytespersecond) /// Value to convert from. /// Unit to convert from. /// BitRate unit value. - public static BitRate From(QuantityValue value, BitRateUnit fromUnit) + public static BitRate From(double value, BitRateUnit fromUnit) { - return new BitRate((double)value, fromUnit); + return new BitRate(value, fromUnit); } #endregion @@ -1099,15 +1073,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is BitRateUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(BitRateUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is BitRateUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(BitRateUnit)} is supported.", nameof(unit)); @@ -1272,18 +1237,6 @@ public BitRate ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not BitRateUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(BitRateUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.g.cs b/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.g.cs index e882651b01..712af22d80 100644 --- a/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.g.cs @@ -40,7 +40,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct BrakeSpecificFuelConsumption : - IArithmeticQuantity, + IArithmeticQuantity, #if NET7_0_OR_GREATER IMultiplyOperators, IMultiplyOperators, @@ -156,7 +156,7 @@ public BrakeSpecificFuelConsumption(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -244,9 +244,8 @@ public static string GetAbbreviation(BrakeSpecificFuelConsumptionUnit unit, IFor /// Creates a from . /// /// If value is NaN or Infinity. - public static BrakeSpecificFuelConsumption FromGramsPerKiloWattHour(QuantityValue gramsperkilowatthour) + public static BrakeSpecificFuelConsumption FromGramsPerKiloWattHour(double value) { - double value = (double) gramsperkilowatthour; return new BrakeSpecificFuelConsumption(value, BrakeSpecificFuelConsumptionUnit.GramPerKiloWattHour); } @@ -254,9 +253,8 @@ public static BrakeSpecificFuelConsumption FromGramsPerKiloWattHour(QuantityValu /// Creates a from . /// /// If value is NaN or Infinity. - public static BrakeSpecificFuelConsumption FromKilogramsPerJoule(QuantityValue kilogramsperjoule) + public static BrakeSpecificFuelConsumption FromKilogramsPerJoule(double value) { - double value = (double) kilogramsperjoule; return new BrakeSpecificFuelConsumption(value, BrakeSpecificFuelConsumptionUnit.KilogramPerJoule); } @@ -264,9 +262,8 @@ public static BrakeSpecificFuelConsumption FromKilogramsPerJoule(QuantityValue k /// Creates a from . /// /// If value is NaN or Infinity. - public static BrakeSpecificFuelConsumption FromPoundsPerMechanicalHorsepowerHour(QuantityValue poundspermechanicalhorsepowerhour) + public static BrakeSpecificFuelConsumption FromPoundsPerMechanicalHorsepowerHour(double value) { - double value = (double) poundspermechanicalhorsepowerhour; return new BrakeSpecificFuelConsumption(value, BrakeSpecificFuelConsumptionUnit.PoundPerMechanicalHorsepowerHour); } @@ -276,9 +273,9 @@ public static BrakeSpecificFuelConsumption FromPoundsPerMechanicalHorsepowerHour /// Value to convert from. /// Unit to convert from. /// BrakeSpecificFuelConsumption unit value. - public static BrakeSpecificFuelConsumption From(QuantityValue value, BrakeSpecificFuelConsumptionUnit fromUnit) + public static BrakeSpecificFuelConsumption From(double value, BrakeSpecificFuelConsumptionUnit fromUnit) { - return new BrakeSpecificFuelConsumption((double)value, fromUnit); + return new BrakeSpecificFuelConsumption(value, fromUnit); } #endregion @@ -711,15 +708,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is BrakeSpecificFuelConsumptionUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(BrakeSpecificFuelConsumptionUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is BrakeSpecificFuelConsumptionUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(BrakeSpecificFuelConsumptionUnit)} is supported.", nameof(unit)); @@ -838,18 +826,6 @@ public BrakeSpecificFuelConsumption ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not BrakeSpecificFuelConsumptionUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(BrakeSpecificFuelConsumptionUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/Capacitance.g.cs b/UnitsNet/GeneratedCode/Quantities/Capacitance.g.cs index a36692fbd9..e2ed75d852 100644 --- a/UnitsNet/GeneratedCode/Quantities/Capacitance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Capacitance.g.cs @@ -40,7 +40,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct Capacitance : - IArithmeticQuantity, + IArithmeticQuantity, IComparable, IComparable, IConvertible, @@ -156,7 +156,7 @@ public Capacitance(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -272,9 +272,8 @@ public static string GetAbbreviation(CapacitanceUnit unit, IFormatProvider? prov /// Creates a from . /// /// If value is NaN or Infinity. - public static Capacitance FromFarads(QuantityValue farads) + public static Capacitance FromFarads(double value) { - double value = (double) farads; return new Capacitance(value, CapacitanceUnit.Farad); } @@ -282,9 +281,8 @@ public static Capacitance FromFarads(QuantityValue farads) /// Creates a from . /// /// If value is NaN or Infinity. - public static Capacitance FromKilofarads(QuantityValue kilofarads) + public static Capacitance FromKilofarads(double value) { - double value = (double) kilofarads; return new Capacitance(value, CapacitanceUnit.Kilofarad); } @@ -292,9 +290,8 @@ public static Capacitance FromKilofarads(QuantityValue kilofarads) /// Creates a from . /// /// If value is NaN or Infinity. - public static Capacitance FromMegafarads(QuantityValue megafarads) + public static Capacitance FromMegafarads(double value) { - double value = (double) megafarads; return new Capacitance(value, CapacitanceUnit.Megafarad); } @@ -302,9 +299,8 @@ public static Capacitance FromMegafarads(QuantityValue megafarads) /// Creates a from . /// /// If value is NaN or Infinity. - public static Capacitance FromMicrofarads(QuantityValue microfarads) + public static Capacitance FromMicrofarads(double value) { - double value = (double) microfarads; return new Capacitance(value, CapacitanceUnit.Microfarad); } @@ -312,9 +308,8 @@ public static Capacitance FromMicrofarads(QuantityValue microfarads) /// Creates a from . /// /// If value is NaN or Infinity. - public static Capacitance FromMillifarads(QuantityValue millifarads) + public static Capacitance FromMillifarads(double value) { - double value = (double) millifarads; return new Capacitance(value, CapacitanceUnit.Millifarad); } @@ -322,9 +317,8 @@ public static Capacitance FromMillifarads(QuantityValue millifarads) /// Creates a from . /// /// If value is NaN or Infinity. - public static Capacitance FromNanofarads(QuantityValue nanofarads) + public static Capacitance FromNanofarads(double value) { - double value = (double) nanofarads; return new Capacitance(value, CapacitanceUnit.Nanofarad); } @@ -332,9 +326,8 @@ public static Capacitance FromNanofarads(QuantityValue nanofarads) /// Creates a from . /// /// If value is NaN or Infinity. - public static Capacitance FromPicofarads(QuantityValue picofarads) + public static Capacitance FromPicofarads(double value) { - double value = (double) picofarads; return new Capacitance(value, CapacitanceUnit.Picofarad); } @@ -344,9 +337,9 @@ public static Capacitance FromPicofarads(QuantityValue picofarads) /// Value to convert from. /// Unit to convert from. /// Capacitance unit value. - public static Capacitance From(QuantityValue value, CapacitanceUnit fromUnit) + public static Capacitance From(double value, CapacitanceUnit fromUnit) { - return new Capacitance((double)value, fromUnit); + return new Capacitance(value, fromUnit); } #endregion @@ -757,15 +750,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is CapacitanceUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(CapacitanceUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is CapacitanceUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(CapacitanceUnit)} is supported.", nameof(unit)); @@ -892,18 +876,6 @@ public Capacitance ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not CapacitanceUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(CapacitanceUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.g.cs b/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.g.cs index 656daf8952..1b66a2090a 100644 --- a/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.g.cs @@ -40,7 +40,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct CoefficientOfThermalExpansion : - IArithmeticQuantity, + IArithmeticQuantity, #if NET7_0_OR_GREATER IMultiplyOperators, #endif @@ -161,7 +161,7 @@ public CoefficientOfThermalExpansion(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -295,9 +295,8 @@ public static string GetAbbreviation(CoefficientOfThermalExpansionUnit unit, IFo /// /// If value is NaN or Infinity. [Obsolete("Use PerDegreeCelsius instead.")] - public static CoefficientOfThermalExpansion FromInverseDegreeCelsius(QuantityValue inversedegreecelsius) + public static CoefficientOfThermalExpansion FromInverseDegreeCelsius(double value) { - double value = (double) inversedegreecelsius; return new CoefficientOfThermalExpansion(value, CoefficientOfThermalExpansionUnit.InverseDegreeCelsius); } @@ -306,9 +305,8 @@ public static CoefficientOfThermalExpansion FromInverseDegreeCelsius(QuantityVal /// /// If value is NaN or Infinity. [Obsolete("Use PerDegreeFahrenheit instead.")] - public static CoefficientOfThermalExpansion FromInverseDegreeFahrenheit(QuantityValue inversedegreefahrenheit) + public static CoefficientOfThermalExpansion FromInverseDegreeFahrenheit(double value) { - double value = (double) inversedegreefahrenheit; return new CoefficientOfThermalExpansion(value, CoefficientOfThermalExpansionUnit.InverseDegreeFahrenheit); } @@ -317,9 +315,8 @@ public static CoefficientOfThermalExpansion FromInverseDegreeFahrenheit(Quantity /// /// If value is NaN or Infinity. [Obsolete("Use PerKelvin instead.")] - public static CoefficientOfThermalExpansion FromInverseKelvin(QuantityValue inversekelvin) + public static CoefficientOfThermalExpansion FromInverseKelvin(double value) { - double value = (double) inversekelvin; return new CoefficientOfThermalExpansion(value, CoefficientOfThermalExpansionUnit.InverseKelvin); } @@ -327,9 +324,8 @@ public static CoefficientOfThermalExpansion FromInverseKelvin(QuantityValue inve /// Creates a from . /// /// If value is NaN or Infinity. - public static CoefficientOfThermalExpansion FromPerDegreeCelsius(QuantityValue perdegreecelsius) + public static CoefficientOfThermalExpansion FromPerDegreeCelsius(double value) { - double value = (double) perdegreecelsius; return new CoefficientOfThermalExpansion(value, CoefficientOfThermalExpansionUnit.PerDegreeCelsius); } @@ -337,9 +333,8 @@ public static CoefficientOfThermalExpansion FromPerDegreeCelsius(QuantityValue p /// Creates a from . /// /// If value is NaN or Infinity. - public static CoefficientOfThermalExpansion FromPerDegreeFahrenheit(QuantityValue perdegreefahrenheit) + public static CoefficientOfThermalExpansion FromPerDegreeFahrenheit(double value) { - double value = (double) perdegreefahrenheit; return new CoefficientOfThermalExpansion(value, CoefficientOfThermalExpansionUnit.PerDegreeFahrenheit); } @@ -347,9 +342,8 @@ public static CoefficientOfThermalExpansion FromPerDegreeFahrenheit(QuantityValu /// Creates a from . /// /// If value is NaN or Infinity. - public static CoefficientOfThermalExpansion FromPerKelvin(QuantityValue perkelvin) + public static CoefficientOfThermalExpansion FromPerKelvin(double value) { - double value = (double) perkelvin; return new CoefficientOfThermalExpansion(value, CoefficientOfThermalExpansionUnit.PerKelvin); } @@ -357,9 +351,8 @@ public static CoefficientOfThermalExpansion FromPerKelvin(QuantityValue perkelvi /// Creates a from . /// /// If value is NaN or Infinity. - public static CoefficientOfThermalExpansion FromPpmPerDegreeCelsius(QuantityValue ppmperdegreecelsius) + public static CoefficientOfThermalExpansion FromPpmPerDegreeCelsius(double value) { - double value = (double) ppmperdegreecelsius; return new CoefficientOfThermalExpansion(value, CoefficientOfThermalExpansionUnit.PpmPerDegreeCelsius); } @@ -367,9 +360,8 @@ public static CoefficientOfThermalExpansion FromPpmPerDegreeCelsius(QuantityValu /// Creates a from . /// /// If value is NaN or Infinity. - public static CoefficientOfThermalExpansion FromPpmPerDegreeFahrenheit(QuantityValue ppmperdegreefahrenheit) + public static CoefficientOfThermalExpansion FromPpmPerDegreeFahrenheit(double value) { - double value = (double) ppmperdegreefahrenheit; return new CoefficientOfThermalExpansion(value, CoefficientOfThermalExpansionUnit.PpmPerDegreeFahrenheit); } @@ -377,9 +369,8 @@ public static CoefficientOfThermalExpansion FromPpmPerDegreeFahrenheit(QuantityV /// Creates a from . /// /// If value is NaN or Infinity. - public static CoefficientOfThermalExpansion FromPpmPerKelvin(QuantityValue ppmperkelvin) + public static CoefficientOfThermalExpansion FromPpmPerKelvin(double value) { - double value = (double) ppmperkelvin; return new CoefficientOfThermalExpansion(value, CoefficientOfThermalExpansionUnit.PpmPerKelvin); } @@ -389,9 +380,9 @@ public static CoefficientOfThermalExpansion FromPpmPerKelvin(QuantityValue ppmpe /// Value to convert from. /// Unit to convert from. /// CoefficientOfThermalExpansion unit value. - public static CoefficientOfThermalExpansion From(QuantityValue value, CoefficientOfThermalExpansionUnit fromUnit) + public static CoefficientOfThermalExpansion From(double value, CoefficientOfThermalExpansionUnit fromUnit) { - return new CoefficientOfThermalExpansion((double)value, fromUnit); + return new CoefficientOfThermalExpansion(value, fromUnit); } #endregion @@ -812,15 +803,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is CoefficientOfThermalExpansionUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(CoefficientOfThermalExpansionUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is CoefficientOfThermalExpansionUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(CoefficientOfThermalExpansionUnit)} is supported.", nameof(unit)); @@ -951,18 +933,6 @@ public CoefficientOfThermalExpansion ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not CoefficientOfThermalExpansionUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(CoefficientOfThermalExpansionUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/Compressibility.g.cs b/UnitsNet/GeneratedCode/Quantities/Compressibility.g.cs index 8c4f3b14c2..b5d7cae6c5 100644 --- a/UnitsNet/GeneratedCode/Quantities/Compressibility.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Compressibility.g.cs @@ -37,7 +37,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct Compressibility : - IArithmeticQuantity, + IArithmeticQuantity, IComparable, IComparable, IConvertible, @@ -153,7 +153,7 @@ public Compressibility(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -269,9 +269,8 @@ public static string GetAbbreviation(CompressibilityUnit unit, IFormatProvider? /// Creates a from . /// /// If value is NaN or Infinity. - public static Compressibility FromInverseAtmospheres(QuantityValue inverseatmospheres) + public static Compressibility FromInverseAtmospheres(double value) { - double value = (double) inverseatmospheres; return new Compressibility(value, CompressibilityUnit.InverseAtmosphere); } @@ -279,9 +278,8 @@ public static Compressibility FromInverseAtmospheres(QuantityValue inverseatmosp /// Creates a from . /// /// If value is NaN or Infinity. - public static Compressibility FromInverseBars(QuantityValue inversebars) + public static Compressibility FromInverseBars(double value) { - double value = (double) inversebars; return new Compressibility(value, CompressibilityUnit.InverseBar); } @@ -289,9 +287,8 @@ public static Compressibility FromInverseBars(QuantityValue inversebars) /// Creates a from . /// /// If value is NaN or Infinity. - public static Compressibility FromInverseKilopascals(QuantityValue inversekilopascals) + public static Compressibility FromInverseKilopascals(double value) { - double value = (double) inversekilopascals; return new Compressibility(value, CompressibilityUnit.InverseKilopascal); } @@ -299,9 +296,8 @@ public static Compressibility FromInverseKilopascals(QuantityValue inversekilopa /// Creates a from . /// /// If value is NaN or Infinity. - public static Compressibility FromInverseMegapascals(QuantityValue inversemegapascals) + public static Compressibility FromInverseMegapascals(double value) { - double value = (double) inversemegapascals; return new Compressibility(value, CompressibilityUnit.InverseMegapascal); } @@ -309,9 +305,8 @@ public static Compressibility FromInverseMegapascals(QuantityValue inversemegapa /// Creates a from . /// /// If value is NaN or Infinity. - public static Compressibility FromInverseMillibars(QuantityValue inversemillibars) + public static Compressibility FromInverseMillibars(double value) { - double value = (double) inversemillibars; return new Compressibility(value, CompressibilityUnit.InverseMillibar); } @@ -319,9 +314,8 @@ public static Compressibility FromInverseMillibars(QuantityValue inversemillibar /// Creates a from . /// /// If value is NaN or Infinity. - public static Compressibility FromInversePascals(QuantityValue inversepascals) + public static Compressibility FromInversePascals(double value) { - double value = (double) inversepascals; return new Compressibility(value, CompressibilityUnit.InversePascal); } @@ -329,9 +323,8 @@ public static Compressibility FromInversePascals(QuantityValue inversepascals) /// Creates a from . /// /// If value is NaN or Infinity. - public static Compressibility FromInversePoundsForcePerSquareInch(QuantityValue inversepoundsforcepersquareinch) + public static Compressibility FromInversePoundsForcePerSquareInch(double value) { - double value = (double) inversepoundsforcepersquareinch; return new Compressibility(value, CompressibilityUnit.InversePoundForcePerSquareInch); } @@ -341,9 +334,9 @@ public static Compressibility FromInversePoundsForcePerSquareInch(QuantityValue /// Value to convert from. /// Unit to convert from. /// Compressibility unit value. - public static Compressibility From(QuantityValue value, CompressibilityUnit fromUnit) + public static Compressibility From(double value, CompressibilityUnit fromUnit) { - return new Compressibility((double)value, fromUnit); + return new Compressibility(value, fromUnit); } #endregion @@ -754,15 +747,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is CompressibilityUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(CompressibilityUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is CompressibilityUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(CompressibilityUnit)} is supported.", nameof(unit)); @@ -889,18 +873,6 @@ public Compressibility ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not CompressibilityUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(CompressibilityUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/Density.g.cs b/UnitsNet/GeneratedCode/Quantities/Density.g.cs index 4c46483364..1b3c8a592d 100644 --- a/UnitsNet/GeneratedCode/Quantities/Density.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Density.g.cs @@ -43,7 +43,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct Density : - IArithmeticQuantity, + IArithmeticQuantity, #if NET7_0_OR_GREATER IMultiplyOperators, IMultiplyOperators, @@ -217,7 +217,7 @@ public Density(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -676,9 +676,8 @@ public static string GetAbbreviation(DensityUnit unit, IFormatProvider? provider /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromCentigramsPerDeciliter(QuantityValue centigramsperdeciliter) + public static Density FromCentigramsPerDeciliter(double value) { - double value = (double) centigramsperdeciliter; return new Density(value, DensityUnit.CentigramPerDeciliter); } @@ -686,9 +685,8 @@ public static Density FromCentigramsPerDeciliter(QuantityValue centigramsperdeci /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromCentigramsPerLiter(QuantityValue centigramsperliter) + public static Density FromCentigramsPerLiter(double value) { - double value = (double) centigramsperliter; return new Density(value, DensityUnit.CentigramPerLiter); } @@ -696,9 +694,8 @@ public static Density FromCentigramsPerLiter(QuantityValue centigramsperliter) /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromCentigramsPerMilliliter(QuantityValue centigramspermilliliter) + public static Density FromCentigramsPerMilliliter(double value) { - double value = (double) centigramspermilliliter; return new Density(value, DensityUnit.CentigramPerMilliliter); } @@ -706,9 +703,8 @@ public static Density FromCentigramsPerMilliliter(QuantityValue centigramspermil /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromDecigramsPerDeciliter(QuantityValue decigramsperdeciliter) + public static Density FromDecigramsPerDeciliter(double value) { - double value = (double) decigramsperdeciliter; return new Density(value, DensityUnit.DecigramPerDeciliter); } @@ -716,9 +712,8 @@ public static Density FromDecigramsPerDeciliter(QuantityValue decigramsperdecili /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromDecigramsPerLiter(QuantityValue decigramsperliter) + public static Density FromDecigramsPerLiter(double value) { - double value = (double) decigramsperliter; return new Density(value, DensityUnit.DecigramPerLiter); } @@ -726,9 +721,8 @@ public static Density FromDecigramsPerLiter(QuantityValue decigramsperliter) /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromDecigramsPerMilliliter(QuantityValue decigramspermilliliter) + public static Density FromDecigramsPerMilliliter(double value) { - double value = (double) decigramspermilliliter; return new Density(value, DensityUnit.DecigramPerMilliliter); } @@ -736,9 +730,8 @@ public static Density FromDecigramsPerMilliliter(QuantityValue decigramspermilli /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromFemtogramsPerDeciliter(QuantityValue femtogramsperdeciliter) + public static Density FromFemtogramsPerDeciliter(double value) { - double value = (double) femtogramsperdeciliter; return new Density(value, DensityUnit.FemtogramPerDeciliter); } @@ -746,9 +739,8 @@ public static Density FromFemtogramsPerDeciliter(QuantityValue femtogramsperdeci /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromFemtogramsPerLiter(QuantityValue femtogramsperliter) + public static Density FromFemtogramsPerLiter(double value) { - double value = (double) femtogramsperliter; return new Density(value, DensityUnit.FemtogramPerLiter); } @@ -756,9 +748,8 @@ public static Density FromFemtogramsPerLiter(QuantityValue femtogramsperliter) /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromFemtogramsPerMilliliter(QuantityValue femtogramspermilliliter) + public static Density FromFemtogramsPerMilliliter(double value) { - double value = (double) femtogramspermilliliter; return new Density(value, DensityUnit.FemtogramPerMilliliter); } @@ -766,9 +757,8 @@ public static Density FromFemtogramsPerMilliliter(QuantityValue femtogramspermil /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromGramsPerCubicCentimeter(QuantityValue gramspercubiccentimeter) + public static Density FromGramsPerCubicCentimeter(double value) { - double value = (double) gramspercubiccentimeter; return new Density(value, DensityUnit.GramPerCubicCentimeter); } @@ -776,9 +766,8 @@ public static Density FromGramsPerCubicCentimeter(QuantityValue gramspercubiccen /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromGramsPerCubicFoot(QuantityValue gramspercubicfoot) + public static Density FromGramsPerCubicFoot(double value) { - double value = (double) gramspercubicfoot; return new Density(value, DensityUnit.GramPerCubicFoot); } @@ -786,9 +775,8 @@ public static Density FromGramsPerCubicFoot(QuantityValue gramspercubicfoot) /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromGramsPerCubicInch(QuantityValue gramspercubicinch) + public static Density FromGramsPerCubicInch(double value) { - double value = (double) gramspercubicinch; return new Density(value, DensityUnit.GramPerCubicInch); } @@ -796,9 +784,8 @@ public static Density FromGramsPerCubicInch(QuantityValue gramspercubicinch) /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromGramsPerCubicMeter(QuantityValue gramspercubicmeter) + public static Density FromGramsPerCubicMeter(double value) { - double value = (double) gramspercubicmeter; return new Density(value, DensityUnit.GramPerCubicMeter); } @@ -806,9 +793,8 @@ public static Density FromGramsPerCubicMeter(QuantityValue gramspercubicmeter) /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromGramsPerCubicMillimeter(QuantityValue gramspercubicmillimeter) + public static Density FromGramsPerCubicMillimeter(double value) { - double value = (double) gramspercubicmillimeter; return new Density(value, DensityUnit.GramPerCubicMillimeter); } @@ -816,9 +802,8 @@ public static Density FromGramsPerCubicMillimeter(QuantityValue gramspercubicmil /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromGramsPerDeciliter(QuantityValue gramsperdeciliter) + public static Density FromGramsPerDeciliter(double value) { - double value = (double) gramsperdeciliter; return new Density(value, DensityUnit.GramPerDeciliter); } @@ -826,9 +811,8 @@ public static Density FromGramsPerDeciliter(QuantityValue gramsperdeciliter) /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromGramsPerLiter(QuantityValue gramsperliter) + public static Density FromGramsPerLiter(double value) { - double value = (double) gramsperliter; return new Density(value, DensityUnit.GramPerLiter); } @@ -836,9 +820,8 @@ public static Density FromGramsPerLiter(QuantityValue gramsperliter) /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromGramsPerMilliliter(QuantityValue gramspermilliliter) + public static Density FromGramsPerMilliliter(double value) { - double value = (double) gramspermilliliter; return new Density(value, DensityUnit.GramPerMilliliter); } @@ -846,9 +829,8 @@ public static Density FromGramsPerMilliliter(QuantityValue gramspermilliliter) /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromKilogramsPerCubicCentimeter(QuantityValue kilogramspercubiccentimeter) + public static Density FromKilogramsPerCubicCentimeter(double value) { - double value = (double) kilogramspercubiccentimeter; return new Density(value, DensityUnit.KilogramPerCubicCentimeter); } @@ -856,9 +838,8 @@ public static Density FromKilogramsPerCubicCentimeter(QuantityValue kilogramsper /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromKilogramsPerCubicMeter(QuantityValue kilogramspercubicmeter) + public static Density FromKilogramsPerCubicMeter(double value) { - double value = (double) kilogramspercubicmeter; return new Density(value, DensityUnit.KilogramPerCubicMeter); } @@ -866,9 +847,8 @@ public static Density FromKilogramsPerCubicMeter(QuantityValue kilogramspercubic /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromKilogramsPerCubicMillimeter(QuantityValue kilogramspercubicmillimeter) + public static Density FromKilogramsPerCubicMillimeter(double value) { - double value = (double) kilogramspercubicmillimeter; return new Density(value, DensityUnit.KilogramPerCubicMillimeter); } @@ -876,9 +856,8 @@ public static Density FromKilogramsPerCubicMillimeter(QuantityValue kilogramsper /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromKilogramsPerLiter(QuantityValue kilogramsperliter) + public static Density FromKilogramsPerLiter(double value) { - double value = (double) kilogramsperliter; return new Density(value, DensityUnit.KilogramPerLiter); } @@ -886,9 +865,8 @@ public static Density FromKilogramsPerLiter(QuantityValue kilogramsperliter) /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromKilopoundsPerCubicFoot(QuantityValue kilopoundspercubicfoot) + public static Density FromKilopoundsPerCubicFoot(double value) { - double value = (double) kilopoundspercubicfoot; return new Density(value, DensityUnit.KilopoundPerCubicFoot); } @@ -896,9 +874,8 @@ public static Density FromKilopoundsPerCubicFoot(QuantityValue kilopoundspercubi /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromKilopoundsPerCubicInch(QuantityValue kilopoundspercubicinch) + public static Density FromKilopoundsPerCubicInch(double value) { - double value = (double) kilopoundspercubicinch; return new Density(value, DensityUnit.KilopoundPerCubicInch); } @@ -906,9 +883,8 @@ public static Density FromKilopoundsPerCubicInch(QuantityValue kilopoundspercubi /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromKilopoundsPerCubicYard(QuantityValue kilopoundspercubicyard) + public static Density FromKilopoundsPerCubicYard(double value) { - double value = (double) kilopoundspercubicyard; return new Density(value, DensityUnit.KilopoundPerCubicYard); } @@ -916,9 +892,8 @@ public static Density FromKilopoundsPerCubicYard(QuantityValue kilopoundspercubi /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromMicrogramsPerCubicMeter(QuantityValue microgramspercubicmeter) + public static Density FromMicrogramsPerCubicMeter(double value) { - double value = (double) microgramspercubicmeter; return new Density(value, DensityUnit.MicrogramPerCubicMeter); } @@ -926,9 +901,8 @@ public static Density FromMicrogramsPerCubicMeter(QuantityValue microgramspercub /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromMicrogramsPerDeciliter(QuantityValue microgramsperdeciliter) + public static Density FromMicrogramsPerDeciliter(double value) { - double value = (double) microgramsperdeciliter; return new Density(value, DensityUnit.MicrogramPerDeciliter); } @@ -936,9 +910,8 @@ public static Density FromMicrogramsPerDeciliter(QuantityValue microgramsperdeci /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromMicrogramsPerLiter(QuantityValue microgramsperliter) + public static Density FromMicrogramsPerLiter(double value) { - double value = (double) microgramsperliter; return new Density(value, DensityUnit.MicrogramPerLiter); } @@ -946,9 +919,8 @@ public static Density FromMicrogramsPerLiter(QuantityValue microgramsperliter) /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromMicrogramsPerMilliliter(QuantityValue microgramspermilliliter) + public static Density FromMicrogramsPerMilliliter(double value) { - double value = (double) microgramspermilliliter; return new Density(value, DensityUnit.MicrogramPerMilliliter); } @@ -956,9 +928,8 @@ public static Density FromMicrogramsPerMilliliter(QuantityValue microgramspermil /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromMilligramsPerCubicMeter(QuantityValue milligramspercubicmeter) + public static Density FromMilligramsPerCubicMeter(double value) { - double value = (double) milligramspercubicmeter; return new Density(value, DensityUnit.MilligramPerCubicMeter); } @@ -966,9 +937,8 @@ public static Density FromMilligramsPerCubicMeter(QuantityValue milligramspercub /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromMilligramsPerDeciliter(QuantityValue milligramsperdeciliter) + public static Density FromMilligramsPerDeciliter(double value) { - double value = (double) milligramsperdeciliter; return new Density(value, DensityUnit.MilligramPerDeciliter); } @@ -976,9 +946,8 @@ public static Density FromMilligramsPerDeciliter(QuantityValue milligramsperdeci /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromMilligramsPerLiter(QuantityValue milligramsperliter) + public static Density FromMilligramsPerLiter(double value) { - double value = (double) milligramsperliter; return new Density(value, DensityUnit.MilligramPerLiter); } @@ -986,9 +955,8 @@ public static Density FromMilligramsPerLiter(QuantityValue milligramsperliter) /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromMilligramsPerMilliliter(QuantityValue milligramspermilliliter) + public static Density FromMilligramsPerMilliliter(double value) { - double value = (double) milligramspermilliliter; return new Density(value, DensityUnit.MilligramPerMilliliter); } @@ -996,9 +964,8 @@ public static Density FromMilligramsPerMilliliter(QuantityValue milligramspermil /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromNanogramsPerDeciliter(QuantityValue nanogramsperdeciliter) + public static Density FromNanogramsPerDeciliter(double value) { - double value = (double) nanogramsperdeciliter; return new Density(value, DensityUnit.NanogramPerDeciliter); } @@ -1006,9 +973,8 @@ public static Density FromNanogramsPerDeciliter(QuantityValue nanogramsperdecili /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromNanogramsPerLiter(QuantityValue nanogramsperliter) + public static Density FromNanogramsPerLiter(double value) { - double value = (double) nanogramsperliter; return new Density(value, DensityUnit.NanogramPerLiter); } @@ -1016,9 +982,8 @@ public static Density FromNanogramsPerLiter(QuantityValue nanogramsperliter) /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromNanogramsPerMilliliter(QuantityValue nanogramspermilliliter) + public static Density FromNanogramsPerMilliliter(double value) { - double value = (double) nanogramspermilliliter; return new Density(value, DensityUnit.NanogramPerMilliliter); } @@ -1026,9 +991,8 @@ public static Density FromNanogramsPerMilliliter(QuantityValue nanogramspermilli /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromPicogramsPerDeciliter(QuantityValue picogramsperdeciliter) + public static Density FromPicogramsPerDeciliter(double value) { - double value = (double) picogramsperdeciliter; return new Density(value, DensityUnit.PicogramPerDeciliter); } @@ -1036,9 +1000,8 @@ public static Density FromPicogramsPerDeciliter(QuantityValue picogramsperdecili /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromPicogramsPerLiter(QuantityValue picogramsperliter) + public static Density FromPicogramsPerLiter(double value) { - double value = (double) picogramsperliter; return new Density(value, DensityUnit.PicogramPerLiter); } @@ -1046,9 +1009,8 @@ public static Density FromPicogramsPerLiter(QuantityValue picogramsperliter) /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromPicogramsPerMilliliter(QuantityValue picogramspermilliliter) + public static Density FromPicogramsPerMilliliter(double value) { - double value = (double) picogramspermilliliter; return new Density(value, DensityUnit.PicogramPerMilliliter); } @@ -1056,9 +1018,8 @@ public static Density FromPicogramsPerMilliliter(QuantityValue picogramspermilli /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromPoundsPerCubicCentimeter(QuantityValue poundspercubiccentimeter) + public static Density FromPoundsPerCubicCentimeter(double value) { - double value = (double) poundspercubiccentimeter; return new Density(value, DensityUnit.PoundPerCubicCentimeter); } @@ -1066,9 +1027,8 @@ public static Density FromPoundsPerCubicCentimeter(QuantityValue poundspercubicc /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromPoundsPerCubicFoot(QuantityValue poundspercubicfoot) + public static Density FromPoundsPerCubicFoot(double value) { - double value = (double) poundspercubicfoot; return new Density(value, DensityUnit.PoundPerCubicFoot); } @@ -1076,9 +1036,8 @@ public static Density FromPoundsPerCubicFoot(QuantityValue poundspercubicfoot) /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromPoundsPerCubicInch(QuantityValue poundspercubicinch) + public static Density FromPoundsPerCubicInch(double value) { - double value = (double) poundspercubicinch; return new Density(value, DensityUnit.PoundPerCubicInch); } @@ -1086,9 +1045,8 @@ public static Density FromPoundsPerCubicInch(QuantityValue poundspercubicinch) /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromPoundsPerCubicMeter(QuantityValue poundspercubicmeter) + public static Density FromPoundsPerCubicMeter(double value) { - double value = (double) poundspercubicmeter; return new Density(value, DensityUnit.PoundPerCubicMeter); } @@ -1096,9 +1054,8 @@ public static Density FromPoundsPerCubicMeter(QuantityValue poundspercubicmeter) /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromPoundsPerCubicMillimeter(QuantityValue poundspercubicmillimeter) + public static Density FromPoundsPerCubicMillimeter(double value) { - double value = (double) poundspercubicmillimeter; return new Density(value, DensityUnit.PoundPerCubicMillimeter); } @@ -1106,9 +1063,8 @@ public static Density FromPoundsPerCubicMillimeter(QuantityValue poundspercubicm /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromPoundsPerCubicYard(QuantityValue poundspercubicyard) + public static Density FromPoundsPerCubicYard(double value) { - double value = (double) poundspercubicyard; return new Density(value, DensityUnit.PoundPerCubicYard); } @@ -1116,9 +1072,8 @@ public static Density FromPoundsPerCubicYard(QuantityValue poundspercubicyard) /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromPoundsPerImperialGallon(QuantityValue poundsperimperialgallon) + public static Density FromPoundsPerImperialGallon(double value) { - double value = (double) poundsperimperialgallon; return new Density(value, DensityUnit.PoundPerImperialGallon); } @@ -1126,9 +1081,8 @@ public static Density FromPoundsPerImperialGallon(QuantityValue poundsperimperia /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromPoundsPerUSGallon(QuantityValue poundsperusgallon) + public static Density FromPoundsPerUSGallon(double value) { - double value = (double) poundsperusgallon; return new Density(value, DensityUnit.PoundPerUSGallon); } @@ -1136,9 +1090,8 @@ public static Density FromPoundsPerUSGallon(QuantityValue poundsperusgallon) /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromSlugsPerCubicCentimeter(QuantityValue slugspercubiccentimeter) + public static Density FromSlugsPerCubicCentimeter(double value) { - double value = (double) slugspercubiccentimeter; return new Density(value, DensityUnit.SlugPerCubicCentimeter); } @@ -1146,9 +1099,8 @@ public static Density FromSlugsPerCubicCentimeter(QuantityValue slugspercubiccen /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromSlugsPerCubicFoot(QuantityValue slugspercubicfoot) + public static Density FromSlugsPerCubicFoot(double value) { - double value = (double) slugspercubicfoot; return new Density(value, DensityUnit.SlugPerCubicFoot); } @@ -1156,9 +1108,8 @@ public static Density FromSlugsPerCubicFoot(QuantityValue slugspercubicfoot) /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromSlugsPerCubicInch(QuantityValue slugspercubicinch) + public static Density FromSlugsPerCubicInch(double value) { - double value = (double) slugspercubicinch; return new Density(value, DensityUnit.SlugPerCubicInch); } @@ -1166,9 +1117,8 @@ public static Density FromSlugsPerCubicInch(QuantityValue slugspercubicinch) /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromSlugsPerCubicMeter(QuantityValue slugspercubicmeter) + public static Density FromSlugsPerCubicMeter(double value) { - double value = (double) slugspercubicmeter; return new Density(value, DensityUnit.SlugPerCubicMeter); } @@ -1176,9 +1126,8 @@ public static Density FromSlugsPerCubicMeter(QuantityValue slugspercubicmeter) /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromSlugsPerCubicMillimeter(QuantityValue slugspercubicmillimeter) + public static Density FromSlugsPerCubicMillimeter(double value) { - double value = (double) slugspercubicmillimeter; return new Density(value, DensityUnit.SlugPerCubicMillimeter); } @@ -1186,9 +1135,8 @@ public static Density FromSlugsPerCubicMillimeter(QuantityValue slugspercubicmil /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromTonnesPerCubicCentimeter(QuantityValue tonnespercubiccentimeter) + public static Density FromTonnesPerCubicCentimeter(double value) { - double value = (double) tonnespercubiccentimeter; return new Density(value, DensityUnit.TonnePerCubicCentimeter); } @@ -1196,9 +1144,8 @@ public static Density FromTonnesPerCubicCentimeter(QuantityValue tonnespercubicc /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromTonnesPerCubicFoot(QuantityValue tonnespercubicfoot) + public static Density FromTonnesPerCubicFoot(double value) { - double value = (double) tonnespercubicfoot; return new Density(value, DensityUnit.TonnePerCubicFoot); } @@ -1206,9 +1153,8 @@ public static Density FromTonnesPerCubicFoot(QuantityValue tonnespercubicfoot) /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromTonnesPerCubicInch(QuantityValue tonnespercubicinch) + public static Density FromTonnesPerCubicInch(double value) { - double value = (double) tonnespercubicinch; return new Density(value, DensityUnit.TonnePerCubicInch); } @@ -1216,9 +1162,8 @@ public static Density FromTonnesPerCubicInch(QuantityValue tonnespercubicinch) /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromTonnesPerCubicMeter(QuantityValue tonnespercubicmeter) + public static Density FromTonnesPerCubicMeter(double value) { - double value = (double) tonnespercubicmeter; return new Density(value, DensityUnit.TonnePerCubicMeter); } @@ -1226,9 +1171,8 @@ public static Density FromTonnesPerCubicMeter(QuantityValue tonnespercubicmeter) /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromTonnesPerCubicMillimeter(QuantityValue tonnespercubicmillimeter) + public static Density FromTonnesPerCubicMillimeter(double value) { - double value = (double) tonnespercubicmillimeter; return new Density(value, DensityUnit.TonnePerCubicMillimeter); } @@ -1238,9 +1182,9 @@ public static Density FromTonnesPerCubicMillimeter(QuantityValue tonnespercubicm /// Value to convert from. /// Unit to convert from. /// Density unit value. - public static Density From(QuantityValue value, DensityUnit fromUnit) + public static Density From(double value, DensityUnit fromUnit) { - return new Density((double)value, fromUnit); + return new Density(value, fromUnit); } #endregion @@ -1697,15 +1641,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is DensityUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(DensityUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is DensityUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(DensityUnit)} is supported.", nameof(unit)); @@ -1930,18 +1865,6 @@ public Density ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not DensityUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(DensityUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/Duration.g.cs b/UnitsNet/GeneratedCode/Quantities/Duration.g.cs index 1fd3a70cb4..85029f0a63 100644 --- a/UnitsNet/GeneratedCode/Quantities/Duration.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Duration.g.cs @@ -40,7 +40,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct Duration : - IArithmeticQuantity, + IArithmeticQuantity, #if NET7_0_OR_GREATER IMultiplyOperators, IMultiplyOperators, @@ -175,7 +175,7 @@ public Duration(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -319,9 +319,8 @@ public static string GetAbbreviation(DurationUnit unit, IFormatProvider? provide /// Creates a from . /// /// If value is NaN or Infinity. - public static Duration FromDays(QuantityValue days) + public static Duration FromDays(double value) { - double value = (double) days; return new Duration(value, DurationUnit.Day); } @@ -329,9 +328,8 @@ public static Duration FromDays(QuantityValue days) /// Creates a from . /// /// If value is NaN or Infinity. - public static Duration FromHours(QuantityValue hours) + public static Duration FromHours(double value) { - double value = (double) hours; return new Duration(value, DurationUnit.Hour); } @@ -339,9 +337,8 @@ public static Duration FromHours(QuantityValue hours) /// Creates a from . /// /// If value is NaN or Infinity. - public static Duration FromJulianYears(QuantityValue julianyears) + public static Duration FromJulianYears(double value) { - double value = (double) julianyears; return new Duration(value, DurationUnit.JulianYear); } @@ -349,9 +346,8 @@ public static Duration FromJulianYears(QuantityValue julianyears) /// Creates a from . /// /// If value is NaN or Infinity. - public static Duration FromMicroseconds(QuantityValue microseconds) + public static Duration FromMicroseconds(double value) { - double value = (double) microseconds; return new Duration(value, DurationUnit.Microsecond); } @@ -359,9 +355,8 @@ public static Duration FromMicroseconds(QuantityValue microseconds) /// Creates a from . /// /// If value is NaN or Infinity. - public static Duration FromMilliseconds(QuantityValue milliseconds) + public static Duration FromMilliseconds(double value) { - double value = (double) milliseconds; return new Duration(value, DurationUnit.Millisecond); } @@ -369,9 +364,8 @@ public static Duration FromMilliseconds(QuantityValue milliseconds) /// Creates a from . /// /// If value is NaN or Infinity. - public static Duration FromMinutes(QuantityValue minutes) + public static Duration FromMinutes(double value) { - double value = (double) minutes; return new Duration(value, DurationUnit.Minute); } @@ -379,9 +373,8 @@ public static Duration FromMinutes(QuantityValue minutes) /// Creates a from . /// /// If value is NaN or Infinity. - public static Duration FromMonths30(QuantityValue months30) + public static Duration FromMonths30(double value) { - double value = (double) months30; return new Duration(value, DurationUnit.Month30); } @@ -389,9 +382,8 @@ public static Duration FromMonths30(QuantityValue months30) /// Creates a from . /// /// If value is NaN or Infinity. - public static Duration FromNanoseconds(QuantityValue nanoseconds) + public static Duration FromNanoseconds(double value) { - double value = (double) nanoseconds; return new Duration(value, DurationUnit.Nanosecond); } @@ -399,9 +391,8 @@ public static Duration FromNanoseconds(QuantityValue nanoseconds) /// Creates a from . /// /// If value is NaN or Infinity. - public static Duration FromSeconds(QuantityValue seconds) + public static Duration FromSeconds(double value) { - double value = (double) seconds; return new Duration(value, DurationUnit.Second); } @@ -409,9 +400,8 @@ public static Duration FromSeconds(QuantityValue seconds) /// Creates a from . /// /// If value is NaN or Infinity. - public static Duration FromWeeks(QuantityValue weeks) + public static Duration FromWeeks(double value) { - double value = (double) weeks; return new Duration(value, DurationUnit.Week); } @@ -419,9 +409,8 @@ public static Duration FromWeeks(QuantityValue weeks) /// Creates a from . /// /// If value is NaN or Infinity. - public static Duration FromYears365(QuantityValue years365) + public static Duration FromYears365(double value) { - double value = (double) years365; return new Duration(value, DurationUnit.Year365); } @@ -431,9 +420,9 @@ public static Duration FromYears365(QuantityValue years365) /// Value to convert from. /// Unit to convert from. /// Duration unit value. - public static Duration From(QuantityValue value, DurationUnit fromUnit) + public static Duration From(double value, DurationUnit fromUnit) { - return new Duration((double)value, fromUnit); + return new Duration(value, fromUnit); } #endregion @@ -926,15 +915,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is DurationUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(DurationUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is DurationUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(DurationUnit)} is supported.", nameof(unit)); @@ -1069,18 +1049,6 @@ public Duration ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not DurationUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(DurationUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.g.cs b/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.g.cs index 79a030503d..e3b9e103ac 100644 --- a/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.g.cs @@ -43,7 +43,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct DynamicViscosity : - IArithmeticQuantity, + IArithmeticQuantity, #if NET7_0_OR_GREATER IDivisionOperators, #endif @@ -165,7 +165,7 @@ public DynamicViscosity(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -302,9 +302,8 @@ public static string GetAbbreviation(DynamicViscosityUnit unit, IFormatProvider? /// Creates a from . /// /// If value is NaN or Infinity. - public static DynamicViscosity FromCentipoise(QuantityValue centipoise) + public static DynamicViscosity FromCentipoise(double value) { - double value = (double) centipoise; return new DynamicViscosity(value, DynamicViscosityUnit.Centipoise); } @@ -312,9 +311,8 @@ public static DynamicViscosity FromCentipoise(QuantityValue centipoise) /// Creates a from . /// /// If value is NaN or Infinity. - public static DynamicViscosity FromMicropascalSeconds(QuantityValue micropascalseconds) + public static DynamicViscosity FromMicropascalSeconds(double value) { - double value = (double) micropascalseconds; return new DynamicViscosity(value, DynamicViscosityUnit.MicropascalSecond); } @@ -322,9 +320,8 @@ public static DynamicViscosity FromMicropascalSeconds(QuantityValue micropascals /// Creates a from . /// /// If value is NaN or Infinity. - public static DynamicViscosity FromMillipascalSeconds(QuantityValue millipascalseconds) + public static DynamicViscosity FromMillipascalSeconds(double value) { - double value = (double) millipascalseconds; return new DynamicViscosity(value, DynamicViscosityUnit.MillipascalSecond); } @@ -332,9 +329,8 @@ public static DynamicViscosity FromMillipascalSeconds(QuantityValue millipascals /// Creates a from . /// /// If value is NaN or Infinity. - public static DynamicViscosity FromNewtonSecondsPerMeterSquared(QuantityValue newtonsecondspermetersquared) + public static DynamicViscosity FromNewtonSecondsPerMeterSquared(double value) { - double value = (double) newtonsecondspermetersquared; return new DynamicViscosity(value, DynamicViscosityUnit.NewtonSecondPerMeterSquared); } @@ -342,9 +338,8 @@ public static DynamicViscosity FromNewtonSecondsPerMeterSquared(QuantityValue ne /// Creates a from . /// /// If value is NaN or Infinity. - public static DynamicViscosity FromPascalSeconds(QuantityValue pascalseconds) + public static DynamicViscosity FromPascalSeconds(double value) { - double value = (double) pascalseconds; return new DynamicViscosity(value, DynamicViscosityUnit.PascalSecond); } @@ -352,9 +347,8 @@ public static DynamicViscosity FromPascalSeconds(QuantityValue pascalseconds) /// Creates a from . /// /// If value is NaN or Infinity. - public static DynamicViscosity FromPoise(QuantityValue poise) + public static DynamicViscosity FromPoise(double value) { - double value = (double) poise; return new DynamicViscosity(value, DynamicViscosityUnit.Poise); } @@ -362,9 +356,8 @@ public static DynamicViscosity FromPoise(QuantityValue poise) /// Creates a from . /// /// If value is NaN or Infinity. - public static DynamicViscosity FromPoundsForceSecondPerSquareFoot(QuantityValue poundsforcesecondpersquarefoot) + public static DynamicViscosity FromPoundsForceSecondPerSquareFoot(double value) { - double value = (double) poundsforcesecondpersquarefoot; return new DynamicViscosity(value, DynamicViscosityUnit.PoundForceSecondPerSquareFoot); } @@ -372,9 +365,8 @@ public static DynamicViscosity FromPoundsForceSecondPerSquareFoot(QuantityValue /// Creates a from . /// /// If value is NaN or Infinity. - public static DynamicViscosity FromPoundsForceSecondPerSquareInch(QuantityValue poundsforcesecondpersquareinch) + public static DynamicViscosity FromPoundsForceSecondPerSquareInch(double value) { - double value = (double) poundsforcesecondpersquareinch; return new DynamicViscosity(value, DynamicViscosityUnit.PoundForceSecondPerSquareInch); } @@ -382,9 +374,8 @@ public static DynamicViscosity FromPoundsForceSecondPerSquareInch(QuantityValue /// Creates a from . /// /// If value is NaN or Infinity. - public static DynamicViscosity FromPoundsPerFootSecond(QuantityValue poundsperfootsecond) + public static DynamicViscosity FromPoundsPerFootSecond(double value) { - double value = (double) poundsperfootsecond; return new DynamicViscosity(value, DynamicViscosityUnit.PoundPerFootSecond); } @@ -392,9 +383,8 @@ public static DynamicViscosity FromPoundsPerFootSecond(QuantityValue poundsperfo /// Creates a from . /// /// If value is NaN or Infinity. - public static DynamicViscosity FromReyns(QuantityValue reyns) + public static DynamicViscosity FromReyns(double value) { - double value = (double) reyns; return new DynamicViscosity(value, DynamicViscosityUnit.Reyn); } @@ -404,9 +394,9 @@ public static DynamicViscosity FromReyns(QuantityValue reyns) /// Value to convert from. /// Unit to convert from. /// DynamicViscosity unit value. - public static DynamicViscosity From(QuantityValue value, DynamicViscosityUnit fromUnit) + public static DynamicViscosity From(double value, DynamicViscosityUnit fromUnit) { - return new DynamicViscosity((double)value, fromUnit); + return new DynamicViscosity(value, fromUnit); } #endregion @@ -827,15 +817,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is DynamicViscosityUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(DynamicViscosityUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is DynamicViscosityUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(DynamicViscosityUnit)} is supported.", nameof(unit)); @@ -968,18 +949,6 @@ public DynamicViscosity ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not DynamicViscosityUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(DynamicViscosityUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.g.cs index 0751d0f95e..03b7123ae4 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.g.cs @@ -37,7 +37,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct ElectricAdmittance : - IArithmeticQuantity, + IArithmeticQuantity, IComparable, IComparable, IConvertible, @@ -150,7 +150,7 @@ public ElectricAdmittance(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -245,9 +245,8 @@ public static string GetAbbreviation(ElectricAdmittanceUnit unit, IFormatProvide /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricAdmittance FromMicrosiemens(QuantityValue microsiemens) + public static ElectricAdmittance FromMicrosiemens(double value) { - double value = (double) microsiemens; return new ElectricAdmittance(value, ElectricAdmittanceUnit.Microsiemens); } @@ -255,9 +254,8 @@ public static ElectricAdmittance FromMicrosiemens(QuantityValue microsiemens) /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricAdmittance FromMillisiemens(QuantityValue millisiemens) + public static ElectricAdmittance FromMillisiemens(double value) { - double value = (double) millisiemens; return new ElectricAdmittance(value, ElectricAdmittanceUnit.Millisiemens); } @@ -265,9 +263,8 @@ public static ElectricAdmittance FromMillisiemens(QuantityValue millisiemens) /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricAdmittance FromNanosiemens(QuantityValue nanosiemens) + public static ElectricAdmittance FromNanosiemens(double value) { - double value = (double) nanosiemens; return new ElectricAdmittance(value, ElectricAdmittanceUnit.Nanosiemens); } @@ -275,9 +272,8 @@ public static ElectricAdmittance FromNanosiemens(QuantityValue nanosiemens) /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricAdmittance FromSiemens(QuantityValue siemens) + public static ElectricAdmittance FromSiemens(double value) { - double value = (double) siemens; return new ElectricAdmittance(value, ElectricAdmittanceUnit.Siemens); } @@ -287,9 +283,9 @@ public static ElectricAdmittance FromSiemens(QuantityValue siemens) /// Value to convert from. /// Unit to convert from. /// ElectricAdmittance unit value. - public static ElectricAdmittance From(QuantityValue value, ElectricAdmittanceUnit fromUnit) + public static ElectricAdmittance From(double value, ElectricAdmittanceUnit fromUnit) { - return new ElectricAdmittance((double)value, fromUnit); + return new ElectricAdmittance(value, fromUnit); } #endregion @@ -700,15 +696,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is ElectricAdmittanceUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ElectricAdmittanceUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is ElectricAdmittanceUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ElectricAdmittanceUnit)} is supported.", nameof(unit)); @@ -829,18 +816,6 @@ public ElectricAdmittance ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not ElectricAdmittanceUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ElectricAdmittanceUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCharge.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCharge.g.cs index ea6a9b18f9..e5c4251ad8 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCharge.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCharge.g.cs @@ -43,7 +43,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct ElectricCharge : - IArithmeticQuantity, + IArithmeticQuantity, #if NET7_0_OR_GREATER IDivisionOperators, IDivisionOperators, @@ -169,7 +169,7 @@ public ElectricCharge(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -313,9 +313,8 @@ public static string GetAbbreviation(ElectricChargeUnit unit, IFormatProvider? p /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCharge FromAmpereHours(QuantityValue amperehours) + public static ElectricCharge FromAmpereHours(double value) { - double value = (double) amperehours; return new ElectricCharge(value, ElectricChargeUnit.AmpereHour); } @@ -323,9 +322,8 @@ public static ElectricCharge FromAmpereHours(QuantityValue amperehours) /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCharge FromCoulombs(QuantityValue coulombs) + public static ElectricCharge FromCoulombs(double value) { - double value = (double) coulombs; return new ElectricCharge(value, ElectricChargeUnit.Coulomb); } @@ -333,9 +331,8 @@ public static ElectricCharge FromCoulombs(QuantityValue coulombs) /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCharge FromKiloampereHours(QuantityValue kiloamperehours) + public static ElectricCharge FromKiloampereHours(double value) { - double value = (double) kiloamperehours; return new ElectricCharge(value, ElectricChargeUnit.KiloampereHour); } @@ -343,9 +340,8 @@ public static ElectricCharge FromKiloampereHours(QuantityValue kiloamperehours) /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCharge FromKilocoulombs(QuantityValue kilocoulombs) + public static ElectricCharge FromKilocoulombs(double value) { - double value = (double) kilocoulombs; return new ElectricCharge(value, ElectricChargeUnit.Kilocoulomb); } @@ -353,9 +349,8 @@ public static ElectricCharge FromKilocoulombs(QuantityValue kilocoulombs) /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCharge FromMegaampereHours(QuantityValue megaamperehours) + public static ElectricCharge FromMegaampereHours(double value) { - double value = (double) megaamperehours; return new ElectricCharge(value, ElectricChargeUnit.MegaampereHour); } @@ -363,9 +358,8 @@ public static ElectricCharge FromMegaampereHours(QuantityValue megaamperehours) /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCharge FromMegacoulombs(QuantityValue megacoulombs) + public static ElectricCharge FromMegacoulombs(double value) { - double value = (double) megacoulombs; return new ElectricCharge(value, ElectricChargeUnit.Megacoulomb); } @@ -373,9 +367,8 @@ public static ElectricCharge FromMegacoulombs(QuantityValue megacoulombs) /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCharge FromMicrocoulombs(QuantityValue microcoulombs) + public static ElectricCharge FromMicrocoulombs(double value) { - double value = (double) microcoulombs; return new ElectricCharge(value, ElectricChargeUnit.Microcoulomb); } @@ -383,9 +376,8 @@ public static ElectricCharge FromMicrocoulombs(QuantityValue microcoulombs) /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCharge FromMilliampereHours(QuantityValue milliamperehours) + public static ElectricCharge FromMilliampereHours(double value) { - double value = (double) milliamperehours; return new ElectricCharge(value, ElectricChargeUnit.MilliampereHour); } @@ -393,9 +385,8 @@ public static ElectricCharge FromMilliampereHours(QuantityValue milliamperehours /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCharge FromMillicoulombs(QuantityValue millicoulombs) + public static ElectricCharge FromMillicoulombs(double value) { - double value = (double) millicoulombs; return new ElectricCharge(value, ElectricChargeUnit.Millicoulomb); } @@ -403,9 +394,8 @@ public static ElectricCharge FromMillicoulombs(QuantityValue millicoulombs) /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCharge FromNanocoulombs(QuantityValue nanocoulombs) + public static ElectricCharge FromNanocoulombs(double value) { - double value = (double) nanocoulombs; return new ElectricCharge(value, ElectricChargeUnit.Nanocoulomb); } @@ -413,9 +403,8 @@ public static ElectricCharge FromNanocoulombs(QuantityValue nanocoulombs) /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCharge FromPicocoulombs(QuantityValue picocoulombs) + public static ElectricCharge FromPicocoulombs(double value) { - double value = (double) picocoulombs; return new ElectricCharge(value, ElectricChargeUnit.Picocoulomb); } @@ -425,9 +414,9 @@ public static ElectricCharge FromPicocoulombs(QuantityValue picocoulombs) /// Value to convert from. /// Unit to convert from. /// ElectricCharge unit value. - public static ElectricCharge From(QuantityValue value, ElectricChargeUnit fromUnit) + public static ElectricCharge From(double value, ElectricChargeUnit fromUnit) { - return new ElectricCharge((double)value, fromUnit); + return new ElectricCharge(value, fromUnit); } #endregion @@ -866,15 +855,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is ElectricChargeUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ElectricChargeUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is ElectricChargeUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ElectricChargeUnit)} is supported.", nameof(unit)); @@ -1009,18 +989,6 @@ public ElectricCharge ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not ElectricChargeUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ElectricChargeUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.g.cs index 899ec712d2..5d91680e82 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.g.cs @@ -40,7 +40,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct ElectricChargeDensity : - IArithmeticQuantity, + IArithmeticQuantity, IComparable, IComparable, IConvertible, @@ -150,7 +150,7 @@ public ElectricChargeDensity(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -224,9 +224,8 @@ public static string GetAbbreviation(ElectricChargeDensityUnit unit, IFormatProv /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricChargeDensity FromCoulombsPerCubicMeter(QuantityValue coulombspercubicmeter) + public static ElectricChargeDensity FromCoulombsPerCubicMeter(double value) { - double value = (double) coulombspercubicmeter; return new ElectricChargeDensity(value, ElectricChargeDensityUnit.CoulombPerCubicMeter); } @@ -236,9 +235,9 @@ public static ElectricChargeDensity FromCoulombsPerCubicMeter(QuantityValue coul /// Value to convert from. /// Unit to convert from. /// ElectricChargeDensity unit value. - public static ElectricChargeDensity From(QuantityValue value, ElectricChargeDensityUnit fromUnit) + public static ElectricChargeDensity From(double value, ElectricChargeDensityUnit fromUnit) { - return new ElectricChargeDensity((double)value, fromUnit); + return new ElectricChargeDensity(value, fromUnit); } #endregion @@ -649,15 +648,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is ElectricChargeDensityUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ElectricChargeDensityUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is ElectricChargeDensityUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ElectricChargeDensityUnit)} is supported.", nameof(unit)); @@ -772,18 +762,6 @@ public ElectricChargeDensity ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not ElectricChargeDensityUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ElectricChargeDensityUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricConductance.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricConductance.g.cs index d878b4172f..604f0d51f8 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricConductance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricConductance.g.cs @@ -40,7 +40,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct ElectricConductance : - IArithmeticQuantity, + IArithmeticQuantity, IComparable, IComparable, IConvertible, @@ -154,7 +154,7 @@ public ElectricConductance(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -256,9 +256,8 @@ public static string GetAbbreviation(ElectricConductanceUnit unit, IFormatProvid /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricConductance FromKilosiemens(QuantityValue kilosiemens) + public static ElectricConductance FromKilosiemens(double value) { - double value = (double) kilosiemens; return new ElectricConductance(value, ElectricConductanceUnit.Kilosiemens); } @@ -266,9 +265,8 @@ public static ElectricConductance FromKilosiemens(QuantityValue kilosiemens) /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricConductance FromMicrosiemens(QuantityValue microsiemens) + public static ElectricConductance FromMicrosiemens(double value) { - double value = (double) microsiemens; return new ElectricConductance(value, ElectricConductanceUnit.Microsiemens); } @@ -276,9 +274,8 @@ public static ElectricConductance FromMicrosiemens(QuantityValue microsiemens) /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricConductance FromMillisiemens(QuantityValue millisiemens) + public static ElectricConductance FromMillisiemens(double value) { - double value = (double) millisiemens; return new ElectricConductance(value, ElectricConductanceUnit.Millisiemens); } @@ -286,9 +283,8 @@ public static ElectricConductance FromMillisiemens(QuantityValue millisiemens) /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricConductance FromNanosiemens(QuantityValue nanosiemens) + public static ElectricConductance FromNanosiemens(double value) { - double value = (double) nanosiemens; return new ElectricConductance(value, ElectricConductanceUnit.Nanosiemens); } @@ -296,9 +292,8 @@ public static ElectricConductance FromNanosiemens(QuantityValue nanosiemens) /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricConductance FromSiemens(QuantityValue siemens) + public static ElectricConductance FromSiemens(double value) { - double value = (double) siemens; return new ElectricConductance(value, ElectricConductanceUnit.Siemens); } @@ -308,9 +303,9 @@ public static ElectricConductance FromSiemens(QuantityValue siemens) /// Value to convert from. /// Unit to convert from. /// ElectricConductance unit value. - public static ElectricConductance From(QuantityValue value, ElectricConductanceUnit fromUnit) + public static ElectricConductance From(double value, ElectricConductanceUnit fromUnit) { - return new ElectricConductance((double)value, fromUnit); + return new ElectricConductance(value, fromUnit); } #endregion @@ -721,15 +716,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is ElectricConductanceUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ElectricConductanceUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is ElectricConductanceUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ElectricConductanceUnit)} is supported.", nameof(unit)); @@ -852,18 +838,6 @@ public ElectricConductance ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not ElectricConductanceUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ElectricConductanceUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.g.cs index d219a0ad7a..3ce5967489 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.g.cs @@ -40,7 +40,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct ElectricConductivity : - IArithmeticQuantity, + IArithmeticQuantity, IComparable, IComparable, IConvertible, @@ -155,7 +155,7 @@ public ElectricConductivity(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -264,9 +264,8 @@ public static string GetAbbreviation(ElectricConductivityUnit unit, IFormatProvi /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricConductivity FromMicrosiemensPerCentimeter(QuantityValue microsiemenspercentimeter) + public static ElectricConductivity FromMicrosiemensPerCentimeter(double value) { - double value = (double) microsiemenspercentimeter; return new ElectricConductivity(value, ElectricConductivityUnit.MicrosiemensPerCentimeter); } @@ -274,9 +273,8 @@ public static ElectricConductivity FromMicrosiemensPerCentimeter(QuantityValue m /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricConductivity FromMillisiemensPerCentimeter(QuantityValue millisiemenspercentimeter) + public static ElectricConductivity FromMillisiemensPerCentimeter(double value) { - double value = (double) millisiemenspercentimeter; return new ElectricConductivity(value, ElectricConductivityUnit.MillisiemensPerCentimeter); } @@ -284,9 +282,8 @@ public static ElectricConductivity FromMillisiemensPerCentimeter(QuantityValue m /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricConductivity FromSiemensPerCentimeter(QuantityValue siemenspercentimeter) + public static ElectricConductivity FromSiemensPerCentimeter(double value) { - double value = (double) siemenspercentimeter; return new ElectricConductivity(value, ElectricConductivityUnit.SiemensPerCentimeter); } @@ -294,9 +291,8 @@ public static ElectricConductivity FromSiemensPerCentimeter(QuantityValue siemen /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricConductivity FromSiemensPerFoot(QuantityValue siemensperfoot) + public static ElectricConductivity FromSiemensPerFoot(double value) { - double value = (double) siemensperfoot; return new ElectricConductivity(value, ElectricConductivityUnit.SiemensPerFoot); } @@ -304,9 +300,8 @@ public static ElectricConductivity FromSiemensPerFoot(QuantityValue siemensperfo /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricConductivity FromSiemensPerInch(QuantityValue siemensperinch) + public static ElectricConductivity FromSiemensPerInch(double value) { - double value = (double) siemensperinch; return new ElectricConductivity(value, ElectricConductivityUnit.SiemensPerInch); } @@ -314,9 +309,8 @@ public static ElectricConductivity FromSiemensPerInch(QuantityValue siemensperin /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricConductivity FromSiemensPerMeter(QuantityValue siemenspermeter) + public static ElectricConductivity FromSiemensPerMeter(double value) { - double value = (double) siemenspermeter; return new ElectricConductivity(value, ElectricConductivityUnit.SiemensPerMeter); } @@ -326,9 +320,9 @@ public static ElectricConductivity FromSiemensPerMeter(QuantityValue siemensperm /// Value to convert from. /// Unit to convert from. /// ElectricConductivity unit value. - public static ElectricConductivity From(QuantityValue value, ElectricConductivityUnit fromUnit) + public static ElectricConductivity From(double value, ElectricConductivityUnit fromUnit) { - return new ElectricConductivity((double)value, fromUnit); + return new ElectricConductivity(value, fromUnit); } #endregion @@ -750,15 +744,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is ElectricConductivityUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ElectricConductivityUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is ElectricConductivityUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ElectricConductivityUnit)} is supported.", nameof(unit)); @@ -883,18 +868,6 @@ public ElectricConductivity ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not ElectricConductivityUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ElectricConductivityUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.g.cs index c54ddcf125..abc2e5d080 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.g.cs @@ -40,7 +40,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct ElectricCurrent : - IArithmeticQuantity, + IArithmeticQuantity, #if NET7_0_OR_GREATER IMultiplyOperators, IMultiplyOperators, @@ -166,7 +166,7 @@ public ElectricCurrent(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -296,9 +296,8 @@ public static string GetAbbreviation(ElectricCurrentUnit unit, IFormatProvider? /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCurrent FromAmperes(QuantityValue amperes) + public static ElectricCurrent FromAmperes(double value) { - double value = (double) amperes; return new ElectricCurrent(value, ElectricCurrentUnit.Ampere); } @@ -306,9 +305,8 @@ public static ElectricCurrent FromAmperes(QuantityValue amperes) /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCurrent FromCentiamperes(QuantityValue centiamperes) + public static ElectricCurrent FromCentiamperes(double value) { - double value = (double) centiamperes; return new ElectricCurrent(value, ElectricCurrentUnit.Centiampere); } @@ -316,9 +314,8 @@ public static ElectricCurrent FromCentiamperes(QuantityValue centiamperes) /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCurrent FromFemtoamperes(QuantityValue femtoamperes) + public static ElectricCurrent FromFemtoamperes(double value) { - double value = (double) femtoamperes; return new ElectricCurrent(value, ElectricCurrentUnit.Femtoampere); } @@ -326,9 +323,8 @@ public static ElectricCurrent FromFemtoamperes(QuantityValue femtoamperes) /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCurrent FromKiloamperes(QuantityValue kiloamperes) + public static ElectricCurrent FromKiloamperes(double value) { - double value = (double) kiloamperes; return new ElectricCurrent(value, ElectricCurrentUnit.Kiloampere); } @@ -336,9 +332,8 @@ public static ElectricCurrent FromKiloamperes(QuantityValue kiloamperes) /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCurrent FromMegaamperes(QuantityValue megaamperes) + public static ElectricCurrent FromMegaamperes(double value) { - double value = (double) megaamperes; return new ElectricCurrent(value, ElectricCurrentUnit.Megaampere); } @@ -346,9 +341,8 @@ public static ElectricCurrent FromMegaamperes(QuantityValue megaamperes) /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCurrent FromMicroamperes(QuantityValue microamperes) + public static ElectricCurrent FromMicroamperes(double value) { - double value = (double) microamperes; return new ElectricCurrent(value, ElectricCurrentUnit.Microampere); } @@ -356,9 +350,8 @@ public static ElectricCurrent FromMicroamperes(QuantityValue microamperes) /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCurrent FromMilliamperes(QuantityValue milliamperes) + public static ElectricCurrent FromMilliamperes(double value) { - double value = (double) milliamperes; return new ElectricCurrent(value, ElectricCurrentUnit.Milliampere); } @@ -366,9 +359,8 @@ public static ElectricCurrent FromMilliamperes(QuantityValue milliamperes) /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCurrent FromNanoamperes(QuantityValue nanoamperes) + public static ElectricCurrent FromNanoamperes(double value) { - double value = (double) nanoamperes; return new ElectricCurrent(value, ElectricCurrentUnit.Nanoampere); } @@ -376,9 +368,8 @@ public static ElectricCurrent FromNanoamperes(QuantityValue nanoamperes) /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCurrent FromPicoamperes(QuantityValue picoamperes) + public static ElectricCurrent FromPicoamperes(double value) { - double value = (double) picoamperes; return new ElectricCurrent(value, ElectricCurrentUnit.Picoampere); } @@ -388,9 +379,9 @@ public static ElectricCurrent FromPicoamperes(QuantityValue picoamperes) /// Value to convert from. /// Unit to convert from. /// ElectricCurrent unit value. - public static ElectricCurrent From(QuantityValue value, ElectricCurrentUnit fromUnit) + public static ElectricCurrent From(double value, ElectricCurrentUnit fromUnit) { - return new ElectricCurrent((double)value, fromUnit); + return new ElectricCurrent(value, fromUnit); } #endregion @@ -847,15 +838,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is ElectricCurrentUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ElectricCurrentUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is ElectricCurrentUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ElectricCurrentUnit)} is supported.", nameof(unit)); @@ -986,18 +968,6 @@ public ElectricCurrent ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not ElectricCurrentUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ElectricCurrentUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.g.cs index bcb73e7de5..ba7c9b30f2 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.g.cs @@ -40,7 +40,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct ElectricCurrentDensity : - IArithmeticQuantity, + IArithmeticQuantity, IComparable, IComparable, IConvertible, @@ -152,7 +152,7 @@ public ElectricCurrentDensity(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -240,9 +240,8 @@ public static string GetAbbreviation(ElectricCurrentDensityUnit unit, IFormatPro /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCurrentDensity FromAmperesPerSquareFoot(QuantityValue amperespersquarefoot) + public static ElectricCurrentDensity FromAmperesPerSquareFoot(double value) { - double value = (double) amperespersquarefoot; return new ElectricCurrentDensity(value, ElectricCurrentDensityUnit.AmperePerSquareFoot); } @@ -250,9 +249,8 @@ public static ElectricCurrentDensity FromAmperesPerSquareFoot(QuantityValue ampe /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCurrentDensity FromAmperesPerSquareInch(QuantityValue amperespersquareinch) + public static ElectricCurrentDensity FromAmperesPerSquareInch(double value) { - double value = (double) amperespersquareinch; return new ElectricCurrentDensity(value, ElectricCurrentDensityUnit.AmperePerSquareInch); } @@ -260,9 +258,8 @@ public static ElectricCurrentDensity FromAmperesPerSquareInch(QuantityValue ampe /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCurrentDensity FromAmperesPerSquareMeter(QuantityValue amperespersquaremeter) + public static ElectricCurrentDensity FromAmperesPerSquareMeter(double value) { - double value = (double) amperespersquaremeter; return new ElectricCurrentDensity(value, ElectricCurrentDensityUnit.AmperePerSquareMeter); } @@ -272,9 +269,9 @@ public static ElectricCurrentDensity FromAmperesPerSquareMeter(QuantityValue amp /// Value to convert from. /// Unit to convert from. /// ElectricCurrentDensity unit value. - public static ElectricCurrentDensity From(QuantityValue value, ElectricCurrentDensityUnit fromUnit) + public static ElectricCurrentDensity From(double value, ElectricCurrentDensityUnit fromUnit) { - return new ElectricCurrentDensity((double)value, fromUnit); + return new ElectricCurrentDensity(value, fromUnit); } #endregion @@ -685,15 +682,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is ElectricCurrentDensityUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ElectricCurrentDensityUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is ElectricCurrentDensityUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ElectricCurrentDensityUnit)} is supported.", nameof(unit)); @@ -812,18 +800,6 @@ public ElectricCurrentDensity ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not ElectricCurrentDensityUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ElectricCurrentDensityUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.g.cs index 6683af5fd6..ee47836741 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.g.cs @@ -40,7 +40,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct ElectricCurrentGradient : - IArithmeticQuantity, + IArithmeticQuantity, #if NET7_0_OR_GREATER IMultiplyOperators, IMultiplyOperators, @@ -160,7 +160,7 @@ public ElectricCurrentGradient(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -276,9 +276,8 @@ public static string GetAbbreviation(ElectricCurrentGradientUnit unit, IFormatPr /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCurrentGradient FromAmperesPerMicrosecond(QuantityValue amperespermicrosecond) + public static ElectricCurrentGradient FromAmperesPerMicrosecond(double value) { - double value = (double) amperespermicrosecond; return new ElectricCurrentGradient(value, ElectricCurrentGradientUnit.AmperePerMicrosecond); } @@ -286,9 +285,8 @@ public static ElectricCurrentGradient FromAmperesPerMicrosecond(QuantityValue am /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCurrentGradient FromAmperesPerMillisecond(QuantityValue amperespermillisecond) + public static ElectricCurrentGradient FromAmperesPerMillisecond(double value) { - double value = (double) amperespermillisecond; return new ElectricCurrentGradient(value, ElectricCurrentGradientUnit.AmperePerMillisecond); } @@ -296,9 +294,8 @@ public static ElectricCurrentGradient FromAmperesPerMillisecond(QuantityValue am /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCurrentGradient FromAmperesPerMinute(QuantityValue amperesperminute) + public static ElectricCurrentGradient FromAmperesPerMinute(double value) { - double value = (double) amperesperminute; return new ElectricCurrentGradient(value, ElectricCurrentGradientUnit.AmperePerMinute); } @@ -306,9 +303,8 @@ public static ElectricCurrentGradient FromAmperesPerMinute(QuantityValue amperes /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCurrentGradient FromAmperesPerNanosecond(QuantityValue amperespernanosecond) + public static ElectricCurrentGradient FromAmperesPerNanosecond(double value) { - double value = (double) amperespernanosecond; return new ElectricCurrentGradient(value, ElectricCurrentGradientUnit.AmperePerNanosecond); } @@ -316,9 +312,8 @@ public static ElectricCurrentGradient FromAmperesPerNanosecond(QuantityValue amp /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCurrentGradient FromAmperesPerSecond(QuantityValue amperespersecond) + public static ElectricCurrentGradient FromAmperesPerSecond(double value) { - double value = (double) amperespersecond; return new ElectricCurrentGradient(value, ElectricCurrentGradientUnit.AmperePerSecond); } @@ -326,9 +321,8 @@ public static ElectricCurrentGradient FromAmperesPerSecond(QuantityValue amperes /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCurrentGradient FromMilliamperesPerMinute(QuantityValue milliamperesperminute) + public static ElectricCurrentGradient FromMilliamperesPerMinute(double value) { - double value = (double) milliamperesperminute; return new ElectricCurrentGradient(value, ElectricCurrentGradientUnit.MilliamperePerMinute); } @@ -336,9 +330,8 @@ public static ElectricCurrentGradient FromMilliamperesPerMinute(QuantityValue mi /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCurrentGradient FromMilliamperesPerSecond(QuantityValue milliamperespersecond) + public static ElectricCurrentGradient FromMilliamperesPerSecond(double value) { - double value = (double) milliamperespersecond; return new ElectricCurrentGradient(value, ElectricCurrentGradientUnit.MilliamperePerSecond); } @@ -348,9 +341,9 @@ public static ElectricCurrentGradient FromMilliamperesPerSecond(QuantityValue mi /// Value to convert from. /// Unit to convert from. /// ElectricCurrentGradient unit value. - public static ElectricCurrentGradient From(QuantityValue value, ElectricCurrentGradientUnit fromUnit) + public static ElectricCurrentGradient From(double value, ElectricCurrentGradientUnit fromUnit) { - return new ElectricCurrentGradient((double)value, fromUnit); + return new ElectricCurrentGradient(value, fromUnit); } #endregion @@ -783,15 +776,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is ElectricCurrentGradientUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ElectricCurrentGradientUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is ElectricCurrentGradientUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ElectricCurrentGradientUnit)} is supported.", nameof(unit)); @@ -918,18 +902,6 @@ public ElectricCurrentGradient ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not ElectricCurrentGradientUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ElectricCurrentGradientUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricField.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricField.g.cs index e45c3a2be9..bc2c96547d 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricField.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricField.g.cs @@ -40,7 +40,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct ElectricField : - IArithmeticQuantity, + IArithmeticQuantity, IComparable, IComparable, IConvertible, @@ -150,7 +150,7 @@ public ElectricField(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -224,9 +224,8 @@ public static string GetAbbreviation(ElectricFieldUnit unit, IFormatProvider? pr /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricField FromVoltsPerMeter(QuantityValue voltspermeter) + public static ElectricField FromVoltsPerMeter(double value) { - double value = (double) voltspermeter; return new ElectricField(value, ElectricFieldUnit.VoltPerMeter); } @@ -236,9 +235,9 @@ public static ElectricField FromVoltsPerMeter(QuantityValue voltspermeter) /// Value to convert from. /// Unit to convert from. /// ElectricField unit value. - public static ElectricField From(QuantityValue value, ElectricFieldUnit fromUnit) + public static ElectricField From(double value, ElectricFieldUnit fromUnit) { - return new ElectricField((double)value, fromUnit); + return new ElectricField(value, fromUnit); } #endregion @@ -649,15 +648,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is ElectricFieldUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ElectricFieldUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is ElectricFieldUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ElectricFieldUnit)} is supported.", nameof(unit)); @@ -772,18 +762,6 @@ public ElectricField ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not ElectricFieldUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ElectricFieldUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricInductance.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricInductance.g.cs index 3d95a66431..8e9965dfd1 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricInductance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricInductance.g.cs @@ -40,7 +40,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct ElectricInductance : - IArithmeticQuantity, + IArithmeticQuantity, IComparable, IComparable, IConvertible, @@ -154,7 +154,7 @@ public ElectricInductance(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -256,9 +256,8 @@ public static string GetAbbreviation(ElectricInductanceUnit unit, IFormatProvide /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricInductance FromHenries(QuantityValue henries) + public static ElectricInductance FromHenries(double value) { - double value = (double) henries; return new ElectricInductance(value, ElectricInductanceUnit.Henry); } @@ -266,9 +265,8 @@ public static ElectricInductance FromHenries(QuantityValue henries) /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricInductance FromMicrohenries(QuantityValue microhenries) + public static ElectricInductance FromMicrohenries(double value) { - double value = (double) microhenries; return new ElectricInductance(value, ElectricInductanceUnit.Microhenry); } @@ -276,9 +274,8 @@ public static ElectricInductance FromMicrohenries(QuantityValue microhenries) /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricInductance FromMillihenries(QuantityValue millihenries) + public static ElectricInductance FromMillihenries(double value) { - double value = (double) millihenries; return new ElectricInductance(value, ElectricInductanceUnit.Millihenry); } @@ -286,9 +283,8 @@ public static ElectricInductance FromMillihenries(QuantityValue millihenries) /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricInductance FromNanohenries(QuantityValue nanohenries) + public static ElectricInductance FromNanohenries(double value) { - double value = (double) nanohenries; return new ElectricInductance(value, ElectricInductanceUnit.Nanohenry); } @@ -296,9 +292,8 @@ public static ElectricInductance FromNanohenries(QuantityValue nanohenries) /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricInductance FromPicohenries(QuantityValue picohenries) + public static ElectricInductance FromPicohenries(double value) { - double value = (double) picohenries; return new ElectricInductance(value, ElectricInductanceUnit.Picohenry); } @@ -308,9 +303,9 @@ public static ElectricInductance FromPicohenries(QuantityValue picohenries) /// Value to convert from. /// Unit to convert from. /// ElectricInductance unit value. - public static ElectricInductance From(QuantityValue value, ElectricInductanceUnit fromUnit) + public static ElectricInductance From(double value, ElectricInductanceUnit fromUnit) { - return new ElectricInductance((double)value, fromUnit); + return new ElectricInductance(value, fromUnit); } #endregion @@ -721,15 +716,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is ElectricInductanceUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ElectricInductanceUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is ElectricInductanceUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ElectricInductanceUnit)} is supported.", nameof(unit)); @@ -852,18 +838,6 @@ public ElectricInductance ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not ElectricInductanceUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ElectricInductanceUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotential.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotential.g.cs index d91a44ff8a..4a7d20dedf 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotential.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotential.g.cs @@ -40,7 +40,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct ElectricPotential : - IArithmeticQuantity, + IArithmeticQuantity, #if NET7_0_OR_GREATER IDivisionOperators, IDivisionOperators, @@ -161,7 +161,7 @@ public ElectricPotential(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -270,9 +270,8 @@ public static string GetAbbreviation(ElectricPotentialUnit unit, IFormatProvider /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotential FromKilovolts(QuantityValue kilovolts) + public static ElectricPotential FromKilovolts(double value) { - double value = (double) kilovolts; return new ElectricPotential(value, ElectricPotentialUnit.Kilovolt); } @@ -280,9 +279,8 @@ public static ElectricPotential FromKilovolts(QuantityValue kilovolts) /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotential FromMegavolts(QuantityValue megavolts) + public static ElectricPotential FromMegavolts(double value) { - double value = (double) megavolts; return new ElectricPotential(value, ElectricPotentialUnit.Megavolt); } @@ -290,9 +288,8 @@ public static ElectricPotential FromMegavolts(QuantityValue megavolts) /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotential FromMicrovolts(QuantityValue microvolts) + public static ElectricPotential FromMicrovolts(double value) { - double value = (double) microvolts; return new ElectricPotential(value, ElectricPotentialUnit.Microvolt); } @@ -300,9 +297,8 @@ public static ElectricPotential FromMicrovolts(QuantityValue microvolts) /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotential FromMillivolts(QuantityValue millivolts) + public static ElectricPotential FromMillivolts(double value) { - double value = (double) millivolts; return new ElectricPotential(value, ElectricPotentialUnit.Millivolt); } @@ -310,9 +306,8 @@ public static ElectricPotential FromMillivolts(QuantityValue millivolts) /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotential FromNanovolts(QuantityValue nanovolts) + public static ElectricPotential FromNanovolts(double value) { - double value = (double) nanovolts; return new ElectricPotential(value, ElectricPotentialUnit.Nanovolt); } @@ -320,9 +315,8 @@ public static ElectricPotential FromNanovolts(QuantityValue nanovolts) /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotential FromVolts(QuantityValue volts) + public static ElectricPotential FromVolts(double value) { - double value = (double) volts; return new ElectricPotential(value, ElectricPotentialUnit.Volt); } @@ -332,9 +326,9 @@ public static ElectricPotential FromVolts(QuantityValue volts) /// Value to convert from. /// Unit to convert from. /// ElectricPotential unit value. - public static ElectricPotential From(QuantityValue value, ElectricPotentialUnit fromUnit) + public static ElectricPotential From(double value, ElectricPotentialUnit fromUnit) { - return new ElectricPotential((double)value, fromUnit); + return new ElectricPotential(value, fromUnit); } #endregion @@ -773,15 +767,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is ElectricPotentialUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ElectricPotentialUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is ElectricPotentialUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ElectricPotentialUnit)} is supported.", nameof(unit)); @@ -906,18 +891,6 @@ public ElectricPotential ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not ElectricPotentialUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ElectricPotentialUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.g.cs index 1570d3641f..fd93ea730f 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.g.cs @@ -37,7 +37,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct ElectricPotentialAc : - IArithmeticQuantity, + IArithmeticQuantity, IComparable, IComparable, IConvertible, @@ -151,7 +151,7 @@ public ElectricPotentialAc(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -253,9 +253,8 @@ public static string GetAbbreviation(ElectricPotentialAcUnit unit, IFormatProvid /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialAc FromKilovoltsAc(QuantityValue kilovoltsac) + public static ElectricPotentialAc FromKilovoltsAc(double value) { - double value = (double) kilovoltsac; return new ElectricPotentialAc(value, ElectricPotentialAcUnit.KilovoltAc); } @@ -263,9 +262,8 @@ public static ElectricPotentialAc FromKilovoltsAc(QuantityValue kilovoltsac) /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialAc FromMegavoltsAc(QuantityValue megavoltsac) + public static ElectricPotentialAc FromMegavoltsAc(double value) { - double value = (double) megavoltsac; return new ElectricPotentialAc(value, ElectricPotentialAcUnit.MegavoltAc); } @@ -273,9 +271,8 @@ public static ElectricPotentialAc FromMegavoltsAc(QuantityValue megavoltsac) /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialAc FromMicrovoltsAc(QuantityValue microvoltsac) + public static ElectricPotentialAc FromMicrovoltsAc(double value) { - double value = (double) microvoltsac; return new ElectricPotentialAc(value, ElectricPotentialAcUnit.MicrovoltAc); } @@ -283,9 +280,8 @@ public static ElectricPotentialAc FromMicrovoltsAc(QuantityValue microvoltsac) /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialAc FromMillivoltsAc(QuantityValue millivoltsac) + public static ElectricPotentialAc FromMillivoltsAc(double value) { - double value = (double) millivoltsac; return new ElectricPotentialAc(value, ElectricPotentialAcUnit.MillivoltAc); } @@ -293,9 +289,8 @@ public static ElectricPotentialAc FromMillivoltsAc(QuantityValue millivoltsac) /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialAc FromVoltsAc(QuantityValue voltsac) + public static ElectricPotentialAc FromVoltsAc(double value) { - double value = (double) voltsac; return new ElectricPotentialAc(value, ElectricPotentialAcUnit.VoltAc); } @@ -305,9 +300,9 @@ public static ElectricPotentialAc FromVoltsAc(QuantityValue voltsac) /// Value to convert from. /// Unit to convert from. /// ElectricPotentialAc unit value. - public static ElectricPotentialAc From(QuantityValue value, ElectricPotentialAcUnit fromUnit) + public static ElectricPotentialAc From(double value, ElectricPotentialAcUnit fromUnit) { - return new ElectricPotentialAc((double)value, fromUnit); + return new ElectricPotentialAc(value, fromUnit); } #endregion @@ -718,15 +713,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is ElectricPotentialAcUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ElectricPotentialAcUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is ElectricPotentialAcUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ElectricPotentialAcUnit)} is supported.", nameof(unit)); @@ -849,18 +835,6 @@ public ElectricPotentialAc ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not ElectricPotentialAcUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ElectricPotentialAcUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialChangeRate.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialChangeRate.g.cs index dad55ac038..b6784e0d4f 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialChangeRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialChangeRate.g.cs @@ -37,7 +37,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct ElectricPotentialChangeRate : - IArithmeticQuantity, + IArithmeticQuantity, IComparable, IComparable, IConvertible, @@ -166,7 +166,7 @@ public ElectricPotentialChangeRate(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -373,9 +373,8 @@ public static string GetAbbreviation(ElectricPotentialChangeRateUnit unit, IForm /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialChangeRate FromKilovoltsPerHour(QuantityValue kilovoltsperhour) + public static ElectricPotentialChangeRate FromKilovoltsPerHour(double value) { - double value = (double) kilovoltsperhour; return new ElectricPotentialChangeRate(value, ElectricPotentialChangeRateUnit.KilovoltPerHour); } @@ -383,9 +382,8 @@ public static ElectricPotentialChangeRate FromKilovoltsPerHour(QuantityValue kil /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialChangeRate FromKilovoltsPerMicrosecond(QuantityValue kilovoltspermicrosecond) + public static ElectricPotentialChangeRate FromKilovoltsPerMicrosecond(double value) { - double value = (double) kilovoltspermicrosecond; return new ElectricPotentialChangeRate(value, ElectricPotentialChangeRateUnit.KilovoltPerMicrosecond); } @@ -393,9 +391,8 @@ public static ElectricPotentialChangeRate FromKilovoltsPerMicrosecond(QuantityVa /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialChangeRate FromKilovoltsPerMinute(QuantityValue kilovoltsperminute) + public static ElectricPotentialChangeRate FromKilovoltsPerMinute(double value) { - double value = (double) kilovoltsperminute; return new ElectricPotentialChangeRate(value, ElectricPotentialChangeRateUnit.KilovoltPerMinute); } @@ -403,9 +400,8 @@ public static ElectricPotentialChangeRate FromKilovoltsPerMinute(QuantityValue k /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialChangeRate FromKilovoltsPerSecond(QuantityValue kilovoltspersecond) + public static ElectricPotentialChangeRate FromKilovoltsPerSecond(double value) { - double value = (double) kilovoltspersecond; return new ElectricPotentialChangeRate(value, ElectricPotentialChangeRateUnit.KilovoltPerSecond); } @@ -413,9 +409,8 @@ public static ElectricPotentialChangeRate FromKilovoltsPerSecond(QuantityValue k /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialChangeRate FromMegavoltsPerHour(QuantityValue megavoltsperhour) + public static ElectricPotentialChangeRate FromMegavoltsPerHour(double value) { - double value = (double) megavoltsperhour; return new ElectricPotentialChangeRate(value, ElectricPotentialChangeRateUnit.MegavoltPerHour); } @@ -423,9 +418,8 @@ public static ElectricPotentialChangeRate FromMegavoltsPerHour(QuantityValue meg /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialChangeRate FromMegavoltsPerMicrosecond(QuantityValue megavoltspermicrosecond) + public static ElectricPotentialChangeRate FromMegavoltsPerMicrosecond(double value) { - double value = (double) megavoltspermicrosecond; return new ElectricPotentialChangeRate(value, ElectricPotentialChangeRateUnit.MegavoltPerMicrosecond); } @@ -433,9 +427,8 @@ public static ElectricPotentialChangeRate FromMegavoltsPerMicrosecond(QuantityVa /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialChangeRate FromMegavoltsPerMinute(QuantityValue megavoltsperminute) + public static ElectricPotentialChangeRate FromMegavoltsPerMinute(double value) { - double value = (double) megavoltsperminute; return new ElectricPotentialChangeRate(value, ElectricPotentialChangeRateUnit.MegavoltPerMinute); } @@ -443,9 +436,8 @@ public static ElectricPotentialChangeRate FromMegavoltsPerMinute(QuantityValue m /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialChangeRate FromMegavoltsPerSecond(QuantityValue megavoltspersecond) + public static ElectricPotentialChangeRate FromMegavoltsPerSecond(double value) { - double value = (double) megavoltspersecond; return new ElectricPotentialChangeRate(value, ElectricPotentialChangeRateUnit.MegavoltPerSecond); } @@ -453,9 +445,8 @@ public static ElectricPotentialChangeRate FromMegavoltsPerSecond(QuantityValue m /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialChangeRate FromMicrovoltsPerHour(QuantityValue microvoltsperhour) + public static ElectricPotentialChangeRate FromMicrovoltsPerHour(double value) { - double value = (double) microvoltsperhour; return new ElectricPotentialChangeRate(value, ElectricPotentialChangeRateUnit.MicrovoltPerHour); } @@ -463,9 +454,8 @@ public static ElectricPotentialChangeRate FromMicrovoltsPerHour(QuantityValue mi /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialChangeRate FromMicrovoltsPerMicrosecond(QuantityValue microvoltspermicrosecond) + public static ElectricPotentialChangeRate FromMicrovoltsPerMicrosecond(double value) { - double value = (double) microvoltspermicrosecond; return new ElectricPotentialChangeRate(value, ElectricPotentialChangeRateUnit.MicrovoltPerMicrosecond); } @@ -473,9 +463,8 @@ public static ElectricPotentialChangeRate FromMicrovoltsPerMicrosecond(QuantityV /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialChangeRate FromMicrovoltsPerMinute(QuantityValue microvoltsperminute) + public static ElectricPotentialChangeRate FromMicrovoltsPerMinute(double value) { - double value = (double) microvoltsperminute; return new ElectricPotentialChangeRate(value, ElectricPotentialChangeRateUnit.MicrovoltPerMinute); } @@ -483,9 +472,8 @@ public static ElectricPotentialChangeRate FromMicrovoltsPerMinute(QuantityValue /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialChangeRate FromMicrovoltsPerSecond(QuantityValue microvoltspersecond) + public static ElectricPotentialChangeRate FromMicrovoltsPerSecond(double value) { - double value = (double) microvoltspersecond; return new ElectricPotentialChangeRate(value, ElectricPotentialChangeRateUnit.MicrovoltPerSecond); } @@ -493,9 +481,8 @@ public static ElectricPotentialChangeRate FromMicrovoltsPerSecond(QuantityValue /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialChangeRate FromMillivoltsPerHour(QuantityValue millivoltsperhour) + public static ElectricPotentialChangeRate FromMillivoltsPerHour(double value) { - double value = (double) millivoltsperhour; return new ElectricPotentialChangeRate(value, ElectricPotentialChangeRateUnit.MillivoltPerHour); } @@ -503,9 +490,8 @@ public static ElectricPotentialChangeRate FromMillivoltsPerHour(QuantityValue mi /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialChangeRate FromMillivoltsPerMicrosecond(QuantityValue millivoltspermicrosecond) + public static ElectricPotentialChangeRate FromMillivoltsPerMicrosecond(double value) { - double value = (double) millivoltspermicrosecond; return new ElectricPotentialChangeRate(value, ElectricPotentialChangeRateUnit.MillivoltPerMicrosecond); } @@ -513,9 +499,8 @@ public static ElectricPotentialChangeRate FromMillivoltsPerMicrosecond(QuantityV /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialChangeRate FromMillivoltsPerMinute(QuantityValue millivoltsperminute) + public static ElectricPotentialChangeRate FromMillivoltsPerMinute(double value) { - double value = (double) millivoltsperminute; return new ElectricPotentialChangeRate(value, ElectricPotentialChangeRateUnit.MillivoltPerMinute); } @@ -523,9 +508,8 @@ public static ElectricPotentialChangeRate FromMillivoltsPerMinute(QuantityValue /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialChangeRate FromMillivoltsPerSecond(QuantityValue millivoltspersecond) + public static ElectricPotentialChangeRate FromMillivoltsPerSecond(double value) { - double value = (double) millivoltspersecond; return new ElectricPotentialChangeRate(value, ElectricPotentialChangeRateUnit.MillivoltPerSecond); } @@ -533,9 +517,8 @@ public static ElectricPotentialChangeRate FromMillivoltsPerSecond(QuantityValue /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialChangeRate FromVoltsPerHour(QuantityValue voltsperhour) + public static ElectricPotentialChangeRate FromVoltsPerHour(double value) { - double value = (double) voltsperhour; return new ElectricPotentialChangeRate(value, ElectricPotentialChangeRateUnit.VoltPerHour); } @@ -543,9 +526,8 @@ public static ElectricPotentialChangeRate FromVoltsPerHour(QuantityValue voltspe /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialChangeRate FromVoltsPerMicrosecond(QuantityValue voltspermicrosecond) + public static ElectricPotentialChangeRate FromVoltsPerMicrosecond(double value) { - double value = (double) voltspermicrosecond; return new ElectricPotentialChangeRate(value, ElectricPotentialChangeRateUnit.VoltPerMicrosecond); } @@ -553,9 +535,8 @@ public static ElectricPotentialChangeRate FromVoltsPerMicrosecond(QuantityValue /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialChangeRate FromVoltsPerMinute(QuantityValue voltsperminute) + public static ElectricPotentialChangeRate FromVoltsPerMinute(double value) { - double value = (double) voltsperminute; return new ElectricPotentialChangeRate(value, ElectricPotentialChangeRateUnit.VoltPerMinute); } @@ -563,9 +544,8 @@ public static ElectricPotentialChangeRate FromVoltsPerMinute(QuantityValue volts /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialChangeRate FromVoltsPerSecond(QuantityValue voltspersecond) + public static ElectricPotentialChangeRate FromVoltsPerSecond(double value) { - double value = (double) voltspersecond; return new ElectricPotentialChangeRate(value, ElectricPotentialChangeRateUnit.VoltPerSecond); } @@ -575,9 +555,9 @@ public static ElectricPotentialChangeRate FromVoltsPerSecond(QuantityValue volts /// Value to convert from. /// Unit to convert from. /// ElectricPotentialChangeRate unit value. - public static ElectricPotentialChangeRate From(QuantityValue value, ElectricPotentialChangeRateUnit fromUnit) + public static ElectricPotentialChangeRate From(double value, ElectricPotentialChangeRateUnit fromUnit) { - return new ElectricPotentialChangeRate((double)value, fromUnit); + return new ElectricPotentialChangeRate(value, fromUnit); } #endregion @@ -988,15 +968,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is ElectricPotentialChangeRateUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ElectricPotentialChangeRateUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is ElectricPotentialChangeRateUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ElectricPotentialChangeRateUnit)} is supported.", nameof(unit)); @@ -1149,18 +1120,6 @@ public ElectricPotentialChangeRate ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not ElectricPotentialChangeRateUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ElectricPotentialChangeRateUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.g.cs index 966aa94815..c587100854 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.g.cs @@ -37,7 +37,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct ElectricPotentialDc : - IArithmeticQuantity, + IArithmeticQuantity, IComparable, IComparable, IConvertible, @@ -151,7 +151,7 @@ public ElectricPotentialDc(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -253,9 +253,8 @@ public static string GetAbbreviation(ElectricPotentialDcUnit unit, IFormatProvid /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialDc FromKilovoltsDc(QuantityValue kilovoltsdc) + public static ElectricPotentialDc FromKilovoltsDc(double value) { - double value = (double) kilovoltsdc; return new ElectricPotentialDc(value, ElectricPotentialDcUnit.KilovoltDc); } @@ -263,9 +262,8 @@ public static ElectricPotentialDc FromKilovoltsDc(QuantityValue kilovoltsdc) /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialDc FromMegavoltsDc(QuantityValue megavoltsdc) + public static ElectricPotentialDc FromMegavoltsDc(double value) { - double value = (double) megavoltsdc; return new ElectricPotentialDc(value, ElectricPotentialDcUnit.MegavoltDc); } @@ -273,9 +271,8 @@ public static ElectricPotentialDc FromMegavoltsDc(QuantityValue megavoltsdc) /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialDc FromMicrovoltsDc(QuantityValue microvoltsdc) + public static ElectricPotentialDc FromMicrovoltsDc(double value) { - double value = (double) microvoltsdc; return new ElectricPotentialDc(value, ElectricPotentialDcUnit.MicrovoltDc); } @@ -283,9 +280,8 @@ public static ElectricPotentialDc FromMicrovoltsDc(QuantityValue microvoltsdc) /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialDc FromMillivoltsDc(QuantityValue millivoltsdc) + public static ElectricPotentialDc FromMillivoltsDc(double value) { - double value = (double) millivoltsdc; return new ElectricPotentialDc(value, ElectricPotentialDcUnit.MillivoltDc); } @@ -293,9 +289,8 @@ public static ElectricPotentialDc FromMillivoltsDc(QuantityValue millivoltsdc) /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialDc FromVoltsDc(QuantityValue voltsdc) + public static ElectricPotentialDc FromVoltsDc(double value) { - double value = (double) voltsdc; return new ElectricPotentialDc(value, ElectricPotentialDcUnit.VoltDc); } @@ -305,9 +300,9 @@ public static ElectricPotentialDc FromVoltsDc(QuantityValue voltsdc) /// Value to convert from. /// Unit to convert from. /// ElectricPotentialDc unit value. - public static ElectricPotentialDc From(QuantityValue value, ElectricPotentialDcUnit fromUnit) + public static ElectricPotentialDc From(double value, ElectricPotentialDcUnit fromUnit) { - return new ElectricPotentialDc((double)value, fromUnit); + return new ElectricPotentialDc(value, fromUnit); } #endregion @@ -718,15 +713,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is ElectricPotentialDcUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ElectricPotentialDcUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is ElectricPotentialDcUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ElectricPotentialDcUnit)} is supported.", nameof(unit)); @@ -849,18 +835,6 @@ public ElectricPotentialDc ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not ElectricPotentialDcUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ElectricPotentialDcUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricResistance.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricResistance.g.cs index 3da018408e..1773329f76 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricResistance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricResistance.g.cs @@ -40,7 +40,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct ElectricResistance : - IArithmeticQuantity, + IArithmeticQuantity, #if NET7_0_OR_GREATER IMultiplyOperators, #endif @@ -159,7 +159,7 @@ public ElectricResistance(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -275,9 +275,8 @@ public static string GetAbbreviation(ElectricResistanceUnit unit, IFormatProvide /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricResistance FromGigaohms(QuantityValue gigaohms) + public static ElectricResistance FromGigaohms(double value) { - double value = (double) gigaohms; return new ElectricResistance(value, ElectricResistanceUnit.Gigaohm); } @@ -285,9 +284,8 @@ public static ElectricResistance FromGigaohms(QuantityValue gigaohms) /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricResistance FromKiloohms(QuantityValue kiloohms) + public static ElectricResistance FromKiloohms(double value) { - double value = (double) kiloohms; return new ElectricResistance(value, ElectricResistanceUnit.Kiloohm); } @@ -295,9 +293,8 @@ public static ElectricResistance FromKiloohms(QuantityValue kiloohms) /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricResistance FromMegaohms(QuantityValue megaohms) + public static ElectricResistance FromMegaohms(double value) { - double value = (double) megaohms; return new ElectricResistance(value, ElectricResistanceUnit.Megaohm); } @@ -305,9 +302,8 @@ public static ElectricResistance FromMegaohms(QuantityValue megaohms) /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricResistance FromMicroohms(QuantityValue microohms) + public static ElectricResistance FromMicroohms(double value) { - double value = (double) microohms; return new ElectricResistance(value, ElectricResistanceUnit.Microohm); } @@ -315,9 +311,8 @@ public static ElectricResistance FromMicroohms(QuantityValue microohms) /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricResistance FromMilliohms(QuantityValue milliohms) + public static ElectricResistance FromMilliohms(double value) { - double value = (double) milliohms; return new ElectricResistance(value, ElectricResistanceUnit.Milliohm); } @@ -325,9 +320,8 @@ public static ElectricResistance FromMilliohms(QuantityValue milliohms) /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricResistance FromOhms(QuantityValue ohms) + public static ElectricResistance FromOhms(double value) { - double value = (double) ohms; return new ElectricResistance(value, ElectricResistanceUnit.Ohm); } @@ -335,9 +329,8 @@ public static ElectricResistance FromOhms(QuantityValue ohms) /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricResistance FromTeraohms(QuantityValue teraohms) + public static ElectricResistance FromTeraohms(double value) { - double value = (double) teraohms; return new ElectricResistance(value, ElectricResistanceUnit.Teraohm); } @@ -347,9 +340,9 @@ public static ElectricResistance FromTeraohms(QuantityValue teraohms) /// Value to convert from. /// Unit to convert from. /// ElectricResistance unit value. - public static ElectricResistance From(QuantityValue value, ElectricResistanceUnit fromUnit) + public static ElectricResistance From(double value, ElectricResistanceUnit fromUnit) { - return new ElectricResistance((double)value, fromUnit); + return new ElectricResistance(value, fromUnit); } #endregion @@ -770,15 +763,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is ElectricResistanceUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ElectricResistanceUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is ElectricResistanceUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ElectricResistanceUnit)} is supported.", nameof(unit)); @@ -905,18 +889,6 @@ public ElectricResistance ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not ElectricResistanceUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ElectricResistanceUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.g.cs index 229ecc2f5f..600264c115 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.g.cs @@ -40,7 +40,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct ElectricResistivity : - IArithmeticQuantity, + IArithmeticQuantity, IComparable, IComparable, IConvertible, @@ -163,7 +163,7 @@ public ElectricResistivity(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -328,9 +328,8 @@ public static string GetAbbreviation(ElectricResistivityUnit unit, IFormatProvid /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricResistivity FromKiloohmsCentimeter(QuantityValue kiloohmscentimeter) + public static ElectricResistivity FromKiloohmsCentimeter(double value) { - double value = (double) kiloohmscentimeter; return new ElectricResistivity(value, ElectricResistivityUnit.KiloohmCentimeter); } @@ -338,9 +337,8 @@ public static ElectricResistivity FromKiloohmsCentimeter(QuantityValue kiloohmsc /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricResistivity FromKiloohmMeters(QuantityValue kiloohmmeters) + public static ElectricResistivity FromKiloohmMeters(double value) { - double value = (double) kiloohmmeters; return new ElectricResistivity(value, ElectricResistivityUnit.KiloohmMeter); } @@ -348,9 +346,8 @@ public static ElectricResistivity FromKiloohmMeters(QuantityValue kiloohmmeters) /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricResistivity FromMegaohmsCentimeter(QuantityValue megaohmscentimeter) + public static ElectricResistivity FromMegaohmsCentimeter(double value) { - double value = (double) megaohmscentimeter; return new ElectricResistivity(value, ElectricResistivityUnit.MegaohmCentimeter); } @@ -358,9 +355,8 @@ public static ElectricResistivity FromMegaohmsCentimeter(QuantityValue megaohmsc /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricResistivity FromMegaohmMeters(QuantityValue megaohmmeters) + public static ElectricResistivity FromMegaohmMeters(double value) { - double value = (double) megaohmmeters; return new ElectricResistivity(value, ElectricResistivityUnit.MegaohmMeter); } @@ -368,9 +364,8 @@ public static ElectricResistivity FromMegaohmMeters(QuantityValue megaohmmeters) /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricResistivity FromMicroohmsCentimeter(QuantityValue microohmscentimeter) + public static ElectricResistivity FromMicroohmsCentimeter(double value) { - double value = (double) microohmscentimeter; return new ElectricResistivity(value, ElectricResistivityUnit.MicroohmCentimeter); } @@ -378,9 +373,8 @@ public static ElectricResistivity FromMicroohmsCentimeter(QuantityValue microohm /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricResistivity FromMicroohmMeters(QuantityValue microohmmeters) + public static ElectricResistivity FromMicroohmMeters(double value) { - double value = (double) microohmmeters; return new ElectricResistivity(value, ElectricResistivityUnit.MicroohmMeter); } @@ -388,9 +382,8 @@ public static ElectricResistivity FromMicroohmMeters(QuantityValue microohmmeter /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricResistivity FromMilliohmsCentimeter(QuantityValue milliohmscentimeter) + public static ElectricResistivity FromMilliohmsCentimeter(double value) { - double value = (double) milliohmscentimeter; return new ElectricResistivity(value, ElectricResistivityUnit.MilliohmCentimeter); } @@ -398,9 +391,8 @@ public static ElectricResistivity FromMilliohmsCentimeter(QuantityValue milliohm /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricResistivity FromMilliohmMeters(QuantityValue milliohmmeters) + public static ElectricResistivity FromMilliohmMeters(double value) { - double value = (double) milliohmmeters; return new ElectricResistivity(value, ElectricResistivityUnit.MilliohmMeter); } @@ -408,9 +400,8 @@ public static ElectricResistivity FromMilliohmMeters(QuantityValue milliohmmeter /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricResistivity FromNanoohmsCentimeter(QuantityValue nanoohmscentimeter) + public static ElectricResistivity FromNanoohmsCentimeter(double value) { - double value = (double) nanoohmscentimeter; return new ElectricResistivity(value, ElectricResistivityUnit.NanoohmCentimeter); } @@ -418,9 +409,8 @@ public static ElectricResistivity FromNanoohmsCentimeter(QuantityValue nanoohmsc /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricResistivity FromNanoohmMeters(QuantityValue nanoohmmeters) + public static ElectricResistivity FromNanoohmMeters(double value) { - double value = (double) nanoohmmeters; return new ElectricResistivity(value, ElectricResistivityUnit.NanoohmMeter); } @@ -428,9 +418,8 @@ public static ElectricResistivity FromNanoohmMeters(QuantityValue nanoohmmeters) /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricResistivity FromOhmsCentimeter(QuantityValue ohmscentimeter) + public static ElectricResistivity FromOhmsCentimeter(double value) { - double value = (double) ohmscentimeter; return new ElectricResistivity(value, ElectricResistivityUnit.OhmCentimeter); } @@ -438,9 +427,8 @@ public static ElectricResistivity FromOhmsCentimeter(QuantityValue ohmscentimete /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricResistivity FromOhmMeters(QuantityValue ohmmeters) + public static ElectricResistivity FromOhmMeters(double value) { - double value = (double) ohmmeters; return new ElectricResistivity(value, ElectricResistivityUnit.OhmMeter); } @@ -448,9 +436,8 @@ public static ElectricResistivity FromOhmMeters(QuantityValue ohmmeters) /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricResistivity FromPicoohmsCentimeter(QuantityValue picoohmscentimeter) + public static ElectricResistivity FromPicoohmsCentimeter(double value) { - double value = (double) picoohmscentimeter; return new ElectricResistivity(value, ElectricResistivityUnit.PicoohmCentimeter); } @@ -458,9 +445,8 @@ public static ElectricResistivity FromPicoohmsCentimeter(QuantityValue picoohmsc /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricResistivity FromPicoohmMeters(QuantityValue picoohmmeters) + public static ElectricResistivity FromPicoohmMeters(double value) { - double value = (double) picoohmmeters; return new ElectricResistivity(value, ElectricResistivityUnit.PicoohmMeter); } @@ -470,9 +456,9 @@ public static ElectricResistivity FromPicoohmMeters(QuantityValue picoohmmeters) /// Value to convert from. /// Unit to convert from. /// ElectricResistivity unit value. - public static ElectricResistivity From(QuantityValue value, ElectricResistivityUnit fromUnit) + public static ElectricResistivity From(double value, ElectricResistivityUnit fromUnit) { - return new ElectricResistivity((double)value, fromUnit); + return new ElectricResistivity(value, fromUnit); } #endregion @@ -894,15 +880,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is ElectricResistivityUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ElectricResistivityUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is ElectricResistivityUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ElectricResistivityUnit)} is supported.", nameof(unit)); @@ -1043,18 +1020,6 @@ public ElectricResistivity ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not ElectricResistivityUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ElectricResistivityUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricSurfaceChargeDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricSurfaceChargeDensity.g.cs index bab70fe581..5e34876016 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricSurfaceChargeDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricSurfaceChargeDensity.g.cs @@ -40,7 +40,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct ElectricSurfaceChargeDensity : - IArithmeticQuantity, + IArithmeticQuantity, IComparable, IComparable, IConvertible, @@ -152,7 +152,7 @@ public ElectricSurfaceChargeDensity(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -240,9 +240,8 @@ public static string GetAbbreviation(ElectricSurfaceChargeDensityUnit unit, IFor /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricSurfaceChargeDensity FromCoulombsPerSquareCentimeter(QuantityValue coulombspersquarecentimeter) + public static ElectricSurfaceChargeDensity FromCoulombsPerSquareCentimeter(double value) { - double value = (double) coulombspersquarecentimeter; return new ElectricSurfaceChargeDensity(value, ElectricSurfaceChargeDensityUnit.CoulombPerSquareCentimeter); } @@ -250,9 +249,8 @@ public static ElectricSurfaceChargeDensity FromCoulombsPerSquareCentimeter(Quant /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricSurfaceChargeDensity FromCoulombsPerSquareInch(QuantityValue coulombspersquareinch) + public static ElectricSurfaceChargeDensity FromCoulombsPerSquareInch(double value) { - double value = (double) coulombspersquareinch; return new ElectricSurfaceChargeDensity(value, ElectricSurfaceChargeDensityUnit.CoulombPerSquareInch); } @@ -260,9 +258,8 @@ public static ElectricSurfaceChargeDensity FromCoulombsPerSquareInch(QuantityVal /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricSurfaceChargeDensity FromCoulombsPerSquareMeter(QuantityValue coulombspersquaremeter) + public static ElectricSurfaceChargeDensity FromCoulombsPerSquareMeter(double value) { - double value = (double) coulombspersquaremeter; return new ElectricSurfaceChargeDensity(value, ElectricSurfaceChargeDensityUnit.CoulombPerSquareMeter); } @@ -272,9 +269,9 @@ public static ElectricSurfaceChargeDensity FromCoulombsPerSquareMeter(QuantityVa /// Value to convert from. /// Unit to convert from. /// ElectricSurfaceChargeDensity unit value. - public static ElectricSurfaceChargeDensity From(QuantityValue value, ElectricSurfaceChargeDensityUnit fromUnit) + public static ElectricSurfaceChargeDensity From(double value, ElectricSurfaceChargeDensityUnit fromUnit) { - return new ElectricSurfaceChargeDensity((double)value, fromUnit); + return new ElectricSurfaceChargeDensity(value, fromUnit); } #endregion @@ -685,15 +682,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is ElectricSurfaceChargeDensityUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ElectricSurfaceChargeDensityUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is ElectricSurfaceChargeDensityUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ElectricSurfaceChargeDensityUnit)} is supported.", nameof(unit)); @@ -812,18 +800,6 @@ public ElectricSurfaceChargeDensity ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not ElectricSurfaceChargeDensityUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ElectricSurfaceChargeDensityUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/Energy.g.cs b/UnitsNet/GeneratedCode/Quantities/Energy.g.cs index 305333c407..398081c271 100644 --- a/UnitsNet/GeneratedCode/Quantities/Energy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Energy.g.cs @@ -40,7 +40,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct Energy : - IArithmeticQuantity, + IArithmeticQuantity, #if NET7_0_OR_GREATER IDivisionOperators, IDivisionOperators, @@ -201,7 +201,7 @@ public Energy(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -548,9 +548,8 @@ public static string GetAbbreviation(EnergyUnit unit, IFormatProvider? provider) /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromBritishThermalUnits(QuantityValue britishthermalunits) + public static Energy FromBritishThermalUnits(double value) { - double value = (double) britishthermalunits; return new Energy(value, EnergyUnit.BritishThermalUnit); } @@ -558,9 +557,8 @@ public static Energy FromBritishThermalUnits(QuantityValue britishthermalunits) /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromCalories(QuantityValue calories) + public static Energy FromCalories(double value) { - double value = (double) calories; return new Energy(value, EnergyUnit.Calorie); } @@ -568,9 +566,8 @@ public static Energy FromCalories(QuantityValue calories) /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromDecathermsEc(QuantityValue decathermsec) + public static Energy FromDecathermsEc(double value) { - double value = (double) decathermsec; return new Energy(value, EnergyUnit.DecathermEc); } @@ -578,9 +575,8 @@ public static Energy FromDecathermsEc(QuantityValue decathermsec) /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromDecathermsImperial(QuantityValue decathermsimperial) + public static Energy FromDecathermsImperial(double value) { - double value = (double) decathermsimperial; return new Energy(value, EnergyUnit.DecathermImperial); } @@ -588,9 +584,8 @@ public static Energy FromDecathermsImperial(QuantityValue decathermsimperial) /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromDecathermsUs(QuantityValue decathermsus) + public static Energy FromDecathermsUs(double value) { - double value = (double) decathermsus; return new Energy(value, EnergyUnit.DecathermUs); } @@ -598,9 +593,8 @@ public static Energy FromDecathermsUs(QuantityValue decathermsus) /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromElectronVolts(QuantityValue electronvolts) + public static Energy FromElectronVolts(double value) { - double value = (double) electronvolts; return new Energy(value, EnergyUnit.ElectronVolt); } @@ -608,9 +602,8 @@ public static Energy FromElectronVolts(QuantityValue electronvolts) /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromErgs(QuantityValue ergs) + public static Energy FromErgs(double value) { - double value = (double) ergs; return new Energy(value, EnergyUnit.Erg); } @@ -618,9 +611,8 @@ public static Energy FromErgs(QuantityValue ergs) /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromFootPounds(QuantityValue footpounds) + public static Energy FromFootPounds(double value) { - double value = (double) footpounds; return new Energy(value, EnergyUnit.FootPound); } @@ -628,9 +620,8 @@ public static Energy FromFootPounds(QuantityValue footpounds) /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromGigabritishThermalUnits(QuantityValue gigabritishthermalunits) + public static Energy FromGigabritishThermalUnits(double value) { - double value = (double) gigabritishthermalunits; return new Energy(value, EnergyUnit.GigabritishThermalUnit); } @@ -638,9 +629,8 @@ public static Energy FromGigabritishThermalUnits(QuantityValue gigabritishtherma /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromGigaelectronVolts(QuantityValue gigaelectronvolts) + public static Energy FromGigaelectronVolts(double value) { - double value = (double) gigaelectronvolts; return new Energy(value, EnergyUnit.GigaelectronVolt); } @@ -648,9 +638,8 @@ public static Energy FromGigaelectronVolts(QuantityValue gigaelectronvolts) /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromGigajoules(QuantityValue gigajoules) + public static Energy FromGigajoules(double value) { - double value = (double) gigajoules; return new Energy(value, EnergyUnit.Gigajoule); } @@ -658,9 +647,8 @@ public static Energy FromGigajoules(QuantityValue gigajoules) /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromGigawattDays(QuantityValue gigawattdays) + public static Energy FromGigawattDays(double value) { - double value = (double) gigawattdays; return new Energy(value, EnergyUnit.GigawattDay); } @@ -668,9 +656,8 @@ public static Energy FromGigawattDays(QuantityValue gigawattdays) /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromGigawattHours(QuantityValue gigawatthours) + public static Energy FromGigawattHours(double value) { - double value = (double) gigawatthours; return new Energy(value, EnergyUnit.GigawattHour); } @@ -678,9 +665,8 @@ public static Energy FromGigawattHours(QuantityValue gigawatthours) /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromHorsepowerHours(QuantityValue horsepowerhours) + public static Energy FromHorsepowerHours(double value) { - double value = (double) horsepowerhours; return new Energy(value, EnergyUnit.HorsepowerHour); } @@ -688,9 +674,8 @@ public static Energy FromHorsepowerHours(QuantityValue horsepowerhours) /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromJoules(QuantityValue joules) + public static Energy FromJoules(double value) { - double value = (double) joules; return new Energy(value, EnergyUnit.Joule); } @@ -698,9 +683,8 @@ public static Energy FromJoules(QuantityValue joules) /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromKilobritishThermalUnits(QuantityValue kilobritishthermalunits) + public static Energy FromKilobritishThermalUnits(double value) { - double value = (double) kilobritishthermalunits; return new Energy(value, EnergyUnit.KilobritishThermalUnit); } @@ -708,9 +692,8 @@ public static Energy FromKilobritishThermalUnits(QuantityValue kilobritishtherma /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromKilocalories(QuantityValue kilocalories) + public static Energy FromKilocalories(double value) { - double value = (double) kilocalories; return new Energy(value, EnergyUnit.Kilocalorie); } @@ -718,9 +701,8 @@ public static Energy FromKilocalories(QuantityValue kilocalories) /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromKiloelectronVolts(QuantityValue kiloelectronvolts) + public static Energy FromKiloelectronVolts(double value) { - double value = (double) kiloelectronvolts; return new Energy(value, EnergyUnit.KiloelectronVolt); } @@ -728,9 +710,8 @@ public static Energy FromKiloelectronVolts(QuantityValue kiloelectronvolts) /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromKilojoules(QuantityValue kilojoules) + public static Energy FromKilojoules(double value) { - double value = (double) kilojoules; return new Energy(value, EnergyUnit.Kilojoule); } @@ -738,9 +719,8 @@ public static Energy FromKilojoules(QuantityValue kilojoules) /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromKilowattDays(QuantityValue kilowattdays) + public static Energy FromKilowattDays(double value) { - double value = (double) kilowattdays; return new Energy(value, EnergyUnit.KilowattDay); } @@ -748,9 +728,8 @@ public static Energy FromKilowattDays(QuantityValue kilowattdays) /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromKilowattHours(QuantityValue kilowatthours) + public static Energy FromKilowattHours(double value) { - double value = (double) kilowatthours; return new Energy(value, EnergyUnit.KilowattHour); } @@ -758,9 +737,8 @@ public static Energy FromKilowattHours(QuantityValue kilowatthours) /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromMegabritishThermalUnits(QuantityValue megabritishthermalunits) + public static Energy FromMegabritishThermalUnits(double value) { - double value = (double) megabritishthermalunits; return new Energy(value, EnergyUnit.MegabritishThermalUnit); } @@ -768,9 +746,8 @@ public static Energy FromMegabritishThermalUnits(QuantityValue megabritishtherma /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromMegacalories(QuantityValue megacalories) + public static Energy FromMegacalories(double value) { - double value = (double) megacalories; return new Energy(value, EnergyUnit.Megacalorie); } @@ -778,9 +755,8 @@ public static Energy FromMegacalories(QuantityValue megacalories) /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromMegaelectronVolts(QuantityValue megaelectronvolts) + public static Energy FromMegaelectronVolts(double value) { - double value = (double) megaelectronvolts; return new Energy(value, EnergyUnit.MegaelectronVolt); } @@ -788,9 +764,8 @@ public static Energy FromMegaelectronVolts(QuantityValue megaelectronvolts) /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromMegajoules(QuantityValue megajoules) + public static Energy FromMegajoules(double value) { - double value = (double) megajoules; return new Energy(value, EnergyUnit.Megajoule); } @@ -798,9 +773,8 @@ public static Energy FromMegajoules(QuantityValue megajoules) /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromMegawattDays(QuantityValue megawattdays) + public static Energy FromMegawattDays(double value) { - double value = (double) megawattdays; return new Energy(value, EnergyUnit.MegawattDay); } @@ -808,9 +782,8 @@ public static Energy FromMegawattDays(QuantityValue megawattdays) /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromMegawattHours(QuantityValue megawatthours) + public static Energy FromMegawattHours(double value) { - double value = (double) megawatthours; return new Energy(value, EnergyUnit.MegawattHour); } @@ -818,9 +791,8 @@ public static Energy FromMegawattHours(QuantityValue megawatthours) /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromMicrojoules(QuantityValue microjoules) + public static Energy FromMicrojoules(double value) { - double value = (double) microjoules; return new Energy(value, EnergyUnit.Microjoule); } @@ -828,9 +800,8 @@ public static Energy FromMicrojoules(QuantityValue microjoules) /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromMillijoules(QuantityValue millijoules) + public static Energy FromMillijoules(double value) { - double value = (double) millijoules; return new Energy(value, EnergyUnit.Millijoule); } @@ -838,9 +809,8 @@ public static Energy FromMillijoules(QuantityValue millijoules) /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromNanojoules(QuantityValue nanojoules) + public static Energy FromNanojoules(double value) { - double value = (double) nanojoules; return new Energy(value, EnergyUnit.Nanojoule); } @@ -848,9 +818,8 @@ public static Energy FromNanojoules(QuantityValue nanojoules) /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromPetajoules(QuantityValue petajoules) + public static Energy FromPetajoules(double value) { - double value = (double) petajoules; return new Energy(value, EnergyUnit.Petajoule); } @@ -858,9 +827,8 @@ public static Energy FromPetajoules(QuantityValue petajoules) /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromTeraelectronVolts(QuantityValue teraelectronvolts) + public static Energy FromTeraelectronVolts(double value) { - double value = (double) teraelectronvolts; return new Energy(value, EnergyUnit.TeraelectronVolt); } @@ -868,9 +836,8 @@ public static Energy FromTeraelectronVolts(QuantityValue teraelectronvolts) /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromTerajoules(QuantityValue terajoules) + public static Energy FromTerajoules(double value) { - double value = (double) terajoules; return new Energy(value, EnergyUnit.Terajoule); } @@ -878,9 +845,8 @@ public static Energy FromTerajoules(QuantityValue terajoules) /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromTerawattDays(QuantityValue terawattdays) + public static Energy FromTerawattDays(double value) { - double value = (double) terawattdays; return new Energy(value, EnergyUnit.TerawattDay); } @@ -888,9 +854,8 @@ public static Energy FromTerawattDays(QuantityValue terawattdays) /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromTerawattHours(QuantityValue terawatthours) + public static Energy FromTerawattHours(double value) { - double value = (double) terawatthours; return new Energy(value, EnergyUnit.TerawattHour); } @@ -898,9 +863,8 @@ public static Energy FromTerawattHours(QuantityValue terawatthours) /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromThermsEc(QuantityValue thermsec) + public static Energy FromThermsEc(double value) { - double value = (double) thermsec; return new Energy(value, EnergyUnit.ThermEc); } @@ -908,9 +872,8 @@ public static Energy FromThermsEc(QuantityValue thermsec) /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromThermsImperial(QuantityValue thermsimperial) + public static Energy FromThermsImperial(double value) { - double value = (double) thermsimperial; return new Energy(value, EnergyUnit.ThermImperial); } @@ -918,9 +881,8 @@ public static Energy FromThermsImperial(QuantityValue thermsimperial) /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromThermsUs(QuantityValue thermsus) + public static Energy FromThermsUs(double value) { - double value = (double) thermsus; return new Energy(value, EnergyUnit.ThermUs); } @@ -928,9 +890,8 @@ public static Energy FromThermsUs(QuantityValue thermsus) /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromWattDays(QuantityValue wattdays) + public static Energy FromWattDays(double value) { - double value = (double) wattdays; return new Energy(value, EnergyUnit.WattDay); } @@ -938,9 +899,8 @@ public static Energy FromWattDays(QuantityValue wattdays) /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromWattHours(QuantityValue watthours) + public static Energy FromWattHours(double value) { - double value = (double) watthours; return new Energy(value, EnergyUnit.WattHour); } @@ -950,9 +910,9 @@ public static Energy FromWattHours(QuantityValue watthours) /// Value to convert from. /// Unit to convert from. /// Energy unit value. - public static Energy From(QuantityValue value, EnergyUnit fromUnit) + public static Energy From(double value, EnergyUnit fromUnit) { - return new Energy((double)value, fromUnit); + return new Energy(value, fromUnit); } #endregion @@ -1427,15 +1387,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is EnergyUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(EnergyUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is EnergyUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(EnergyUnit)} is supported.", nameof(unit)); @@ -1628,18 +1579,6 @@ public Energy ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not EnergyUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(EnergyUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/EnergyDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/EnergyDensity.g.cs index c5f3640ac6..b9b53f8fee 100644 --- a/UnitsNet/GeneratedCode/Quantities/EnergyDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/EnergyDensity.g.cs @@ -40,7 +40,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct EnergyDensity : - IArithmeticQuantity, + IArithmeticQuantity, #if NET7_0_OR_GREATER IMultiplyOperators, #endif @@ -164,7 +164,7 @@ public EnergyDensity(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -315,9 +315,8 @@ public static string GetAbbreviation(EnergyDensityUnit unit, IFormatProvider? pr /// Creates a from . /// /// If value is NaN or Infinity. - public static EnergyDensity FromGigajoulesPerCubicMeter(QuantityValue gigajoulespercubicmeter) + public static EnergyDensity FromGigajoulesPerCubicMeter(double value) { - double value = (double) gigajoulespercubicmeter; return new EnergyDensity(value, EnergyDensityUnit.GigajoulePerCubicMeter); } @@ -325,9 +324,8 @@ public static EnergyDensity FromGigajoulesPerCubicMeter(QuantityValue gigajoules /// Creates a from . /// /// If value is NaN or Infinity. - public static EnergyDensity FromGigawattHoursPerCubicMeter(QuantityValue gigawatthourspercubicmeter) + public static EnergyDensity FromGigawattHoursPerCubicMeter(double value) { - double value = (double) gigawatthourspercubicmeter; return new EnergyDensity(value, EnergyDensityUnit.GigawattHourPerCubicMeter); } @@ -335,9 +333,8 @@ public static EnergyDensity FromGigawattHoursPerCubicMeter(QuantityValue gigawat /// Creates a from . /// /// If value is NaN or Infinity. - public static EnergyDensity FromJoulesPerCubicMeter(QuantityValue joulespercubicmeter) + public static EnergyDensity FromJoulesPerCubicMeter(double value) { - double value = (double) joulespercubicmeter; return new EnergyDensity(value, EnergyDensityUnit.JoulePerCubicMeter); } @@ -345,9 +342,8 @@ public static EnergyDensity FromJoulesPerCubicMeter(QuantityValue joulespercubic /// Creates a from . /// /// If value is NaN or Infinity. - public static EnergyDensity FromKilojoulesPerCubicMeter(QuantityValue kilojoulespercubicmeter) + public static EnergyDensity FromKilojoulesPerCubicMeter(double value) { - double value = (double) kilojoulespercubicmeter; return new EnergyDensity(value, EnergyDensityUnit.KilojoulePerCubicMeter); } @@ -355,9 +351,8 @@ public static EnergyDensity FromKilojoulesPerCubicMeter(QuantityValue kilojoules /// Creates a from . /// /// If value is NaN or Infinity. - public static EnergyDensity FromKilowattHoursPerCubicMeter(QuantityValue kilowatthourspercubicmeter) + public static EnergyDensity FromKilowattHoursPerCubicMeter(double value) { - double value = (double) kilowatthourspercubicmeter; return new EnergyDensity(value, EnergyDensityUnit.KilowattHourPerCubicMeter); } @@ -365,9 +360,8 @@ public static EnergyDensity FromKilowattHoursPerCubicMeter(QuantityValue kilowat /// Creates a from . /// /// If value is NaN or Infinity. - public static EnergyDensity FromMegajoulesPerCubicMeter(QuantityValue megajoulespercubicmeter) + public static EnergyDensity FromMegajoulesPerCubicMeter(double value) { - double value = (double) megajoulespercubicmeter; return new EnergyDensity(value, EnergyDensityUnit.MegajoulePerCubicMeter); } @@ -375,9 +369,8 @@ public static EnergyDensity FromMegajoulesPerCubicMeter(QuantityValue megajoules /// Creates a from . /// /// If value is NaN or Infinity. - public static EnergyDensity FromMegawattHoursPerCubicMeter(QuantityValue megawatthourspercubicmeter) + public static EnergyDensity FromMegawattHoursPerCubicMeter(double value) { - double value = (double) megawatthourspercubicmeter; return new EnergyDensity(value, EnergyDensityUnit.MegawattHourPerCubicMeter); } @@ -385,9 +378,8 @@ public static EnergyDensity FromMegawattHoursPerCubicMeter(QuantityValue megawat /// Creates a from . /// /// If value is NaN or Infinity. - public static EnergyDensity FromPetajoulesPerCubicMeter(QuantityValue petajoulespercubicmeter) + public static EnergyDensity FromPetajoulesPerCubicMeter(double value) { - double value = (double) petajoulespercubicmeter; return new EnergyDensity(value, EnergyDensityUnit.PetajoulePerCubicMeter); } @@ -395,9 +387,8 @@ public static EnergyDensity FromPetajoulesPerCubicMeter(QuantityValue petajoules /// Creates a from . /// /// If value is NaN or Infinity. - public static EnergyDensity FromPetawattHoursPerCubicMeter(QuantityValue petawatthourspercubicmeter) + public static EnergyDensity FromPetawattHoursPerCubicMeter(double value) { - double value = (double) petawatthourspercubicmeter; return new EnergyDensity(value, EnergyDensityUnit.PetawattHourPerCubicMeter); } @@ -405,9 +396,8 @@ public static EnergyDensity FromPetawattHoursPerCubicMeter(QuantityValue petawat /// Creates a from . /// /// If value is NaN or Infinity. - public static EnergyDensity FromTerajoulesPerCubicMeter(QuantityValue terajoulespercubicmeter) + public static EnergyDensity FromTerajoulesPerCubicMeter(double value) { - double value = (double) terajoulespercubicmeter; return new EnergyDensity(value, EnergyDensityUnit.TerajoulePerCubicMeter); } @@ -415,9 +405,8 @@ public static EnergyDensity FromTerajoulesPerCubicMeter(QuantityValue terajoules /// Creates a from . /// /// If value is NaN or Infinity. - public static EnergyDensity FromTerawattHoursPerCubicMeter(QuantityValue terawatthourspercubicmeter) + public static EnergyDensity FromTerawattHoursPerCubicMeter(double value) { - double value = (double) terawatthourspercubicmeter; return new EnergyDensity(value, EnergyDensityUnit.TerawattHourPerCubicMeter); } @@ -425,9 +414,8 @@ public static EnergyDensity FromTerawattHoursPerCubicMeter(QuantityValue terawat /// Creates a from . /// /// If value is NaN or Infinity. - public static EnergyDensity FromWattHoursPerCubicMeter(QuantityValue watthourspercubicmeter) + public static EnergyDensity FromWattHoursPerCubicMeter(double value) { - double value = (double) watthourspercubicmeter; return new EnergyDensity(value, EnergyDensityUnit.WattHourPerCubicMeter); } @@ -437,9 +425,9 @@ public static EnergyDensity FromWattHoursPerCubicMeter(QuantityValue watthourspe /// Value to convert from. /// Unit to convert from. /// EnergyDensity unit value. - public static EnergyDensity From(QuantityValue value, EnergyDensityUnit fromUnit) + public static EnergyDensity From(double value, EnergyDensityUnit fromUnit) { - return new EnergyDensity((double)value, fromUnit); + return new EnergyDensity(value, fromUnit); } #endregion @@ -860,15 +848,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is EnergyDensityUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(EnergyDensityUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is EnergyDensityUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(EnergyDensityUnit)} is supported.", nameof(unit)); @@ -1005,18 +984,6 @@ public EnergyDensity ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not EnergyDensityUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(EnergyDensityUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/Entropy.g.cs b/UnitsNet/GeneratedCode/Quantities/Entropy.g.cs index ed43a2be22..179ae809d3 100644 --- a/UnitsNet/GeneratedCode/Quantities/Entropy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Entropy.g.cs @@ -40,7 +40,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct Entropy : - IArithmeticQuantity, + IArithmeticQuantity, #if NET7_0_OR_GREATER IMultiplyOperators, IDivisionOperators, @@ -160,7 +160,7 @@ public Entropy(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -276,9 +276,8 @@ public static string GetAbbreviation(EntropyUnit unit, IFormatProvider? provider /// Creates a from . /// /// If value is NaN or Infinity. - public static Entropy FromCaloriesPerKelvin(QuantityValue caloriesperkelvin) + public static Entropy FromCaloriesPerKelvin(double value) { - double value = (double) caloriesperkelvin; return new Entropy(value, EntropyUnit.CaloriePerKelvin); } @@ -286,9 +285,8 @@ public static Entropy FromCaloriesPerKelvin(QuantityValue caloriesperkelvin) /// Creates a from . /// /// If value is NaN or Infinity. - public static Entropy FromJoulesPerDegreeCelsius(QuantityValue joulesperdegreecelsius) + public static Entropy FromJoulesPerDegreeCelsius(double value) { - double value = (double) joulesperdegreecelsius; return new Entropy(value, EntropyUnit.JoulePerDegreeCelsius); } @@ -296,9 +294,8 @@ public static Entropy FromJoulesPerDegreeCelsius(QuantityValue joulesperdegreece /// Creates a from . /// /// If value is NaN or Infinity. - public static Entropy FromJoulesPerKelvin(QuantityValue joulesperkelvin) + public static Entropy FromJoulesPerKelvin(double value) { - double value = (double) joulesperkelvin; return new Entropy(value, EntropyUnit.JoulePerKelvin); } @@ -306,9 +303,8 @@ public static Entropy FromJoulesPerKelvin(QuantityValue joulesperkelvin) /// Creates a from . /// /// If value is NaN or Infinity. - public static Entropy FromKilocaloriesPerKelvin(QuantityValue kilocaloriesperkelvin) + public static Entropy FromKilocaloriesPerKelvin(double value) { - double value = (double) kilocaloriesperkelvin; return new Entropy(value, EntropyUnit.KilocaloriePerKelvin); } @@ -316,9 +312,8 @@ public static Entropy FromKilocaloriesPerKelvin(QuantityValue kilocaloriesperkel /// Creates a from . /// /// If value is NaN or Infinity. - public static Entropy FromKilojoulesPerDegreeCelsius(QuantityValue kilojoulesperdegreecelsius) + public static Entropy FromKilojoulesPerDegreeCelsius(double value) { - double value = (double) kilojoulesperdegreecelsius; return new Entropy(value, EntropyUnit.KilojoulePerDegreeCelsius); } @@ -326,9 +321,8 @@ public static Entropy FromKilojoulesPerDegreeCelsius(QuantityValue kilojoulesper /// Creates a from . /// /// If value is NaN or Infinity. - public static Entropy FromKilojoulesPerKelvin(QuantityValue kilojoulesperkelvin) + public static Entropy FromKilojoulesPerKelvin(double value) { - double value = (double) kilojoulesperkelvin; return new Entropy(value, EntropyUnit.KilojoulePerKelvin); } @@ -336,9 +330,8 @@ public static Entropy FromKilojoulesPerKelvin(QuantityValue kilojoulesperkelvin) /// Creates a from . /// /// If value is NaN or Infinity. - public static Entropy FromMegajoulesPerKelvin(QuantityValue megajoulesperkelvin) + public static Entropy FromMegajoulesPerKelvin(double value) { - double value = (double) megajoulesperkelvin; return new Entropy(value, EntropyUnit.MegajoulePerKelvin); } @@ -348,9 +341,9 @@ public static Entropy FromMegajoulesPerKelvin(QuantityValue megajoulesperkelvin) /// Value to convert from. /// Unit to convert from. /// Entropy unit value. - public static Entropy From(QuantityValue value, EntropyUnit fromUnit) + public static Entropy From(double value, EntropyUnit fromUnit) { - return new Entropy((double)value, fromUnit); + return new Entropy(value, fromUnit); } #endregion @@ -777,15 +770,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is EntropyUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(EntropyUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is EntropyUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(EntropyUnit)} is supported.", nameof(unit)); @@ -912,18 +896,6 @@ public Entropy ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not EntropyUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(EntropyUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/Force.g.cs b/UnitsNet/GeneratedCode/Quantities/Force.g.cs index c3d4390d12..7589bb7e99 100644 --- a/UnitsNet/GeneratedCode/Quantities/Force.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Force.g.cs @@ -40,7 +40,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct Force : - IArithmeticQuantity, + IArithmeticQuantity, #if NET7_0_OR_GREATER IDivisionOperators, IDivisionOperators, @@ -176,7 +176,7 @@ public Force(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -348,9 +348,8 @@ public static string GetAbbreviation(ForceUnit unit, IFormatProvider? provider) /// Creates a from . /// /// If value is NaN or Infinity. - public static Force FromDecanewtons(QuantityValue decanewtons) + public static Force FromDecanewtons(double value) { - double value = (double) decanewtons; return new Force(value, ForceUnit.Decanewton); } @@ -358,9 +357,8 @@ public static Force FromDecanewtons(QuantityValue decanewtons) /// Creates a from . /// /// If value is NaN or Infinity. - public static Force FromDyne(QuantityValue dyne) + public static Force FromDyne(double value) { - double value = (double) dyne; return new Force(value, ForceUnit.Dyn); } @@ -368,9 +366,8 @@ public static Force FromDyne(QuantityValue dyne) /// Creates a from . /// /// If value is NaN or Infinity. - public static Force FromKilogramsForce(QuantityValue kilogramsforce) + public static Force FromKilogramsForce(double value) { - double value = (double) kilogramsforce; return new Force(value, ForceUnit.KilogramForce); } @@ -378,9 +375,8 @@ public static Force FromKilogramsForce(QuantityValue kilogramsforce) /// Creates a from . /// /// If value is NaN or Infinity. - public static Force FromKilonewtons(QuantityValue kilonewtons) + public static Force FromKilonewtons(double value) { - double value = (double) kilonewtons; return new Force(value, ForceUnit.Kilonewton); } @@ -388,9 +384,8 @@ public static Force FromKilonewtons(QuantityValue kilonewtons) /// Creates a from . /// /// If value is NaN or Infinity. - public static Force FromKiloPonds(QuantityValue kiloponds) + public static Force FromKiloPonds(double value) { - double value = (double) kiloponds; return new Force(value, ForceUnit.KiloPond); } @@ -398,9 +393,8 @@ public static Force FromKiloPonds(QuantityValue kiloponds) /// Creates a from . /// /// If value is NaN or Infinity. - public static Force FromKilopoundsForce(QuantityValue kilopoundsforce) + public static Force FromKilopoundsForce(double value) { - double value = (double) kilopoundsforce; return new Force(value, ForceUnit.KilopoundForce); } @@ -408,9 +402,8 @@ public static Force FromKilopoundsForce(QuantityValue kilopoundsforce) /// Creates a from . /// /// If value is NaN or Infinity. - public static Force FromMeganewtons(QuantityValue meganewtons) + public static Force FromMeganewtons(double value) { - double value = (double) meganewtons; return new Force(value, ForceUnit.Meganewton); } @@ -418,9 +411,8 @@ public static Force FromMeganewtons(QuantityValue meganewtons) /// Creates a from . /// /// If value is NaN or Infinity. - public static Force FromMicronewtons(QuantityValue micronewtons) + public static Force FromMicronewtons(double value) { - double value = (double) micronewtons; return new Force(value, ForceUnit.Micronewton); } @@ -428,9 +420,8 @@ public static Force FromMicronewtons(QuantityValue micronewtons) /// Creates a from . /// /// If value is NaN or Infinity. - public static Force FromMillinewtons(QuantityValue millinewtons) + public static Force FromMillinewtons(double value) { - double value = (double) millinewtons; return new Force(value, ForceUnit.Millinewton); } @@ -438,9 +429,8 @@ public static Force FromMillinewtons(QuantityValue millinewtons) /// Creates a from . /// /// If value is NaN or Infinity. - public static Force FromNewtons(QuantityValue newtons) + public static Force FromNewtons(double value) { - double value = (double) newtons; return new Force(value, ForceUnit.Newton); } @@ -448,9 +438,8 @@ public static Force FromNewtons(QuantityValue newtons) /// Creates a from . /// /// If value is NaN or Infinity. - public static Force FromOunceForce(QuantityValue ounceforce) + public static Force FromOunceForce(double value) { - double value = (double) ounceforce; return new Force(value, ForceUnit.OunceForce); } @@ -458,9 +447,8 @@ public static Force FromOunceForce(QuantityValue ounceforce) /// Creates a from . /// /// If value is NaN or Infinity. - public static Force FromPoundals(QuantityValue poundals) + public static Force FromPoundals(double value) { - double value = (double) poundals; return new Force(value, ForceUnit.Poundal); } @@ -468,9 +456,8 @@ public static Force FromPoundals(QuantityValue poundals) /// Creates a from . /// /// If value is NaN or Infinity. - public static Force FromPoundsForce(QuantityValue poundsforce) + public static Force FromPoundsForce(double value) { - double value = (double) poundsforce; return new Force(value, ForceUnit.PoundForce); } @@ -478,9 +465,8 @@ public static Force FromPoundsForce(QuantityValue poundsforce) /// Creates a from . /// /// If value is NaN or Infinity. - public static Force FromShortTonsForce(QuantityValue shorttonsforce) + public static Force FromShortTonsForce(double value) { - double value = (double) shorttonsforce; return new Force(value, ForceUnit.ShortTonForce); } @@ -488,9 +474,8 @@ public static Force FromShortTonsForce(QuantityValue shorttonsforce) /// Creates a from . /// /// If value is NaN or Infinity. - public static Force FromTonnesForce(QuantityValue tonnesforce) + public static Force FromTonnesForce(double value) { - double value = (double) tonnesforce; return new Force(value, ForceUnit.TonneForce); } @@ -500,9 +485,9 @@ public static Force FromTonnesForce(QuantityValue tonnesforce) /// Value to convert from. /// Unit to convert from. /// Force unit value. - public static Force From(QuantityValue value, ForceUnit fromUnit) + public static Force From(double value, ForceUnit fromUnit) { - return new Force((double)value, fromUnit); + return new Force(value, fromUnit); } #endregion @@ -977,15 +962,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is ForceUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ForceUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is ForceUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ForceUnit)} is supported.", nameof(unit)); @@ -1128,18 +1104,6 @@ public Force ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not ForceUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ForceUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.g.cs b/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.g.cs index 6b54cb1e24..7e45485779 100644 --- a/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.g.cs @@ -40,7 +40,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct ForceChangeRate : - IArithmeticQuantity, + IArithmeticQuantity, #if NET7_0_OR_GREATER IMultiplyOperators, IMultiplyOperators, @@ -168,7 +168,7 @@ public ForceChangeRate(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -340,9 +340,8 @@ public static string GetAbbreviation(ForceChangeRateUnit unit, IFormatProvider? /// Creates a from . /// /// If value is NaN or Infinity. - public static ForceChangeRate FromCentinewtonsPerSecond(QuantityValue centinewtonspersecond) + public static ForceChangeRate FromCentinewtonsPerSecond(double value) { - double value = (double) centinewtonspersecond; return new ForceChangeRate(value, ForceChangeRateUnit.CentinewtonPerSecond); } @@ -350,9 +349,8 @@ public static ForceChangeRate FromCentinewtonsPerSecond(QuantityValue centinewto /// Creates a from . /// /// If value is NaN or Infinity. - public static ForceChangeRate FromDecanewtonsPerMinute(QuantityValue decanewtonsperminute) + public static ForceChangeRate FromDecanewtonsPerMinute(double value) { - double value = (double) decanewtonsperminute; return new ForceChangeRate(value, ForceChangeRateUnit.DecanewtonPerMinute); } @@ -360,9 +358,8 @@ public static ForceChangeRate FromDecanewtonsPerMinute(QuantityValue decanewtons /// Creates a from . /// /// If value is NaN or Infinity. - public static ForceChangeRate FromDecanewtonsPerSecond(QuantityValue decanewtonspersecond) + public static ForceChangeRate FromDecanewtonsPerSecond(double value) { - double value = (double) decanewtonspersecond; return new ForceChangeRate(value, ForceChangeRateUnit.DecanewtonPerSecond); } @@ -370,9 +367,8 @@ public static ForceChangeRate FromDecanewtonsPerSecond(QuantityValue decanewtons /// Creates a from . /// /// If value is NaN or Infinity. - public static ForceChangeRate FromDecinewtonsPerSecond(QuantityValue decinewtonspersecond) + public static ForceChangeRate FromDecinewtonsPerSecond(double value) { - double value = (double) decinewtonspersecond; return new ForceChangeRate(value, ForceChangeRateUnit.DecinewtonPerSecond); } @@ -380,9 +376,8 @@ public static ForceChangeRate FromDecinewtonsPerSecond(QuantityValue decinewtons /// Creates a from . /// /// If value is NaN or Infinity. - public static ForceChangeRate FromKilonewtonsPerMinute(QuantityValue kilonewtonsperminute) + public static ForceChangeRate FromKilonewtonsPerMinute(double value) { - double value = (double) kilonewtonsperminute; return new ForceChangeRate(value, ForceChangeRateUnit.KilonewtonPerMinute); } @@ -390,9 +385,8 @@ public static ForceChangeRate FromKilonewtonsPerMinute(QuantityValue kilonewtons /// Creates a from . /// /// If value is NaN or Infinity. - public static ForceChangeRate FromKilonewtonsPerSecond(QuantityValue kilonewtonspersecond) + public static ForceChangeRate FromKilonewtonsPerSecond(double value) { - double value = (double) kilonewtonspersecond; return new ForceChangeRate(value, ForceChangeRateUnit.KilonewtonPerSecond); } @@ -400,9 +394,8 @@ public static ForceChangeRate FromKilonewtonsPerSecond(QuantityValue kilonewtons /// Creates a from . /// /// If value is NaN or Infinity. - public static ForceChangeRate FromKilopoundsForcePerMinute(QuantityValue kilopoundsforceperminute) + public static ForceChangeRate FromKilopoundsForcePerMinute(double value) { - double value = (double) kilopoundsforceperminute; return new ForceChangeRate(value, ForceChangeRateUnit.KilopoundForcePerMinute); } @@ -410,9 +403,8 @@ public static ForceChangeRate FromKilopoundsForcePerMinute(QuantityValue kilopou /// Creates a from . /// /// If value is NaN or Infinity. - public static ForceChangeRate FromKilopoundsForcePerSecond(QuantityValue kilopoundsforcepersecond) + public static ForceChangeRate FromKilopoundsForcePerSecond(double value) { - double value = (double) kilopoundsforcepersecond; return new ForceChangeRate(value, ForceChangeRateUnit.KilopoundForcePerSecond); } @@ -420,9 +412,8 @@ public static ForceChangeRate FromKilopoundsForcePerSecond(QuantityValue kilopou /// Creates a from . /// /// If value is NaN or Infinity. - public static ForceChangeRate FromMicronewtonsPerSecond(QuantityValue micronewtonspersecond) + public static ForceChangeRate FromMicronewtonsPerSecond(double value) { - double value = (double) micronewtonspersecond; return new ForceChangeRate(value, ForceChangeRateUnit.MicronewtonPerSecond); } @@ -430,9 +421,8 @@ public static ForceChangeRate FromMicronewtonsPerSecond(QuantityValue micronewto /// Creates a from . /// /// If value is NaN or Infinity. - public static ForceChangeRate FromMillinewtonsPerSecond(QuantityValue millinewtonspersecond) + public static ForceChangeRate FromMillinewtonsPerSecond(double value) { - double value = (double) millinewtonspersecond; return new ForceChangeRate(value, ForceChangeRateUnit.MillinewtonPerSecond); } @@ -440,9 +430,8 @@ public static ForceChangeRate FromMillinewtonsPerSecond(QuantityValue millinewto /// Creates a from . /// /// If value is NaN or Infinity. - public static ForceChangeRate FromNanonewtonsPerSecond(QuantityValue nanonewtonspersecond) + public static ForceChangeRate FromNanonewtonsPerSecond(double value) { - double value = (double) nanonewtonspersecond; return new ForceChangeRate(value, ForceChangeRateUnit.NanonewtonPerSecond); } @@ -450,9 +439,8 @@ public static ForceChangeRate FromNanonewtonsPerSecond(QuantityValue nanonewtons /// Creates a from . /// /// If value is NaN or Infinity. - public static ForceChangeRate FromNewtonsPerMinute(QuantityValue newtonsperminute) + public static ForceChangeRate FromNewtonsPerMinute(double value) { - double value = (double) newtonsperminute; return new ForceChangeRate(value, ForceChangeRateUnit.NewtonPerMinute); } @@ -460,9 +448,8 @@ public static ForceChangeRate FromNewtonsPerMinute(QuantityValue newtonsperminut /// Creates a from . /// /// If value is NaN or Infinity. - public static ForceChangeRate FromNewtonsPerSecond(QuantityValue newtonspersecond) + public static ForceChangeRate FromNewtonsPerSecond(double value) { - double value = (double) newtonspersecond; return new ForceChangeRate(value, ForceChangeRateUnit.NewtonPerSecond); } @@ -470,9 +457,8 @@ public static ForceChangeRate FromNewtonsPerSecond(QuantityValue newtonspersecon /// Creates a from . /// /// If value is NaN or Infinity. - public static ForceChangeRate FromPoundsForcePerMinute(QuantityValue poundsforceperminute) + public static ForceChangeRate FromPoundsForcePerMinute(double value) { - double value = (double) poundsforceperminute; return new ForceChangeRate(value, ForceChangeRateUnit.PoundForcePerMinute); } @@ -480,9 +466,8 @@ public static ForceChangeRate FromPoundsForcePerMinute(QuantityValue poundsforce /// Creates a from . /// /// If value is NaN or Infinity. - public static ForceChangeRate FromPoundsForcePerSecond(QuantityValue poundsforcepersecond) + public static ForceChangeRate FromPoundsForcePerSecond(double value) { - double value = (double) poundsforcepersecond; return new ForceChangeRate(value, ForceChangeRateUnit.PoundForcePerSecond); } @@ -492,9 +477,9 @@ public static ForceChangeRate FromPoundsForcePerSecond(QuantityValue poundsforce /// Value to convert from. /// Unit to convert from. /// ForceChangeRate unit value. - public static ForceChangeRate From(QuantityValue value, ForceChangeRateUnit fromUnit) + public static ForceChangeRate From(double value, ForceChangeRateUnit fromUnit) { - return new ForceChangeRate((double)value, fromUnit); + return new ForceChangeRate(value, fromUnit); } #endregion @@ -927,15 +912,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is ForceChangeRateUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ForceChangeRateUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is ForceChangeRateUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ForceChangeRateUnit)} is supported.", nameof(unit)); @@ -1078,18 +1054,6 @@ public ForceChangeRate ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not ForceChangeRateUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ForceChangeRateUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/ForcePerLength.g.cs b/UnitsNet/GeneratedCode/Quantities/ForcePerLength.g.cs index c4ba2a2396..a03cd01f8a 100644 --- a/UnitsNet/GeneratedCode/Quantities/ForcePerLength.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ForcePerLength.g.cs @@ -40,7 +40,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct ForcePerLength : - IArithmeticQuantity, + IArithmeticQuantity, #if NET7_0_OR_GREATER IMultiplyOperators, IDivisionOperators, @@ -194,7 +194,7 @@ public ForcePerLength(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -527,9 +527,8 @@ public static string GetAbbreviation(ForcePerLengthUnit unit, IFormatProvider? p /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromCentinewtonsPerCentimeter(QuantityValue centinewtonspercentimeter) + public static ForcePerLength FromCentinewtonsPerCentimeter(double value) { - double value = (double) centinewtonspercentimeter; return new ForcePerLength(value, ForcePerLengthUnit.CentinewtonPerCentimeter); } @@ -537,9 +536,8 @@ public static ForcePerLength FromCentinewtonsPerCentimeter(QuantityValue centine /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromCentinewtonsPerMeter(QuantityValue centinewtonspermeter) + public static ForcePerLength FromCentinewtonsPerMeter(double value) { - double value = (double) centinewtonspermeter; return new ForcePerLength(value, ForcePerLengthUnit.CentinewtonPerMeter); } @@ -547,9 +545,8 @@ public static ForcePerLength FromCentinewtonsPerMeter(QuantityValue centinewtons /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromCentinewtonsPerMillimeter(QuantityValue centinewtonspermillimeter) + public static ForcePerLength FromCentinewtonsPerMillimeter(double value) { - double value = (double) centinewtonspermillimeter; return new ForcePerLength(value, ForcePerLengthUnit.CentinewtonPerMillimeter); } @@ -557,9 +554,8 @@ public static ForcePerLength FromCentinewtonsPerMillimeter(QuantityValue centine /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromDecanewtonsPerCentimeter(QuantityValue decanewtonspercentimeter) + public static ForcePerLength FromDecanewtonsPerCentimeter(double value) { - double value = (double) decanewtonspercentimeter; return new ForcePerLength(value, ForcePerLengthUnit.DecanewtonPerCentimeter); } @@ -567,9 +563,8 @@ public static ForcePerLength FromDecanewtonsPerCentimeter(QuantityValue decanewt /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromDecanewtonsPerMeter(QuantityValue decanewtonspermeter) + public static ForcePerLength FromDecanewtonsPerMeter(double value) { - double value = (double) decanewtonspermeter; return new ForcePerLength(value, ForcePerLengthUnit.DecanewtonPerMeter); } @@ -577,9 +572,8 @@ public static ForcePerLength FromDecanewtonsPerMeter(QuantityValue decanewtonspe /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromDecanewtonsPerMillimeter(QuantityValue decanewtonspermillimeter) + public static ForcePerLength FromDecanewtonsPerMillimeter(double value) { - double value = (double) decanewtonspermillimeter; return new ForcePerLength(value, ForcePerLengthUnit.DecanewtonPerMillimeter); } @@ -587,9 +581,8 @@ public static ForcePerLength FromDecanewtonsPerMillimeter(QuantityValue decanewt /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromDecinewtonsPerCentimeter(QuantityValue decinewtonspercentimeter) + public static ForcePerLength FromDecinewtonsPerCentimeter(double value) { - double value = (double) decinewtonspercentimeter; return new ForcePerLength(value, ForcePerLengthUnit.DecinewtonPerCentimeter); } @@ -597,9 +590,8 @@ public static ForcePerLength FromDecinewtonsPerCentimeter(QuantityValue decinewt /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromDecinewtonsPerMeter(QuantityValue decinewtonspermeter) + public static ForcePerLength FromDecinewtonsPerMeter(double value) { - double value = (double) decinewtonspermeter; return new ForcePerLength(value, ForcePerLengthUnit.DecinewtonPerMeter); } @@ -607,9 +599,8 @@ public static ForcePerLength FromDecinewtonsPerMeter(QuantityValue decinewtonspe /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromDecinewtonsPerMillimeter(QuantityValue decinewtonspermillimeter) + public static ForcePerLength FromDecinewtonsPerMillimeter(double value) { - double value = (double) decinewtonspermillimeter; return new ForcePerLength(value, ForcePerLengthUnit.DecinewtonPerMillimeter); } @@ -617,9 +608,8 @@ public static ForcePerLength FromDecinewtonsPerMillimeter(QuantityValue decinewt /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromKilogramsForcePerCentimeter(QuantityValue kilogramsforcepercentimeter) + public static ForcePerLength FromKilogramsForcePerCentimeter(double value) { - double value = (double) kilogramsforcepercentimeter; return new ForcePerLength(value, ForcePerLengthUnit.KilogramForcePerCentimeter); } @@ -627,9 +617,8 @@ public static ForcePerLength FromKilogramsForcePerCentimeter(QuantityValue kilog /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromKilogramsForcePerMeter(QuantityValue kilogramsforcepermeter) + public static ForcePerLength FromKilogramsForcePerMeter(double value) { - double value = (double) kilogramsforcepermeter; return new ForcePerLength(value, ForcePerLengthUnit.KilogramForcePerMeter); } @@ -637,9 +626,8 @@ public static ForcePerLength FromKilogramsForcePerMeter(QuantityValue kilogramsf /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromKilogramsForcePerMillimeter(QuantityValue kilogramsforcepermillimeter) + public static ForcePerLength FromKilogramsForcePerMillimeter(double value) { - double value = (double) kilogramsforcepermillimeter; return new ForcePerLength(value, ForcePerLengthUnit.KilogramForcePerMillimeter); } @@ -647,9 +635,8 @@ public static ForcePerLength FromKilogramsForcePerMillimeter(QuantityValue kilog /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromKilonewtonsPerCentimeter(QuantityValue kilonewtonspercentimeter) + public static ForcePerLength FromKilonewtonsPerCentimeter(double value) { - double value = (double) kilonewtonspercentimeter; return new ForcePerLength(value, ForcePerLengthUnit.KilonewtonPerCentimeter); } @@ -657,9 +644,8 @@ public static ForcePerLength FromKilonewtonsPerCentimeter(QuantityValue kilonewt /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromKilonewtonsPerMeter(QuantityValue kilonewtonspermeter) + public static ForcePerLength FromKilonewtonsPerMeter(double value) { - double value = (double) kilonewtonspermeter; return new ForcePerLength(value, ForcePerLengthUnit.KilonewtonPerMeter); } @@ -667,9 +653,8 @@ public static ForcePerLength FromKilonewtonsPerMeter(QuantityValue kilonewtonspe /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromKilonewtonsPerMillimeter(QuantityValue kilonewtonspermillimeter) + public static ForcePerLength FromKilonewtonsPerMillimeter(double value) { - double value = (double) kilonewtonspermillimeter; return new ForcePerLength(value, ForcePerLengthUnit.KilonewtonPerMillimeter); } @@ -677,9 +662,8 @@ public static ForcePerLength FromKilonewtonsPerMillimeter(QuantityValue kilonewt /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromKilopoundsForcePerFoot(QuantityValue kilopoundsforceperfoot) + public static ForcePerLength FromKilopoundsForcePerFoot(double value) { - double value = (double) kilopoundsforceperfoot; return new ForcePerLength(value, ForcePerLengthUnit.KilopoundForcePerFoot); } @@ -687,9 +671,8 @@ public static ForcePerLength FromKilopoundsForcePerFoot(QuantityValue kilopounds /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromKilopoundsForcePerInch(QuantityValue kilopoundsforceperinch) + public static ForcePerLength FromKilopoundsForcePerInch(double value) { - double value = (double) kilopoundsforceperinch; return new ForcePerLength(value, ForcePerLengthUnit.KilopoundForcePerInch); } @@ -697,9 +680,8 @@ public static ForcePerLength FromKilopoundsForcePerInch(QuantityValue kilopounds /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromMeganewtonsPerCentimeter(QuantityValue meganewtonspercentimeter) + public static ForcePerLength FromMeganewtonsPerCentimeter(double value) { - double value = (double) meganewtonspercentimeter; return new ForcePerLength(value, ForcePerLengthUnit.MeganewtonPerCentimeter); } @@ -707,9 +689,8 @@ public static ForcePerLength FromMeganewtonsPerCentimeter(QuantityValue meganewt /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromMeganewtonsPerMeter(QuantityValue meganewtonspermeter) + public static ForcePerLength FromMeganewtonsPerMeter(double value) { - double value = (double) meganewtonspermeter; return new ForcePerLength(value, ForcePerLengthUnit.MeganewtonPerMeter); } @@ -717,9 +698,8 @@ public static ForcePerLength FromMeganewtonsPerMeter(QuantityValue meganewtonspe /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromMeganewtonsPerMillimeter(QuantityValue meganewtonspermillimeter) + public static ForcePerLength FromMeganewtonsPerMillimeter(double value) { - double value = (double) meganewtonspermillimeter; return new ForcePerLength(value, ForcePerLengthUnit.MeganewtonPerMillimeter); } @@ -727,9 +707,8 @@ public static ForcePerLength FromMeganewtonsPerMillimeter(QuantityValue meganewt /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromMicronewtonsPerCentimeter(QuantityValue micronewtonspercentimeter) + public static ForcePerLength FromMicronewtonsPerCentimeter(double value) { - double value = (double) micronewtonspercentimeter; return new ForcePerLength(value, ForcePerLengthUnit.MicronewtonPerCentimeter); } @@ -737,9 +716,8 @@ public static ForcePerLength FromMicronewtonsPerCentimeter(QuantityValue microne /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromMicronewtonsPerMeter(QuantityValue micronewtonspermeter) + public static ForcePerLength FromMicronewtonsPerMeter(double value) { - double value = (double) micronewtonspermeter; return new ForcePerLength(value, ForcePerLengthUnit.MicronewtonPerMeter); } @@ -747,9 +725,8 @@ public static ForcePerLength FromMicronewtonsPerMeter(QuantityValue micronewtons /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromMicronewtonsPerMillimeter(QuantityValue micronewtonspermillimeter) + public static ForcePerLength FromMicronewtonsPerMillimeter(double value) { - double value = (double) micronewtonspermillimeter; return new ForcePerLength(value, ForcePerLengthUnit.MicronewtonPerMillimeter); } @@ -757,9 +734,8 @@ public static ForcePerLength FromMicronewtonsPerMillimeter(QuantityValue microne /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromMillinewtonsPerCentimeter(QuantityValue millinewtonspercentimeter) + public static ForcePerLength FromMillinewtonsPerCentimeter(double value) { - double value = (double) millinewtonspercentimeter; return new ForcePerLength(value, ForcePerLengthUnit.MillinewtonPerCentimeter); } @@ -767,9 +743,8 @@ public static ForcePerLength FromMillinewtonsPerCentimeter(QuantityValue milline /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromMillinewtonsPerMeter(QuantityValue millinewtonspermeter) + public static ForcePerLength FromMillinewtonsPerMeter(double value) { - double value = (double) millinewtonspermeter; return new ForcePerLength(value, ForcePerLengthUnit.MillinewtonPerMeter); } @@ -777,9 +752,8 @@ public static ForcePerLength FromMillinewtonsPerMeter(QuantityValue millinewtons /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromMillinewtonsPerMillimeter(QuantityValue millinewtonspermillimeter) + public static ForcePerLength FromMillinewtonsPerMillimeter(double value) { - double value = (double) millinewtonspermillimeter; return new ForcePerLength(value, ForcePerLengthUnit.MillinewtonPerMillimeter); } @@ -787,9 +761,8 @@ public static ForcePerLength FromMillinewtonsPerMillimeter(QuantityValue milline /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromNanonewtonsPerCentimeter(QuantityValue nanonewtonspercentimeter) + public static ForcePerLength FromNanonewtonsPerCentimeter(double value) { - double value = (double) nanonewtonspercentimeter; return new ForcePerLength(value, ForcePerLengthUnit.NanonewtonPerCentimeter); } @@ -797,9 +770,8 @@ public static ForcePerLength FromNanonewtonsPerCentimeter(QuantityValue nanonewt /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromNanonewtonsPerMeter(QuantityValue nanonewtonspermeter) + public static ForcePerLength FromNanonewtonsPerMeter(double value) { - double value = (double) nanonewtonspermeter; return new ForcePerLength(value, ForcePerLengthUnit.NanonewtonPerMeter); } @@ -807,9 +779,8 @@ public static ForcePerLength FromNanonewtonsPerMeter(QuantityValue nanonewtonspe /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromNanonewtonsPerMillimeter(QuantityValue nanonewtonspermillimeter) + public static ForcePerLength FromNanonewtonsPerMillimeter(double value) { - double value = (double) nanonewtonspermillimeter; return new ForcePerLength(value, ForcePerLengthUnit.NanonewtonPerMillimeter); } @@ -817,9 +788,8 @@ public static ForcePerLength FromNanonewtonsPerMillimeter(QuantityValue nanonewt /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromNewtonsPerCentimeter(QuantityValue newtonspercentimeter) + public static ForcePerLength FromNewtonsPerCentimeter(double value) { - double value = (double) newtonspercentimeter; return new ForcePerLength(value, ForcePerLengthUnit.NewtonPerCentimeter); } @@ -827,9 +797,8 @@ public static ForcePerLength FromNewtonsPerCentimeter(QuantityValue newtonsperce /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromNewtonsPerMeter(QuantityValue newtonspermeter) + public static ForcePerLength FromNewtonsPerMeter(double value) { - double value = (double) newtonspermeter; return new ForcePerLength(value, ForcePerLengthUnit.NewtonPerMeter); } @@ -837,9 +806,8 @@ public static ForcePerLength FromNewtonsPerMeter(QuantityValue newtonspermeter) /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromNewtonsPerMillimeter(QuantityValue newtonspermillimeter) + public static ForcePerLength FromNewtonsPerMillimeter(double value) { - double value = (double) newtonspermillimeter; return new ForcePerLength(value, ForcePerLengthUnit.NewtonPerMillimeter); } @@ -847,9 +815,8 @@ public static ForcePerLength FromNewtonsPerMillimeter(QuantityValue newtonspermi /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromPoundsForcePerFoot(QuantityValue poundsforceperfoot) + public static ForcePerLength FromPoundsForcePerFoot(double value) { - double value = (double) poundsforceperfoot; return new ForcePerLength(value, ForcePerLengthUnit.PoundForcePerFoot); } @@ -857,9 +824,8 @@ public static ForcePerLength FromPoundsForcePerFoot(QuantityValue poundsforceper /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromPoundsForcePerInch(QuantityValue poundsforceperinch) + public static ForcePerLength FromPoundsForcePerInch(double value) { - double value = (double) poundsforceperinch; return new ForcePerLength(value, ForcePerLengthUnit.PoundForcePerInch); } @@ -867,9 +833,8 @@ public static ForcePerLength FromPoundsForcePerInch(QuantityValue poundsforceper /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromPoundsForcePerYard(QuantityValue poundsforceperyard) + public static ForcePerLength FromPoundsForcePerYard(double value) { - double value = (double) poundsforceperyard; return new ForcePerLength(value, ForcePerLengthUnit.PoundForcePerYard); } @@ -877,9 +842,8 @@ public static ForcePerLength FromPoundsForcePerYard(QuantityValue poundsforceper /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromTonnesForcePerCentimeter(QuantityValue tonnesforcepercentimeter) + public static ForcePerLength FromTonnesForcePerCentimeter(double value) { - double value = (double) tonnesforcepercentimeter; return new ForcePerLength(value, ForcePerLengthUnit.TonneForcePerCentimeter); } @@ -887,9 +851,8 @@ public static ForcePerLength FromTonnesForcePerCentimeter(QuantityValue tonnesfo /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromTonnesForcePerMeter(QuantityValue tonnesforcepermeter) + public static ForcePerLength FromTonnesForcePerMeter(double value) { - double value = (double) tonnesforcepermeter; return new ForcePerLength(value, ForcePerLengthUnit.TonneForcePerMeter); } @@ -897,9 +860,8 @@ public static ForcePerLength FromTonnesForcePerMeter(QuantityValue tonnesforcepe /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromTonnesForcePerMillimeter(QuantityValue tonnesforcepermillimeter) + public static ForcePerLength FromTonnesForcePerMillimeter(double value) { - double value = (double) tonnesforcepermillimeter; return new ForcePerLength(value, ForcePerLengthUnit.TonneForcePerMillimeter); } @@ -909,9 +871,9 @@ public static ForcePerLength FromTonnesForcePerMillimeter(QuantityValue tonnesfo /// Value to convert from. /// Unit to convert from. /// ForcePerLength unit value. - public static ForcePerLength From(QuantityValue value, ForcePerLengthUnit fromUnit) + public static ForcePerLength From(double value, ForcePerLengthUnit fromUnit) { - return new ForcePerLength((double)value, fromUnit); + return new ForcePerLength(value, fromUnit); } #endregion @@ -1356,15 +1318,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is ForcePerLengthUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ForcePerLengthUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is ForcePerLengthUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ForcePerLengthUnit)} is supported.", nameof(unit)); @@ -1553,18 +1506,6 @@ public ForcePerLength ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not ForcePerLengthUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ForcePerLengthUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/Frequency.g.cs b/UnitsNet/GeneratedCode/Quantities/Frequency.g.cs index c47f8d33d8..475e716416 100644 --- a/UnitsNet/GeneratedCode/Quantities/Frequency.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Frequency.g.cs @@ -40,7 +40,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct Frequency : - IArithmeticQuantity, + IArithmeticQuantity, #if NET7_0_OR_GREATER IMultiplyOperators, #endif @@ -165,7 +165,7 @@ public Frequency(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -323,9 +323,8 @@ public static string GetAbbreviation(FrequencyUnit unit, IFormatProvider? provid /// Creates a from . /// /// If value is NaN or Infinity. - public static Frequency FromBeatsPerMinute(QuantityValue beatsperminute) + public static Frequency FromBeatsPerMinute(double value) { - double value = (double) beatsperminute; return new Frequency(value, FrequencyUnit.BeatPerMinute); } @@ -333,9 +332,8 @@ public static Frequency FromBeatsPerMinute(QuantityValue beatsperminute) /// Creates a from . /// /// If value is NaN or Infinity. - public static Frequency FromBUnits(QuantityValue bunits) + public static Frequency FromBUnits(double value) { - double value = (double) bunits; return new Frequency(value, FrequencyUnit.BUnit); } @@ -343,9 +341,8 @@ public static Frequency FromBUnits(QuantityValue bunits) /// Creates a from . /// /// If value is NaN or Infinity. - public static Frequency FromCyclesPerHour(QuantityValue cyclesperhour) + public static Frequency FromCyclesPerHour(double value) { - double value = (double) cyclesperhour; return new Frequency(value, FrequencyUnit.CyclePerHour); } @@ -353,9 +350,8 @@ public static Frequency FromCyclesPerHour(QuantityValue cyclesperhour) /// Creates a from . /// /// If value is NaN or Infinity. - public static Frequency FromCyclesPerMinute(QuantityValue cyclesperminute) + public static Frequency FromCyclesPerMinute(double value) { - double value = (double) cyclesperminute; return new Frequency(value, FrequencyUnit.CyclePerMinute); } @@ -363,9 +359,8 @@ public static Frequency FromCyclesPerMinute(QuantityValue cyclesperminute) /// Creates a from . /// /// If value is NaN or Infinity. - public static Frequency FromGigahertz(QuantityValue gigahertz) + public static Frequency FromGigahertz(double value) { - double value = (double) gigahertz; return new Frequency(value, FrequencyUnit.Gigahertz); } @@ -373,9 +368,8 @@ public static Frequency FromGigahertz(QuantityValue gigahertz) /// Creates a from . /// /// If value is NaN or Infinity. - public static Frequency FromHertz(QuantityValue hertz) + public static Frequency FromHertz(double value) { - double value = (double) hertz; return new Frequency(value, FrequencyUnit.Hertz); } @@ -383,9 +377,8 @@ public static Frequency FromHertz(QuantityValue hertz) /// Creates a from . /// /// If value is NaN or Infinity. - public static Frequency FromKilohertz(QuantityValue kilohertz) + public static Frequency FromKilohertz(double value) { - double value = (double) kilohertz; return new Frequency(value, FrequencyUnit.Kilohertz); } @@ -393,9 +386,8 @@ public static Frequency FromKilohertz(QuantityValue kilohertz) /// Creates a from . /// /// If value is NaN or Infinity. - public static Frequency FromMegahertz(QuantityValue megahertz) + public static Frequency FromMegahertz(double value) { - double value = (double) megahertz; return new Frequency(value, FrequencyUnit.Megahertz); } @@ -403,9 +395,8 @@ public static Frequency FromMegahertz(QuantityValue megahertz) /// Creates a from . /// /// If value is NaN or Infinity. - public static Frequency FromMicrohertz(QuantityValue microhertz) + public static Frequency FromMicrohertz(double value) { - double value = (double) microhertz; return new Frequency(value, FrequencyUnit.Microhertz); } @@ -413,9 +404,8 @@ public static Frequency FromMicrohertz(QuantityValue microhertz) /// Creates a from . /// /// If value is NaN or Infinity. - public static Frequency FromMillihertz(QuantityValue millihertz) + public static Frequency FromMillihertz(double value) { - double value = (double) millihertz; return new Frequency(value, FrequencyUnit.Millihertz); } @@ -423,9 +413,8 @@ public static Frequency FromMillihertz(QuantityValue millihertz) /// Creates a from . /// /// If value is NaN or Infinity. - public static Frequency FromPerSecond(QuantityValue persecond) + public static Frequency FromPerSecond(double value) { - double value = (double) persecond; return new Frequency(value, FrequencyUnit.PerSecond); } @@ -433,9 +422,8 @@ public static Frequency FromPerSecond(QuantityValue persecond) /// Creates a from . /// /// If value is NaN or Infinity. - public static Frequency FromRadiansPerSecond(QuantityValue radianspersecond) + public static Frequency FromRadiansPerSecond(double value) { - double value = (double) radianspersecond; return new Frequency(value, FrequencyUnit.RadianPerSecond); } @@ -443,9 +431,8 @@ public static Frequency FromRadiansPerSecond(QuantityValue radianspersecond) /// Creates a from . /// /// If value is NaN or Infinity. - public static Frequency FromTerahertz(QuantityValue terahertz) + public static Frequency FromTerahertz(double value) { - double value = (double) terahertz; return new Frequency(value, FrequencyUnit.Terahertz); } @@ -455,9 +442,9 @@ public static Frequency FromTerahertz(QuantityValue terahertz) /// Value to convert from. /// Unit to convert from. /// Frequency unit value. - public static Frequency From(QuantityValue value, FrequencyUnit fromUnit) + public static Frequency From(double value, FrequencyUnit fromUnit) { - return new Frequency((double)value, fromUnit); + return new Frequency(value, fromUnit); } #endregion @@ -878,15 +865,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is FrequencyUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(FrequencyUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is FrequencyUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(FrequencyUnit)} is supported.", nameof(unit)); @@ -1025,18 +1003,6 @@ public Frequency ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not FrequencyUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(FrequencyUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/FuelEfficiency.g.cs b/UnitsNet/GeneratedCode/Quantities/FuelEfficiency.g.cs index 58ea11bbd4..66a00f14f6 100644 --- a/UnitsNet/GeneratedCode/Quantities/FuelEfficiency.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/FuelEfficiency.g.cs @@ -40,7 +40,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct FuelEfficiency : - IArithmeticQuantity, + IArithmeticQuantity, IComparable, IComparable, IConvertible, @@ -153,7 +153,7 @@ public FuelEfficiency(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -248,9 +248,8 @@ public static string GetAbbreviation(FuelEfficiencyUnit unit, IFormatProvider? p /// Creates a from . /// /// If value is NaN or Infinity. - public static FuelEfficiency FromKilometersPerLiter(QuantityValue kilometersperliter) + public static FuelEfficiency FromKilometersPerLiter(double value) { - double value = (double) kilometersperliter; return new FuelEfficiency(value, FuelEfficiencyUnit.KilometerPerLiter); } @@ -258,9 +257,8 @@ public static FuelEfficiency FromKilometersPerLiter(QuantityValue kilometersperl /// Creates a from . /// /// If value is NaN or Infinity. - public static FuelEfficiency FromLitersPer100Kilometers(QuantityValue litersper100kilometers) + public static FuelEfficiency FromLitersPer100Kilometers(double value) { - double value = (double) litersper100kilometers; return new FuelEfficiency(value, FuelEfficiencyUnit.LiterPer100Kilometers); } @@ -268,9 +266,8 @@ public static FuelEfficiency FromLitersPer100Kilometers(QuantityValue litersper1 /// Creates a from . /// /// If value is NaN or Infinity. - public static FuelEfficiency FromMilesPerUkGallon(QuantityValue milesperukgallon) + public static FuelEfficiency FromMilesPerUkGallon(double value) { - double value = (double) milesperukgallon; return new FuelEfficiency(value, FuelEfficiencyUnit.MilePerUkGallon); } @@ -278,9 +275,8 @@ public static FuelEfficiency FromMilesPerUkGallon(QuantityValue milesperukgallon /// Creates a from . /// /// If value is NaN or Infinity. - public static FuelEfficiency FromMilesPerUsGallon(QuantityValue milesperusgallon) + public static FuelEfficiency FromMilesPerUsGallon(double value) { - double value = (double) milesperusgallon; return new FuelEfficiency(value, FuelEfficiencyUnit.MilePerUsGallon); } @@ -290,9 +286,9 @@ public static FuelEfficiency FromMilesPerUsGallon(QuantityValue milesperusgallon /// Value to convert from. /// Unit to convert from. /// FuelEfficiency unit value. - public static FuelEfficiency From(QuantityValue value, FuelEfficiencyUnit fromUnit) + public static FuelEfficiency From(double value, FuelEfficiencyUnit fromUnit) { - return new FuelEfficiency((double)value, fromUnit); + return new FuelEfficiency(value, fromUnit); } #endregion @@ -703,15 +699,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is FuelEfficiencyUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(FuelEfficiencyUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is FuelEfficiencyUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(FuelEfficiencyUnit)} is supported.", nameof(unit)); @@ -832,18 +819,6 @@ public FuelEfficiency ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not FuelEfficiencyUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(FuelEfficiencyUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/HeatFlux.g.cs b/UnitsNet/GeneratedCode/Quantities/HeatFlux.g.cs index ef3d60e6df..6a31f77be8 100644 --- a/UnitsNet/GeneratedCode/Quantities/HeatFlux.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/HeatFlux.g.cs @@ -40,7 +40,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct HeatFlux : - IArithmeticQuantity, + IArithmeticQuantity, #if NET7_0_OR_GREATER IMultiplyOperators, #endif @@ -170,7 +170,7 @@ public HeatFlux(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -363,9 +363,8 @@ public static string GetAbbreviation(HeatFluxUnit unit, IFormatProvider? provide /// Creates a from . /// /// If value is NaN or Infinity. - public static HeatFlux FromBtusPerHourSquareFoot(QuantityValue btusperhoursquarefoot) + public static HeatFlux FromBtusPerHourSquareFoot(double value) { - double value = (double) btusperhoursquarefoot; return new HeatFlux(value, HeatFluxUnit.BtuPerHourSquareFoot); } @@ -373,9 +372,8 @@ public static HeatFlux FromBtusPerHourSquareFoot(QuantityValue btusperhoursquare /// Creates a from . /// /// If value is NaN or Infinity. - public static HeatFlux FromBtusPerMinuteSquareFoot(QuantityValue btusperminutesquarefoot) + public static HeatFlux FromBtusPerMinuteSquareFoot(double value) { - double value = (double) btusperminutesquarefoot; return new HeatFlux(value, HeatFluxUnit.BtuPerMinuteSquareFoot); } @@ -383,9 +381,8 @@ public static HeatFlux FromBtusPerMinuteSquareFoot(QuantityValue btusperminutesq /// Creates a from . /// /// If value is NaN or Infinity. - public static HeatFlux FromBtusPerSecondSquareFoot(QuantityValue btuspersecondsquarefoot) + public static HeatFlux FromBtusPerSecondSquareFoot(double value) { - double value = (double) btuspersecondsquarefoot; return new HeatFlux(value, HeatFluxUnit.BtuPerSecondSquareFoot); } @@ -393,9 +390,8 @@ public static HeatFlux FromBtusPerSecondSquareFoot(QuantityValue btuspersecondsq /// Creates a from . /// /// If value is NaN or Infinity. - public static HeatFlux FromBtusPerSecondSquareInch(QuantityValue btuspersecondsquareinch) + public static HeatFlux FromBtusPerSecondSquareInch(double value) { - double value = (double) btuspersecondsquareinch; return new HeatFlux(value, HeatFluxUnit.BtuPerSecondSquareInch); } @@ -403,9 +399,8 @@ public static HeatFlux FromBtusPerSecondSquareInch(QuantityValue btuspersecondsq /// Creates a from . /// /// If value is NaN or Infinity. - public static HeatFlux FromCaloriesPerSecondSquareCentimeter(QuantityValue caloriespersecondsquarecentimeter) + public static HeatFlux FromCaloriesPerSecondSquareCentimeter(double value) { - double value = (double) caloriespersecondsquarecentimeter; return new HeatFlux(value, HeatFluxUnit.CaloriePerSecondSquareCentimeter); } @@ -413,9 +408,8 @@ public static HeatFlux FromCaloriesPerSecondSquareCentimeter(QuantityValue calor /// Creates a from . /// /// If value is NaN or Infinity. - public static HeatFlux FromCentiwattsPerSquareMeter(QuantityValue centiwattspersquaremeter) + public static HeatFlux FromCentiwattsPerSquareMeter(double value) { - double value = (double) centiwattspersquaremeter; return new HeatFlux(value, HeatFluxUnit.CentiwattPerSquareMeter); } @@ -423,9 +417,8 @@ public static HeatFlux FromCentiwattsPerSquareMeter(QuantityValue centiwattspers /// Creates a from . /// /// If value is NaN or Infinity. - public static HeatFlux FromDeciwattsPerSquareMeter(QuantityValue deciwattspersquaremeter) + public static HeatFlux FromDeciwattsPerSquareMeter(double value) { - double value = (double) deciwattspersquaremeter; return new HeatFlux(value, HeatFluxUnit.DeciwattPerSquareMeter); } @@ -433,9 +426,8 @@ public static HeatFlux FromDeciwattsPerSquareMeter(QuantityValue deciwattspersqu /// Creates a from . /// /// If value is NaN or Infinity. - public static HeatFlux FromKilocaloriesPerHourSquareMeter(QuantityValue kilocaloriesperhoursquaremeter) + public static HeatFlux FromKilocaloriesPerHourSquareMeter(double value) { - double value = (double) kilocaloriesperhoursquaremeter; return new HeatFlux(value, HeatFluxUnit.KilocaloriePerHourSquareMeter); } @@ -443,9 +435,8 @@ public static HeatFlux FromKilocaloriesPerHourSquareMeter(QuantityValue kilocalo /// Creates a from . /// /// If value is NaN or Infinity. - public static HeatFlux FromKilocaloriesPerSecondSquareCentimeter(QuantityValue kilocaloriespersecondsquarecentimeter) + public static HeatFlux FromKilocaloriesPerSecondSquareCentimeter(double value) { - double value = (double) kilocaloriespersecondsquarecentimeter; return new HeatFlux(value, HeatFluxUnit.KilocaloriePerSecondSquareCentimeter); } @@ -453,9 +444,8 @@ public static HeatFlux FromKilocaloriesPerSecondSquareCentimeter(QuantityValue k /// Creates a from . /// /// If value is NaN or Infinity. - public static HeatFlux FromKilowattsPerSquareMeter(QuantityValue kilowattspersquaremeter) + public static HeatFlux FromKilowattsPerSquareMeter(double value) { - double value = (double) kilowattspersquaremeter; return new HeatFlux(value, HeatFluxUnit.KilowattPerSquareMeter); } @@ -463,9 +453,8 @@ public static HeatFlux FromKilowattsPerSquareMeter(QuantityValue kilowattspersqu /// Creates a from . /// /// If value is NaN or Infinity. - public static HeatFlux FromMicrowattsPerSquareMeter(QuantityValue microwattspersquaremeter) + public static HeatFlux FromMicrowattsPerSquareMeter(double value) { - double value = (double) microwattspersquaremeter; return new HeatFlux(value, HeatFluxUnit.MicrowattPerSquareMeter); } @@ -473,9 +462,8 @@ public static HeatFlux FromMicrowattsPerSquareMeter(QuantityValue microwattspers /// Creates a from . /// /// If value is NaN or Infinity. - public static HeatFlux FromMilliwattsPerSquareMeter(QuantityValue milliwattspersquaremeter) + public static HeatFlux FromMilliwattsPerSquareMeter(double value) { - double value = (double) milliwattspersquaremeter; return new HeatFlux(value, HeatFluxUnit.MilliwattPerSquareMeter); } @@ -483,9 +471,8 @@ public static HeatFlux FromMilliwattsPerSquareMeter(QuantityValue milliwattspers /// Creates a from . /// /// If value is NaN or Infinity. - public static HeatFlux FromNanowattsPerSquareMeter(QuantityValue nanowattspersquaremeter) + public static HeatFlux FromNanowattsPerSquareMeter(double value) { - double value = (double) nanowattspersquaremeter; return new HeatFlux(value, HeatFluxUnit.NanowattPerSquareMeter); } @@ -493,9 +480,8 @@ public static HeatFlux FromNanowattsPerSquareMeter(QuantityValue nanowattspersqu /// Creates a from . /// /// If value is NaN or Infinity. - public static HeatFlux FromPoundsForcePerFootSecond(QuantityValue poundsforceperfootsecond) + public static HeatFlux FromPoundsForcePerFootSecond(double value) { - double value = (double) poundsforceperfootsecond; return new HeatFlux(value, HeatFluxUnit.PoundForcePerFootSecond); } @@ -503,9 +489,8 @@ public static HeatFlux FromPoundsForcePerFootSecond(QuantityValue poundsforceper /// Creates a from . /// /// If value is NaN or Infinity. - public static HeatFlux FromPoundsPerSecondCubed(QuantityValue poundspersecondcubed) + public static HeatFlux FromPoundsPerSecondCubed(double value) { - double value = (double) poundspersecondcubed; return new HeatFlux(value, HeatFluxUnit.PoundPerSecondCubed); } @@ -513,9 +498,8 @@ public static HeatFlux FromPoundsPerSecondCubed(QuantityValue poundspersecondcub /// Creates a from . /// /// If value is NaN or Infinity. - public static HeatFlux FromWattsPerSquareFoot(QuantityValue wattspersquarefoot) + public static HeatFlux FromWattsPerSquareFoot(double value) { - double value = (double) wattspersquarefoot; return new HeatFlux(value, HeatFluxUnit.WattPerSquareFoot); } @@ -523,9 +507,8 @@ public static HeatFlux FromWattsPerSquareFoot(QuantityValue wattspersquarefoot) /// Creates a from . /// /// If value is NaN or Infinity. - public static HeatFlux FromWattsPerSquareInch(QuantityValue wattspersquareinch) + public static HeatFlux FromWattsPerSquareInch(double value) { - double value = (double) wattspersquareinch; return new HeatFlux(value, HeatFluxUnit.WattPerSquareInch); } @@ -533,9 +516,8 @@ public static HeatFlux FromWattsPerSquareInch(QuantityValue wattspersquareinch) /// Creates a from . /// /// If value is NaN or Infinity. - public static HeatFlux FromWattsPerSquareMeter(QuantityValue wattspersquaremeter) + public static HeatFlux FromWattsPerSquareMeter(double value) { - double value = (double) wattspersquaremeter; return new HeatFlux(value, HeatFluxUnit.WattPerSquareMeter); } @@ -545,9 +527,9 @@ public static HeatFlux FromWattsPerSquareMeter(QuantityValue wattspersquaremeter /// Value to convert from. /// Unit to convert from. /// HeatFlux unit value. - public static HeatFlux From(QuantityValue value, HeatFluxUnit fromUnit) + public static HeatFlux From(double value, HeatFluxUnit fromUnit) { - return new HeatFlux((double)value, fromUnit); + return new HeatFlux(value, fromUnit); } #endregion @@ -968,15 +950,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is HeatFluxUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(HeatFluxUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is HeatFluxUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(HeatFluxUnit)} is supported.", nameof(unit)); @@ -1125,18 +1098,6 @@ public HeatFlux ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not HeatFluxUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(HeatFluxUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.g.cs b/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.g.cs index 6372f3d2b5..3b594f1644 100644 --- a/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.g.cs @@ -37,7 +37,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct HeatTransferCoefficient : - IArithmeticQuantity, + IArithmeticQuantity, IComparable, IComparable, IConvertible, @@ -152,7 +152,7 @@ public HeatTransferCoefficient(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -262,9 +262,8 @@ public static string GetAbbreviation(HeatTransferCoefficientUnit unit, IFormatPr /// Creates a from . /// /// If value is NaN or Infinity. - public static HeatTransferCoefficient FromBtusPerHourSquareFootDegreeFahrenheit(QuantityValue btusperhoursquarefootdegreefahrenheit) + public static HeatTransferCoefficient FromBtusPerHourSquareFootDegreeFahrenheit(double value) { - double value = (double) btusperhoursquarefootdegreefahrenheit; return new HeatTransferCoefficient(value, HeatTransferCoefficientUnit.BtuPerHourSquareFootDegreeFahrenheit); } @@ -273,9 +272,8 @@ public static HeatTransferCoefficient FromBtusPerHourSquareFootDegreeFahrenheit( /// /// If value is NaN or Infinity. [Obsolete("The name of this definition incorrectly omitted time as divisor, please use BtuPerHourSquareFootDegreeFahrenheit instead")] - public static HeatTransferCoefficient FromBtusPerSquareFootDegreeFahrenheit(QuantityValue btuspersquarefootdegreefahrenheit) + public static HeatTransferCoefficient FromBtusPerSquareFootDegreeFahrenheit(double value) { - double value = (double) btuspersquarefootdegreefahrenheit; return new HeatTransferCoefficient(value, HeatTransferCoefficientUnit.BtuPerSquareFootDegreeFahrenheit); } @@ -283,9 +281,8 @@ public static HeatTransferCoefficient FromBtusPerSquareFootDegreeFahrenheit(Quan /// Creates a from . /// /// If value is NaN or Infinity. - public static HeatTransferCoefficient FromCaloriesPerHourSquareMeterDegreeCelsius(QuantityValue caloriesperhoursquaremeterdegreecelsius) + public static HeatTransferCoefficient FromCaloriesPerHourSquareMeterDegreeCelsius(double value) { - double value = (double) caloriesperhoursquaremeterdegreecelsius; return new HeatTransferCoefficient(value, HeatTransferCoefficientUnit.CaloriePerHourSquareMeterDegreeCelsius); } @@ -293,9 +290,8 @@ public static HeatTransferCoefficient FromCaloriesPerHourSquareMeterDegreeCelsiu /// Creates a from . /// /// If value is NaN or Infinity. - public static HeatTransferCoefficient FromKilocaloriesPerHourSquareMeterDegreeCelsius(QuantityValue kilocaloriesperhoursquaremeterdegreecelsius) + public static HeatTransferCoefficient FromKilocaloriesPerHourSquareMeterDegreeCelsius(double value) { - double value = (double) kilocaloriesperhoursquaremeterdegreecelsius; return new HeatTransferCoefficient(value, HeatTransferCoefficientUnit.KilocaloriePerHourSquareMeterDegreeCelsius); } @@ -303,9 +299,8 @@ public static HeatTransferCoefficient FromKilocaloriesPerHourSquareMeterDegreeCe /// Creates a from . /// /// If value is NaN or Infinity. - public static HeatTransferCoefficient FromWattsPerSquareMeterCelsius(QuantityValue wattspersquaremetercelsius) + public static HeatTransferCoefficient FromWattsPerSquareMeterCelsius(double value) { - double value = (double) wattspersquaremetercelsius; return new HeatTransferCoefficient(value, HeatTransferCoefficientUnit.WattPerSquareMeterCelsius); } @@ -313,9 +308,8 @@ public static HeatTransferCoefficient FromWattsPerSquareMeterCelsius(QuantityVal /// Creates a from . /// /// If value is NaN or Infinity. - public static HeatTransferCoefficient FromWattsPerSquareMeterKelvin(QuantityValue wattspersquaremeterkelvin) + public static HeatTransferCoefficient FromWattsPerSquareMeterKelvin(double value) { - double value = (double) wattspersquaremeterkelvin; return new HeatTransferCoefficient(value, HeatTransferCoefficientUnit.WattPerSquareMeterKelvin); } @@ -325,9 +319,9 @@ public static HeatTransferCoefficient FromWattsPerSquareMeterKelvin(QuantityValu /// Value to convert from. /// Unit to convert from. /// HeatTransferCoefficient unit value. - public static HeatTransferCoefficient From(QuantityValue value, HeatTransferCoefficientUnit fromUnit) + public static HeatTransferCoefficient From(double value, HeatTransferCoefficientUnit fromUnit) { - return new HeatTransferCoefficient((double)value, fromUnit); + return new HeatTransferCoefficient(value, fromUnit); } #endregion @@ -738,15 +732,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is HeatTransferCoefficientUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(HeatTransferCoefficientUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is HeatTransferCoefficientUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(HeatTransferCoefficientUnit)} is supported.", nameof(unit)); @@ -871,18 +856,6 @@ public HeatTransferCoefficient ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not HeatTransferCoefficientUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(HeatTransferCoefficientUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/Illuminance.g.cs b/UnitsNet/GeneratedCode/Quantities/Illuminance.g.cs index 52e4d540ce..d3ec835c8b 100644 --- a/UnitsNet/GeneratedCode/Quantities/Illuminance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Illuminance.g.cs @@ -40,7 +40,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct Illuminance : - IArithmeticQuantity, + IArithmeticQuantity, IComparable, IComparable, IConvertible, @@ -153,7 +153,7 @@ public Illuminance(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -248,9 +248,8 @@ public static string GetAbbreviation(IlluminanceUnit unit, IFormatProvider? prov /// Creates a from . /// /// If value is NaN or Infinity. - public static Illuminance FromKilolux(QuantityValue kilolux) + public static Illuminance FromKilolux(double value) { - double value = (double) kilolux; return new Illuminance(value, IlluminanceUnit.Kilolux); } @@ -258,9 +257,8 @@ public static Illuminance FromKilolux(QuantityValue kilolux) /// Creates a from . /// /// If value is NaN or Infinity. - public static Illuminance FromLux(QuantityValue lux) + public static Illuminance FromLux(double value) { - double value = (double) lux; return new Illuminance(value, IlluminanceUnit.Lux); } @@ -268,9 +266,8 @@ public static Illuminance FromLux(QuantityValue lux) /// Creates a from . /// /// If value is NaN or Infinity. - public static Illuminance FromMegalux(QuantityValue megalux) + public static Illuminance FromMegalux(double value) { - double value = (double) megalux; return new Illuminance(value, IlluminanceUnit.Megalux); } @@ -278,9 +275,8 @@ public static Illuminance FromMegalux(QuantityValue megalux) /// Creates a from . /// /// If value is NaN or Infinity. - public static Illuminance FromMillilux(QuantityValue millilux) + public static Illuminance FromMillilux(double value) { - double value = (double) millilux; return new Illuminance(value, IlluminanceUnit.Millilux); } @@ -290,9 +286,9 @@ public static Illuminance FromMillilux(QuantityValue millilux) /// Value to convert from. /// Unit to convert from. /// Illuminance unit value. - public static Illuminance From(QuantityValue value, IlluminanceUnit fromUnit) + public static Illuminance From(double value, IlluminanceUnit fromUnit) { - return new Illuminance((double)value, fromUnit); + return new Illuminance(value, fromUnit); } #endregion @@ -703,15 +699,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is IlluminanceUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(IlluminanceUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is IlluminanceUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(IlluminanceUnit)} is supported.", nameof(unit)); @@ -832,18 +819,6 @@ public Illuminance ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not IlluminanceUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(IlluminanceUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/Impulse.g.cs b/UnitsNet/GeneratedCode/Quantities/Impulse.g.cs index 014956a017..3b0e7de806 100644 --- a/UnitsNet/GeneratedCode/Quantities/Impulse.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Impulse.g.cs @@ -37,7 +37,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct Impulse : - IArithmeticQuantity, + IArithmeticQuantity, IComparable, IComparable, IConvertible, @@ -159,7 +159,7 @@ public Impulse(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -317,9 +317,8 @@ public static string GetAbbreviation(ImpulseUnit unit, IFormatProvider? provider /// Creates a from . /// /// If value is NaN or Infinity. - public static Impulse FromCentinewtonSeconds(QuantityValue centinewtonseconds) + public static Impulse FromCentinewtonSeconds(double value) { - double value = (double) centinewtonseconds; return new Impulse(value, ImpulseUnit.CentinewtonSecond); } @@ -327,9 +326,8 @@ public static Impulse FromCentinewtonSeconds(QuantityValue centinewtonseconds) /// Creates a from . /// /// If value is NaN or Infinity. - public static Impulse FromDecanewtonSeconds(QuantityValue decanewtonseconds) + public static Impulse FromDecanewtonSeconds(double value) { - double value = (double) decanewtonseconds; return new Impulse(value, ImpulseUnit.DecanewtonSecond); } @@ -337,9 +335,8 @@ public static Impulse FromDecanewtonSeconds(QuantityValue decanewtonseconds) /// Creates a from . /// /// If value is NaN or Infinity. - public static Impulse FromDecinewtonSeconds(QuantityValue decinewtonseconds) + public static Impulse FromDecinewtonSeconds(double value) { - double value = (double) decinewtonseconds; return new Impulse(value, ImpulseUnit.DecinewtonSecond); } @@ -347,9 +344,8 @@ public static Impulse FromDecinewtonSeconds(QuantityValue decinewtonseconds) /// Creates a from . /// /// If value is NaN or Infinity. - public static Impulse FromKilogramMetersPerSecond(QuantityValue kilogrammeterspersecond) + public static Impulse FromKilogramMetersPerSecond(double value) { - double value = (double) kilogrammeterspersecond; return new Impulse(value, ImpulseUnit.KilogramMeterPerSecond); } @@ -357,9 +353,8 @@ public static Impulse FromKilogramMetersPerSecond(QuantityValue kilogrammeterspe /// Creates a from . /// /// If value is NaN or Infinity. - public static Impulse FromKilonewtonSeconds(QuantityValue kilonewtonseconds) + public static Impulse FromKilonewtonSeconds(double value) { - double value = (double) kilonewtonseconds; return new Impulse(value, ImpulseUnit.KilonewtonSecond); } @@ -367,9 +362,8 @@ public static Impulse FromKilonewtonSeconds(QuantityValue kilonewtonseconds) /// Creates a from . /// /// If value is NaN or Infinity. - public static Impulse FromMeganewtonSeconds(QuantityValue meganewtonseconds) + public static Impulse FromMeganewtonSeconds(double value) { - double value = (double) meganewtonseconds; return new Impulse(value, ImpulseUnit.MeganewtonSecond); } @@ -377,9 +371,8 @@ public static Impulse FromMeganewtonSeconds(QuantityValue meganewtonseconds) /// Creates a from . /// /// If value is NaN or Infinity. - public static Impulse FromMicronewtonSeconds(QuantityValue micronewtonseconds) + public static Impulse FromMicronewtonSeconds(double value) { - double value = (double) micronewtonseconds; return new Impulse(value, ImpulseUnit.MicronewtonSecond); } @@ -387,9 +380,8 @@ public static Impulse FromMicronewtonSeconds(QuantityValue micronewtonseconds) /// Creates a from . /// /// If value is NaN or Infinity. - public static Impulse FromMillinewtonSeconds(QuantityValue millinewtonseconds) + public static Impulse FromMillinewtonSeconds(double value) { - double value = (double) millinewtonseconds; return new Impulse(value, ImpulseUnit.MillinewtonSecond); } @@ -397,9 +389,8 @@ public static Impulse FromMillinewtonSeconds(QuantityValue millinewtonseconds) /// Creates a from . /// /// If value is NaN or Infinity. - public static Impulse FromNanonewtonSeconds(QuantityValue nanonewtonseconds) + public static Impulse FromNanonewtonSeconds(double value) { - double value = (double) nanonewtonseconds; return new Impulse(value, ImpulseUnit.NanonewtonSecond); } @@ -407,9 +398,8 @@ public static Impulse FromNanonewtonSeconds(QuantityValue nanonewtonseconds) /// Creates a from . /// /// If value is NaN or Infinity. - public static Impulse FromNewtonSeconds(QuantityValue newtonseconds) + public static Impulse FromNewtonSeconds(double value) { - double value = (double) newtonseconds; return new Impulse(value, ImpulseUnit.NewtonSecond); } @@ -417,9 +407,8 @@ public static Impulse FromNewtonSeconds(QuantityValue newtonseconds) /// Creates a from . /// /// If value is NaN or Infinity. - public static Impulse FromPoundFeetPerSecond(QuantityValue poundfeetpersecond) + public static Impulse FromPoundFeetPerSecond(double value) { - double value = (double) poundfeetpersecond; return new Impulse(value, ImpulseUnit.PoundFootPerSecond); } @@ -427,9 +416,8 @@ public static Impulse FromPoundFeetPerSecond(QuantityValue poundfeetpersecond) /// Creates a from . /// /// If value is NaN or Infinity. - public static Impulse FromPoundForceSeconds(QuantityValue poundforceseconds) + public static Impulse FromPoundForceSeconds(double value) { - double value = (double) poundforceseconds; return new Impulse(value, ImpulseUnit.PoundForceSecond); } @@ -437,9 +425,8 @@ public static Impulse FromPoundForceSeconds(QuantityValue poundforceseconds) /// Creates a from . /// /// If value is NaN or Infinity. - public static Impulse FromSlugFeetPerSecond(QuantityValue slugfeetpersecond) + public static Impulse FromSlugFeetPerSecond(double value) { - double value = (double) slugfeetpersecond; return new Impulse(value, ImpulseUnit.SlugFootPerSecond); } @@ -449,9 +436,9 @@ public static Impulse FromSlugFeetPerSecond(QuantityValue slugfeetpersecond) /// Value to convert from. /// Unit to convert from. /// Impulse unit value. - public static Impulse From(QuantityValue value, ImpulseUnit fromUnit) + public static Impulse From(double value, ImpulseUnit fromUnit) { - return new Impulse((double)value, fromUnit); + return new Impulse(value, fromUnit); } #endregion @@ -862,15 +849,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is ImpulseUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ImpulseUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is ImpulseUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ImpulseUnit)} is supported.", nameof(unit)); @@ -1009,18 +987,6 @@ public Impulse ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not ImpulseUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ImpulseUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/Information.g.cs b/UnitsNet/GeneratedCode/Quantities/Information.g.cs index 36dcc10bf3..cde77174b2 100644 --- a/UnitsNet/GeneratedCode/Quantities/Information.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Information.g.cs @@ -37,7 +37,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct Information : - IArithmeticQuantity, + IArithmeticQuantity, IComparable, IComparable, IConvertible, @@ -172,7 +172,7 @@ public Information(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -421,9 +421,8 @@ public static string GetAbbreviation(InformationUnit unit, IFormatProvider? prov /// Creates a from . /// /// If value is NaN or Infinity. - public static Information FromBits(QuantityValue bits) + public static Information FromBits(double value) { - double value = (double) bits; return new Information(value, InformationUnit.Bit); } @@ -431,9 +430,8 @@ public static Information FromBits(QuantityValue bits) /// Creates a from . /// /// If value is NaN or Infinity. - public static Information FromBytes(QuantityValue bytes) + public static Information FromBytes(double value) { - double value = (double) bytes; return new Information(value, InformationUnit.Byte); } @@ -441,9 +439,8 @@ public static Information FromBytes(QuantityValue bytes) /// Creates a from . /// /// If value is NaN or Infinity. - public static Information FromExabits(QuantityValue exabits) + public static Information FromExabits(double value) { - double value = (double) exabits; return new Information(value, InformationUnit.Exabit); } @@ -451,9 +448,8 @@ public static Information FromExabits(QuantityValue exabits) /// Creates a from . /// /// If value is NaN or Infinity. - public static Information FromExabytes(QuantityValue exabytes) + public static Information FromExabytes(double value) { - double value = (double) exabytes; return new Information(value, InformationUnit.Exabyte); } @@ -461,9 +457,8 @@ public static Information FromExabytes(QuantityValue exabytes) /// Creates a from . /// /// If value is NaN or Infinity. - public static Information FromExbibits(QuantityValue exbibits) + public static Information FromExbibits(double value) { - double value = (double) exbibits; return new Information(value, InformationUnit.Exbibit); } @@ -471,9 +466,8 @@ public static Information FromExbibits(QuantityValue exbibits) /// Creates a from . /// /// If value is NaN or Infinity. - public static Information FromExbibytes(QuantityValue exbibytes) + public static Information FromExbibytes(double value) { - double value = (double) exbibytes; return new Information(value, InformationUnit.Exbibyte); } @@ -481,9 +475,8 @@ public static Information FromExbibytes(QuantityValue exbibytes) /// Creates a from . /// /// If value is NaN or Infinity. - public static Information FromGibibits(QuantityValue gibibits) + public static Information FromGibibits(double value) { - double value = (double) gibibits; return new Information(value, InformationUnit.Gibibit); } @@ -491,9 +484,8 @@ public static Information FromGibibits(QuantityValue gibibits) /// Creates a from . /// /// If value is NaN or Infinity. - public static Information FromGibibytes(QuantityValue gibibytes) + public static Information FromGibibytes(double value) { - double value = (double) gibibytes; return new Information(value, InformationUnit.Gibibyte); } @@ -501,9 +493,8 @@ public static Information FromGibibytes(QuantityValue gibibytes) /// Creates a from . /// /// If value is NaN or Infinity. - public static Information FromGigabits(QuantityValue gigabits) + public static Information FromGigabits(double value) { - double value = (double) gigabits; return new Information(value, InformationUnit.Gigabit); } @@ -511,9 +502,8 @@ public static Information FromGigabits(QuantityValue gigabits) /// Creates a from . /// /// If value is NaN or Infinity. - public static Information FromGigabytes(QuantityValue gigabytes) + public static Information FromGigabytes(double value) { - double value = (double) gigabytes; return new Information(value, InformationUnit.Gigabyte); } @@ -521,9 +511,8 @@ public static Information FromGigabytes(QuantityValue gigabytes) /// Creates a from . /// /// If value is NaN or Infinity. - public static Information FromKibibits(QuantityValue kibibits) + public static Information FromKibibits(double value) { - double value = (double) kibibits; return new Information(value, InformationUnit.Kibibit); } @@ -531,9 +520,8 @@ public static Information FromKibibits(QuantityValue kibibits) /// Creates a from . /// /// If value is NaN or Infinity. - public static Information FromKibibytes(QuantityValue kibibytes) + public static Information FromKibibytes(double value) { - double value = (double) kibibytes; return new Information(value, InformationUnit.Kibibyte); } @@ -541,9 +529,8 @@ public static Information FromKibibytes(QuantityValue kibibytes) /// Creates a from . /// /// If value is NaN or Infinity. - public static Information FromKilobits(QuantityValue kilobits) + public static Information FromKilobits(double value) { - double value = (double) kilobits; return new Information(value, InformationUnit.Kilobit); } @@ -551,9 +538,8 @@ public static Information FromKilobits(QuantityValue kilobits) /// Creates a from . /// /// If value is NaN or Infinity. - public static Information FromKilobytes(QuantityValue kilobytes) + public static Information FromKilobytes(double value) { - double value = (double) kilobytes; return new Information(value, InformationUnit.Kilobyte); } @@ -561,9 +547,8 @@ public static Information FromKilobytes(QuantityValue kilobytes) /// Creates a from . /// /// If value is NaN or Infinity. - public static Information FromMebibits(QuantityValue mebibits) + public static Information FromMebibits(double value) { - double value = (double) mebibits; return new Information(value, InformationUnit.Mebibit); } @@ -571,9 +556,8 @@ public static Information FromMebibits(QuantityValue mebibits) /// Creates a from . /// /// If value is NaN or Infinity. - public static Information FromMebibytes(QuantityValue mebibytes) + public static Information FromMebibytes(double value) { - double value = (double) mebibytes; return new Information(value, InformationUnit.Mebibyte); } @@ -581,9 +565,8 @@ public static Information FromMebibytes(QuantityValue mebibytes) /// Creates a from . /// /// If value is NaN or Infinity. - public static Information FromMegabits(QuantityValue megabits) + public static Information FromMegabits(double value) { - double value = (double) megabits; return new Information(value, InformationUnit.Megabit); } @@ -591,9 +574,8 @@ public static Information FromMegabits(QuantityValue megabits) /// Creates a from . /// /// If value is NaN or Infinity. - public static Information FromMegabytes(QuantityValue megabytes) + public static Information FromMegabytes(double value) { - double value = (double) megabytes; return new Information(value, InformationUnit.Megabyte); } @@ -601,9 +583,8 @@ public static Information FromMegabytes(QuantityValue megabytes) /// Creates a from . /// /// If value is NaN or Infinity. - public static Information FromPebibits(QuantityValue pebibits) + public static Information FromPebibits(double value) { - double value = (double) pebibits; return new Information(value, InformationUnit.Pebibit); } @@ -611,9 +592,8 @@ public static Information FromPebibits(QuantityValue pebibits) /// Creates a from . /// /// If value is NaN or Infinity. - public static Information FromPebibytes(QuantityValue pebibytes) + public static Information FromPebibytes(double value) { - double value = (double) pebibytes; return new Information(value, InformationUnit.Pebibyte); } @@ -621,9 +601,8 @@ public static Information FromPebibytes(QuantityValue pebibytes) /// Creates a from . /// /// If value is NaN or Infinity. - public static Information FromPetabits(QuantityValue petabits) + public static Information FromPetabits(double value) { - double value = (double) petabits; return new Information(value, InformationUnit.Petabit); } @@ -631,9 +610,8 @@ public static Information FromPetabits(QuantityValue petabits) /// Creates a from . /// /// If value is NaN or Infinity. - public static Information FromPetabytes(QuantityValue petabytes) + public static Information FromPetabytes(double value) { - double value = (double) petabytes; return new Information(value, InformationUnit.Petabyte); } @@ -641,9 +619,8 @@ public static Information FromPetabytes(QuantityValue petabytes) /// Creates a from . /// /// If value is NaN or Infinity. - public static Information FromTebibits(QuantityValue tebibits) + public static Information FromTebibits(double value) { - double value = (double) tebibits; return new Information(value, InformationUnit.Tebibit); } @@ -651,9 +628,8 @@ public static Information FromTebibits(QuantityValue tebibits) /// Creates a from . /// /// If value is NaN or Infinity. - public static Information FromTebibytes(QuantityValue tebibytes) + public static Information FromTebibytes(double value) { - double value = (double) tebibytes; return new Information(value, InformationUnit.Tebibyte); } @@ -661,9 +637,8 @@ public static Information FromTebibytes(QuantityValue tebibytes) /// Creates a from . /// /// If value is NaN or Infinity. - public static Information FromTerabits(QuantityValue terabits) + public static Information FromTerabits(double value) { - double value = (double) terabits; return new Information(value, InformationUnit.Terabit); } @@ -671,9 +646,8 @@ public static Information FromTerabits(QuantityValue terabits) /// Creates a from . /// /// If value is NaN or Infinity. - public static Information FromTerabytes(QuantityValue terabytes) + public static Information FromTerabytes(double value) { - double value = (double) terabytes; return new Information(value, InformationUnit.Terabyte); } @@ -683,9 +657,9 @@ public static Information FromTerabytes(QuantityValue terabytes) /// Value to convert from. /// Unit to convert from. /// Information unit value. - public static Information From(QuantityValue value, InformationUnit fromUnit) + public static Information From(double value, InformationUnit fromUnit) { - return new Information((double)value, fromUnit); + return new Information(value, fromUnit); } #endregion @@ -1096,15 +1070,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is InformationUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(InformationUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is InformationUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(InformationUnit)} is supported.", nameof(unit)); @@ -1269,18 +1234,6 @@ public Information ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not InformationUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(InformationUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/Irradiance.g.cs b/UnitsNet/GeneratedCode/Quantities/Irradiance.g.cs index 678bc160ba..e2b5a1fac0 100644 --- a/UnitsNet/GeneratedCode/Quantities/Irradiance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Irradiance.g.cs @@ -37,7 +37,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct Irradiance : - IArithmeticQuantity, + IArithmeticQuantity, IComparable, IComparable, IConvertible, @@ -160,7 +160,7 @@ public Irradiance(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -325,9 +325,8 @@ public static string GetAbbreviation(IrradianceUnit unit, IFormatProvider? provi /// Creates a from . /// /// If value is NaN or Infinity. - public static Irradiance FromKilowattsPerSquareCentimeter(QuantityValue kilowattspersquarecentimeter) + public static Irradiance FromKilowattsPerSquareCentimeter(double value) { - double value = (double) kilowattspersquarecentimeter; return new Irradiance(value, IrradianceUnit.KilowattPerSquareCentimeter); } @@ -335,9 +334,8 @@ public static Irradiance FromKilowattsPerSquareCentimeter(QuantityValue kilowatt /// Creates a from . /// /// If value is NaN or Infinity. - public static Irradiance FromKilowattsPerSquareMeter(QuantityValue kilowattspersquaremeter) + public static Irradiance FromKilowattsPerSquareMeter(double value) { - double value = (double) kilowattspersquaremeter; return new Irradiance(value, IrradianceUnit.KilowattPerSquareMeter); } @@ -345,9 +343,8 @@ public static Irradiance FromKilowattsPerSquareMeter(QuantityValue kilowattspers /// Creates a from . /// /// If value is NaN or Infinity. - public static Irradiance FromMegawattsPerSquareCentimeter(QuantityValue megawattspersquarecentimeter) + public static Irradiance FromMegawattsPerSquareCentimeter(double value) { - double value = (double) megawattspersquarecentimeter; return new Irradiance(value, IrradianceUnit.MegawattPerSquareCentimeter); } @@ -355,9 +352,8 @@ public static Irradiance FromMegawattsPerSquareCentimeter(QuantityValue megawatt /// Creates a from . /// /// If value is NaN or Infinity. - public static Irradiance FromMegawattsPerSquareMeter(QuantityValue megawattspersquaremeter) + public static Irradiance FromMegawattsPerSquareMeter(double value) { - double value = (double) megawattspersquaremeter; return new Irradiance(value, IrradianceUnit.MegawattPerSquareMeter); } @@ -365,9 +361,8 @@ public static Irradiance FromMegawattsPerSquareMeter(QuantityValue megawattspers /// Creates a from . /// /// If value is NaN or Infinity. - public static Irradiance FromMicrowattsPerSquareCentimeter(QuantityValue microwattspersquarecentimeter) + public static Irradiance FromMicrowattsPerSquareCentimeter(double value) { - double value = (double) microwattspersquarecentimeter; return new Irradiance(value, IrradianceUnit.MicrowattPerSquareCentimeter); } @@ -375,9 +370,8 @@ public static Irradiance FromMicrowattsPerSquareCentimeter(QuantityValue microwa /// Creates a from . /// /// If value is NaN or Infinity. - public static Irradiance FromMicrowattsPerSquareMeter(QuantityValue microwattspersquaremeter) + public static Irradiance FromMicrowattsPerSquareMeter(double value) { - double value = (double) microwattspersquaremeter; return new Irradiance(value, IrradianceUnit.MicrowattPerSquareMeter); } @@ -385,9 +379,8 @@ public static Irradiance FromMicrowattsPerSquareMeter(QuantityValue microwattspe /// Creates a from . /// /// If value is NaN or Infinity. - public static Irradiance FromMilliwattsPerSquareCentimeter(QuantityValue milliwattspersquarecentimeter) + public static Irradiance FromMilliwattsPerSquareCentimeter(double value) { - double value = (double) milliwattspersquarecentimeter; return new Irradiance(value, IrradianceUnit.MilliwattPerSquareCentimeter); } @@ -395,9 +388,8 @@ public static Irradiance FromMilliwattsPerSquareCentimeter(QuantityValue milliwa /// Creates a from . /// /// If value is NaN or Infinity. - public static Irradiance FromMilliwattsPerSquareMeter(QuantityValue milliwattspersquaremeter) + public static Irradiance FromMilliwattsPerSquareMeter(double value) { - double value = (double) milliwattspersquaremeter; return new Irradiance(value, IrradianceUnit.MilliwattPerSquareMeter); } @@ -405,9 +397,8 @@ public static Irradiance FromMilliwattsPerSquareMeter(QuantityValue milliwattspe /// Creates a from . /// /// If value is NaN or Infinity. - public static Irradiance FromNanowattsPerSquareCentimeter(QuantityValue nanowattspersquarecentimeter) + public static Irradiance FromNanowattsPerSquareCentimeter(double value) { - double value = (double) nanowattspersquarecentimeter; return new Irradiance(value, IrradianceUnit.NanowattPerSquareCentimeter); } @@ -415,9 +406,8 @@ public static Irradiance FromNanowattsPerSquareCentimeter(QuantityValue nanowatt /// Creates a from . /// /// If value is NaN or Infinity. - public static Irradiance FromNanowattsPerSquareMeter(QuantityValue nanowattspersquaremeter) + public static Irradiance FromNanowattsPerSquareMeter(double value) { - double value = (double) nanowattspersquaremeter; return new Irradiance(value, IrradianceUnit.NanowattPerSquareMeter); } @@ -425,9 +415,8 @@ public static Irradiance FromNanowattsPerSquareMeter(QuantityValue nanowattspers /// Creates a from . /// /// If value is NaN or Infinity. - public static Irradiance FromPicowattsPerSquareCentimeter(QuantityValue picowattspersquarecentimeter) + public static Irradiance FromPicowattsPerSquareCentimeter(double value) { - double value = (double) picowattspersquarecentimeter; return new Irradiance(value, IrradianceUnit.PicowattPerSquareCentimeter); } @@ -435,9 +424,8 @@ public static Irradiance FromPicowattsPerSquareCentimeter(QuantityValue picowatt /// Creates a from . /// /// If value is NaN or Infinity. - public static Irradiance FromPicowattsPerSquareMeter(QuantityValue picowattspersquaremeter) + public static Irradiance FromPicowattsPerSquareMeter(double value) { - double value = (double) picowattspersquaremeter; return new Irradiance(value, IrradianceUnit.PicowattPerSquareMeter); } @@ -445,9 +433,8 @@ public static Irradiance FromPicowattsPerSquareMeter(QuantityValue picowattspers /// Creates a from . /// /// If value is NaN or Infinity. - public static Irradiance FromWattsPerSquareCentimeter(QuantityValue wattspersquarecentimeter) + public static Irradiance FromWattsPerSquareCentimeter(double value) { - double value = (double) wattspersquarecentimeter; return new Irradiance(value, IrradianceUnit.WattPerSquareCentimeter); } @@ -455,9 +442,8 @@ public static Irradiance FromWattsPerSquareCentimeter(QuantityValue wattspersqua /// Creates a from . /// /// If value is NaN or Infinity. - public static Irradiance FromWattsPerSquareMeter(QuantityValue wattspersquaremeter) + public static Irradiance FromWattsPerSquareMeter(double value) { - double value = (double) wattspersquaremeter; return new Irradiance(value, IrradianceUnit.WattPerSquareMeter); } @@ -467,9 +453,9 @@ public static Irradiance FromWattsPerSquareMeter(QuantityValue wattspersquaremet /// Value to convert from. /// Unit to convert from. /// Irradiance unit value. - public static Irradiance From(QuantityValue value, IrradianceUnit fromUnit) + public static Irradiance From(double value, IrradianceUnit fromUnit) { - return new Irradiance((double)value, fromUnit); + return new Irradiance(value, fromUnit); } #endregion @@ -880,15 +866,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is IrradianceUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(IrradianceUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is IrradianceUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(IrradianceUnit)} is supported.", nameof(unit)); @@ -1029,18 +1006,6 @@ public Irradiance ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not IrradianceUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(IrradianceUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/Irradiation.g.cs b/UnitsNet/GeneratedCode/Quantities/Irradiation.g.cs index e218c44001..b9aecce6af 100644 --- a/UnitsNet/GeneratedCode/Quantities/Irradiation.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Irradiation.g.cs @@ -40,7 +40,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct Irradiation : - IArithmeticQuantity, + IArithmeticQuantity, IComparable, IComparable, IConvertible, @@ -156,7 +156,7 @@ public Irradiation(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -272,9 +272,8 @@ public static string GetAbbreviation(IrradiationUnit unit, IFormatProvider? prov /// Creates a from . /// /// If value is NaN or Infinity. - public static Irradiation FromJoulesPerSquareCentimeter(QuantityValue joulespersquarecentimeter) + public static Irradiation FromJoulesPerSquareCentimeter(double value) { - double value = (double) joulespersquarecentimeter; return new Irradiation(value, IrradiationUnit.JoulePerSquareCentimeter); } @@ -282,9 +281,8 @@ public static Irradiation FromJoulesPerSquareCentimeter(QuantityValue joulespers /// Creates a from . /// /// If value is NaN or Infinity. - public static Irradiation FromJoulesPerSquareMeter(QuantityValue joulespersquaremeter) + public static Irradiation FromJoulesPerSquareMeter(double value) { - double value = (double) joulespersquaremeter; return new Irradiation(value, IrradiationUnit.JoulePerSquareMeter); } @@ -292,9 +290,8 @@ public static Irradiation FromJoulesPerSquareMeter(QuantityValue joulespersquare /// Creates a from . /// /// If value is NaN or Infinity. - public static Irradiation FromJoulesPerSquareMillimeter(QuantityValue joulespersquaremillimeter) + public static Irradiation FromJoulesPerSquareMillimeter(double value) { - double value = (double) joulespersquaremillimeter; return new Irradiation(value, IrradiationUnit.JoulePerSquareMillimeter); } @@ -302,9 +299,8 @@ public static Irradiation FromJoulesPerSquareMillimeter(QuantityValue joulespers /// Creates a from . /// /// If value is NaN or Infinity. - public static Irradiation FromKilojoulesPerSquareMeter(QuantityValue kilojoulespersquaremeter) + public static Irradiation FromKilojoulesPerSquareMeter(double value) { - double value = (double) kilojoulespersquaremeter; return new Irradiation(value, IrradiationUnit.KilojoulePerSquareMeter); } @@ -312,9 +308,8 @@ public static Irradiation FromKilojoulesPerSquareMeter(QuantityValue kilojoulesp /// Creates a from . /// /// If value is NaN or Infinity. - public static Irradiation FromKilowattHoursPerSquareMeter(QuantityValue kilowatthourspersquaremeter) + public static Irradiation FromKilowattHoursPerSquareMeter(double value) { - double value = (double) kilowatthourspersquaremeter; return new Irradiation(value, IrradiationUnit.KilowattHourPerSquareMeter); } @@ -322,9 +317,8 @@ public static Irradiation FromKilowattHoursPerSquareMeter(QuantityValue kilowatt /// Creates a from . /// /// If value is NaN or Infinity. - public static Irradiation FromMillijoulesPerSquareCentimeter(QuantityValue millijoulespersquarecentimeter) + public static Irradiation FromMillijoulesPerSquareCentimeter(double value) { - double value = (double) millijoulespersquarecentimeter; return new Irradiation(value, IrradiationUnit.MillijoulePerSquareCentimeter); } @@ -332,9 +326,8 @@ public static Irradiation FromMillijoulesPerSquareCentimeter(QuantityValue milli /// Creates a from . /// /// If value is NaN or Infinity. - public static Irradiation FromWattHoursPerSquareMeter(QuantityValue watthourspersquaremeter) + public static Irradiation FromWattHoursPerSquareMeter(double value) { - double value = (double) watthourspersquaremeter; return new Irradiation(value, IrradiationUnit.WattHourPerSquareMeter); } @@ -344,9 +337,9 @@ public static Irradiation FromWattHoursPerSquareMeter(QuantityValue watthoursper /// Value to convert from. /// Unit to convert from. /// Irradiation unit value. - public static Irradiation From(QuantityValue value, IrradiationUnit fromUnit) + public static Irradiation From(double value, IrradiationUnit fromUnit) { - return new Irradiation((double)value, fromUnit); + return new Irradiation(value, fromUnit); } #endregion @@ -757,15 +750,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is IrradiationUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(IrradiationUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is IrradiationUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(IrradiationUnit)} is supported.", nameof(unit)); @@ -892,18 +876,6 @@ public Irradiation ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not IrradiationUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(IrradiationUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/Jerk.g.cs b/UnitsNet/GeneratedCode/Quantities/Jerk.g.cs index 5ea97824d3..c52efa5dc8 100644 --- a/UnitsNet/GeneratedCode/Quantities/Jerk.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Jerk.g.cs @@ -37,7 +37,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct Jerk : - IArithmeticQuantity, + IArithmeticQuantity, IComparable, IComparable, IConvertible, @@ -157,7 +157,7 @@ public Jerk(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -301,9 +301,8 @@ public static string GetAbbreviation(JerkUnit unit, IFormatProvider? provider) /// Creates a from . /// /// If value is NaN or Infinity. - public static Jerk FromCentimetersPerSecondCubed(QuantityValue centimeterspersecondcubed) + public static Jerk FromCentimetersPerSecondCubed(double value) { - double value = (double) centimeterspersecondcubed; return new Jerk(value, JerkUnit.CentimeterPerSecondCubed); } @@ -311,9 +310,8 @@ public static Jerk FromCentimetersPerSecondCubed(QuantityValue centimeterspersec /// Creates a from . /// /// If value is NaN or Infinity. - public static Jerk FromDecimetersPerSecondCubed(QuantityValue decimeterspersecondcubed) + public static Jerk FromDecimetersPerSecondCubed(double value) { - double value = (double) decimeterspersecondcubed; return new Jerk(value, JerkUnit.DecimeterPerSecondCubed); } @@ -321,9 +319,8 @@ public static Jerk FromDecimetersPerSecondCubed(QuantityValue decimeterspersecon /// Creates a from . /// /// If value is NaN or Infinity. - public static Jerk FromFeetPerSecondCubed(QuantityValue feetpersecondcubed) + public static Jerk FromFeetPerSecondCubed(double value) { - double value = (double) feetpersecondcubed; return new Jerk(value, JerkUnit.FootPerSecondCubed); } @@ -331,9 +328,8 @@ public static Jerk FromFeetPerSecondCubed(QuantityValue feetpersecondcubed) /// Creates a from . /// /// If value is NaN or Infinity. - public static Jerk FromInchesPerSecondCubed(QuantityValue inchespersecondcubed) + public static Jerk FromInchesPerSecondCubed(double value) { - double value = (double) inchespersecondcubed; return new Jerk(value, JerkUnit.InchPerSecondCubed); } @@ -341,9 +337,8 @@ public static Jerk FromInchesPerSecondCubed(QuantityValue inchespersecondcubed) /// Creates a from . /// /// If value is NaN or Infinity. - public static Jerk FromKilometersPerSecondCubed(QuantityValue kilometerspersecondcubed) + public static Jerk FromKilometersPerSecondCubed(double value) { - double value = (double) kilometerspersecondcubed; return new Jerk(value, JerkUnit.KilometerPerSecondCubed); } @@ -351,9 +346,8 @@ public static Jerk FromKilometersPerSecondCubed(QuantityValue kilometerspersecon /// Creates a from . /// /// If value is NaN or Infinity. - public static Jerk FromMetersPerSecondCubed(QuantityValue meterspersecondcubed) + public static Jerk FromMetersPerSecondCubed(double value) { - double value = (double) meterspersecondcubed; return new Jerk(value, JerkUnit.MeterPerSecondCubed); } @@ -361,9 +355,8 @@ public static Jerk FromMetersPerSecondCubed(QuantityValue meterspersecondcubed) /// Creates a from . /// /// If value is NaN or Infinity. - public static Jerk FromMicrometersPerSecondCubed(QuantityValue micrometerspersecondcubed) + public static Jerk FromMicrometersPerSecondCubed(double value) { - double value = (double) micrometerspersecondcubed; return new Jerk(value, JerkUnit.MicrometerPerSecondCubed); } @@ -371,9 +364,8 @@ public static Jerk FromMicrometersPerSecondCubed(QuantityValue micrometerspersec /// Creates a from . /// /// If value is NaN or Infinity. - public static Jerk FromMillimetersPerSecondCubed(QuantityValue millimeterspersecondcubed) + public static Jerk FromMillimetersPerSecondCubed(double value) { - double value = (double) millimeterspersecondcubed; return new Jerk(value, JerkUnit.MillimeterPerSecondCubed); } @@ -381,9 +373,8 @@ public static Jerk FromMillimetersPerSecondCubed(QuantityValue millimeterspersec /// Creates a from . /// /// If value is NaN or Infinity. - public static Jerk FromMillistandardGravitiesPerSecond(QuantityValue millistandardgravitiespersecond) + public static Jerk FromMillistandardGravitiesPerSecond(double value) { - double value = (double) millistandardgravitiespersecond; return new Jerk(value, JerkUnit.MillistandardGravitiesPerSecond); } @@ -391,9 +382,8 @@ public static Jerk FromMillistandardGravitiesPerSecond(QuantityValue millistanda /// Creates a from . /// /// If value is NaN or Infinity. - public static Jerk FromNanometersPerSecondCubed(QuantityValue nanometerspersecondcubed) + public static Jerk FromNanometersPerSecondCubed(double value) { - double value = (double) nanometerspersecondcubed; return new Jerk(value, JerkUnit.NanometerPerSecondCubed); } @@ -401,9 +391,8 @@ public static Jerk FromNanometersPerSecondCubed(QuantityValue nanometerspersecon /// Creates a from . /// /// If value is NaN or Infinity. - public static Jerk FromStandardGravitiesPerSecond(QuantityValue standardgravitiespersecond) + public static Jerk FromStandardGravitiesPerSecond(double value) { - double value = (double) standardgravitiespersecond; return new Jerk(value, JerkUnit.StandardGravitiesPerSecond); } @@ -413,9 +402,9 @@ public static Jerk FromStandardGravitiesPerSecond(QuantityValue standardgravitie /// Value to convert from. /// Unit to convert from. /// Jerk unit value. - public static Jerk From(QuantityValue value, JerkUnit fromUnit) + public static Jerk From(double value, JerkUnit fromUnit) { - return new Jerk((double)value, fromUnit); + return new Jerk(value, fromUnit); } #endregion @@ -826,15 +815,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is JerkUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(JerkUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is JerkUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(JerkUnit)} is supported.", nameof(unit)); @@ -969,18 +949,6 @@ public Jerk ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not JerkUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(JerkUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.g.cs b/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.g.cs index cc7dc19d31..e668624bac 100644 --- a/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.g.cs @@ -43,7 +43,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct KinematicViscosity : - IArithmeticQuantity, + IArithmeticQuantity, #if NET7_0_OR_GREATER IMultiplyOperators, IMultiplyOperators, @@ -167,7 +167,7 @@ public KinematicViscosity(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -297,9 +297,8 @@ public static string GetAbbreviation(KinematicViscosityUnit unit, IFormatProvide /// Creates a from . /// /// If value is NaN or Infinity. - public static KinematicViscosity FromCentistokes(QuantityValue centistokes) + public static KinematicViscosity FromCentistokes(double value) { - double value = (double) centistokes; return new KinematicViscosity(value, KinematicViscosityUnit.Centistokes); } @@ -307,9 +306,8 @@ public static KinematicViscosity FromCentistokes(QuantityValue centistokes) /// Creates a from . /// /// If value is NaN or Infinity. - public static KinematicViscosity FromDecistokes(QuantityValue decistokes) + public static KinematicViscosity FromDecistokes(double value) { - double value = (double) decistokes; return new KinematicViscosity(value, KinematicViscosityUnit.Decistokes); } @@ -317,9 +315,8 @@ public static KinematicViscosity FromDecistokes(QuantityValue decistokes) /// Creates a from . /// /// If value is NaN or Infinity. - public static KinematicViscosity FromKilostokes(QuantityValue kilostokes) + public static KinematicViscosity FromKilostokes(double value) { - double value = (double) kilostokes; return new KinematicViscosity(value, KinematicViscosityUnit.Kilostokes); } @@ -327,9 +324,8 @@ public static KinematicViscosity FromKilostokes(QuantityValue kilostokes) /// Creates a from . /// /// If value is NaN or Infinity. - public static KinematicViscosity FromMicrostokes(QuantityValue microstokes) + public static KinematicViscosity FromMicrostokes(double value) { - double value = (double) microstokes; return new KinematicViscosity(value, KinematicViscosityUnit.Microstokes); } @@ -337,9 +333,8 @@ public static KinematicViscosity FromMicrostokes(QuantityValue microstokes) /// Creates a from . /// /// If value is NaN or Infinity. - public static KinematicViscosity FromMillistokes(QuantityValue millistokes) + public static KinematicViscosity FromMillistokes(double value) { - double value = (double) millistokes; return new KinematicViscosity(value, KinematicViscosityUnit.Millistokes); } @@ -347,9 +342,8 @@ public static KinematicViscosity FromMillistokes(QuantityValue millistokes) /// Creates a from . /// /// If value is NaN or Infinity. - public static KinematicViscosity FromNanostokes(QuantityValue nanostokes) + public static KinematicViscosity FromNanostokes(double value) { - double value = (double) nanostokes; return new KinematicViscosity(value, KinematicViscosityUnit.Nanostokes); } @@ -357,9 +351,8 @@ public static KinematicViscosity FromNanostokes(QuantityValue nanostokes) /// Creates a from . /// /// If value is NaN or Infinity. - public static KinematicViscosity FromSquareFeetPerSecond(QuantityValue squarefeetpersecond) + public static KinematicViscosity FromSquareFeetPerSecond(double value) { - double value = (double) squarefeetpersecond; return new KinematicViscosity(value, KinematicViscosityUnit.SquareFootPerSecond); } @@ -367,9 +360,8 @@ public static KinematicViscosity FromSquareFeetPerSecond(QuantityValue squarefee /// Creates a from . /// /// If value is NaN or Infinity. - public static KinematicViscosity FromSquareMetersPerSecond(QuantityValue squaremeterspersecond) + public static KinematicViscosity FromSquareMetersPerSecond(double value) { - double value = (double) squaremeterspersecond; return new KinematicViscosity(value, KinematicViscosityUnit.SquareMeterPerSecond); } @@ -377,9 +369,8 @@ public static KinematicViscosity FromSquareMetersPerSecond(QuantityValue squarem /// Creates a from . /// /// If value is NaN or Infinity. - public static KinematicViscosity FromStokes(QuantityValue stokes) + public static KinematicViscosity FromStokes(double value) { - double value = (double) stokes; return new KinematicViscosity(value, KinematicViscosityUnit.Stokes); } @@ -389,9 +380,9 @@ public static KinematicViscosity FromStokes(QuantityValue stokes) /// Value to convert from. /// Unit to convert from. /// KinematicViscosity unit value. - public static KinematicViscosity From(QuantityValue value, KinematicViscosityUnit fromUnit) + public static KinematicViscosity From(double value, KinematicViscosityUnit fromUnit) { - return new KinematicViscosity((double)value, fromUnit); + return new KinematicViscosity(value, fromUnit); } #endregion @@ -836,15 +827,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is KinematicViscosityUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(KinematicViscosityUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is KinematicViscosityUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(KinematicViscosityUnit)} is supported.", nameof(unit)); @@ -975,18 +957,6 @@ public KinematicViscosity ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not KinematicViscosityUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(KinematicViscosityUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/LeakRate.g.cs b/UnitsNet/GeneratedCode/Quantities/LeakRate.g.cs index 01406342cf..42c88fbd83 100644 --- a/UnitsNet/GeneratedCode/Quantities/LeakRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LeakRate.g.cs @@ -40,7 +40,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct LeakRate : - IArithmeticQuantity, + IArithmeticQuantity, IComparable, IComparable, IConvertible, @@ -152,7 +152,7 @@ public LeakRate(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -240,9 +240,8 @@ public static string GetAbbreviation(LeakRateUnit unit, IFormatProvider? provide /// Creates a from . /// /// If value is NaN or Infinity. - public static LeakRate FromMillibarLitersPerSecond(QuantityValue millibarliterspersecond) + public static LeakRate FromMillibarLitersPerSecond(double value) { - double value = (double) millibarliterspersecond; return new LeakRate(value, LeakRateUnit.MillibarLiterPerSecond); } @@ -250,9 +249,8 @@ public static LeakRate FromMillibarLitersPerSecond(QuantityValue millibarlitersp /// Creates a from . /// /// If value is NaN or Infinity. - public static LeakRate FromPascalCubicMetersPerSecond(QuantityValue pascalcubicmeterspersecond) + public static LeakRate FromPascalCubicMetersPerSecond(double value) { - double value = (double) pascalcubicmeterspersecond; return new LeakRate(value, LeakRateUnit.PascalCubicMeterPerSecond); } @@ -260,9 +258,8 @@ public static LeakRate FromPascalCubicMetersPerSecond(QuantityValue pascalcubicm /// Creates a from . /// /// If value is NaN or Infinity. - public static LeakRate FromTorrLitersPerSecond(QuantityValue torrliterspersecond) + public static LeakRate FromTorrLitersPerSecond(double value) { - double value = (double) torrliterspersecond; return new LeakRate(value, LeakRateUnit.TorrLiterPerSecond); } @@ -272,9 +269,9 @@ public static LeakRate FromTorrLitersPerSecond(QuantityValue torrliterspersecond /// Value to convert from. /// Unit to convert from. /// LeakRate unit value. - public static LeakRate From(QuantityValue value, LeakRateUnit fromUnit) + public static LeakRate From(double value, LeakRateUnit fromUnit) { - return new LeakRate((double)value, fromUnit); + return new LeakRate(value, fromUnit); } #endregion @@ -685,15 +682,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is LeakRateUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(LeakRateUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is LeakRateUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(LeakRateUnit)} is supported.", nameof(unit)); @@ -812,18 +800,6 @@ public LeakRate ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not LeakRateUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(LeakRateUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/Length.g.cs b/UnitsNet/GeneratedCode/Quantities/Length.g.cs index e97ae64cdc..bd849fd3e5 100644 --- a/UnitsNet/GeneratedCode/Quantities/Length.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Length.g.cs @@ -40,7 +40,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct Length : - IArithmeticQuantity, + IArithmeticQuantity, #if NET7_0_OR_GREATER IMultiplyOperators, IDivisionOperators, @@ -205,7 +205,7 @@ public Length(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -566,9 +566,8 @@ public static string GetAbbreviation(LengthUnit unit, IFormatProvider? provider) /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromAngstroms(QuantityValue angstroms) + public static Length FromAngstroms(double value) { - double value = (double) angstroms; return new Length(value, LengthUnit.Angstrom); } @@ -576,9 +575,8 @@ public static Length FromAngstroms(QuantityValue angstroms) /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromAstronomicalUnits(QuantityValue astronomicalunits) + public static Length FromAstronomicalUnits(double value) { - double value = (double) astronomicalunits; return new Length(value, LengthUnit.AstronomicalUnit); } @@ -586,9 +584,8 @@ public static Length FromAstronomicalUnits(QuantityValue astronomicalunits) /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromCentimeters(QuantityValue centimeters) + public static Length FromCentimeters(double value) { - double value = (double) centimeters; return new Length(value, LengthUnit.Centimeter); } @@ -596,9 +593,8 @@ public static Length FromCentimeters(QuantityValue centimeters) /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromChains(QuantityValue chains) + public static Length FromChains(double value) { - double value = (double) chains; return new Length(value, LengthUnit.Chain); } @@ -606,9 +602,8 @@ public static Length FromChains(QuantityValue chains) /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromDataMiles(QuantityValue datamiles) + public static Length FromDataMiles(double value) { - double value = (double) datamiles; return new Length(value, LengthUnit.DataMile); } @@ -616,9 +611,8 @@ public static Length FromDataMiles(QuantityValue datamiles) /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromDecameters(QuantityValue decameters) + public static Length FromDecameters(double value) { - double value = (double) decameters; return new Length(value, LengthUnit.Decameter); } @@ -626,9 +620,8 @@ public static Length FromDecameters(QuantityValue decameters) /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromDecimeters(QuantityValue decimeters) + public static Length FromDecimeters(double value) { - double value = (double) decimeters; return new Length(value, LengthUnit.Decimeter); } @@ -636,9 +629,8 @@ public static Length FromDecimeters(QuantityValue decimeters) /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromDtpPicas(QuantityValue dtppicas) + public static Length FromDtpPicas(double value) { - double value = (double) dtppicas; return new Length(value, LengthUnit.DtpPica); } @@ -646,9 +638,8 @@ public static Length FromDtpPicas(QuantityValue dtppicas) /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromDtpPoints(QuantityValue dtppoints) + public static Length FromDtpPoints(double value) { - double value = (double) dtppoints; return new Length(value, LengthUnit.DtpPoint); } @@ -656,9 +647,8 @@ public static Length FromDtpPoints(QuantityValue dtppoints) /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromFathoms(QuantityValue fathoms) + public static Length FromFathoms(double value) { - double value = (double) fathoms; return new Length(value, LengthUnit.Fathom); } @@ -666,9 +656,8 @@ public static Length FromFathoms(QuantityValue fathoms) /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromFemtometers(QuantityValue femtometers) + public static Length FromFemtometers(double value) { - double value = (double) femtometers; return new Length(value, LengthUnit.Femtometer); } @@ -676,9 +665,8 @@ public static Length FromFemtometers(QuantityValue femtometers) /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromFeet(QuantityValue feet) + public static Length FromFeet(double value) { - double value = (double) feet; return new Length(value, LengthUnit.Foot); } @@ -686,9 +674,8 @@ public static Length FromFeet(QuantityValue feet) /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromGigameters(QuantityValue gigameters) + public static Length FromGigameters(double value) { - double value = (double) gigameters; return new Length(value, LengthUnit.Gigameter); } @@ -696,9 +683,8 @@ public static Length FromGigameters(QuantityValue gigameters) /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromHands(QuantityValue hands) + public static Length FromHands(double value) { - double value = (double) hands; return new Length(value, LengthUnit.Hand); } @@ -706,9 +692,8 @@ public static Length FromHands(QuantityValue hands) /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromHectometers(QuantityValue hectometers) + public static Length FromHectometers(double value) { - double value = (double) hectometers; return new Length(value, LengthUnit.Hectometer); } @@ -716,9 +701,8 @@ public static Length FromHectometers(QuantityValue hectometers) /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromInches(QuantityValue inches) + public static Length FromInches(double value) { - double value = (double) inches; return new Length(value, LengthUnit.Inch); } @@ -726,9 +710,8 @@ public static Length FromInches(QuantityValue inches) /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromKilofeet(QuantityValue kilofeet) + public static Length FromKilofeet(double value) { - double value = (double) kilofeet; return new Length(value, LengthUnit.Kilofoot); } @@ -736,9 +719,8 @@ public static Length FromKilofeet(QuantityValue kilofeet) /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromKilolightYears(QuantityValue kilolightyears) + public static Length FromKilolightYears(double value) { - double value = (double) kilolightyears; return new Length(value, LengthUnit.KilolightYear); } @@ -746,9 +728,8 @@ public static Length FromKilolightYears(QuantityValue kilolightyears) /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromKilometers(QuantityValue kilometers) + public static Length FromKilometers(double value) { - double value = (double) kilometers; return new Length(value, LengthUnit.Kilometer); } @@ -756,9 +737,8 @@ public static Length FromKilometers(QuantityValue kilometers) /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromKiloparsecs(QuantityValue kiloparsecs) + public static Length FromKiloparsecs(double value) { - double value = (double) kiloparsecs; return new Length(value, LengthUnit.Kiloparsec); } @@ -766,9 +746,8 @@ public static Length FromKiloparsecs(QuantityValue kiloparsecs) /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromKiloyards(QuantityValue kiloyards) + public static Length FromKiloyards(double value) { - double value = (double) kiloyards; return new Length(value, LengthUnit.Kiloyard); } @@ -776,9 +755,8 @@ public static Length FromKiloyards(QuantityValue kiloyards) /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromLightYears(QuantityValue lightyears) + public static Length FromLightYears(double value) { - double value = (double) lightyears; return new Length(value, LengthUnit.LightYear); } @@ -786,9 +764,8 @@ public static Length FromLightYears(QuantityValue lightyears) /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromMegalightYears(QuantityValue megalightyears) + public static Length FromMegalightYears(double value) { - double value = (double) megalightyears; return new Length(value, LengthUnit.MegalightYear); } @@ -796,9 +773,8 @@ public static Length FromMegalightYears(QuantityValue megalightyears) /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromMegameters(QuantityValue megameters) + public static Length FromMegameters(double value) { - double value = (double) megameters; return new Length(value, LengthUnit.Megameter); } @@ -806,9 +782,8 @@ public static Length FromMegameters(QuantityValue megameters) /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromMegaparsecs(QuantityValue megaparsecs) + public static Length FromMegaparsecs(double value) { - double value = (double) megaparsecs; return new Length(value, LengthUnit.Megaparsec); } @@ -816,9 +791,8 @@ public static Length FromMegaparsecs(QuantityValue megaparsecs) /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromMeters(QuantityValue meters) + public static Length FromMeters(double value) { - double value = (double) meters; return new Length(value, LengthUnit.Meter); } @@ -826,9 +800,8 @@ public static Length FromMeters(QuantityValue meters) /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromMicroinches(QuantityValue microinches) + public static Length FromMicroinches(double value) { - double value = (double) microinches; return new Length(value, LengthUnit.Microinch); } @@ -836,9 +809,8 @@ public static Length FromMicroinches(QuantityValue microinches) /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromMicrometers(QuantityValue micrometers) + public static Length FromMicrometers(double value) { - double value = (double) micrometers; return new Length(value, LengthUnit.Micrometer); } @@ -846,9 +818,8 @@ public static Length FromMicrometers(QuantityValue micrometers) /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromMils(QuantityValue mils) + public static Length FromMils(double value) { - double value = (double) mils; return new Length(value, LengthUnit.Mil); } @@ -856,9 +827,8 @@ public static Length FromMils(QuantityValue mils) /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromMiles(QuantityValue miles) + public static Length FromMiles(double value) { - double value = (double) miles; return new Length(value, LengthUnit.Mile); } @@ -866,9 +836,8 @@ public static Length FromMiles(QuantityValue miles) /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromMillimeters(QuantityValue millimeters) + public static Length FromMillimeters(double value) { - double value = (double) millimeters; return new Length(value, LengthUnit.Millimeter); } @@ -876,9 +845,8 @@ public static Length FromMillimeters(QuantityValue millimeters) /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromNanometers(QuantityValue nanometers) + public static Length FromNanometers(double value) { - double value = (double) nanometers; return new Length(value, LengthUnit.Nanometer); } @@ -886,9 +854,8 @@ public static Length FromNanometers(QuantityValue nanometers) /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromNauticalMiles(QuantityValue nauticalmiles) + public static Length FromNauticalMiles(double value) { - double value = (double) nauticalmiles; return new Length(value, LengthUnit.NauticalMile); } @@ -896,9 +863,8 @@ public static Length FromNauticalMiles(QuantityValue nauticalmiles) /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromParsecs(QuantityValue parsecs) + public static Length FromParsecs(double value) { - double value = (double) parsecs; return new Length(value, LengthUnit.Parsec); } @@ -906,9 +872,8 @@ public static Length FromParsecs(QuantityValue parsecs) /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromPicometers(QuantityValue picometers) + public static Length FromPicometers(double value) { - double value = (double) picometers; return new Length(value, LengthUnit.Picometer); } @@ -916,9 +881,8 @@ public static Length FromPicometers(QuantityValue picometers) /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromPrinterPicas(QuantityValue printerpicas) + public static Length FromPrinterPicas(double value) { - double value = (double) printerpicas; return new Length(value, LengthUnit.PrinterPica); } @@ -926,9 +890,8 @@ public static Length FromPrinterPicas(QuantityValue printerpicas) /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromPrinterPoints(QuantityValue printerpoints) + public static Length FromPrinterPoints(double value) { - double value = (double) printerpoints; return new Length(value, LengthUnit.PrinterPoint); } @@ -936,9 +899,8 @@ public static Length FromPrinterPoints(QuantityValue printerpoints) /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromShackles(QuantityValue shackles) + public static Length FromShackles(double value) { - double value = (double) shackles; return new Length(value, LengthUnit.Shackle); } @@ -946,9 +908,8 @@ public static Length FromShackles(QuantityValue shackles) /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromSolarRadiuses(QuantityValue solarradiuses) + public static Length FromSolarRadiuses(double value) { - double value = (double) solarradiuses; return new Length(value, LengthUnit.SolarRadius); } @@ -956,9 +917,8 @@ public static Length FromSolarRadiuses(QuantityValue solarradiuses) /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromTwips(QuantityValue twips) + public static Length FromTwips(double value) { - double value = (double) twips; return new Length(value, LengthUnit.Twip); } @@ -966,9 +926,8 @@ public static Length FromTwips(QuantityValue twips) /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromUsSurveyFeet(QuantityValue ussurveyfeet) + public static Length FromUsSurveyFeet(double value) { - double value = (double) ussurveyfeet; return new Length(value, LengthUnit.UsSurveyFoot); } @@ -976,9 +935,8 @@ public static Length FromUsSurveyFeet(QuantityValue ussurveyfeet) /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromYards(QuantityValue yards) + public static Length FromYards(double value) { - double value = (double) yards; return new Length(value, LengthUnit.Yard); } @@ -988,9 +946,9 @@ public static Length FromYards(QuantityValue yards) /// Value to convert from. /// Unit to convert from. /// Length unit value. - public static Length From(QuantityValue value, LengthUnit fromUnit) + public static Length From(double value, LengthUnit fromUnit) { - return new Length((double)value, fromUnit); + return new Length(value, fromUnit); } #endregion @@ -1484,15 +1442,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is LengthUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(LengthUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is LengthUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(LengthUnit)} is supported.", nameof(unit)); @@ -1689,18 +1638,6 @@ public Length ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not LengthUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(LengthUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/Level.g.cs b/UnitsNet/GeneratedCode/Quantities/Level.g.cs index a5400487bc..3cfbe10c83 100644 --- a/UnitsNet/GeneratedCode/Quantities/Level.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Level.g.cs @@ -37,7 +37,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct Level : - IArithmeticQuantity, + IArithmeticQuantity, IComparable, IComparable, IConvertible, @@ -148,7 +148,7 @@ public Level(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -229,9 +229,8 @@ public static string GetAbbreviation(LevelUnit unit, IFormatProvider? provider) /// Creates a from . /// /// If value is NaN or Infinity. - public static Level FromDecibels(QuantityValue decibels) + public static Level FromDecibels(double value) { - double value = (double) decibels; return new Level(value, LevelUnit.Decibel); } @@ -239,9 +238,8 @@ public static Level FromDecibels(QuantityValue decibels) /// Creates a from . /// /// If value is NaN or Infinity. - public static Level FromNepers(QuantityValue nepers) + public static Level FromNepers(double value) { - double value = (double) nepers; return new Level(value, LevelUnit.Neper); } @@ -251,9 +249,9 @@ public static Level FromNepers(QuantityValue nepers) /// Value to convert from. /// Unit to convert from. /// Level unit value. - public static Level From(QuantityValue value, LevelUnit fromUnit) + public static Level From(double value, LevelUnit fromUnit) { - return new Level((double)value, fromUnit); + return new Level(value, fromUnit); } #endregion @@ -437,14 +435,14 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Level public static Level operator *(Level left, double right) { // Logarithmic multiplication = addition - return new Level(left.Value + (double)right, left.Unit); + return new Level(left.Value + right, left.Unit); } /// Get from logarithmic division of by value. public static Level operator /(Level left, double right) { // Logarithmic division = subtraction - return new Level(left.Value - (double)right, left.Unit); + return new Level(left.Value - right, left.Unit); } /// Get ratio value from logarithmic division of by . @@ -672,15 +670,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is LevelUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(LevelUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is LevelUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(LevelUnit)} is supported.", nameof(unit)); @@ -797,18 +786,6 @@ public Level ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not LevelUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(LevelUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/LinearDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/LinearDensity.g.cs index 1066b2224a..150aad3fda 100644 --- a/UnitsNet/GeneratedCode/Quantities/LinearDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LinearDensity.g.cs @@ -43,7 +43,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct LinearDensity : - IArithmeticQuantity, + IArithmeticQuantity, #if NET7_0_OR_GREATER IDivisionOperators, IDivisionOperators, @@ -171,7 +171,7 @@ public LinearDensity(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -336,9 +336,8 @@ public static string GetAbbreviation(LinearDensityUnit unit, IFormatProvider? pr /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearDensity FromGramsPerCentimeter(QuantityValue gramspercentimeter) + public static LinearDensity FromGramsPerCentimeter(double value) { - double value = (double) gramspercentimeter; return new LinearDensity(value, LinearDensityUnit.GramPerCentimeter); } @@ -346,9 +345,8 @@ public static LinearDensity FromGramsPerCentimeter(QuantityValue gramspercentime /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearDensity FromGramsPerMeter(QuantityValue gramspermeter) + public static LinearDensity FromGramsPerMeter(double value) { - double value = (double) gramspermeter; return new LinearDensity(value, LinearDensityUnit.GramPerMeter); } @@ -356,9 +354,8 @@ public static LinearDensity FromGramsPerMeter(QuantityValue gramspermeter) /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearDensity FromGramsPerMillimeter(QuantityValue gramspermillimeter) + public static LinearDensity FromGramsPerMillimeter(double value) { - double value = (double) gramspermillimeter; return new LinearDensity(value, LinearDensityUnit.GramPerMillimeter); } @@ -366,9 +363,8 @@ public static LinearDensity FromGramsPerMillimeter(QuantityValue gramspermillime /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearDensity FromKilogramsPerCentimeter(QuantityValue kilogramspercentimeter) + public static LinearDensity FromKilogramsPerCentimeter(double value) { - double value = (double) kilogramspercentimeter; return new LinearDensity(value, LinearDensityUnit.KilogramPerCentimeter); } @@ -376,9 +372,8 @@ public static LinearDensity FromKilogramsPerCentimeter(QuantityValue kilogramspe /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearDensity FromKilogramsPerMeter(QuantityValue kilogramspermeter) + public static LinearDensity FromKilogramsPerMeter(double value) { - double value = (double) kilogramspermeter; return new LinearDensity(value, LinearDensityUnit.KilogramPerMeter); } @@ -386,9 +381,8 @@ public static LinearDensity FromKilogramsPerMeter(QuantityValue kilogramspermete /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearDensity FromKilogramsPerMillimeter(QuantityValue kilogramspermillimeter) + public static LinearDensity FromKilogramsPerMillimeter(double value) { - double value = (double) kilogramspermillimeter; return new LinearDensity(value, LinearDensityUnit.KilogramPerMillimeter); } @@ -396,9 +390,8 @@ public static LinearDensity FromKilogramsPerMillimeter(QuantityValue kilogramspe /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearDensity FromMicrogramsPerCentimeter(QuantityValue microgramspercentimeter) + public static LinearDensity FromMicrogramsPerCentimeter(double value) { - double value = (double) microgramspercentimeter; return new LinearDensity(value, LinearDensityUnit.MicrogramPerCentimeter); } @@ -406,9 +399,8 @@ public static LinearDensity FromMicrogramsPerCentimeter(QuantityValue micrograms /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearDensity FromMicrogramsPerMeter(QuantityValue microgramspermeter) + public static LinearDensity FromMicrogramsPerMeter(double value) { - double value = (double) microgramspermeter; return new LinearDensity(value, LinearDensityUnit.MicrogramPerMeter); } @@ -416,9 +408,8 @@ public static LinearDensity FromMicrogramsPerMeter(QuantityValue microgramsperme /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearDensity FromMicrogramsPerMillimeter(QuantityValue microgramspermillimeter) + public static LinearDensity FromMicrogramsPerMillimeter(double value) { - double value = (double) microgramspermillimeter; return new LinearDensity(value, LinearDensityUnit.MicrogramPerMillimeter); } @@ -426,9 +417,8 @@ public static LinearDensity FromMicrogramsPerMillimeter(QuantityValue micrograms /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearDensity FromMilligramsPerCentimeter(QuantityValue milligramspercentimeter) + public static LinearDensity FromMilligramsPerCentimeter(double value) { - double value = (double) milligramspercentimeter; return new LinearDensity(value, LinearDensityUnit.MilligramPerCentimeter); } @@ -436,9 +426,8 @@ public static LinearDensity FromMilligramsPerCentimeter(QuantityValue milligrams /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearDensity FromMilligramsPerMeter(QuantityValue milligramspermeter) + public static LinearDensity FromMilligramsPerMeter(double value) { - double value = (double) milligramspermeter; return new LinearDensity(value, LinearDensityUnit.MilligramPerMeter); } @@ -446,9 +435,8 @@ public static LinearDensity FromMilligramsPerMeter(QuantityValue milligramsperme /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearDensity FromMilligramsPerMillimeter(QuantityValue milligramspermillimeter) + public static LinearDensity FromMilligramsPerMillimeter(double value) { - double value = (double) milligramspermillimeter; return new LinearDensity(value, LinearDensityUnit.MilligramPerMillimeter); } @@ -456,9 +444,8 @@ public static LinearDensity FromMilligramsPerMillimeter(QuantityValue milligrams /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearDensity FromPoundsPerFoot(QuantityValue poundsperfoot) + public static LinearDensity FromPoundsPerFoot(double value) { - double value = (double) poundsperfoot; return new LinearDensity(value, LinearDensityUnit.PoundPerFoot); } @@ -466,9 +453,8 @@ public static LinearDensity FromPoundsPerFoot(QuantityValue poundsperfoot) /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearDensity FromPoundsPerInch(QuantityValue poundsperinch) + public static LinearDensity FromPoundsPerInch(double value) { - double value = (double) poundsperinch; return new LinearDensity(value, LinearDensityUnit.PoundPerInch); } @@ -478,9 +464,9 @@ public static LinearDensity FromPoundsPerInch(QuantityValue poundsperinch) /// Value to convert from. /// Unit to convert from. /// LinearDensity unit value. - public static LinearDensity From(QuantityValue value, LinearDensityUnit fromUnit) + public static LinearDensity From(double value, LinearDensityUnit fromUnit) { - return new LinearDensity((double)value, fromUnit); + return new LinearDensity(value, fromUnit); } #endregion @@ -913,15 +899,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is LinearDensityUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(LinearDensityUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is LinearDensityUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(LinearDensityUnit)} is supported.", nameof(unit)); @@ -1062,18 +1039,6 @@ public LinearDensity ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not LinearDensityUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(LinearDensityUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/LinearPowerDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/LinearPowerDensity.g.cs index 9cffb201d4..c8ecfb66ae 100644 --- a/UnitsNet/GeneratedCode/Quantities/LinearPowerDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LinearPowerDensity.g.cs @@ -40,7 +40,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct LinearPowerDensity : - IArithmeticQuantity, + IArithmeticQuantity, IComparable, IComparable, IConvertible, @@ -174,7 +174,7 @@ public LinearPowerDensity(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -416,9 +416,8 @@ public static string GetAbbreviation(LinearPowerDensityUnit unit, IFormatProvide /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearPowerDensity FromGigawattsPerCentimeter(QuantityValue gigawattspercentimeter) + public static LinearPowerDensity FromGigawattsPerCentimeter(double value) { - double value = (double) gigawattspercentimeter; return new LinearPowerDensity(value, LinearPowerDensityUnit.GigawattPerCentimeter); } @@ -426,9 +425,8 @@ public static LinearPowerDensity FromGigawattsPerCentimeter(QuantityValue gigawa /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearPowerDensity FromGigawattsPerFoot(QuantityValue gigawattsperfoot) + public static LinearPowerDensity FromGigawattsPerFoot(double value) { - double value = (double) gigawattsperfoot; return new LinearPowerDensity(value, LinearPowerDensityUnit.GigawattPerFoot); } @@ -436,9 +434,8 @@ public static LinearPowerDensity FromGigawattsPerFoot(QuantityValue gigawattsper /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearPowerDensity FromGigawattsPerInch(QuantityValue gigawattsperinch) + public static LinearPowerDensity FromGigawattsPerInch(double value) { - double value = (double) gigawattsperinch; return new LinearPowerDensity(value, LinearPowerDensityUnit.GigawattPerInch); } @@ -446,9 +443,8 @@ public static LinearPowerDensity FromGigawattsPerInch(QuantityValue gigawattsper /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearPowerDensity FromGigawattsPerMeter(QuantityValue gigawattspermeter) + public static LinearPowerDensity FromGigawattsPerMeter(double value) { - double value = (double) gigawattspermeter; return new LinearPowerDensity(value, LinearPowerDensityUnit.GigawattPerMeter); } @@ -456,9 +452,8 @@ public static LinearPowerDensity FromGigawattsPerMeter(QuantityValue gigawattspe /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearPowerDensity FromGigawattsPerMillimeter(QuantityValue gigawattspermillimeter) + public static LinearPowerDensity FromGigawattsPerMillimeter(double value) { - double value = (double) gigawattspermillimeter; return new LinearPowerDensity(value, LinearPowerDensityUnit.GigawattPerMillimeter); } @@ -466,9 +461,8 @@ public static LinearPowerDensity FromGigawattsPerMillimeter(QuantityValue gigawa /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearPowerDensity FromKilowattsPerCentimeter(QuantityValue kilowattspercentimeter) + public static LinearPowerDensity FromKilowattsPerCentimeter(double value) { - double value = (double) kilowattspercentimeter; return new LinearPowerDensity(value, LinearPowerDensityUnit.KilowattPerCentimeter); } @@ -476,9 +470,8 @@ public static LinearPowerDensity FromKilowattsPerCentimeter(QuantityValue kilowa /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearPowerDensity FromKilowattsPerFoot(QuantityValue kilowattsperfoot) + public static LinearPowerDensity FromKilowattsPerFoot(double value) { - double value = (double) kilowattsperfoot; return new LinearPowerDensity(value, LinearPowerDensityUnit.KilowattPerFoot); } @@ -486,9 +479,8 @@ public static LinearPowerDensity FromKilowattsPerFoot(QuantityValue kilowattsper /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearPowerDensity FromKilowattsPerInch(QuantityValue kilowattsperinch) + public static LinearPowerDensity FromKilowattsPerInch(double value) { - double value = (double) kilowattsperinch; return new LinearPowerDensity(value, LinearPowerDensityUnit.KilowattPerInch); } @@ -496,9 +488,8 @@ public static LinearPowerDensity FromKilowattsPerInch(QuantityValue kilowattsper /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearPowerDensity FromKilowattsPerMeter(QuantityValue kilowattspermeter) + public static LinearPowerDensity FromKilowattsPerMeter(double value) { - double value = (double) kilowattspermeter; return new LinearPowerDensity(value, LinearPowerDensityUnit.KilowattPerMeter); } @@ -506,9 +497,8 @@ public static LinearPowerDensity FromKilowattsPerMeter(QuantityValue kilowattspe /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearPowerDensity FromKilowattsPerMillimeter(QuantityValue kilowattspermillimeter) + public static LinearPowerDensity FromKilowattsPerMillimeter(double value) { - double value = (double) kilowattspermillimeter; return new LinearPowerDensity(value, LinearPowerDensityUnit.KilowattPerMillimeter); } @@ -516,9 +506,8 @@ public static LinearPowerDensity FromKilowattsPerMillimeter(QuantityValue kilowa /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearPowerDensity FromMegawattsPerCentimeter(QuantityValue megawattspercentimeter) + public static LinearPowerDensity FromMegawattsPerCentimeter(double value) { - double value = (double) megawattspercentimeter; return new LinearPowerDensity(value, LinearPowerDensityUnit.MegawattPerCentimeter); } @@ -526,9 +515,8 @@ public static LinearPowerDensity FromMegawattsPerCentimeter(QuantityValue megawa /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearPowerDensity FromMegawattsPerFoot(QuantityValue megawattsperfoot) + public static LinearPowerDensity FromMegawattsPerFoot(double value) { - double value = (double) megawattsperfoot; return new LinearPowerDensity(value, LinearPowerDensityUnit.MegawattPerFoot); } @@ -536,9 +524,8 @@ public static LinearPowerDensity FromMegawattsPerFoot(QuantityValue megawattsper /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearPowerDensity FromMegawattsPerInch(QuantityValue megawattsperinch) + public static LinearPowerDensity FromMegawattsPerInch(double value) { - double value = (double) megawattsperinch; return new LinearPowerDensity(value, LinearPowerDensityUnit.MegawattPerInch); } @@ -546,9 +533,8 @@ public static LinearPowerDensity FromMegawattsPerInch(QuantityValue megawattsper /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearPowerDensity FromMegawattsPerMeter(QuantityValue megawattspermeter) + public static LinearPowerDensity FromMegawattsPerMeter(double value) { - double value = (double) megawattspermeter; return new LinearPowerDensity(value, LinearPowerDensityUnit.MegawattPerMeter); } @@ -556,9 +542,8 @@ public static LinearPowerDensity FromMegawattsPerMeter(QuantityValue megawattspe /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearPowerDensity FromMegawattsPerMillimeter(QuantityValue megawattspermillimeter) + public static LinearPowerDensity FromMegawattsPerMillimeter(double value) { - double value = (double) megawattspermillimeter; return new LinearPowerDensity(value, LinearPowerDensityUnit.MegawattPerMillimeter); } @@ -566,9 +551,8 @@ public static LinearPowerDensity FromMegawattsPerMillimeter(QuantityValue megawa /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearPowerDensity FromMilliwattsPerCentimeter(QuantityValue milliwattspercentimeter) + public static LinearPowerDensity FromMilliwattsPerCentimeter(double value) { - double value = (double) milliwattspercentimeter; return new LinearPowerDensity(value, LinearPowerDensityUnit.MilliwattPerCentimeter); } @@ -576,9 +560,8 @@ public static LinearPowerDensity FromMilliwattsPerCentimeter(QuantityValue milli /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearPowerDensity FromMilliwattsPerFoot(QuantityValue milliwattsperfoot) + public static LinearPowerDensity FromMilliwattsPerFoot(double value) { - double value = (double) milliwattsperfoot; return new LinearPowerDensity(value, LinearPowerDensityUnit.MilliwattPerFoot); } @@ -586,9 +569,8 @@ public static LinearPowerDensity FromMilliwattsPerFoot(QuantityValue milliwattsp /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearPowerDensity FromMilliwattsPerInch(QuantityValue milliwattsperinch) + public static LinearPowerDensity FromMilliwattsPerInch(double value) { - double value = (double) milliwattsperinch; return new LinearPowerDensity(value, LinearPowerDensityUnit.MilliwattPerInch); } @@ -596,9 +578,8 @@ public static LinearPowerDensity FromMilliwattsPerInch(QuantityValue milliwattsp /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearPowerDensity FromMilliwattsPerMeter(QuantityValue milliwattspermeter) + public static LinearPowerDensity FromMilliwattsPerMeter(double value) { - double value = (double) milliwattspermeter; return new LinearPowerDensity(value, LinearPowerDensityUnit.MilliwattPerMeter); } @@ -606,9 +587,8 @@ public static LinearPowerDensity FromMilliwattsPerMeter(QuantityValue milliwatts /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearPowerDensity FromMilliwattsPerMillimeter(QuantityValue milliwattspermillimeter) + public static LinearPowerDensity FromMilliwattsPerMillimeter(double value) { - double value = (double) milliwattspermillimeter; return new LinearPowerDensity(value, LinearPowerDensityUnit.MilliwattPerMillimeter); } @@ -616,9 +596,8 @@ public static LinearPowerDensity FromMilliwattsPerMillimeter(QuantityValue milli /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearPowerDensity FromWattsPerCentimeter(QuantityValue wattspercentimeter) + public static LinearPowerDensity FromWattsPerCentimeter(double value) { - double value = (double) wattspercentimeter; return new LinearPowerDensity(value, LinearPowerDensityUnit.WattPerCentimeter); } @@ -626,9 +605,8 @@ public static LinearPowerDensity FromWattsPerCentimeter(QuantityValue wattsperce /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearPowerDensity FromWattsPerFoot(QuantityValue wattsperfoot) + public static LinearPowerDensity FromWattsPerFoot(double value) { - double value = (double) wattsperfoot; return new LinearPowerDensity(value, LinearPowerDensityUnit.WattPerFoot); } @@ -636,9 +614,8 @@ public static LinearPowerDensity FromWattsPerFoot(QuantityValue wattsperfoot) /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearPowerDensity FromWattsPerInch(QuantityValue wattsperinch) + public static LinearPowerDensity FromWattsPerInch(double value) { - double value = (double) wattsperinch; return new LinearPowerDensity(value, LinearPowerDensityUnit.WattPerInch); } @@ -646,9 +623,8 @@ public static LinearPowerDensity FromWattsPerInch(QuantityValue wattsperinch) /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearPowerDensity FromWattsPerMeter(QuantityValue wattspermeter) + public static LinearPowerDensity FromWattsPerMeter(double value) { - double value = (double) wattspermeter; return new LinearPowerDensity(value, LinearPowerDensityUnit.WattPerMeter); } @@ -656,9 +632,8 @@ public static LinearPowerDensity FromWattsPerMeter(QuantityValue wattspermeter) /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearPowerDensity FromWattsPerMillimeter(QuantityValue wattspermillimeter) + public static LinearPowerDensity FromWattsPerMillimeter(double value) { - double value = (double) wattspermillimeter; return new LinearPowerDensity(value, LinearPowerDensityUnit.WattPerMillimeter); } @@ -668,9 +643,9 @@ public static LinearPowerDensity FromWattsPerMillimeter(QuantityValue wattspermi /// Value to convert from. /// Unit to convert from. /// LinearPowerDensity unit value. - public static LinearPowerDensity From(QuantityValue value, LinearPowerDensityUnit fromUnit) + public static LinearPowerDensity From(double value, LinearPowerDensityUnit fromUnit) { - return new LinearPowerDensity((double)value, fromUnit); + return new LinearPowerDensity(value, fromUnit); } #endregion @@ -1081,15 +1056,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is LinearPowerDensityUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(LinearPowerDensityUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is LinearPowerDensityUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(LinearPowerDensityUnit)} is supported.", nameof(unit)); @@ -1252,18 +1218,6 @@ public LinearPowerDensity ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not LinearPowerDensityUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(LinearPowerDensityUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/Luminance.g.cs b/UnitsNet/GeneratedCode/Quantities/Luminance.g.cs index 883435684d..7aeb3c7428 100644 --- a/UnitsNet/GeneratedCode/Quantities/Luminance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Luminance.g.cs @@ -43,7 +43,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct Luminance : - IArithmeticQuantity, + IArithmeticQuantity, #if NET7_0_OR_GREATER IMultiplyOperators, #endif @@ -165,7 +165,7 @@ public Luminance(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -302,9 +302,8 @@ public static string GetAbbreviation(LuminanceUnit unit, IFormatProvider? provid /// Creates a from . /// /// If value is NaN or Infinity. - public static Luminance FromCandelasPerSquareFoot(QuantityValue candelaspersquarefoot) + public static Luminance FromCandelasPerSquareFoot(double value) { - double value = (double) candelaspersquarefoot; return new Luminance(value, LuminanceUnit.CandelaPerSquareFoot); } @@ -312,9 +311,8 @@ public static Luminance FromCandelasPerSquareFoot(QuantityValue candelaspersquar /// Creates a from . /// /// If value is NaN or Infinity. - public static Luminance FromCandelasPerSquareInch(QuantityValue candelaspersquareinch) + public static Luminance FromCandelasPerSquareInch(double value) { - double value = (double) candelaspersquareinch; return new Luminance(value, LuminanceUnit.CandelaPerSquareInch); } @@ -322,9 +320,8 @@ public static Luminance FromCandelasPerSquareInch(QuantityValue candelaspersquar /// Creates a from . /// /// If value is NaN or Infinity. - public static Luminance FromCandelasPerSquareMeter(QuantityValue candelaspersquaremeter) + public static Luminance FromCandelasPerSquareMeter(double value) { - double value = (double) candelaspersquaremeter; return new Luminance(value, LuminanceUnit.CandelaPerSquareMeter); } @@ -332,9 +329,8 @@ public static Luminance FromCandelasPerSquareMeter(QuantityValue candelaspersqua /// Creates a from . /// /// If value is NaN or Infinity. - public static Luminance FromCenticandelasPerSquareMeter(QuantityValue centicandelaspersquaremeter) + public static Luminance FromCenticandelasPerSquareMeter(double value) { - double value = (double) centicandelaspersquaremeter; return new Luminance(value, LuminanceUnit.CenticandelaPerSquareMeter); } @@ -342,9 +338,8 @@ public static Luminance FromCenticandelasPerSquareMeter(QuantityValue centicande /// Creates a from . /// /// If value is NaN or Infinity. - public static Luminance FromDecicandelasPerSquareMeter(QuantityValue decicandelaspersquaremeter) + public static Luminance FromDecicandelasPerSquareMeter(double value) { - double value = (double) decicandelaspersquaremeter; return new Luminance(value, LuminanceUnit.DecicandelaPerSquareMeter); } @@ -352,9 +347,8 @@ public static Luminance FromDecicandelasPerSquareMeter(QuantityValue decicandela /// Creates a from . /// /// If value is NaN or Infinity. - public static Luminance FromKilocandelasPerSquareMeter(QuantityValue kilocandelaspersquaremeter) + public static Luminance FromKilocandelasPerSquareMeter(double value) { - double value = (double) kilocandelaspersquaremeter; return new Luminance(value, LuminanceUnit.KilocandelaPerSquareMeter); } @@ -362,9 +356,8 @@ public static Luminance FromKilocandelasPerSquareMeter(QuantityValue kilocandela /// Creates a from . /// /// If value is NaN or Infinity. - public static Luminance FromMicrocandelasPerSquareMeter(QuantityValue microcandelaspersquaremeter) + public static Luminance FromMicrocandelasPerSquareMeter(double value) { - double value = (double) microcandelaspersquaremeter; return new Luminance(value, LuminanceUnit.MicrocandelaPerSquareMeter); } @@ -372,9 +365,8 @@ public static Luminance FromMicrocandelasPerSquareMeter(QuantityValue microcande /// Creates a from . /// /// If value is NaN or Infinity. - public static Luminance FromMillicandelasPerSquareMeter(QuantityValue millicandelaspersquaremeter) + public static Luminance FromMillicandelasPerSquareMeter(double value) { - double value = (double) millicandelaspersquaremeter; return new Luminance(value, LuminanceUnit.MillicandelaPerSquareMeter); } @@ -382,9 +374,8 @@ public static Luminance FromMillicandelasPerSquareMeter(QuantityValue millicande /// Creates a from . /// /// If value is NaN or Infinity. - public static Luminance FromNanocandelasPerSquareMeter(QuantityValue nanocandelaspersquaremeter) + public static Luminance FromNanocandelasPerSquareMeter(double value) { - double value = (double) nanocandelaspersquaremeter; return new Luminance(value, LuminanceUnit.NanocandelaPerSquareMeter); } @@ -392,9 +383,8 @@ public static Luminance FromNanocandelasPerSquareMeter(QuantityValue nanocandela /// Creates a from . /// /// If value is NaN or Infinity. - public static Luminance FromNits(QuantityValue nits) + public static Luminance FromNits(double value) { - double value = (double) nits; return new Luminance(value, LuminanceUnit.Nit); } @@ -404,9 +394,9 @@ public static Luminance FromNits(QuantityValue nits) /// Value to convert from. /// Unit to convert from. /// Luminance unit value. - public static Luminance From(QuantityValue value, LuminanceUnit fromUnit) + public static Luminance From(double value, LuminanceUnit fromUnit) { - return new Luminance((double)value, fromUnit); + return new Luminance(value, fromUnit); } #endregion @@ -827,15 +817,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is LuminanceUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(LuminanceUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is LuminanceUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(LuminanceUnit)} is supported.", nameof(unit)); @@ -968,18 +949,6 @@ public Luminance ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not LuminanceUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(LuminanceUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/Luminosity.g.cs b/UnitsNet/GeneratedCode/Quantities/Luminosity.g.cs index 1c9ecef869..00dec263fa 100644 --- a/UnitsNet/GeneratedCode/Quantities/Luminosity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Luminosity.g.cs @@ -40,7 +40,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct Luminosity : - IArithmeticQuantity, + IArithmeticQuantity, IComparable, IComparable, IConvertible, @@ -163,7 +163,7 @@ public Luminosity(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -328,9 +328,8 @@ public static string GetAbbreviation(LuminosityUnit unit, IFormatProvider? provi /// Creates a from . /// /// If value is NaN or Infinity. - public static Luminosity FromDecawatts(QuantityValue decawatts) + public static Luminosity FromDecawatts(double value) { - double value = (double) decawatts; return new Luminosity(value, LuminosityUnit.Decawatt); } @@ -338,9 +337,8 @@ public static Luminosity FromDecawatts(QuantityValue decawatts) /// Creates a from . /// /// If value is NaN or Infinity. - public static Luminosity FromDeciwatts(QuantityValue deciwatts) + public static Luminosity FromDeciwatts(double value) { - double value = (double) deciwatts; return new Luminosity(value, LuminosityUnit.Deciwatt); } @@ -348,9 +346,8 @@ public static Luminosity FromDeciwatts(QuantityValue deciwatts) /// Creates a from . /// /// If value is NaN or Infinity. - public static Luminosity FromFemtowatts(QuantityValue femtowatts) + public static Luminosity FromFemtowatts(double value) { - double value = (double) femtowatts; return new Luminosity(value, LuminosityUnit.Femtowatt); } @@ -358,9 +355,8 @@ public static Luminosity FromFemtowatts(QuantityValue femtowatts) /// Creates a from . /// /// If value is NaN or Infinity. - public static Luminosity FromGigawatts(QuantityValue gigawatts) + public static Luminosity FromGigawatts(double value) { - double value = (double) gigawatts; return new Luminosity(value, LuminosityUnit.Gigawatt); } @@ -368,9 +364,8 @@ public static Luminosity FromGigawatts(QuantityValue gigawatts) /// Creates a from . /// /// If value is NaN or Infinity. - public static Luminosity FromKilowatts(QuantityValue kilowatts) + public static Luminosity FromKilowatts(double value) { - double value = (double) kilowatts; return new Luminosity(value, LuminosityUnit.Kilowatt); } @@ -378,9 +373,8 @@ public static Luminosity FromKilowatts(QuantityValue kilowatts) /// Creates a from . /// /// If value is NaN or Infinity. - public static Luminosity FromMegawatts(QuantityValue megawatts) + public static Luminosity FromMegawatts(double value) { - double value = (double) megawatts; return new Luminosity(value, LuminosityUnit.Megawatt); } @@ -388,9 +382,8 @@ public static Luminosity FromMegawatts(QuantityValue megawatts) /// Creates a from . /// /// If value is NaN or Infinity. - public static Luminosity FromMicrowatts(QuantityValue microwatts) + public static Luminosity FromMicrowatts(double value) { - double value = (double) microwatts; return new Luminosity(value, LuminosityUnit.Microwatt); } @@ -398,9 +391,8 @@ public static Luminosity FromMicrowatts(QuantityValue microwatts) /// Creates a from . /// /// If value is NaN or Infinity. - public static Luminosity FromMilliwatts(QuantityValue milliwatts) + public static Luminosity FromMilliwatts(double value) { - double value = (double) milliwatts; return new Luminosity(value, LuminosityUnit.Milliwatt); } @@ -408,9 +400,8 @@ public static Luminosity FromMilliwatts(QuantityValue milliwatts) /// Creates a from . /// /// If value is NaN or Infinity. - public static Luminosity FromNanowatts(QuantityValue nanowatts) + public static Luminosity FromNanowatts(double value) { - double value = (double) nanowatts; return new Luminosity(value, LuminosityUnit.Nanowatt); } @@ -418,9 +409,8 @@ public static Luminosity FromNanowatts(QuantityValue nanowatts) /// Creates a from . /// /// If value is NaN or Infinity. - public static Luminosity FromPetawatts(QuantityValue petawatts) + public static Luminosity FromPetawatts(double value) { - double value = (double) petawatts; return new Luminosity(value, LuminosityUnit.Petawatt); } @@ -428,9 +418,8 @@ public static Luminosity FromPetawatts(QuantityValue petawatts) /// Creates a from . /// /// If value is NaN or Infinity. - public static Luminosity FromPicowatts(QuantityValue picowatts) + public static Luminosity FromPicowatts(double value) { - double value = (double) picowatts; return new Luminosity(value, LuminosityUnit.Picowatt); } @@ -438,9 +427,8 @@ public static Luminosity FromPicowatts(QuantityValue picowatts) /// Creates a from . /// /// If value is NaN or Infinity. - public static Luminosity FromSolarLuminosities(QuantityValue solarluminosities) + public static Luminosity FromSolarLuminosities(double value) { - double value = (double) solarluminosities; return new Luminosity(value, LuminosityUnit.SolarLuminosity); } @@ -448,9 +436,8 @@ public static Luminosity FromSolarLuminosities(QuantityValue solarluminosities) /// Creates a from . /// /// If value is NaN or Infinity. - public static Luminosity FromTerawatts(QuantityValue terawatts) + public static Luminosity FromTerawatts(double value) { - double value = (double) terawatts; return new Luminosity(value, LuminosityUnit.Terawatt); } @@ -458,9 +445,8 @@ public static Luminosity FromTerawatts(QuantityValue terawatts) /// Creates a from . /// /// If value is NaN or Infinity. - public static Luminosity FromWatts(QuantityValue watts) + public static Luminosity FromWatts(double value) { - double value = (double) watts; return new Luminosity(value, LuminosityUnit.Watt); } @@ -470,9 +456,9 @@ public static Luminosity FromWatts(QuantityValue watts) /// Value to convert from. /// Unit to convert from. /// Luminosity unit value. - public static Luminosity From(QuantityValue value, LuminosityUnit fromUnit) + public static Luminosity From(double value, LuminosityUnit fromUnit) { - return new Luminosity((double)value, fromUnit); + return new Luminosity(value, fromUnit); } #endregion @@ -883,15 +869,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is LuminosityUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(LuminosityUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is LuminosityUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(LuminosityUnit)} is supported.", nameof(unit)); @@ -1032,18 +1009,6 @@ public Luminosity ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not LuminosityUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(LuminosityUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/LuminousFlux.g.cs b/UnitsNet/GeneratedCode/Quantities/LuminousFlux.g.cs index 6bfccfe0c6..9ab25d187b 100644 --- a/UnitsNet/GeneratedCode/Quantities/LuminousFlux.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LuminousFlux.g.cs @@ -40,7 +40,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct LuminousFlux : - IArithmeticQuantity, + IArithmeticQuantity, IComparable, IComparable, IConvertible, @@ -150,7 +150,7 @@ public LuminousFlux(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -224,9 +224,8 @@ public static string GetAbbreviation(LuminousFluxUnit unit, IFormatProvider? pro /// Creates a from . /// /// If value is NaN or Infinity. - public static LuminousFlux FromLumens(QuantityValue lumens) + public static LuminousFlux FromLumens(double value) { - double value = (double) lumens; return new LuminousFlux(value, LuminousFluxUnit.Lumen); } @@ -236,9 +235,9 @@ public static LuminousFlux FromLumens(QuantityValue lumens) /// Value to convert from. /// Unit to convert from. /// LuminousFlux unit value. - public static LuminousFlux From(QuantityValue value, LuminousFluxUnit fromUnit) + public static LuminousFlux From(double value, LuminousFluxUnit fromUnit) { - return new LuminousFlux((double)value, fromUnit); + return new LuminousFlux(value, fromUnit); } #endregion @@ -649,15 +648,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is LuminousFluxUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(LuminousFluxUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is LuminousFluxUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(LuminousFluxUnit)} is supported.", nameof(unit)); @@ -772,18 +762,6 @@ public LuminousFlux ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not LuminousFluxUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(LuminousFluxUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.g.cs b/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.g.cs index dc3aa573f6..a82a6831b8 100644 --- a/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.g.cs @@ -43,7 +43,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct LuminousIntensity : - IArithmeticQuantity, + IArithmeticQuantity, #if NET7_0_OR_GREATER IDivisionOperators, IDivisionOperators, @@ -157,7 +157,7 @@ public LuminousIntensity(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -231,9 +231,8 @@ public static string GetAbbreviation(LuminousIntensityUnit unit, IFormatProvider /// Creates a from . /// /// If value is NaN or Infinity. - public static LuminousIntensity FromCandela(QuantityValue candela) + public static LuminousIntensity FromCandela(double value) { - double value = (double) candela; return new LuminousIntensity(value, LuminousIntensityUnit.Candela); } @@ -243,9 +242,9 @@ public static LuminousIntensity FromCandela(QuantityValue candela) /// Value to convert from. /// Unit to convert from. /// LuminousIntensity unit value. - public static LuminousIntensity From(QuantityValue value, LuminousIntensityUnit fromUnit) + public static LuminousIntensity From(double value, LuminousIntensityUnit fromUnit) { - return new LuminousIntensity((double)value, fromUnit); + return new LuminousIntensity(value, fromUnit); } #endregion @@ -672,15 +671,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is LuminousIntensityUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(LuminousIntensityUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is LuminousIntensityUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(LuminousIntensityUnit)} is supported.", nameof(unit)); @@ -795,18 +785,6 @@ public LuminousIntensity ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not LuminousIntensityUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(LuminousIntensityUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/MagneticField.g.cs b/UnitsNet/GeneratedCode/Quantities/MagneticField.g.cs index ae039d94fc..1b161d5d12 100644 --- a/UnitsNet/GeneratedCode/Quantities/MagneticField.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MagneticField.g.cs @@ -40,7 +40,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct MagneticField : - IArithmeticQuantity, + IArithmeticQuantity, IComparable, IComparable, IConvertible, @@ -155,7 +155,7 @@ public MagneticField(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -264,9 +264,8 @@ public static string GetAbbreviation(MagneticFieldUnit unit, IFormatProvider? pr /// Creates a from . /// /// If value is NaN or Infinity. - public static MagneticField FromGausses(QuantityValue gausses) + public static MagneticField FromGausses(double value) { - double value = (double) gausses; return new MagneticField(value, MagneticFieldUnit.Gauss); } @@ -274,9 +273,8 @@ public static MagneticField FromGausses(QuantityValue gausses) /// Creates a from . /// /// If value is NaN or Infinity. - public static MagneticField FromMicroteslas(QuantityValue microteslas) + public static MagneticField FromMicroteslas(double value) { - double value = (double) microteslas; return new MagneticField(value, MagneticFieldUnit.Microtesla); } @@ -284,9 +282,8 @@ public static MagneticField FromMicroteslas(QuantityValue microteslas) /// Creates a from . /// /// If value is NaN or Infinity. - public static MagneticField FromMilligausses(QuantityValue milligausses) + public static MagneticField FromMilligausses(double value) { - double value = (double) milligausses; return new MagneticField(value, MagneticFieldUnit.Milligauss); } @@ -294,9 +291,8 @@ public static MagneticField FromMilligausses(QuantityValue milligausses) /// Creates a from . /// /// If value is NaN or Infinity. - public static MagneticField FromMilliteslas(QuantityValue milliteslas) + public static MagneticField FromMilliteslas(double value) { - double value = (double) milliteslas; return new MagneticField(value, MagneticFieldUnit.Millitesla); } @@ -304,9 +300,8 @@ public static MagneticField FromMilliteslas(QuantityValue milliteslas) /// Creates a from . /// /// If value is NaN or Infinity. - public static MagneticField FromNanoteslas(QuantityValue nanoteslas) + public static MagneticField FromNanoteslas(double value) { - double value = (double) nanoteslas; return new MagneticField(value, MagneticFieldUnit.Nanotesla); } @@ -314,9 +309,8 @@ public static MagneticField FromNanoteslas(QuantityValue nanoteslas) /// Creates a from . /// /// If value is NaN or Infinity. - public static MagneticField FromTeslas(QuantityValue teslas) + public static MagneticField FromTeslas(double value) { - double value = (double) teslas; return new MagneticField(value, MagneticFieldUnit.Tesla); } @@ -326,9 +320,9 @@ public static MagneticField FromTeslas(QuantityValue teslas) /// Value to convert from. /// Unit to convert from. /// MagneticField unit value. - public static MagneticField From(QuantityValue value, MagneticFieldUnit fromUnit) + public static MagneticField From(double value, MagneticFieldUnit fromUnit) { - return new MagneticField((double)value, fromUnit); + return new MagneticField(value, fromUnit); } #endregion @@ -739,15 +733,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is MagneticFieldUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(MagneticFieldUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is MagneticFieldUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(MagneticFieldUnit)} is supported.", nameof(unit)); @@ -872,18 +857,6 @@ public MagneticField ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not MagneticFieldUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(MagneticFieldUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/MagneticFlux.g.cs b/UnitsNet/GeneratedCode/Quantities/MagneticFlux.g.cs index 50b4d387c8..80e3a9b0fc 100644 --- a/UnitsNet/GeneratedCode/Quantities/MagneticFlux.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MagneticFlux.g.cs @@ -40,7 +40,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct MagneticFlux : - IArithmeticQuantity, + IArithmeticQuantity, IComparable, IComparable, IConvertible, @@ -150,7 +150,7 @@ public MagneticFlux(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -224,9 +224,8 @@ public static string GetAbbreviation(MagneticFluxUnit unit, IFormatProvider? pro /// Creates a from . /// /// If value is NaN or Infinity. - public static MagneticFlux FromWebers(QuantityValue webers) + public static MagneticFlux FromWebers(double value) { - double value = (double) webers; return new MagneticFlux(value, MagneticFluxUnit.Weber); } @@ -236,9 +235,9 @@ public static MagneticFlux FromWebers(QuantityValue webers) /// Value to convert from. /// Unit to convert from. /// MagneticFlux unit value. - public static MagneticFlux From(QuantityValue value, MagneticFluxUnit fromUnit) + public static MagneticFlux From(double value, MagneticFluxUnit fromUnit) { - return new MagneticFlux((double)value, fromUnit); + return new MagneticFlux(value, fromUnit); } #endregion @@ -649,15 +648,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is MagneticFluxUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(MagneticFluxUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is MagneticFluxUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(MagneticFluxUnit)} is supported.", nameof(unit)); @@ -772,18 +762,6 @@ public MagneticFlux ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not MagneticFluxUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(MagneticFluxUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/Magnetization.g.cs b/UnitsNet/GeneratedCode/Quantities/Magnetization.g.cs index cadecb3367..2d589711e7 100644 --- a/UnitsNet/GeneratedCode/Quantities/Magnetization.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Magnetization.g.cs @@ -40,7 +40,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct Magnetization : - IArithmeticQuantity, + IArithmeticQuantity, IComparable, IComparable, IConvertible, @@ -150,7 +150,7 @@ public Magnetization(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -224,9 +224,8 @@ public static string GetAbbreviation(MagnetizationUnit unit, IFormatProvider? pr /// Creates a from . /// /// If value is NaN or Infinity. - public static Magnetization FromAmperesPerMeter(QuantityValue amperespermeter) + public static Magnetization FromAmperesPerMeter(double value) { - double value = (double) amperespermeter; return new Magnetization(value, MagnetizationUnit.AmperePerMeter); } @@ -236,9 +235,9 @@ public static Magnetization FromAmperesPerMeter(QuantityValue amperespermeter) /// Value to convert from. /// Unit to convert from. /// Magnetization unit value. - public static Magnetization From(QuantityValue value, MagnetizationUnit fromUnit) + public static Magnetization From(double value, MagnetizationUnit fromUnit) { - return new Magnetization((double)value, fromUnit); + return new Magnetization(value, fromUnit); } #endregion @@ -649,15 +648,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is MagnetizationUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(MagnetizationUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is MagnetizationUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(MagnetizationUnit)} is supported.", nameof(unit)); @@ -772,18 +762,6 @@ public Magnetization ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not MagnetizationUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(MagnetizationUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/Mass.g.cs b/UnitsNet/GeneratedCode/Quantities/Mass.g.cs index 1ff055bda1..d9e495fee2 100644 --- a/UnitsNet/GeneratedCode/Quantities/Mass.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Mass.g.cs @@ -40,7 +40,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct Mass : - IArithmeticQuantity, + IArithmeticQuantity, #if NET7_0_OR_GREATER IDivisionOperators, IDivisionOperators, @@ -193,7 +193,7 @@ public Mass(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -449,9 +449,8 @@ public static string GetAbbreviation(MassUnit unit, IFormatProvider? provider) /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromCentigrams(QuantityValue centigrams) + public static Mass FromCentigrams(double value) { - double value = (double) centigrams; return new Mass(value, MassUnit.Centigram); } @@ -459,9 +458,8 @@ public static Mass FromCentigrams(QuantityValue centigrams) /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromDecagrams(QuantityValue decagrams) + public static Mass FromDecagrams(double value) { - double value = (double) decagrams; return new Mass(value, MassUnit.Decagram); } @@ -469,9 +467,8 @@ public static Mass FromDecagrams(QuantityValue decagrams) /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromDecigrams(QuantityValue decigrams) + public static Mass FromDecigrams(double value) { - double value = (double) decigrams; return new Mass(value, MassUnit.Decigram); } @@ -479,9 +476,8 @@ public static Mass FromDecigrams(QuantityValue decigrams) /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromEarthMasses(QuantityValue earthmasses) + public static Mass FromEarthMasses(double value) { - double value = (double) earthmasses; return new Mass(value, MassUnit.EarthMass); } @@ -489,9 +485,8 @@ public static Mass FromEarthMasses(QuantityValue earthmasses) /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromFemtograms(QuantityValue femtograms) + public static Mass FromFemtograms(double value) { - double value = (double) femtograms; return new Mass(value, MassUnit.Femtogram); } @@ -499,9 +494,8 @@ public static Mass FromFemtograms(QuantityValue femtograms) /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromGrains(QuantityValue grains) + public static Mass FromGrains(double value) { - double value = (double) grains; return new Mass(value, MassUnit.Grain); } @@ -509,9 +503,8 @@ public static Mass FromGrains(QuantityValue grains) /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromGrams(QuantityValue grams) + public static Mass FromGrams(double value) { - double value = (double) grams; return new Mass(value, MassUnit.Gram); } @@ -519,9 +512,8 @@ public static Mass FromGrams(QuantityValue grams) /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromHectograms(QuantityValue hectograms) + public static Mass FromHectograms(double value) { - double value = (double) hectograms; return new Mass(value, MassUnit.Hectogram); } @@ -529,9 +521,8 @@ public static Mass FromHectograms(QuantityValue hectograms) /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromKilograms(QuantityValue kilograms) + public static Mass FromKilograms(double value) { - double value = (double) kilograms; return new Mass(value, MassUnit.Kilogram); } @@ -539,9 +530,8 @@ public static Mass FromKilograms(QuantityValue kilograms) /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromKilopounds(QuantityValue kilopounds) + public static Mass FromKilopounds(double value) { - double value = (double) kilopounds; return new Mass(value, MassUnit.Kilopound); } @@ -549,9 +539,8 @@ public static Mass FromKilopounds(QuantityValue kilopounds) /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromKilotonnes(QuantityValue kilotonnes) + public static Mass FromKilotonnes(double value) { - double value = (double) kilotonnes; return new Mass(value, MassUnit.Kilotonne); } @@ -559,9 +548,8 @@ public static Mass FromKilotonnes(QuantityValue kilotonnes) /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromLongHundredweight(QuantityValue longhundredweight) + public static Mass FromLongHundredweight(double value) { - double value = (double) longhundredweight; return new Mass(value, MassUnit.LongHundredweight); } @@ -569,9 +557,8 @@ public static Mass FromLongHundredweight(QuantityValue longhundredweight) /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromLongTons(QuantityValue longtons) + public static Mass FromLongTons(double value) { - double value = (double) longtons; return new Mass(value, MassUnit.LongTon); } @@ -579,9 +566,8 @@ public static Mass FromLongTons(QuantityValue longtons) /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromMegapounds(QuantityValue megapounds) + public static Mass FromMegapounds(double value) { - double value = (double) megapounds; return new Mass(value, MassUnit.Megapound); } @@ -589,9 +575,8 @@ public static Mass FromMegapounds(QuantityValue megapounds) /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromMegatonnes(QuantityValue megatonnes) + public static Mass FromMegatonnes(double value) { - double value = (double) megatonnes; return new Mass(value, MassUnit.Megatonne); } @@ -599,9 +584,8 @@ public static Mass FromMegatonnes(QuantityValue megatonnes) /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromMicrograms(QuantityValue micrograms) + public static Mass FromMicrograms(double value) { - double value = (double) micrograms; return new Mass(value, MassUnit.Microgram); } @@ -609,9 +593,8 @@ public static Mass FromMicrograms(QuantityValue micrograms) /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromMilligrams(QuantityValue milligrams) + public static Mass FromMilligrams(double value) { - double value = (double) milligrams; return new Mass(value, MassUnit.Milligram); } @@ -619,9 +602,8 @@ public static Mass FromMilligrams(QuantityValue milligrams) /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromNanograms(QuantityValue nanograms) + public static Mass FromNanograms(double value) { - double value = (double) nanograms; return new Mass(value, MassUnit.Nanogram); } @@ -629,9 +611,8 @@ public static Mass FromNanograms(QuantityValue nanograms) /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromOunces(QuantityValue ounces) + public static Mass FromOunces(double value) { - double value = (double) ounces; return new Mass(value, MassUnit.Ounce); } @@ -639,9 +620,8 @@ public static Mass FromOunces(QuantityValue ounces) /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromPicograms(QuantityValue picograms) + public static Mass FromPicograms(double value) { - double value = (double) picograms; return new Mass(value, MassUnit.Picogram); } @@ -649,9 +629,8 @@ public static Mass FromPicograms(QuantityValue picograms) /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromPounds(QuantityValue pounds) + public static Mass FromPounds(double value) { - double value = (double) pounds; return new Mass(value, MassUnit.Pound); } @@ -659,9 +638,8 @@ public static Mass FromPounds(QuantityValue pounds) /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromShortHundredweight(QuantityValue shorthundredweight) + public static Mass FromShortHundredweight(double value) { - double value = (double) shorthundredweight; return new Mass(value, MassUnit.ShortHundredweight); } @@ -669,9 +647,8 @@ public static Mass FromShortHundredweight(QuantityValue shorthundredweight) /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromShortTons(QuantityValue shorttons) + public static Mass FromShortTons(double value) { - double value = (double) shorttons; return new Mass(value, MassUnit.ShortTon); } @@ -679,9 +656,8 @@ public static Mass FromShortTons(QuantityValue shorttons) /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromSlugs(QuantityValue slugs) + public static Mass FromSlugs(double value) { - double value = (double) slugs; return new Mass(value, MassUnit.Slug); } @@ -689,9 +665,8 @@ public static Mass FromSlugs(QuantityValue slugs) /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromSolarMasses(QuantityValue solarmasses) + public static Mass FromSolarMasses(double value) { - double value = (double) solarmasses; return new Mass(value, MassUnit.SolarMass); } @@ -699,9 +674,8 @@ public static Mass FromSolarMasses(QuantityValue solarmasses) /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromStone(QuantityValue stone) + public static Mass FromStone(double value) { - double value = (double) stone; return new Mass(value, MassUnit.Stone); } @@ -709,9 +683,8 @@ public static Mass FromStone(QuantityValue stone) /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromTonnes(QuantityValue tonnes) + public static Mass FromTonnes(double value) { - double value = (double) tonnes; return new Mass(value, MassUnit.Tonne); } @@ -721,9 +694,9 @@ public static Mass FromTonnes(QuantityValue tonnes) /// Value to convert from. /// Unit to convert from. /// Mass unit value. - public static Mass From(QuantityValue value, MassUnit fromUnit) + public static Mass From(double value, MassUnit fromUnit) { - return new Mass((double)value, fromUnit); + return new Mass(value, fromUnit); } #endregion @@ -1228,15 +1201,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is MassUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(MassUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is MassUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(MassUnit)} is supported.", nameof(unit)); @@ -1403,18 +1367,6 @@ public Mass ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not MassUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(MassUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/MassConcentration.g.cs b/UnitsNet/GeneratedCode/Quantities/MassConcentration.g.cs index ee8c291022..bd7feec1d8 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassConcentration.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassConcentration.g.cs @@ -43,7 +43,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct MassConcentration : - IArithmeticQuantity, + IArithmeticQuantity, #if NET7_0_OR_GREATER IMultiplyOperators, IDivisionOperators, @@ -206,7 +206,7 @@ public MassConcentration(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -616,9 +616,8 @@ public static string GetAbbreviation(MassConcentrationUnit unit, IFormatProvider /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromCentigramsPerDeciliter(QuantityValue centigramsperdeciliter) + public static MassConcentration FromCentigramsPerDeciliter(double value) { - double value = (double) centigramsperdeciliter; return new MassConcentration(value, MassConcentrationUnit.CentigramPerDeciliter); } @@ -626,9 +625,8 @@ public static MassConcentration FromCentigramsPerDeciliter(QuantityValue centigr /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromCentigramsPerLiter(QuantityValue centigramsperliter) + public static MassConcentration FromCentigramsPerLiter(double value) { - double value = (double) centigramsperliter; return new MassConcentration(value, MassConcentrationUnit.CentigramPerLiter); } @@ -636,9 +634,8 @@ public static MassConcentration FromCentigramsPerLiter(QuantityValue centigramsp /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromCentigramsPerMicroliter(QuantityValue centigramspermicroliter) + public static MassConcentration FromCentigramsPerMicroliter(double value) { - double value = (double) centigramspermicroliter; return new MassConcentration(value, MassConcentrationUnit.CentigramPerMicroliter); } @@ -646,9 +643,8 @@ public static MassConcentration FromCentigramsPerMicroliter(QuantityValue centig /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromCentigramsPerMilliliter(QuantityValue centigramspermilliliter) + public static MassConcentration FromCentigramsPerMilliliter(double value) { - double value = (double) centigramspermilliliter; return new MassConcentration(value, MassConcentrationUnit.CentigramPerMilliliter); } @@ -656,9 +652,8 @@ public static MassConcentration FromCentigramsPerMilliliter(QuantityValue centig /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromDecigramsPerDeciliter(QuantityValue decigramsperdeciliter) + public static MassConcentration FromDecigramsPerDeciliter(double value) { - double value = (double) decigramsperdeciliter; return new MassConcentration(value, MassConcentrationUnit.DecigramPerDeciliter); } @@ -666,9 +661,8 @@ public static MassConcentration FromDecigramsPerDeciliter(QuantityValue decigram /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromDecigramsPerLiter(QuantityValue decigramsperliter) + public static MassConcentration FromDecigramsPerLiter(double value) { - double value = (double) decigramsperliter; return new MassConcentration(value, MassConcentrationUnit.DecigramPerLiter); } @@ -676,9 +670,8 @@ public static MassConcentration FromDecigramsPerLiter(QuantityValue decigramsper /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromDecigramsPerMicroliter(QuantityValue decigramspermicroliter) + public static MassConcentration FromDecigramsPerMicroliter(double value) { - double value = (double) decigramspermicroliter; return new MassConcentration(value, MassConcentrationUnit.DecigramPerMicroliter); } @@ -686,9 +679,8 @@ public static MassConcentration FromDecigramsPerMicroliter(QuantityValue decigra /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromDecigramsPerMilliliter(QuantityValue decigramspermilliliter) + public static MassConcentration FromDecigramsPerMilliliter(double value) { - double value = (double) decigramspermilliliter; return new MassConcentration(value, MassConcentrationUnit.DecigramPerMilliliter); } @@ -696,9 +688,8 @@ public static MassConcentration FromDecigramsPerMilliliter(QuantityValue decigra /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromGramsPerCubicCentimeter(QuantityValue gramspercubiccentimeter) + public static MassConcentration FromGramsPerCubicCentimeter(double value) { - double value = (double) gramspercubiccentimeter; return new MassConcentration(value, MassConcentrationUnit.GramPerCubicCentimeter); } @@ -706,9 +697,8 @@ public static MassConcentration FromGramsPerCubicCentimeter(QuantityValue gramsp /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromGramsPerCubicMeter(QuantityValue gramspercubicmeter) + public static MassConcentration FromGramsPerCubicMeter(double value) { - double value = (double) gramspercubicmeter; return new MassConcentration(value, MassConcentrationUnit.GramPerCubicMeter); } @@ -716,9 +706,8 @@ public static MassConcentration FromGramsPerCubicMeter(QuantityValue gramspercub /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromGramsPerCubicMillimeter(QuantityValue gramspercubicmillimeter) + public static MassConcentration FromGramsPerCubicMillimeter(double value) { - double value = (double) gramspercubicmillimeter; return new MassConcentration(value, MassConcentrationUnit.GramPerCubicMillimeter); } @@ -726,9 +715,8 @@ public static MassConcentration FromGramsPerCubicMillimeter(QuantityValue gramsp /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromGramsPerDeciliter(QuantityValue gramsperdeciliter) + public static MassConcentration FromGramsPerDeciliter(double value) { - double value = (double) gramsperdeciliter; return new MassConcentration(value, MassConcentrationUnit.GramPerDeciliter); } @@ -736,9 +724,8 @@ public static MassConcentration FromGramsPerDeciliter(QuantityValue gramsperdeci /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromGramsPerLiter(QuantityValue gramsperliter) + public static MassConcentration FromGramsPerLiter(double value) { - double value = (double) gramsperliter; return new MassConcentration(value, MassConcentrationUnit.GramPerLiter); } @@ -746,9 +733,8 @@ public static MassConcentration FromGramsPerLiter(QuantityValue gramsperliter) /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromGramsPerMicroliter(QuantityValue gramspermicroliter) + public static MassConcentration FromGramsPerMicroliter(double value) { - double value = (double) gramspermicroliter; return new MassConcentration(value, MassConcentrationUnit.GramPerMicroliter); } @@ -756,9 +742,8 @@ public static MassConcentration FromGramsPerMicroliter(QuantityValue gramspermic /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromGramsPerMilliliter(QuantityValue gramspermilliliter) + public static MassConcentration FromGramsPerMilliliter(double value) { - double value = (double) gramspermilliliter; return new MassConcentration(value, MassConcentrationUnit.GramPerMilliliter); } @@ -766,9 +751,8 @@ public static MassConcentration FromGramsPerMilliliter(QuantityValue gramspermil /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromKilogramsPerCubicCentimeter(QuantityValue kilogramspercubiccentimeter) + public static MassConcentration FromKilogramsPerCubicCentimeter(double value) { - double value = (double) kilogramspercubiccentimeter; return new MassConcentration(value, MassConcentrationUnit.KilogramPerCubicCentimeter); } @@ -776,9 +760,8 @@ public static MassConcentration FromKilogramsPerCubicCentimeter(QuantityValue ki /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromKilogramsPerCubicMeter(QuantityValue kilogramspercubicmeter) + public static MassConcentration FromKilogramsPerCubicMeter(double value) { - double value = (double) kilogramspercubicmeter; return new MassConcentration(value, MassConcentrationUnit.KilogramPerCubicMeter); } @@ -786,9 +769,8 @@ public static MassConcentration FromKilogramsPerCubicMeter(QuantityValue kilogra /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromKilogramsPerCubicMillimeter(QuantityValue kilogramspercubicmillimeter) + public static MassConcentration FromKilogramsPerCubicMillimeter(double value) { - double value = (double) kilogramspercubicmillimeter; return new MassConcentration(value, MassConcentrationUnit.KilogramPerCubicMillimeter); } @@ -796,9 +778,8 @@ public static MassConcentration FromKilogramsPerCubicMillimeter(QuantityValue ki /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromKilogramsPerLiter(QuantityValue kilogramsperliter) + public static MassConcentration FromKilogramsPerLiter(double value) { - double value = (double) kilogramsperliter; return new MassConcentration(value, MassConcentrationUnit.KilogramPerLiter); } @@ -806,9 +787,8 @@ public static MassConcentration FromKilogramsPerLiter(QuantityValue kilogramsper /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromKilopoundsPerCubicFoot(QuantityValue kilopoundspercubicfoot) + public static MassConcentration FromKilopoundsPerCubicFoot(double value) { - double value = (double) kilopoundspercubicfoot; return new MassConcentration(value, MassConcentrationUnit.KilopoundPerCubicFoot); } @@ -816,9 +796,8 @@ public static MassConcentration FromKilopoundsPerCubicFoot(QuantityValue kilopou /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromKilopoundsPerCubicInch(QuantityValue kilopoundspercubicinch) + public static MassConcentration FromKilopoundsPerCubicInch(double value) { - double value = (double) kilopoundspercubicinch; return new MassConcentration(value, MassConcentrationUnit.KilopoundPerCubicInch); } @@ -826,9 +805,8 @@ public static MassConcentration FromKilopoundsPerCubicInch(QuantityValue kilopou /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromMicrogramsPerCubicMeter(QuantityValue microgramspercubicmeter) + public static MassConcentration FromMicrogramsPerCubicMeter(double value) { - double value = (double) microgramspercubicmeter; return new MassConcentration(value, MassConcentrationUnit.MicrogramPerCubicMeter); } @@ -836,9 +814,8 @@ public static MassConcentration FromMicrogramsPerCubicMeter(QuantityValue microg /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromMicrogramsPerDeciliter(QuantityValue microgramsperdeciliter) + public static MassConcentration FromMicrogramsPerDeciliter(double value) { - double value = (double) microgramsperdeciliter; return new MassConcentration(value, MassConcentrationUnit.MicrogramPerDeciliter); } @@ -846,9 +823,8 @@ public static MassConcentration FromMicrogramsPerDeciliter(QuantityValue microgr /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromMicrogramsPerLiter(QuantityValue microgramsperliter) + public static MassConcentration FromMicrogramsPerLiter(double value) { - double value = (double) microgramsperliter; return new MassConcentration(value, MassConcentrationUnit.MicrogramPerLiter); } @@ -856,9 +832,8 @@ public static MassConcentration FromMicrogramsPerLiter(QuantityValue microgramsp /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromMicrogramsPerMicroliter(QuantityValue microgramspermicroliter) + public static MassConcentration FromMicrogramsPerMicroliter(double value) { - double value = (double) microgramspermicroliter; return new MassConcentration(value, MassConcentrationUnit.MicrogramPerMicroliter); } @@ -866,9 +841,8 @@ public static MassConcentration FromMicrogramsPerMicroliter(QuantityValue microg /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromMicrogramsPerMilliliter(QuantityValue microgramspermilliliter) + public static MassConcentration FromMicrogramsPerMilliliter(double value) { - double value = (double) microgramspermilliliter; return new MassConcentration(value, MassConcentrationUnit.MicrogramPerMilliliter); } @@ -876,9 +850,8 @@ public static MassConcentration FromMicrogramsPerMilliliter(QuantityValue microg /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromMilligramsPerCubicMeter(QuantityValue milligramspercubicmeter) + public static MassConcentration FromMilligramsPerCubicMeter(double value) { - double value = (double) milligramspercubicmeter; return new MassConcentration(value, MassConcentrationUnit.MilligramPerCubicMeter); } @@ -886,9 +859,8 @@ public static MassConcentration FromMilligramsPerCubicMeter(QuantityValue millig /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromMilligramsPerDeciliter(QuantityValue milligramsperdeciliter) + public static MassConcentration FromMilligramsPerDeciliter(double value) { - double value = (double) milligramsperdeciliter; return new MassConcentration(value, MassConcentrationUnit.MilligramPerDeciliter); } @@ -896,9 +868,8 @@ public static MassConcentration FromMilligramsPerDeciliter(QuantityValue milligr /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromMilligramsPerLiter(QuantityValue milligramsperliter) + public static MassConcentration FromMilligramsPerLiter(double value) { - double value = (double) milligramsperliter; return new MassConcentration(value, MassConcentrationUnit.MilligramPerLiter); } @@ -906,9 +877,8 @@ public static MassConcentration FromMilligramsPerLiter(QuantityValue milligramsp /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromMilligramsPerMicroliter(QuantityValue milligramspermicroliter) + public static MassConcentration FromMilligramsPerMicroliter(double value) { - double value = (double) milligramspermicroliter; return new MassConcentration(value, MassConcentrationUnit.MilligramPerMicroliter); } @@ -916,9 +886,8 @@ public static MassConcentration FromMilligramsPerMicroliter(QuantityValue millig /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromMilligramsPerMilliliter(QuantityValue milligramspermilliliter) + public static MassConcentration FromMilligramsPerMilliliter(double value) { - double value = (double) milligramspermilliliter; return new MassConcentration(value, MassConcentrationUnit.MilligramPerMilliliter); } @@ -926,9 +895,8 @@ public static MassConcentration FromMilligramsPerMilliliter(QuantityValue millig /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromNanogramsPerDeciliter(QuantityValue nanogramsperdeciliter) + public static MassConcentration FromNanogramsPerDeciliter(double value) { - double value = (double) nanogramsperdeciliter; return new MassConcentration(value, MassConcentrationUnit.NanogramPerDeciliter); } @@ -936,9 +904,8 @@ public static MassConcentration FromNanogramsPerDeciliter(QuantityValue nanogram /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromNanogramsPerLiter(QuantityValue nanogramsperliter) + public static MassConcentration FromNanogramsPerLiter(double value) { - double value = (double) nanogramsperliter; return new MassConcentration(value, MassConcentrationUnit.NanogramPerLiter); } @@ -946,9 +913,8 @@ public static MassConcentration FromNanogramsPerLiter(QuantityValue nanogramsper /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromNanogramsPerMicroliter(QuantityValue nanogramspermicroliter) + public static MassConcentration FromNanogramsPerMicroliter(double value) { - double value = (double) nanogramspermicroliter; return new MassConcentration(value, MassConcentrationUnit.NanogramPerMicroliter); } @@ -956,9 +922,8 @@ public static MassConcentration FromNanogramsPerMicroliter(QuantityValue nanogra /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromNanogramsPerMilliliter(QuantityValue nanogramspermilliliter) + public static MassConcentration FromNanogramsPerMilliliter(double value) { - double value = (double) nanogramspermilliliter; return new MassConcentration(value, MassConcentrationUnit.NanogramPerMilliliter); } @@ -966,9 +931,8 @@ public static MassConcentration FromNanogramsPerMilliliter(QuantityValue nanogra /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromOuncesPerImperialGallon(QuantityValue ouncesperimperialgallon) + public static MassConcentration FromOuncesPerImperialGallon(double value) { - double value = (double) ouncesperimperialgallon; return new MassConcentration(value, MassConcentrationUnit.OuncePerImperialGallon); } @@ -976,9 +940,8 @@ public static MassConcentration FromOuncesPerImperialGallon(QuantityValue ounces /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromOuncesPerUSGallon(QuantityValue ouncesperusgallon) + public static MassConcentration FromOuncesPerUSGallon(double value) { - double value = (double) ouncesperusgallon; return new MassConcentration(value, MassConcentrationUnit.OuncePerUSGallon); } @@ -986,9 +949,8 @@ public static MassConcentration FromOuncesPerUSGallon(QuantityValue ouncesperusg /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromPicogramsPerDeciliter(QuantityValue picogramsperdeciliter) + public static MassConcentration FromPicogramsPerDeciliter(double value) { - double value = (double) picogramsperdeciliter; return new MassConcentration(value, MassConcentrationUnit.PicogramPerDeciliter); } @@ -996,9 +958,8 @@ public static MassConcentration FromPicogramsPerDeciliter(QuantityValue picogram /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromPicogramsPerLiter(QuantityValue picogramsperliter) + public static MassConcentration FromPicogramsPerLiter(double value) { - double value = (double) picogramsperliter; return new MassConcentration(value, MassConcentrationUnit.PicogramPerLiter); } @@ -1006,9 +967,8 @@ public static MassConcentration FromPicogramsPerLiter(QuantityValue picogramsper /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromPicogramsPerMicroliter(QuantityValue picogramspermicroliter) + public static MassConcentration FromPicogramsPerMicroliter(double value) { - double value = (double) picogramspermicroliter; return new MassConcentration(value, MassConcentrationUnit.PicogramPerMicroliter); } @@ -1016,9 +976,8 @@ public static MassConcentration FromPicogramsPerMicroliter(QuantityValue picogra /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromPicogramsPerMilliliter(QuantityValue picogramspermilliliter) + public static MassConcentration FromPicogramsPerMilliliter(double value) { - double value = (double) picogramspermilliliter; return new MassConcentration(value, MassConcentrationUnit.PicogramPerMilliliter); } @@ -1026,9 +985,8 @@ public static MassConcentration FromPicogramsPerMilliliter(QuantityValue picogra /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromPoundsPerCubicFoot(QuantityValue poundspercubicfoot) + public static MassConcentration FromPoundsPerCubicFoot(double value) { - double value = (double) poundspercubicfoot; return new MassConcentration(value, MassConcentrationUnit.PoundPerCubicFoot); } @@ -1036,9 +994,8 @@ public static MassConcentration FromPoundsPerCubicFoot(QuantityValue poundspercu /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromPoundsPerCubicInch(QuantityValue poundspercubicinch) + public static MassConcentration FromPoundsPerCubicInch(double value) { - double value = (double) poundspercubicinch; return new MassConcentration(value, MassConcentrationUnit.PoundPerCubicInch); } @@ -1046,9 +1003,8 @@ public static MassConcentration FromPoundsPerCubicInch(QuantityValue poundspercu /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromPoundsPerImperialGallon(QuantityValue poundsperimperialgallon) + public static MassConcentration FromPoundsPerImperialGallon(double value) { - double value = (double) poundsperimperialgallon; return new MassConcentration(value, MassConcentrationUnit.PoundPerImperialGallon); } @@ -1056,9 +1012,8 @@ public static MassConcentration FromPoundsPerImperialGallon(QuantityValue pounds /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromPoundsPerUSGallon(QuantityValue poundsperusgallon) + public static MassConcentration FromPoundsPerUSGallon(double value) { - double value = (double) poundsperusgallon; return new MassConcentration(value, MassConcentrationUnit.PoundPerUSGallon); } @@ -1066,9 +1021,8 @@ public static MassConcentration FromPoundsPerUSGallon(QuantityValue poundsperusg /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromSlugsPerCubicFoot(QuantityValue slugspercubicfoot) + public static MassConcentration FromSlugsPerCubicFoot(double value) { - double value = (double) slugspercubicfoot; return new MassConcentration(value, MassConcentrationUnit.SlugPerCubicFoot); } @@ -1076,9 +1030,8 @@ public static MassConcentration FromSlugsPerCubicFoot(QuantityValue slugspercubi /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromTonnesPerCubicCentimeter(QuantityValue tonnespercubiccentimeter) + public static MassConcentration FromTonnesPerCubicCentimeter(double value) { - double value = (double) tonnespercubiccentimeter; return new MassConcentration(value, MassConcentrationUnit.TonnePerCubicCentimeter); } @@ -1086,9 +1039,8 @@ public static MassConcentration FromTonnesPerCubicCentimeter(QuantityValue tonne /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromTonnesPerCubicMeter(QuantityValue tonnespercubicmeter) + public static MassConcentration FromTonnesPerCubicMeter(double value) { - double value = (double) tonnespercubicmeter; return new MassConcentration(value, MassConcentrationUnit.TonnePerCubicMeter); } @@ -1096,9 +1048,8 @@ public static MassConcentration FromTonnesPerCubicMeter(QuantityValue tonnesperc /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromTonnesPerCubicMillimeter(QuantityValue tonnespercubicmillimeter) + public static MassConcentration FromTonnesPerCubicMillimeter(double value) { - double value = (double) tonnespercubicmillimeter; return new MassConcentration(value, MassConcentrationUnit.TonnePerCubicMillimeter); } @@ -1108,9 +1059,9 @@ public static MassConcentration FromTonnesPerCubicMillimeter(QuantityValue tonne /// Value to convert from. /// Unit to convert from. /// MassConcentration unit value. - public static MassConcentration From(QuantityValue value, MassConcentrationUnit fromUnit) + public static MassConcentration From(double value, MassConcentrationUnit fromUnit) { - return new MassConcentration((double)value, fromUnit); + return new MassConcentration(value, fromUnit); } #endregion @@ -1543,15 +1494,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is MassConcentrationUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(MassConcentrationUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is MassConcentrationUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(MassConcentrationUnit)} is supported.", nameof(unit)); @@ -1762,18 +1704,6 @@ public MassConcentration ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not MassConcentrationUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(MassConcentrationUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/MassFlow.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFlow.g.cs index bc6331a141..22b9d72ef2 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFlow.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFlow.g.cs @@ -40,7 +40,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct MassFlow : - IArithmeticQuantity, + IArithmeticQuantity, #if NET7_0_OR_GREATER IDivisionOperators, IDivisionOperators, @@ -193,7 +193,7 @@ public MassFlow(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -491,9 +491,8 @@ public static string GetAbbreviation(MassFlowUnit unit, IFormatProvider? provide /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromCentigramsPerDay(QuantityValue centigramsperday) + public static MassFlow FromCentigramsPerDay(double value) { - double value = (double) centigramsperday; return new MassFlow(value, MassFlowUnit.CentigramPerDay); } @@ -501,9 +500,8 @@ public static MassFlow FromCentigramsPerDay(QuantityValue centigramsperday) /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromCentigramsPerSecond(QuantityValue centigramspersecond) + public static MassFlow FromCentigramsPerSecond(double value) { - double value = (double) centigramspersecond; return new MassFlow(value, MassFlowUnit.CentigramPerSecond); } @@ -511,9 +509,8 @@ public static MassFlow FromCentigramsPerSecond(QuantityValue centigramspersecond /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromDecagramsPerDay(QuantityValue decagramsperday) + public static MassFlow FromDecagramsPerDay(double value) { - double value = (double) decagramsperday; return new MassFlow(value, MassFlowUnit.DecagramPerDay); } @@ -521,9 +518,8 @@ public static MassFlow FromDecagramsPerDay(QuantityValue decagramsperday) /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromDecagramsPerSecond(QuantityValue decagramspersecond) + public static MassFlow FromDecagramsPerSecond(double value) { - double value = (double) decagramspersecond; return new MassFlow(value, MassFlowUnit.DecagramPerSecond); } @@ -531,9 +527,8 @@ public static MassFlow FromDecagramsPerSecond(QuantityValue decagramspersecond) /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromDecigramsPerDay(QuantityValue decigramsperday) + public static MassFlow FromDecigramsPerDay(double value) { - double value = (double) decigramsperday; return new MassFlow(value, MassFlowUnit.DecigramPerDay); } @@ -541,9 +536,8 @@ public static MassFlow FromDecigramsPerDay(QuantityValue decigramsperday) /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromDecigramsPerSecond(QuantityValue decigramspersecond) + public static MassFlow FromDecigramsPerSecond(double value) { - double value = (double) decigramspersecond; return new MassFlow(value, MassFlowUnit.DecigramPerSecond); } @@ -551,9 +545,8 @@ public static MassFlow FromDecigramsPerSecond(QuantityValue decigramspersecond) /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromGramsPerDay(QuantityValue gramsperday) + public static MassFlow FromGramsPerDay(double value) { - double value = (double) gramsperday; return new MassFlow(value, MassFlowUnit.GramPerDay); } @@ -561,9 +554,8 @@ public static MassFlow FromGramsPerDay(QuantityValue gramsperday) /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromGramsPerHour(QuantityValue gramsperhour) + public static MassFlow FromGramsPerHour(double value) { - double value = (double) gramsperhour; return new MassFlow(value, MassFlowUnit.GramPerHour); } @@ -571,9 +563,8 @@ public static MassFlow FromGramsPerHour(QuantityValue gramsperhour) /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromGramsPerSecond(QuantityValue gramspersecond) + public static MassFlow FromGramsPerSecond(double value) { - double value = (double) gramspersecond; return new MassFlow(value, MassFlowUnit.GramPerSecond); } @@ -581,9 +572,8 @@ public static MassFlow FromGramsPerSecond(QuantityValue gramspersecond) /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromHectogramsPerDay(QuantityValue hectogramsperday) + public static MassFlow FromHectogramsPerDay(double value) { - double value = (double) hectogramsperday; return new MassFlow(value, MassFlowUnit.HectogramPerDay); } @@ -591,9 +581,8 @@ public static MassFlow FromHectogramsPerDay(QuantityValue hectogramsperday) /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromHectogramsPerSecond(QuantityValue hectogramspersecond) + public static MassFlow FromHectogramsPerSecond(double value) { - double value = (double) hectogramspersecond; return new MassFlow(value, MassFlowUnit.HectogramPerSecond); } @@ -601,9 +590,8 @@ public static MassFlow FromHectogramsPerSecond(QuantityValue hectogramspersecond /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromKilogramsPerDay(QuantityValue kilogramsperday) + public static MassFlow FromKilogramsPerDay(double value) { - double value = (double) kilogramsperday; return new MassFlow(value, MassFlowUnit.KilogramPerDay); } @@ -611,9 +599,8 @@ public static MassFlow FromKilogramsPerDay(QuantityValue kilogramsperday) /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromKilogramsPerHour(QuantityValue kilogramsperhour) + public static MassFlow FromKilogramsPerHour(double value) { - double value = (double) kilogramsperhour; return new MassFlow(value, MassFlowUnit.KilogramPerHour); } @@ -621,9 +608,8 @@ public static MassFlow FromKilogramsPerHour(QuantityValue kilogramsperhour) /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromKilogramsPerMinute(QuantityValue kilogramsperminute) + public static MassFlow FromKilogramsPerMinute(double value) { - double value = (double) kilogramsperminute; return new MassFlow(value, MassFlowUnit.KilogramPerMinute); } @@ -631,9 +617,8 @@ public static MassFlow FromKilogramsPerMinute(QuantityValue kilogramsperminute) /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromKilogramsPerSecond(QuantityValue kilogramspersecond) + public static MassFlow FromKilogramsPerSecond(double value) { - double value = (double) kilogramspersecond; return new MassFlow(value, MassFlowUnit.KilogramPerSecond); } @@ -641,9 +626,8 @@ public static MassFlow FromKilogramsPerSecond(QuantityValue kilogramspersecond) /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromMegagramsPerDay(QuantityValue megagramsperday) + public static MassFlow FromMegagramsPerDay(double value) { - double value = (double) megagramsperday; return new MassFlow(value, MassFlowUnit.MegagramPerDay); } @@ -651,9 +635,8 @@ public static MassFlow FromMegagramsPerDay(QuantityValue megagramsperday) /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromMegapoundsPerDay(QuantityValue megapoundsperday) + public static MassFlow FromMegapoundsPerDay(double value) { - double value = (double) megapoundsperday; return new MassFlow(value, MassFlowUnit.MegapoundPerDay); } @@ -661,9 +644,8 @@ public static MassFlow FromMegapoundsPerDay(QuantityValue megapoundsperday) /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromMegapoundsPerHour(QuantityValue megapoundsperhour) + public static MassFlow FromMegapoundsPerHour(double value) { - double value = (double) megapoundsperhour; return new MassFlow(value, MassFlowUnit.MegapoundPerHour); } @@ -671,9 +653,8 @@ public static MassFlow FromMegapoundsPerHour(QuantityValue megapoundsperhour) /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromMegapoundsPerMinute(QuantityValue megapoundsperminute) + public static MassFlow FromMegapoundsPerMinute(double value) { - double value = (double) megapoundsperminute; return new MassFlow(value, MassFlowUnit.MegapoundPerMinute); } @@ -681,9 +662,8 @@ public static MassFlow FromMegapoundsPerMinute(QuantityValue megapoundsperminute /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromMegapoundsPerSecond(QuantityValue megapoundspersecond) + public static MassFlow FromMegapoundsPerSecond(double value) { - double value = (double) megapoundspersecond; return new MassFlow(value, MassFlowUnit.MegapoundPerSecond); } @@ -691,9 +671,8 @@ public static MassFlow FromMegapoundsPerSecond(QuantityValue megapoundspersecond /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromMicrogramsPerDay(QuantityValue microgramsperday) + public static MassFlow FromMicrogramsPerDay(double value) { - double value = (double) microgramsperday; return new MassFlow(value, MassFlowUnit.MicrogramPerDay); } @@ -701,9 +680,8 @@ public static MassFlow FromMicrogramsPerDay(QuantityValue microgramsperday) /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromMicrogramsPerSecond(QuantityValue microgramspersecond) + public static MassFlow FromMicrogramsPerSecond(double value) { - double value = (double) microgramspersecond; return new MassFlow(value, MassFlowUnit.MicrogramPerSecond); } @@ -711,9 +689,8 @@ public static MassFlow FromMicrogramsPerSecond(QuantityValue microgramspersecond /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromMilligramsPerDay(QuantityValue milligramsperday) + public static MassFlow FromMilligramsPerDay(double value) { - double value = (double) milligramsperday; return new MassFlow(value, MassFlowUnit.MilligramPerDay); } @@ -721,9 +698,8 @@ public static MassFlow FromMilligramsPerDay(QuantityValue milligramsperday) /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromMilligramsPerSecond(QuantityValue milligramspersecond) + public static MassFlow FromMilligramsPerSecond(double value) { - double value = (double) milligramspersecond; return new MassFlow(value, MassFlowUnit.MilligramPerSecond); } @@ -731,9 +707,8 @@ public static MassFlow FromMilligramsPerSecond(QuantityValue milligramspersecond /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromNanogramsPerDay(QuantityValue nanogramsperday) + public static MassFlow FromNanogramsPerDay(double value) { - double value = (double) nanogramsperday; return new MassFlow(value, MassFlowUnit.NanogramPerDay); } @@ -741,9 +716,8 @@ public static MassFlow FromNanogramsPerDay(QuantityValue nanogramsperday) /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromNanogramsPerSecond(QuantityValue nanogramspersecond) + public static MassFlow FromNanogramsPerSecond(double value) { - double value = (double) nanogramspersecond; return new MassFlow(value, MassFlowUnit.NanogramPerSecond); } @@ -751,9 +725,8 @@ public static MassFlow FromNanogramsPerSecond(QuantityValue nanogramspersecond) /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromPoundsPerDay(QuantityValue poundsperday) + public static MassFlow FromPoundsPerDay(double value) { - double value = (double) poundsperday; return new MassFlow(value, MassFlowUnit.PoundPerDay); } @@ -761,9 +734,8 @@ public static MassFlow FromPoundsPerDay(QuantityValue poundsperday) /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromPoundsPerHour(QuantityValue poundsperhour) + public static MassFlow FromPoundsPerHour(double value) { - double value = (double) poundsperhour; return new MassFlow(value, MassFlowUnit.PoundPerHour); } @@ -771,9 +743,8 @@ public static MassFlow FromPoundsPerHour(QuantityValue poundsperhour) /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromPoundsPerMinute(QuantityValue poundsperminute) + public static MassFlow FromPoundsPerMinute(double value) { - double value = (double) poundsperminute; return new MassFlow(value, MassFlowUnit.PoundPerMinute); } @@ -781,9 +752,8 @@ public static MassFlow FromPoundsPerMinute(QuantityValue poundsperminute) /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromPoundsPerSecond(QuantityValue poundspersecond) + public static MassFlow FromPoundsPerSecond(double value) { - double value = (double) poundspersecond; return new MassFlow(value, MassFlowUnit.PoundPerSecond); } @@ -791,9 +761,8 @@ public static MassFlow FromPoundsPerSecond(QuantityValue poundspersecond) /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromShortTonsPerHour(QuantityValue shorttonsperhour) + public static MassFlow FromShortTonsPerHour(double value) { - double value = (double) shorttonsperhour; return new MassFlow(value, MassFlowUnit.ShortTonPerHour); } @@ -801,9 +770,8 @@ public static MassFlow FromShortTonsPerHour(QuantityValue shorttonsperhour) /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromTonnesPerDay(QuantityValue tonnesperday) + public static MassFlow FromTonnesPerDay(double value) { - double value = (double) tonnesperday; return new MassFlow(value, MassFlowUnit.TonnePerDay); } @@ -811,9 +779,8 @@ public static MassFlow FromTonnesPerDay(QuantityValue tonnesperday) /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromTonnesPerHour(QuantityValue tonnesperhour) + public static MassFlow FromTonnesPerHour(double value) { - double value = (double) tonnesperhour; return new MassFlow(value, MassFlowUnit.TonnePerHour); } @@ -823,9 +790,9 @@ public static MassFlow FromTonnesPerHour(QuantityValue tonnesperhour) /// Value to convert from. /// Unit to convert from. /// MassFlow unit value. - public static MassFlow From(QuantityValue value, MassFlowUnit fromUnit) + public static MassFlow From(double value, MassFlowUnit fromUnit) { - return new MassFlow((double)value, fromUnit); + return new MassFlow(value, fromUnit); } #endregion @@ -1300,15 +1267,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is MassFlowUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(MassFlowUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is MassFlowUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(MassFlowUnit)} is supported.", nameof(unit)); @@ -1487,18 +1445,6 @@ public MassFlow ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not MassFlowUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(MassFlowUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/MassFlux.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFlux.g.cs index 74dae04d8c..77e91ab108 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFlux.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFlux.g.cs @@ -40,7 +40,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct MassFlux : - IArithmeticQuantity, + IArithmeticQuantity, #if NET7_0_OR_GREATER IDivisionOperators, IMultiplyOperators, @@ -166,7 +166,7 @@ public MassFlux(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -317,9 +317,8 @@ public static string GetAbbreviation(MassFluxUnit unit, IFormatProvider? provide /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlux FromGramsPerHourPerSquareCentimeter(QuantityValue gramsperhourpersquarecentimeter) + public static MassFlux FromGramsPerHourPerSquareCentimeter(double value) { - double value = (double) gramsperhourpersquarecentimeter; return new MassFlux(value, MassFluxUnit.GramPerHourPerSquareCentimeter); } @@ -327,9 +326,8 @@ public static MassFlux FromGramsPerHourPerSquareCentimeter(QuantityValue gramspe /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlux FromGramsPerHourPerSquareMeter(QuantityValue gramsperhourpersquaremeter) + public static MassFlux FromGramsPerHourPerSquareMeter(double value) { - double value = (double) gramsperhourpersquaremeter; return new MassFlux(value, MassFluxUnit.GramPerHourPerSquareMeter); } @@ -337,9 +335,8 @@ public static MassFlux FromGramsPerHourPerSquareMeter(QuantityValue gramsperhour /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlux FromGramsPerHourPerSquareMillimeter(QuantityValue gramsperhourpersquaremillimeter) + public static MassFlux FromGramsPerHourPerSquareMillimeter(double value) { - double value = (double) gramsperhourpersquaremillimeter; return new MassFlux(value, MassFluxUnit.GramPerHourPerSquareMillimeter); } @@ -347,9 +344,8 @@ public static MassFlux FromGramsPerHourPerSquareMillimeter(QuantityValue gramspe /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlux FromGramsPerSecondPerSquareCentimeter(QuantityValue gramspersecondpersquarecentimeter) + public static MassFlux FromGramsPerSecondPerSquareCentimeter(double value) { - double value = (double) gramspersecondpersquarecentimeter; return new MassFlux(value, MassFluxUnit.GramPerSecondPerSquareCentimeter); } @@ -357,9 +353,8 @@ public static MassFlux FromGramsPerSecondPerSquareCentimeter(QuantityValue grams /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlux FromGramsPerSecondPerSquareMeter(QuantityValue gramspersecondpersquaremeter) + public static MassFlux FromGramsPerSecondPerSquareMeter(double value) { - double value = (double) gramspersecondpersquaremeter; return new MassFlux(value, MassFluxUnit.GramPerSecondPerSquareMeter); } @@ -367,9 +362,8 @@ public static MassFlux FromGramsPerSecondPerSquareMeter(QuantityValue gramsperse /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlux FromGramsPerSecondPerSquareMillimeter(QuantityValue gramspersecondpersquaremillimeter) + public static MassFlux FromGramsPerSecondPerSquareMillimeter(double value) { - double value = (double) gramspersecondpersquaremillimeter; return new MassFlux(value, MassFluxUnit.GramPerSecondPerSquareMillimeter); } @@ -377,9 +371,8 @@ public static MassFlux FromGramsPerSecondPerSquareMillimeter(QuantityValue grams /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlux FromKilogramsPerHourPerSquareCentimeter(QuantityValue kilogramsperhourpersquarecentimeter) + public static MassFlux FromKilogramsPerHourPerSquareCentimeter(double value) { - double value = (double) kilogramsperhourpersquarecentimeter; return new MassFlux(value, MassFluxUnit.KilogramPerHourPerSquareCentimeter); } @@ -387,9 +380,8 @@ public static MassFlux FromKilogramsPerHourPerSquareCentimeter(QuantityValue kil /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlux FromKilogramsPerHourPerSquareMeter(QuantityValue kilogramsperhourpersquaremeter) + public static MassFlux FromKilogramsPerHourPerSquareMeter(double value) { - double value = (double) kilogramsperhourpersquaremeter; return new MassFlux(value, MassFluxUnit.KilogramPerHourPerSquareMeter); } @@ -397,9 +389,8 @@ public static MassFlux FromKilogramsPerHourPerSquareMeter(QuantityValue kilogram /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlux FromKilogramsPerHourPerSquareMillimeter(QuantityValue kilogramsperhourpersquaremillimeter) + public static MassFlux FromKilogramsPerHourPerSquareMillimeter(double value) { - double value = (double) kilogramsperhourpersquaremillimeter; return new MassFlux(value, MassFluxUnit.KilogramPerHourPerSquareMillimeter); } @@ -407,9 +398,8 @@ public static MassFlux FromKilogramsPerHourPerSquareMillimeter(QuantityValue kil /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlux FromKilogramsPerSecondPerSquareCentimeter(QuantityValue kilogramspersecondpersquarecentimeter) + public static MassFlux FromKilogramsPerSecondPerSquareCentimeter(double value) { - double value = (double) kilogramspersecondpersquarecentimeter; return new MassFlux(value, MassFluxUnit.KilogramPerSecondPerSquareCentimeter); } @@ -417,9 +407,8 @@ public static MassFlux FromKilogramsPerSecondPerSquareCentimeter(QuantityValue k /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlux FromKilogramsPerSecondPerSquareMeter(QuantityValue kilogramspersecondpersquaremeter) + public static MassFlux FromKilogramsPerSecondPerSquareMeter(double value) { - double value = (double) kilogramspersecondpersquaremeter; return new MassFlux(value, MassFluxUnit.KilogramPerSecondPerSquareMeter); } @@ -427,9 +416,8 @@ public static MassFlux FromKilogramsPerSecondPerSquareMeter(QuantityValue kilogr /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlux FromKilogramsPerSecondPerSquareMillimeter(QuantityValue kilogramspersecondpersquaremillimeter) + public static MassFlux FromKilogramsPerSecondPerSquareMillimeter(double value) { - double value = (double) kilogramspersecondpersquaremillimeter; return new MassFlux(value, MassFluxUnit.KilogramPerSecondPerSquareMillimeter); } @@ -439,9 +427,9 @@ public static MassFlux FromKilogramsPerSecondPerSquareMillimeter(QuantityValue k /// Value to convert from. /// Unit to convert from. /// MassFlux unit value. - public static MassFlux From(QuantityValue value, MassFluxUnit fromUnit) + public static MassFlux From(double value, MassFluxUnit fromUnit) { - return new MassFlux((double)value, fromUnit); + return new MassFlux(value, fromUnit); } #endregion @@ -874,15 +862,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is MassFluxUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(MassFluxUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is MassFluxUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(MassFluxUnit)} is supported.", nameof(unit)); @@ -1019,18 +998,6 @@ public MassFlux ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not MassFluxUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(MassFluxUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/MassFraction.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFraction.g.cs index 749c8a47c6..0ade3af47b 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFraction.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFraction.g.cs @@ -43,7 +43,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct MassFraction : - IArithmeticQuantity, + IArithmeticQuantity, #if NET7_0_OR_GREATER IMultiplyOperators, #endif @@ -179,7 +179,7 @@ public MassFraction(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -414,9 +414,8 @@ public static string GetAbbreviation(MassFractionUnit unit, IFormatProvider? pro /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFraction FromCentigramsPerGram(QuantityValue centigramspergram) + public static MassFraction FromCentigramsPerGram(double value) { - double value = (double) centigramspergram; return new MassFraction(value, MassFractionUnit.CentigramPerGram); } @@ -424,9 +423,8 @@ public static MassFraction FromCentigramsPerGram(QuantityValue centigramspergram /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFraction FromCentigramsPerKilogram(QuantityValue centigramsperkilogram) + public static MassFraction FromCentigramsPerKilogram(double value) { - double value = (double) centigramsperkilogram; return new MassFraction(value, MassFractionUnit.CentigramPerKilogram); } @@ -434,9 +432,8 @@ public static MassFraction FromCentigramsPerKilogram(QuantityValue centigramsper /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFraction FromDecagramsPerGram(QuantityValue decagramspergram) + public static MassFraction FromDecagramsPerGram(double value) { - double value = (double) decagramspergram; return new MassFraction(value, MassFractionUnit.DecagramPerGram); } @@ -444,9 +441,8 @@ public static MassFraction FromDecagramsPerGram(QuantityValue decagramspergram) /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFraction FromDecagramsPerKilogram(QuantityValue decagramsperkilogram) + public static MassFraction FromDecagramsPerKilogram(double value) { - double value = (double) decagramsperkilogram; return new MassFraction(value, MassFractionUnit.DecagramPerKilogram); } @@ -454,9 +450,8 @@ public static MassFraction FromDecagramsPerKilogram(QuantityValue decagramsperki /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFraction FromDecigramsPerGram(QuantityValue decigramspergram) + public static MassFraction FromDecigramsPerGram(double value) { - double value = (double) decigramspergram; return new MassFraction(value, MassFractionUnit.DecigramPerGram); } @@ -464,9 +459,8 @@ public static MassFraction FromDecigramsPerGram(QuantityValue decigramspergram) /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFraction FromDecigramsPerKilogram(QuantityValue decigramsperkilogram) + public static MassFraction FromDecigramsPerKilogram(double value) { - double value = (double) decigramsperkilogram; return new MassFraction(value, MassFractionUnit.DecigramPerKilogram); } @@ -474,9 +468,8 @@ public static MassFraction FromDecigramsPerKilogram(QuantityValue decigramsperki /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFraction FromDecimalFractions(QuantityValue decimalfractions) + public static MassFraction FromDecimalFractions(double value) { - double value = (double) decimalfractions; return new MassFraction(value, MassFractionUnit.DecimalFraction); } @@ -484,9 +477,8 @@ public static MassFraction FromDecimalFractions(QuantityValue decimalfractions) /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFraction FromGramsPerGram(QuantityValue gramspergram) + public static MassFraction FromGramsPerGram(double value) { - double value = (double) gramspergram; return new MassFraction(value, MassFractionUnit.GramPerGram); } @@ -494,9 +486,8 @@ public static MassFraction FromGramsPerGram(QuantityValue gramspergram) /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFraction FromGramsPerKilogram(QuantityValue gramsperkilogram) + public static MassFraction FromGramsPerKilogram(double value) { - double value = (double) gramsperkilogram; return new MassFraction(value, MassFractionUnit.GramPerKilogram); } @@ -504,9 +495,8 @@ public static MassFraction FromGramsPerKilogram(QuantityValue gramsperkilogram) /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFraction FromHectogramsPerGram(QuantityValue hectogramspergram) + public static MassFraction FromHectogramsPerGram(double value) { - double value = (double) hectogramspergram; return new MassFraction(value, MassFractionUnit.HectogramPerGram); } @@ -514,9 +504,8 @@ public static MassFraction FromHectogramsPerGram(QuantityValue hectogramspergram /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFraction FromHectogramsPerKilogram(QuantityValue hectogramsperkilogram) + public static MassFraction FromHectogramsPerKilogram(double value) { - double value = (double) hectogramsperkilogram; return new MassFraction(value, MassFractionUnit.HectogramPerKilogram); } @@ -524,9 +513,8 @@ public static MassFraction FromHectogramsPerKilogram(QuantityValue hectogramsper /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFraction FromKilogramsPerGram(QuantityValue kilogramspergram) + public static MassFraction FromKilogramsPerGram(double value) { - double value = (double) kilogramspergram; return new MassFraction(value, MassFractionUnit.KilogramPerGram); } @@ -534,9 +522,8 @@ public static MassFraction FromKilogramsPerGram(QuantityValue kilogramspergram) /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFraction FromKilogramsPerKilogram(QuantityValue kilogramsperkilogram) + public static MassFraction FromKilogramsPerKilogram(double value) { - double value = (double) kilogramsperkilogram; return new MassFraction(value, MassFractionUnit.KilogramPerKilogram); } @@ -544,9 +531,8 @@ public static MassFraction FromKilogramsPerKilogram(QuantityValue kilogramsperki /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFraction FromMicrogramsPerGram(QuantityValue microgramspergram) + public static MassFraction FromMicrogramsPerGram(double value) { - double value = (double) microgramspergram; return new MassFraction(value, MassFractionUnit.MicrogramPerGram); } @@ -554,9 +540,8 @@ public static MassFraction FromMicrogramsPerGram(QuantityValue microgramspergram /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFraction FromMicrogramsPerKilogram(QuantityValue microgramsperkilogram) + public static MassFraction FromMicrogramsPerKilogram(double value) { - double value = (double) microgramsperkilogram; return new MassFraction(value, MassFractionUnit.MicrogramPerKilogram); } @@ -564,9 +549,8 @@ public static MassFraction FromMicrogramsPerKilogram(QuantityValue microgramsper /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFraction FromMilligramsPerGram(QuantityValue milligramspergram) + public static MassFraction FromMilligramsPerGram(double value) { - double value = (double) milligramspergram; return new MassFraction(value, MassFractionUnit.MilligramPerGram); } @@ -574,9 +558,8 @@ public static MassFraction FromMilligramsPerGram(QuantityValue milligramspergram /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFraction FromMilligramsPerKilogram(QuantityValue milligramsperkilogram) + public static MassFraction FromMilligramsPerKilogram(double value) { - double value = (double) milligramsperkilogram; return new MassFraction(value, MassFractionUnit.MilligramPerKilogram); } @@ -584,9 +567,8 @@ public static MassFraction FromMilligramsPerKilogram(QuantityValue milligramsper /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFraction FromNanogramsPerGram(QuantityValue nanogramspergram) + public static MassFraction FromNanogramsPerGram(double value) { - double value = (double) nanogramspergram; return new MassFraction(value, MassFractionUnit.NanogramPerGram); } @@ -594,9 +576,8 @@ public static MassFraction FromNanogramsPerGram(QuantityValue nanogramspergram) /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFraction FromNanogramsPerKilogram(QuantityValue nanogramsperkilogram) + public static MassFraction FromNanogramsPerKilogram(double value) { - double value = (double) nanogramsperkilogram; return new MassFraction(value, MassFractionUnit.NanogramPerKilogram); } @@ -604,9 +585,8 @@ public static MassFraction FromNanogramsPerKilogram(QuantityValue nanogramsperki /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFraction FromPartsPerBillion(QuantityValue partsperbillion) + public static MassFraction FromPartsPerBillion(double value) { - double value = (double) partsperbillion; return new MassFraction(value, MassFractionUnit.PartPerBillion); } @@ -614,9 +594,8 @@ public static MassFraction FromPartsPerBillion(QuantityValue partsperbillion) /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFraction FromPartsPerMillion(QuantityValue partspermillion) + public static MassFraction FromPartsPerMillion(double value) { - double value = (double) partspermillion; return new MassFraction(value, MassFractionUnit.PartPerMillion); } @@ -624,9 +603,8 @@ public static MassFraction FromPartsPerMillion(QuantityValue partspermillion) /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFraction FromPartsPerThousand(QuantityValue partsperthousand) + public static MassFraction FromPartsPerThousand(double value) { - double value = (double) partsperthousand; return new MassFraction(value, MassFractionUnit.PartPerThousand); } @@ -634,9 +612,8 @@ public static MassFraction FromPartsPerThousand(QuantityValue partsperthousand) /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFraction FromPartsPerTrillion(QuantityValue partspertrillion) + public static MassFraction FromPartsPerTrillion(double value) { - double value = (double) partspertrillion; return new MassFraction(value, MassFractionUnit.PartPerTrillion); } @@ -644,9 +621,8 @@ public static MassFraction FromPartsPerTrillion(QuantityValue partspertrillion) /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFraction FromPercent(QuantityValue percent) + public static MassFraction FromPercent(double value) { - double value = (double) percent; return new MassFraction(value, MassFractionUnit.Percent); } @@ -656,9 +632,9 @@ public static MassFraction FromPercent(QuantityValue percent) /// Value to convert from. /// Unit to convert from. /// MassFraction unit value. - public static MassFraction From(QuantityValue value, MassFractionUnit fromUnit) + public static MassFraction From(double value, MassFractionUnit fromUnit) { - return new MassFraction((double)value, fromUnit); + return new MassFraction(value, fromUnit); } #endregion @@ -1079,15 +1055,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is MassFractionUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(MassFractionUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is MassFractionUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(MassFractionUnit)} is supported.", nameof(unit)); @@ -1248,18 +1215,6 @@ public MassFraction ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not MassFractionUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(MassFractionUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.g.cs b/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.g.cs index b1960d57f9..ac7c6a34a8 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.g.cs @@ -37,7 +37,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct MassMomentOfInertia : - IArithmeticQuantity, + IArithmeticQuantity, IComparable, IComparable, IConvertible, @@ -174,7 +174,7 @@ public MassMomentOfInertia(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -437,9 +437,8 @@ public static string GetAbbreviation(MassMomentOfInertiaUnit unit, IFormatProvid /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromGramSquareCentimeters(QuantityValue gramsquarecentimeters) + public static MassMomentOfInertia FromGramSquareCentimeters(double value) { - double value = (double) gramsquarecentimeters; return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.GramSquareCentimeter); } @@ -447,9 +446,8 @@ public static MassMomentOfInertia FromGramSquareCentimeters(QuantityValue gramsq /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromGramSquareDecimeters(QuantityValue gramsquaredecimeters) + public static MassMomentOfInertia FromGramSquareDecimeters(double value) { - double value = (double) gramsquaredecimeters; return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.GramSquareDecimeter); } @@ -457,9 +455,8 @@ public static MassMomentOfInertia FromGramSquareDecimeters(QuantityValue gramsqu /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromGramSquareMeters(QuantityValue gramsquaremeters) + public static MassMomentOfInertia FromGramSquareMeters(double value) { - double value = (double) gramsquaremeters; return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.GramSquareMeter); } @@ -467,9 +464,8 @@ public static MassMomentOfInertia FromGramSquareMeters(QuantityValue gramsquarem /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromGramSquareMillimeters(QuantityValue gramsquaremillimeters) + public static MassMomentOfInertia FromGramSquareMillimeters(double value) { - double value = (double) gramsquaremillimeters; return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.GramSquareMillimeter); } @@ -477,9 +473,8 @@ public static MassMomentOfInertia FromGramSquareMillimeters(QuantityValue gramsq /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromKilogramSquareCentimeters(QuantityValue kilogramsquarecentimeters) + public static MassMomentOfInertia FromKilogramSquareCentimeters(double value) { - double value = (double) kilogramsquarecentimeters; return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.KilogramSquareCentimeter); } @@ -487,9 +482,8 @@ public static MassMomentOfInertia FromKilogramSquareCentimeters(QuantityValue ki /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromKilogramSquareDecimeters(QuantityValue kilogramsquaredecimeters) + public static MassMomentOfInertia FromKilogramSquareDecimeters(double value) { - double value = (double) kilogramsquaredecimeters; return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.KilogramSquareDecimeter); } @@ -497,9 +491,8 @@ public static MassMomentOfInertia FromKilogramSquareDecimeters(QuantityValue kil /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromKilogramSquareMeters(QuantityValue kilogramsquaremeters) + public static MassMomentOfInertia FromKilogramSquareMeters(double value) { - double value = (double) kilogramsquaremeters; return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.KilogramSquareMeter); } @@ -507,9 +500,8 @@ public static MassMomentOfInertia FromKilogramSquareMeters(QuantityValue kilogra /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromKilogramSquareMillimeters(QuantityValue kilogramsquaremillimeters) + public static MassMomentOfInertia FromKilogramSquareMillimeters(double value) { - double value = (double) kilogramsquaremillimeters; return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.KilogramSquareMillimeter); } @@ -517,9 +509,8 @@ public static MassMomentOfInertia FromKilogramSquareMillimeters(QuantityValue ki /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromKilotonneSquareCentimeters(QuantityValue kilotonnesquarecentimeters) + public static MassMomentOfInertia FromKilotonneSquareCentimeters(double value) { - double value = (double) kilotonnesquarecentimeters; return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.KilotonneSquareCentimeter); } @@ -527,9 +518,8 @@ public static MassMomentOfInertia FromKilotonneSquareCentimeters(QuantityValue k /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromKilotonneSquareDecimeters(QuantityValue kilotonnesquaredecimeters) + public static MassMomentOfInertia FromKilotonneSquareDecimeters(double value) { - double value = (double) kilotonnesquaredecimeters; return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.KilotonneSquareDecimeter); } @@ -537,9 +527,8 @@ public static MassMomentOfInertia FromKilotonneSquareDecimeters(QuantityValue ki /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromKilotonneSquareMeters(QuantityValue kilotonnesquaremeters) + public static MassMomentOfInertia FromKilotonneSquareMeters(double value) { - double value = (double) kilotonnesquaremeters; return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.KilotonneSquareMeter); } @@ -547,9 +536,8 @@ public static MassMomentOfInertia FromKilotonneSquareMeters(QuantityValue kiloto /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromKilotonneSquareMilimeters(QuantityValue kilotonnesquaremilimeters) + public static MassMomentOfInertia FromKilotonneSquareMilimeters(double value) { - double value = (double) kilotonnesquaremilimeters; return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.KilotonneSquareMilimeter); } @@ -557,9 +545,8 @@ public static MassMomentOfInertia FromKilotonneSquareMilimeters(QuantityValue ki /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromMegatonneSquareCentimeters(QuantityValue megatonnesquarecentimeters) + public static MassMomentOfInertia FromMegatonneSquareCentimeters(double value) { - double value = (double) megatonnesquarecentimeters; return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.MegatonneSquareCentimeter); } @@ -567,9 +554,8 @@ public static MassMomentOfInertia FromMegatonneSquareCentimeters(QuantityValue m /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromMegatonneSquareDecimeters(QuantityValue megatonnesquaredecimeters) + public static MassMomentOfInertia FromMegatonneSquareDecimeters(double value) { - double value = (double) megatonnesquaredecimeters; return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.MegatonneSquareDecimeter); } @@ -577,9 +563,8 @@ public static MassMomentOfInertia FromMegatonneSquareDecimeters(QuantityValue me /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromMegatonneSquareMeters(QuantityValue megatonnesquaremeters) + public static MassMomentOfInertia FromMegatonneSquareMeters(double value) { - double value = (double) megatonnesquaremeters; return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.MegatonneSquareMeter); } @@ -587,9 +572,8 @@ public static MassMomentOfInertia FromMegatonneSquareMeters(QuantityValue megato /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromMegatonneSquareMilimeters(QuantityValue megatonnesquaremilimeters) + public static MassMomentOfInertia FromMegatonneSquareMilimeters(double value) { - double value = (double) megatonnesquaremilimeters; return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.MegatonneSquareMilimeter); } @@ -597,9 +581,8 @@ public static MassMomentOfInertia FromMegatonneSquareMilimeters(QuantityValue me /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromMilligramSquareCentimeters(QuantityValue milligramsquarecentimeters) + public static MassMomentOfInertia FromMilligramSquareCentimeters(double value) { - double value = (double) milligramsquarecentimeters; return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.MilligramSquareCentimeter); } @@ -607,9 +590,8 @@ public static MassMomentOfInertia FromMilligramSquareCentimeters(QuantityValue m /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromMilligramSquareDecimeters(QuantityValue milligramsquaredecimeters) + public static MassMomentOfInertia FromMilligramSquareDecimeters(double value) { - double value = (double) milligramsquaredecimeters; return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.MilligramSquareDecimeter); } @@ -617,9 +599,8 @@ public static MassMomentOfInertia FromMilligramSquareDecimeters(QuantityValue mi /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromMilligramSquareMeters(QuantityValue milligramsquaremeters) + public static MassMomentOfInertia FromMilligramSquareMeters(double value) { - double value = (double) milligramsquaremeters; return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.MilligramSquareMeter); } @@ -627,9 +608,8 @@ public static MassMomentOfInertia FromMilligramSquareMeters(QuantityValue millig /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromMilligramSquareMillimeters(QuantityValue milligramsquaremillimeters) + public static MassMomentOfInertia FromMilligramSquareMillimeters(double value) { - double value = (double) milligramsquaremillimeters; return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.MilligramSquareMillimeter); } @@ -637,9 +617,8 @@ public static MassMomentOfInertia FromMilligramSquareMillimeters(QuantityValue m /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromPoundSquareFeet(QuantityValue poundsquarefeet) + public static MassMomentOfInertia FromPoundSquareFeet(double value) { - double value = (double) poundsquarefeet; return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.PoundSquareFoot); } @@ -647,9 +626,8 @@ public static MassMomentOfInertia FromPoundSquareFeet(QuantityValue poundsquaref /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromPoundSquareInches(QuantityValue poundsquareinches) + public static MassMomentOfInertia FromPoundSquareInches(double value) { - double value = (double) poundsquareinches; return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.PoundSquareInch); } @@ -657,9 +635,8 @@ public static MassMomentOfInertia FromPoundSquareInches(QuantityValue poundsquar /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromSlugSquareFeet(QuantityValue slugsquarefeet) + public static MassMomentOfInertia FromSlugSquareFeet(double value) { - double value = (double) slugsquarefeet; return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.SlugSquareFoot); } @@ -667,9 +644,8 @@ public static MassMomentOfInertia FromSlugSquareFeet(QuantityValue slugsquarefee /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromSlugSquareInches(QuantityValue slugsquareinches) + public static MassMomentOfInertia FromSlugSquareInches(double value) { - double value = (double) slugsquareinches; return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.SlugSquareInch); } @@ -677,9 +653,8 @@ public static MassMomentOfInertia FromSlugSquareInches(QuantityValue slugsquarei /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromTonneSquareCentimeters(QuantityValue tonnesquarecentimeters) + public static MassMomentOfInertia FromTonneSquareCentimeters(double value) { - double value = (double) tonnesquarecentimeters; return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.TonneSquareCentimeter); } @@ -687,9 +662,8 @@ public static MassMomentOfInertia FromTonneSquareCentimeters(QuantityValue tonne /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromTonneSquareDecimeters(QuantityValue tonnesquaredecimeters) + public static MassMomentOfInertia FromTonneSquareDecimeters(double value) { - double value = (double) tonnesquaredecimeters; return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.TonneSquareDecimeter); } @@ -697,9 +671,8 @@ public static MassMomentOfInertia FromTonneSquareDecimeters(QuantityValue tonnes /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromTonneSquareMeters(QuantityValue tonnesquaremeters) + public static MassMomentOfInertia FromTonneSquareMeters(double value) { - double value = (double) tonnesquaremeters; return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.TonneSquareMeter); } @@ -707,9 +680,8 @@ public static MassMomentOfInertia FromTonneSquareMeters(QuantityValue tonnesquar /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromTonneSquareMilimeters(QuantityValue tonnesquaremilimeters) + public static MassMomentOfInertia FromTonneSquareMilimeters(double value) { - double value = (double) tonnesquaremilimeters; return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.TonneSquareMilimeter); } @@ -719,9 +691,9 @@ public static MassMomentOfInertia FromTonneSquareMilimeters(QuantityValue tonnes /// Value to convert from. /// Unit to convert from. /// MassMomentOfInertia unit value. - public static MassMomentOfInertia From(QuantityValue value, MassMomentOfInertiaUnit fromUnit) + public static MassMomentOfInertia From(double value, MassMomentOfInertiaUnit fromUnit) { - return new MassMomentOfInertia((double)value, fromUnit); + return new MassMomentOfInertia(value, fromUnit); } #endregion @@ -1132,15 +1104,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is MassMomentOfInertiaUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(MassMomentOfInertiaUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is MassMomentOfInertiaUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(MassMomentOfInertiaUnit)} is supported.", nameof(unit)); @@ -1309,18 +1272,6 @@ public MassMomentOfInertia ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not MassMomentOfInertiaUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(MassMomentOfInertiaUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/Molality.g.cs b/UnitsNet/GeneratedCode/Quantities/Molality.g.cs index 6bc27c5f39..017d459c53 100644 --- a/UnitsNet/GeneratedCode/Quantities/Molality.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Molality.g.cs @@ -40,7 +40,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct Molality : - IArithmeticQuantity, + IArithmeticQuantity, IComparable, IComparable, IConvertible, @@ -151,7 +151,7 @@ public Molality(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -232,9 +232,8 @@ public static string GetAbbreviation(MolalityUnit unit, IFormatProvider? provide /// Creates a from . /// /// If value is NaN or Infinity. - public static Molality FromMolesPerGram(QuantityValue molespergram) + public static Molality FromMolesPerGram(double value) { - double value = (double) molespergram; return new Molality(value, MolalityUnit.MolePerGram); } @@ -242,9 +241,8 @@ public static Molality FromMolesPerGram(QuantityValue molespergram) /// Creates a from . /// /// If value is NaN or Infinity. - public static Molality FromMolesPerKilogram(QuantityValue molesperkilogram) + public static Molality FromMolesPerKilogram(double value) { - double value = (double) molesperkilogram; return new Molality(value, MolalityUnit.MolePerKilogram); } @@ -254,9 +252,9 @@ public static Molality FromMolesPerKilogram(QuantityValue molesperkilogram) /// Value to convert from. /// Unit to convert from. /// Molality unit value. - public static Molality From(QuantityValue value, MolalityUnit fromUnit) + public static Molality From(double value, MolalityUnit fromUnit) { - return new Molality((double)value, fromUnit); + return new Molality(value, fromUnit); } #endregion @@ -667,15 +665,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is MolalityUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(MolalityUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is MolalityUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(MolalityUnit)} is supported.", nameof(unit)); @@ -792,18 +781,6 @@ public Molality ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not MolalityUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(MolalityUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/MolarEnergy.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarEnergy.g.cs index 2685cba4e5..f30bdc6f7f 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarEnergy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarEnergy.g.cs @@ -37,7 +37,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct MolarEnergy : - IArithmeticQuantity, + IArithmeticQuantity, IComparable, IComparable, IConvertible, @@ -149,7 +149,7 @@ public MolarEnergy(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -237,9 +237,8 @@ public static string GetAbbreviation(MolarEnergyUnit unit, IFormatProvider? prov /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarEnergy FromJoulesPerMole(QuantityValue joulespermole) + public static MolarEnergy FromJoulesPerMole(double value) { - double value = (double) joulespermole; return new MolarEnergy(value, MolarEnergyUnit.JoulePerMole); } @@ -247,9 +246,8 @@ public static MolarEnergy FromJoulesPerMole(QuantityValue joulespermole) /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarEnergy FromKilojoulesPerMole(QuantityValue kilojoulespermole) + public static MolarEnergy FromKilojoulesPerMole(double value) { - double value = (double) kilojoulespermole; return new MolarEnergy(value, MolarEnergyUnit.KilojoulePerMole); } @@ -257,9 +255,8 @@ public static MolarEnergy FromKilojoulesPerMole(QuantityValue kilojoulespermole) /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarEnergy FromMegajoulesPerMole(QuantityValue megajoulespermole) + public static MolarEnergy FromMegajoulesPerMole(double value) { - double value = (double) megajoulespermole; return new MolarEnergy(value, MolarEnergyUnit.MegajoulePerMole); } @@ -269,9 +266,9 @@ public static MolarEnergy FromMegajoulesPerMole(QuantityValue megajoulespermole) /// Value to convert from. /// Unit to convert from. /// MolarEnergy unit value. - public static MolarEnergy From(QuantityValue value, MolarEnergyUnit fromUnit) + public static MolarEnergy From(double value, MolarEnergyUnit fromUnit) { - return new MolarEnergy((double)value, fromUnit); + return new MolarEnergy(value, fromUnit); } #endregion @@ -682,15 +679,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is MolarEnergyUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(MolarEnergyUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is MolarEnergyUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(MolarEnergyUnit)} is supported.", nameof(unit)); @@ -809,18 +797,6 @@ public MolarEnergy ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not MolarEnergyUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(MolarEnergyUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/MolarEntropy.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarEntropy.g.cs index c7006545cc..e1c0049a88 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarEntropy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarEntropy.g.cs @@ -37,7 +37,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct MolarEntropy : - IArithmeticQuantity, + IArithmeticQuantity, IComparable, IComparable, IConvertible, @@ -149,7 +149,7 @@ public MolarEntropy(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -237,9 +237,8 @@ public static string GetAbbreviation(MolarEntropyUnit unit, IFormatProvider? pro /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarEntropy FromJoulesPerMoleKelvin(QuantityValue joulespermolekelvin) + public static MolarEntropy FromJoulesPerMoleKelvin(double value) { - double value = (double) joulespermolekelvin; return new MolarEntropy(value, MolarEntropyUnit.JoulePerMoleKelvin); } @@ -247,9 +246,8 @@ public static MolarEntropy FromJoulesPerMoleKelvin(QuantityValue joulespermoleke /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarEntropy FromKilojoulesPerMoleKelvin(QuantityValue kilojoulespermolekelvin) + public static MolarEntropy FromKilojoulesPerMoleKelvin(double value) { - double value = (double) kilojoulespermolekelvin; return new MolarEntropy(value, MolarEntropyUnit.KilojoulePerMoleKelvin); } @@ -257,9 +255,8 @@ public static MolarEntropy FromKilojoulesPerMoleKelvin(QuantityValue kilojoulesp /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarEntropy FromMegajoulesPerMoleKelvin(QuantityValue megajoulespermolekelvin) + public static MolarEntropy FromMegajoulesPerMoleKelvin(double value) { - double value = (double) megajoulespermolekelvin; return new MolarEntropy(value, MolarEntropyUnit.MegajoulePerMoleKelvin); } @@ -269,9 +266,9 @@ public static MolarEntropy FromMegajoulesPerMoleKelvin(QuantityValue megajoulesp /// Value to convert from. /// Unit to convert from. /// MolarEntropy unit value. - public static MolarEntropy From(QuantityValue value, MolarEntropyUnit fromUnit) + public static MolarEntropy From(double value, MolarEntropyUnit fromUnit) { - return new MolarEntropy((double)value, fromUnit); + return new MolarEntropy(value, fromUnit); } #endregion @@ -682,15 +679,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is MolarEntropyUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(MolarEntropyUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is MolarEntropyUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(MolarEntropyUnit)} is supported.", nameof(unit)); @@ -809,18 +797,6 @@ public MolarEntropy ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not MolarEntropyUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(MolarEntropyUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/MolarFlow.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarFlow.g.cs index c9bd4c5d32..52d7f13d6f 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarFlow.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarFlow.g.cs @@ -40,7 +40,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct MolarFlow : - IArithmeticQuantity, + IArithmeticQuantity, #if NET7_0_OR_GREATER IMultiplyOperators, IMultiplyOperators, @@ -164,7 +164,7 @@ public MolarFlow(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -294,9 +294,8 @@ public static string GetAbbreviation(MolarFlowUnit unit, IFormatProvider? provid /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarFlow FromKilomolesPerHour(QuantityValue kilomolesperhour) + public static MolarFlow FromKilomolesPerHour(double value) { - double value = (double) kilomolesperhour; return new MolarFlow(value, MolarFlowUnit.KilomolePerHour); } @@ -304,9 +303,8 @@ public static MolarFlow FromKilomolesPerHour(QuantityValue kilomolesperhour) /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarFlow FromKilomolesPerMinute(QuantityValue kilomolesperminute) + public static MolarFlow FromKilomolesPerMinute(double value) { - double value = (double) kilomolesperminute; return new MolarFlow(value, MolarFlowUnit.KilomolePerMinute); } @@ -314,9 +312,8 @@ public static MolarFlow FromKilomolesPerMinute(QuantityValue kilomolesperminute) /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarFlow FromKilomolesPerSecond(QuantityValue kilomolespersecond) + public static MolarFlow FromKilomolesPerSecond(double value) { - double value = (double) kilomolespersecond; return new MolarFlow(value, MolarFlowUnit.KilomolePerSecond); } @@ -324,9 +321,8 @@ public static MolarFlow FromKilomolesPerSecond(QuantityValue kilomolespersecond) /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarFlow FromMolesPerHour(QuantityValue molesperhour) + public static MolarFlow FromMolesPerHour(double value) { - double value = (double) molesperhour; return new MolarFlow(value, MolarFlowUnit.MolePerHour); } @@ -334,9 +330,8 @@ public static MolarFlow FromMolesPerHour(QuantityValue molesperhour) /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarFlow FromMolesPerMinute(QuantityValue molesperminute) + public static MolarFlow FromMolesPerMinute(double value) { - double value = (double) molesperminute; return new MolarFlow(value, MolarFlowUnit.MolePerMinute); } @@ -344,9 +339,8 @@ public static MolarFlow FromMolesPerMinute(QuantityValue molesperminute) /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarFlow FromMolesPerSecond(QuantityValue molespersecond) + public static MolarFlow FromMolesPerSecond(double value) { - double value = (double) molespersecond; return new MolarFlow(value, MolarFlowUnit.MolePerSecond); } @@ -354,9 +348,8 @@ public static MolarFlow FromMolesPerSecond(QuantityValue molespersecond) /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarFlow FromPoundMolesPerHour(QuantityValue poundmolesperhour) + public static MolarFlow FromPoundMolesPerHour(double value) { - double value = (double) poundmolesperhour; return new MolarFlow(value, MolarFlowUnit.PoundMolePerHour); } @@ -364,9 +357,8 @@ public static MolarFlow FromPoundMolesPerHour(QuantityValue poundmolesperhour) /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarFlow FromPoundMolesPerMinute(QuantityValue poundmolesperminute) + public static MolarFlow FromPoundMolesPerMinute(double value) { - double value = (double) poundmolesperminute; return new MolarFlow(value, MolarFlowUnit.PoundMolePerMinute); } @@ -374,9 +366,8 @@ public static MolarFlow FromPoundMolesPerMinute(QuantityValue poundmolesperminut /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarFlow FromPoundMolesPerSecond(QuantityValue poundmolespersecond) + public static MolarFlow FromPoundMolesPerSecond(double value) { - double value = (double) poundmolespersecond; return new MolarFlow(value, MolarFlowUnit.PoundMolePerSecond); } @@ -386,9 +377,9 @@ public static MolarFlow FromPoundMolesPerSecond(QuantityValue poundmolespersecon /// Value to convert from. /// Unit to convert from. /// MolarFlow unit value. - public static MolarFlow From(QuantityValue value, MolarFlowUnit fromUnit) + public static MolarFlow From(double value, MolarFlowUnit fromUnit) { - return new MolarFlow((double)value, fromUnit); + return new MolarFlow(value, fromUnit); } #endregion @@ -833,15 +824,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is MolarFlowUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(MolarFlowUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is MolarFlowUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(MolarFlowUnit)} is supported.", nameof(unit)); @@ -972,18 +954,6 @@ public MolarFlow ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not MolarFlowUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(MolarFlowUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/MolarMass.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarMass.g.cs index 435d364984..d7b7d6696a 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarMass.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarMass.g.cs @@ -40,7 +40,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct MolarMass : - IArithmeticQuantity, + IArithmeticQuantity, #if NET7_0_OR_GREATER IMultiplyOperators, IMultiplyOperators, @@ -167,7 +167,7 @@ public MolarMass(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -325,9 +325,8 @@ public static string GetAbbreviation(MolarMassUnit unit, IFormatProvider? provid /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarMass FromCentigramsPerMole(QuantityValue centigramspermole) + public static MolarMass FromCentigramsPerMole(double value) { - double value = (double) centigramspermole; return new MolarMass(value, MolarMassUnit.CentigramPerMole); } @@ -335,9 +334,8 @@ public static MolarMass FromCentigramsPerMole(QuantityValue centigramspermole) /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarMass FromDecagramsPerMole(QuantityValue decagramspermole) + public static MolarMass FromDecagramsPerMole(double value) { - double value = (double) decagramspermole; return new MolarMass(value, MolarMassUnit.DecagramPerMole); } @@ -345,9 +343,8 @@ public static MolarMass FromDecagramsPerMole(QuantityValue decagramspermole) /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarMass FromDecigramsPerMole(QuantityValue decigramspermole) + public static MolarMass FromDecigramsPerMole(double value) { - double value = (double) decigramspermole; return new MolarMass(value, MolarMassUnit.DecigramPerMole); } @@ -355,9 +352,8 @@ public static MolarMass FromDecigramsPerMole(QuantityValue decigramspermole) /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarMass FromGramsPerMole(QuantityValue gramspermole) + public static MolarMass FromGramsPerMole(double value) { - double value = (double) gramspermole; return new MolarMass(value, MolarMassUnit.GramPerMole); } @@ -365,9 +361,8 @@ public static MolarMass FromGramsPerMole(QuantityValue gramspermole) /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarMass FromHectogramsPerMole(QuantityValue hectogramspermole) + public static MolarMass FromHectogramsPerMole(double value) { - double value = (double) hectogramspermole; return new MolarMass(value, MolarMassUnit.HectogramPerMole); } @@ -375,9 +370,8 @@ public static MolarMass FromHectogramsPerMole(QuantityValue hectogramspermole) /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarMass FromKilogramsPerKilomole(QuantityValue kilogramsperkilomole) + public static MolarMass FromKilogramsPerKilomole(double value) { - double value = (double) kilogramsperkilomole; return new MolarMass(value, MolarMassUnit.KilogramPerKilomole); } @@ -385,9 +379,8 @@ public static MolarMass FromKilogramsPerKilomole(QuantityValue kilogramsperkilom /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarMass FromKilogramsPerMole(QuantityValue kilogramspermole) + public static MolarMass FromKilogramsPerMole(double value) { - double value = (double) kilogramspermole; return new MolarMass(value, MolarMassUnit.KilogramPerMole); } @@ -395,9 +388,8 @@ public static MolarMass FromKilogramsPerMole(QuantityValue kilogramspermole) /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarMass FromKilopoundsPerMole(QuantityValue kilopoundspermole) + public static MolarMass FromKilopoundsPerMole(double value) { - double value = (double) kilopoundspermole; return new MolarMass(value, MolarMassUnit.KilopoundPerMole); } @@ -405,9 +397,8 @@ public static MolarMass FromKilopoundsPerMole(QuantityValue kilopoundspermole) /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarMass FromMegapoundsPerMole(QuantityValue megapoundspermole) + public static MolarMass FromMegapoundsPerMole(double value) { - double value = (double) megapoundspermole; return new MolarMass(value, MolarMassUnit.MegapoundPerMole); } @@ -415,9 +406,8 @@ public static MolarMass FromMegapoundsPerMole(QuantityValue megapoundspermole) /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarMass FromMicrogramsPerMole(QuantityValue microgramspermole) + public static MolarMass FromMicrogramsPerMole(double value) { - double value = (double) microgramspermole; return new MolarMass(value, MolarMassUnit.MicrogramPerMole); } @@ -425,9 +415,8 @@ public static MolarMass FromMicrogramsPerMole(QuantityValue microgramspermole) /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarMass FromMilligramsPerMole(QuantityValue milligramspermole) + public static MolarMass FromMilligramsPerMole(double value) { - double value = (double) milligramspermole; return new MolarMass(value, MolarMassUnit.MilligramPerMole); } @@ -435,9 +424,8 @@ public static MolarMass FromMilligramsPerMole(QuantityValue milligramspermole) /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarMass FromNanogramsPerMole(QuantityValue nanogramspermole) + public static MolarMass FromNanogramsPerMole(double value) { - double value = (double) nanogramspermole; return new MolarMass(value, MolarMassUnit.NanogramPerMole); } @@ -445,9 +433,8 @@ public static MolarMass FromNanogramsPerMole(QuantityValue nanogramspermole) /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarMass FromPoundsPerMole(QuantityValue poundspermole) + public static MolarMass FromPoundsPerMole(double value) { - double value = (double) poundspermole; return new MolarMass(value, MolarMassUnit.PoundPerMole); } @@ -457,9 +444,9 @@ public static MolarMass FromPoundsPerMole(QuantityValue poundspermole) /// Value to convert from. /// Unit to convert from. /// MolarMass unit value. - public static MolarMass From(QuantityValue value, MolarMassUnit fromUnit) + public static MolarMass From(double value, MolarMassUnit fromUnit) { - return new MolarMass((double)value, fromUnit); + return new MolarMass(value, fromUnit); } #endregion @@ -892,15 +879,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is MolarMassUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(MolarMassUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is MolarMassUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(MolarMassUnit)} is supported.", nameof(unit)); @@ -1039,18 +1017,6 @@ public MolarMass ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not MolarMassUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(MolarMassUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/Molarity.g.cs b/UnitsNet/GeneratedCode/Quantities/Molarity.g.cs index 936248d156..7a1614b281 100644 --- a/UnitsNet/GeneratedCode/Quantities/Molarity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Molarity.g.cs @@ -43,7 +43,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct Molarity : - IArithmeticQuantity, + IArithmeticQuantity, #if NET7_0_OR_GREATER IMultiplyOperators, IMultiplyOperators, @@ -167,7 +167,7 @@ public Molarity(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -311,9 +311,8 @@ public static string GetAbbreviation(MolarityUnit unit, IFormatProvider? provide /// Creates a from . /// /// If value is NaN or Infinity. - public static Molarity FromCentimolesPerLiter(QuantityValue centimolesperliter) + public static Molarity FromCentimolesPerLiter(double value) { - double value = (double) centimolesperliter; return new Molarity(value, MolarityUnit.CentimolePerLiter); } @@ -321,9 +320,8 @@ public static Molarity FromCentimolesPerLiter(QuantityValue centimolesperliter) /// Creates a from . /// /// If value is NaN or Infinity. - public static Molarity FromDecimolesPerLiter(QuantityValue decimolesperliter) + public static Molarity FromDecimolesPerLiter(double value) { - double value = (double) decimolesperliter; return new Molarity(value, MolarityUnit.DecimolePerLiter); } @@ -331,9 +329,8 @@ public static Molarity FromDecimolesPerLiter(QuantityValue decimolesperliter) /// Creates a from . /// /// If value is NaN or Infinity. - public static Molarity FromFemtomolesPerLiter(QuantityValue femtomolesperliter) + public static Molarity FromFemtomolesPerLiter(double value) { - double value = (double) femtomolesperliter; return new Molarity(value, MolarityUnit.FemtomolePerLiter); } @@ -341,9 +338,8 @@ public static Molarity FromFemtomolesPerLiter(QuantityValue femtomolesperliter) /// Creates a from . /// /// If value is NaN or Infinity. - public static Molarity FromKilomolesPerCubicMeter(QuantityValue kilomolespercubicmeter) + public static Molarity FromKilomolesPerCubicMeter(double value) { - double value = (double) kilomolespercubicmeter; return new Molarity(value, MolarityUnit.KilomolePerCubicMeter); } @@ -351,9 +347,8 @@ public static Molarity FromKilomolesPerCubicMeter(QuantityValue kilomolespercubi /// Creates a from . /// /// If value is NaN or Infinity. - public static Molarity FromMicromolesPerLiter(QuantityValue micromolesperliter) + public static Molarity FromMicromolesPerLiter(double value) { - double value = (double) micromolesperliter; return new Molarity(value, MolarityUnit.MicromolePerLiter); } @@ -361,9 +356,8 @@ public static Molarity FromMicromolesPerLiter(QuantityValue micromolesperliter) /// Creates a from . /// /// If value is NaN or Infinity. - public static Molarity FromMillimolesPerLiter(QuantityValue millimolesperliter) + public static Molarity FromMillimolesPerLiter(double value) { - double value = (double) millimolesperliter; return new Molarity(value, MolarityUnit.MillimolePerLiter); } @@ -371,9 +365,8 @@ public static Molarity FromMillimolesPerLiter(QuantityValue millimolesperliter) /// Creates a from . /// /// If value is NaN or Infinity. - public static Molarity FromMolesPerCubicMeter(QuantityValue molespercubicmeter) + public static Molarity FromMolesPerCubicMeter(double value) { - double value = (double) molespercubicmeter; return new Molarity(value, MolarityUnit.MolePerCubicMeter); } @@ -381,9 +374,8 @@ public static Molarity FromMolesPerCubicMeter(QuantityValue molespercubicmeter) /// Creates a from . /// /// If value is NaN or Infinity. - public static Molarity FromMolesPerLiter(QuantityValue molesperliter) + public static Molarity FromMolesPerLiter(double value) { - double value = (double) molesperliter; return new Molarity(value, MolarityUnit.MolePerLiter); } @@ -391,9 +383,8 @@ public static Molarity FromMolesPerLiter(QuantityValue molesperliter) /// Creates a from . /// /// If value is NaN or Infinity. - public static Molarity FromNanomolesPerLiter(QuantityValue nanomolesperliter) + public static Molarity FromNanomolesPerLiter(double value) { - double value = (double) nanomolesperliter; return new Molarity(value, MolarityUnit.NanomolePerLiter); } @@ -401,9 +392,8 @@ public static Molarity FromNanomolesPerLiter(QuantityValue nanomolesperliter) /// Creates a from . /// /// If value is NaN or Infinity. - public static Molarity FromPicomolesPerLiter(QuantityValue picomolesperliter) + public static Molarity FromPicomolesPerLiter(double value) { - double value = (double) picomolesperliter; return new Molarity(value, MolarityUnit.PicomolePerLiter); } @@ -411,9 +401,8 @@ public static Molarity FromPicomolesPerLiter(QuantityValue picomolesperliter) /// Creates a from . /// /// If value is NaN or Infinity. - public static Molarity FromPoundMolesPerCubicFoot(QuantityValue poundmolespercubicfoot) + public static Molarity FromPoundMolesPerCubicFoot(double value) { - double value = (double) poundmolespercubicfoot; return new Molarity(value, MolarityUnit.PoundMolePerCubicFoot); } @@ -423,9 +412,9 @@ public static Molarity FromPoundMolesPerCubicFoot(QuantityValue poundmolespercub /// Value to convert from. /// Unit to convert from. /// Molarity unit value. - public static Molarity From(QuantityValue value, MolarityUnit fromUnit) + public static Molarity From(double value, MolarityUnit fromUnit) { - return new Molarity((double)value, fromUnit); + return new Molarity(value, fromUnit); } #endregion @@ -852,15 +841,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is MolarityUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(MolarityUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is MolarityUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(MolarityUnit)} is supported.", nameof(unit)); @@ -995,18 +975,6 @@ public Molarity ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not MolarityUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(MolarityUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/Permeability.g.cs b/UnitsNet/GeneratedCode/Quantities/Permeability.g.cs index be2971b0cd..0220349934 100644 --- a/UnitsNet/GeneratedCode/Quantities/Permeability.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Permeability.g.cs @@ -40,7 +40,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct Permeability : - IArithmeticQuantity, + IArithmeticQuantity, IComparable, IComparable, IConvertible, @@ -150,7 +150,7 @@ public Permeability(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -224,9 +224,8 @@ public static string GetAbbreviation(PermeabilityUnit unit, IFormatProvider? pro /// Creates a from . /// /// If value is NaN or Infinity. - public static Permeability FromHenriesPerMeter(QuantityValue henriespermeter) + public static Permeability FromHenriesPerMeter(double value) { - double value = (double) henriespermeter; return new Permeability(value, PermeabilityUnit.HenryPerMeter); } @@ -236,9 +235,9 @@ public static Permeability FromHenriesPerMeter(QuantityValue henriespermeter) /// Value to convert from. /// Unit to convert from. /// Permeability unit value. - public static Permeability From(QuantityValue value, PermeabilityUnit fromUnit) + public static Permeability From(double value, PermeabilityUnit fromUnit) { - return new Permeability((double)value, fromUnit); + return new Permeability(value, fromUnit); } #endregion @@ -649,15 +648,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is PermeabilityUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(PermeabilityUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is PermeabilityUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(PermeabilityUnit)} is supported.", nameof(unit)); @@ -772,18 +762,6 @@ public Permeability ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not PermeabilityUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(PermeabilityUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/Permittivity.g.cs b/UnitsNet/GeneratedCode/Quantities/Permittivity.g.cs index ef68870bba..9893ff11a7 100644 --- a/UnitsNet/GeneratedCode/Quantities/Permittivity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Permittivity.g.cs @@ -40,7 +40,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct Permittivity : - IArithmeticQuantity, + IArithmeticQuantity, IComparable, IComparable, IConvertible, @@ -150,7 +150,7 @@ public Permittivity(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -224,9 +224,8 @@ public static string GetAbbreviation(PermittivityUnit unit, IFormatProvider? pro /// Creates a from . /// /// If value is NaN or Infinity. - public static Permittivity FromFaradsPerMeter(QuantityValue faradspermeter) + public static Permittivity FromFaradsPerMeter(double value) { - double value = (double) faradspermeter; return new Permittivity(value, PermittivityUnit.FaradPerMeter); } @@ -236,9 +235,9 @@ public static Permittivity FromFaradsPerMeter(QuantityValue faradspermeter) /// Value to convert from. /// Unit to convert from. /// Permittivity unit value. - public static Permittivity From(QuantityValue value, PermittivityUnit fromUnit) + public static Permittivity From(double value, PermittivityUnit fromUnit) { - return new Permittivity((double)value, fromUnit); + return new Permittivity(value, fromUnit); } #endregion @@ -649,15 +648,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is PermittivityUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(PermittivityUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is PermittivityUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(PermittivityUnit)} is supported.", nameof(unit)); @@ -772,18 +762,6 @@ public Permittivity ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not PermittivityUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(PermittivityUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/PorousMediumPermeability.g.cs b/UnitsNet/GeneratedCode/Quantities/PorousMediumPermeability.g.cs index a2443d796f..7317201cad 100644 --- a/UnitsNet/GeneratedCode/Quantities/PorousMediumPermeability.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PorousMediumPermeability.g.cs @@ -40,7 +40,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct PorousMediumPermeability : - IArithmeticQuantity, + IArithmeticQuantity, IComparable, IComparable, IConvertible, @@ -154,7 +154,7 @@ public PorousMediumPermeability(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -256,9 +256,8 @@ public static string GetAbbreviation(PorousMediumPermeabilityUnit unit, IFormatP /// Creates a from . /// /// If value is NaN or Infinity. - public static PorousMediumPermeability FromDarcys(QuantityValue darcys) + public static PorousMediumPermeability FromDarcys(double value) { - double value = (double) darcys; return new PorousMediumPermeability(value, PorousMediumPermeabilityUnit.Darcy); } @@ -266,9 +265,8 @@ public static PorousMediumPermeability FromDarcys(QuantityValue darcys) /// Creates a from . /// /// If value is NaN or Infinity. - public static PorousMediumPermeability FromMicrodarcys(QuantityValue microdarcys) + public static PorousMediumPermeability FromMicrodarcys(double value) { - double value = (double) microdarcys; return new PorousMediumPermeability(value, PorousMediumPermeabilityUnit.Microdarcy); } @@ -276,9 +274,8 @@ public static PorousMediumPermeability FromMicrodarcys(QuantityValue microdarcys /// Creates a from . /// /// If value is NaN or Infinity. - public static PorousMediumPermeability FromMillidarcys(QuantityValue millidarcys) + public static PorousMediumPermeability FromMillidarcys(double value) { - double value = (double) millidarcys; return new PorousMediumPermeability(value, PorousMediumPermeabilityUnit.Millidarcy); } @@ -286,9 +283,8 @@ public static PorousMediumPermeability FromMillidarcys(QuantityValue millidarcys /// Creates a from . /// /// If value is NaN or Infinity. - public static PorousMediumPermeability FromSquareCentimeters(QuantityValue squarecentimeters) + public static PorousMediumPermeability FromSquareCentimeters(double value) { - double value = (double) squarecentimeters; return new PorousMediumPermeability(value, PorousMediumPermeabilityUnit.SquareCentimeter); } @@ -296,9 +292,8 @@ public static PorousMediumPermeability FromSquareCentimeters(QuantityValue squar /// Creates a from . /// /// If value is NaN or Infinity. - public static PorousMediumPermeability FromSquareMeters(QuantityValue squaremeters) + public static PorousMediumPermeability FromSquareMeters(double value) { - double value = (double) squaremeters; return new PorousMediumPermeability(value, PorousMediumPermeabilityUnit.SquareMeter); } @@ -308,9 +303,9 @@ public static PorousMediumPermeability FromSquareMeters(QuantityValue squaremete /// Value to convert from. /// Unit to convert from. /// PorousMediumPermeability unit value. - public static PorousMediumPermeability From(QuantityValue value, PorousMediumPermeabilityUnit fromUnit) + public static PorousMediumPermeability From(double value, PorousMediumPermeabilityUnit fromUnit) { - return new PorousMediumPermeability((double)value, fromUnit); + return new PorousMediumPermeability(value, fromUnit); } #endregion @@ -721,15 +716,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is PorousMediumPermeabilityUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(PorousMediumPermeabilityUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is PorousMediumPermeabilityUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(PorousMediumPermeabilityUnit)} is supported.", nameof(unit)); @@ -852,18 +838,6 @@ public PorousMediumPermeability ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not PorousMediumPermeabilityUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(PorousMediumPermeabilityUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/Power.g.cs b/UnitsNet/GeneratedCode/Quantities/Power.g.cs index cfd9e0cf5d..186f60ad34 100644 --- a/UnitsNet/GeneratedCode/Quantities/Power.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Power.g.cs @@ -40,7 +40,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct Power : - IArithmeticQuantity, + IArithmeticQuantity, #if NET7_0_OR_GREATER IDivisionOperators, IDivisionOperators, @@ -189,7 +189,7 @@ public Power(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -438,9 +438,8 @@ public static string GetAbbreviation(PowerUnit unit, IFormatProvider? provider) /// Creates a from . /// /// If value is NaN or Infinity. - public static Power FromBoilerHorsepower(QuantityValue boilerhorsepower) + public static Power FromBoilerHorsepower(double value) { - double value = (double) boilerhorsepower; return new Power(value, PowerUnit.BoilerHorsepower); } @@ -448,9 +447,8 @@ public static Power FromBoilerHorsepower(QuantityValue boilerhorsepower) /// Creates a from . /// /// If value is NaN or Infinity. - public static Power FromBritishThermalUnitsPerHour(QuantityValue britishthermalunitsperhour) + public static Power FromBritishThermalUnitsPerHour(double value) { - double value = (double) britishthermalunitsperhour; return new Power(value, PowerUnit.BritishThermalUnitPerHour); } @@ -458,9 +456,8 @@ public static Power FromBritishThermalUnitsPerHour(QuantityValue britishthermalu /// Creates a from . /// /// If value is NaN or Infinity. - public static Power FromDecawatts(QuantityValue decawatts) + public static Power FromDecawatts(double value) { - double value = (double) decawatts; return new Power(value, PowerUnit.Decawatt); } @@ -468,9 +465,8 @@ public static Power FromDecawatts(QuantityValue decawatts) /// Creates a from . /// /// If value is NaN or Infinity. - public static Power FromDeciwatts(QuantityValue deciwatts) + public static Power FromDeciwatts(double value) { - double value = (double) deciwatts; return new Power(value, PowerUnit.Deciwatt); } @@ -478,9 +474,8 @@ public static Power FromDeciwatts(QuantityValue deciwatts) /// Creates a from . /// /// If value is NaN or Infinity. - public static Power FromElectricalHorsepower(QuantityValue electricalhorsepower) + public static Power FromElectricalHorsepower(double value) { - double value = (double) electricalhorsepower; return new Power(value, PowerUnit.ElectricalHorsepower); } @@ -488,9 +483,8 @@ public static Power FromElectricalHorsepower(QuantityValue electricalhorsepower) /// Creates a from . /// /// If value is NaN or Infinity. - public static Power FromFemtowatts(QuantityValue femtowatts) + public static Power FromFemtowatts(double value) { - double value = (double) femtowatts; return new Power(value, PowerUnit.Femtowatt); } @@ -498,9 +492,8 @@ public static Power FromFemtowatts(QuantityValue femtowatts) /// Creates a from . /// /// If value is NaN or Infinity. - public static Power FromGigajoulesPerHour(QuantityValue gigajoulesperhour) + public static Power FromGigajoulesPerHour(double value) { - double value = (double) gigajoulesperhour; return new Power(value, PowerUnit.GigajoulePerHour); } @@ -508,9 +501,8 @@ public static Power FromGigajoulesPerHour(QuantityValue gigajoulesperhour) /// Creates a from . /// /// If value is NaN or Infinity. - public static Power FromGigawatts(QuantityValue gigawatts) + public static Power FromGigawatts(double value) { - double value = (double) gigawatts; return new Power(value, PowerUnit.Gigawatt); } @@ -518,9 +510,8 @@ public static Power FromGigawatts(QuantityValue gigawatts) /// Creates a from . /// /// If value is NaN or Infinity. - public static Power FromHydraulicHorsepower(QuantityValue hydraulichorsepower) + public static Power FromHydraulicHorsepower(double value) { - double value = (double) hydraulichorsepower; return new Power(value, PowerUnit.HydraulicHorsepower); } @@ -528,9 +519,8 @@ public static Power FromHydraulicHorsepower(QuantityValue hydraulichorsepower) /// Creates a from . /// /// If value is NaN or Infinity. - public static Power FromJoulesPerHour(QuantityValue joulesperhour) + public static Power FromJoulesPerHour(double value) { - double value = (double) joulesperhour; return new Power(value, PowerUnit.JoulePerHour); } @@ -538,9 +528,8 @@ public static Power FromJoulesPerHour(QuantityValue joulesperhour) /// Creates a from . /// /// If value is NaN or Infinity. - public static Power FromKilobritishThermalUnitsPerHour(QuantityValue kilobritishthermalunitsperhour) + public static Power FromKilobritishThermalUnitsPerHour(double value) { - double value = (double) kilobritishthermalunitsperhour; return new Power(value, PowerUnit.KilobritishThermalUnitPerHour); } @@ -548,9 +537,8 @@ public static Power FromKilobritishThermalUnitsPerHour(QuantityValue kilobritish /// Creates a from . /// /// If value is NaN or Infinity. - public static Power FromKilojoulesPerHour(QuantityValue kilojoulesperhour) + public static Power FromKilojoulesPerHour(double value) { - double value = (double) kilojoulesperhour; return new Power(value, PowerUnit.KilojoulePerHour); } @@ -558,9 +546,8 @@ public static Power FromKilojoulesPerHour(QuantityValue kilojoulesperhour) /// Creates a from . /// /// If value is NaN or Infinity. - public static Power FromKilowatts(QuantityValue kilowatts) + public static Power FromKilowatts(double value) { - double value = (double) kilowatts; return new Power(value, PowerUnit.Kilowatt); } @@ -568,9 +555,8 @@ public static Power FromKilowatts(QuantityValue kilowatts) /// Creates a from . /// /// If value is NaN or Infinity. - public static Power FromMechanicalHorsepower(QuantityValue mechanicalhorsepower) + public static Power FromMechanicalHorsepower(double value) { - double value = (double) mechanicalhorsepower; return new Power(value, PowerUnit.MechanicalHorsepower); } @@ -578,9 +564,8 @@ public static Power FromMechanicalHorsepower(QuantityValue mechanicalhorsepower) /// Creates a from . /// /// If value is NaN or Infinity. - public static Power FromMegabritishThermalUnitsPerHour(QuantityValue megabritishthermalunitsperhour) + public static Power FromMegabritishThermalUnitsPerHour(double value) { - double value = (double) megabritishthermalunitsperhour; return new Power(value, PowerUnit.MegabritishThermalUnitPerHour); } @@ -588,9 +573,8 @@ public static Power FromMegabritishThermalUnitsPerHour(QuantityValue megabritish /// Creates a from . /// /// If value is NaN or Infinity. - public static Power FromMegajoulesPerHour(QuantityValue megajoulesperhour) + public static Power FromMegajoulesPerHour(double value) { - double value = (double) megajoulesperhour; return new Power(value, PowerUnit.MegajoulePerHour); } @@ -598,9 +582,8 @@ public static Power FromMegajoulesPerHour(QuantityValue megajoulesperhour) /// Creates a from . /// /// If value is NaN or Infinity. - public static Power FromMegawatts(QuantityValue megawatts) + public static Power FromMegawatts(double value) { - double value = (double) megawatts; return new Power(value, PowerUnit.Megawatt); } @@ -608,9 +591,8 @@ public static Power FromMegawatts(QuantityValue megawatts) /// Creates a from . /// /// If value is NaN or Infinity. - public static Power FromMetricHorsepower(QuantityValue metrichorsepower) + public static Power FromMetricHorsepower(double value) { - double value = (double) metrichorsepower; return new Power(value, PowerUnit.MetricHorsepower); } @@ -618,9 +600,8 @@ public static Power FromMetricHorsepower(QuantityValue metrichorsepower) /// Creates a from . /// /// If value is NaN or Infinity. - public static Power FromMicrowatts(QuantityValue microwatts) + public static Power FromMicrowatts(double value) { - double value = (double) microwatts; return new Power(value, PowerUnit.Microwatt); } @@ -628,9 +609,8 @@ public static Power FromMicrowatts(QuantityValue microwatts) /// Creates a from . /// /// If value is NaN or Infinity. - public static Power FromMillijoulesPerHour(QuantityValue millijoulesperhour) + public static Power FromMillijoulesPerHour(double value) { - double value = (double) millijoulesperhour; return new Power(value, PowerUnit.MillijoulePerHour); } @@ -638,9 +618,8 @@ public static Power FromMillijoulesPerHour(QuantityValue millijoulesperhour) /// Creates a from . /// /// If value is NaN or Infinity. - public static Power FromMilliwatts(QuantityValue milliwatts) + public static Power FromMilliwatts(double value) { - double value = (double) milliwatts; return new Power(value, PowerUnit.Milliwatt); } @@ -648,9 +627,8 @@ public static Power FromMilliwatts(QuantityValue milliwatts) /// Creates a from . /// /// If value is NaN or Infinity. - public static Power FromNanowatts(QuantityValue nanowatts) + public static Power FromNanowatts(double value) { - double value = (double) nanowatts; return new Power(value, PowerUnit.Nanowatt); } @@ -658,9 +636,8 @@ public static Power FromNanowatts(QuantityValue nanowatts) /// Creates a from . /// /// If value is NaN or Infinity. - public static Power FromPetawatts(QuantityValue petawatts) + public static Power FromPetawatts(double value) { - double value = (double) petawatts; return new Power(value, PowerUnit.Petawatt); } @@ -668,9 +645,8 @@ public static Power FromPetawatts(QuantityValue petawatts) /// Creates a from . /// /// If value is NaN or Infinity. - public static Power FromPicowatts(QuantityValue picowatts) + public static Power FromPicowatts(double value) { - double value = (double) picowatts; return new Power(value, PowerUnit.Picowatt); } @@ -678,9 +654,8 @@ public static Power FromPicowatts(QuantityValue picowatts) /// Creates a from . /// /// If value is NaN or Infinity. - public static Power FromTerawatts(QuantityValue terawatts) + public static Power FromTerawatts(double value) { - double value = (double) terawatts; return new Power(value, PowerUnit.Terawatt); } @@ -688,9 +663,8 @@ public static Power FromTerawatts(QuantityValue terawatts) /// Creates a from . /// /// If value is NaN or Infinity. - public static Power FromWatts(QuantityValue watts) + public static Power FromWatts(double value) { - double value = (double) watts; return new Power(value, PowerUnit.Watt); } @@ -700,9 +674,9 @@ public static Power FromWatts(QuantityValue watts) /// Value to convert from. /// Unit to convert from. /// Power unit value. - public static Power From(QuantityValue value, PowerUnit fromUnit) + public static Power From(double value, PowerUnit fromUnit) { - return new Power((double)value, fromUnit); + return new Power(value, fromUnit); } #endregion @@ -1195,15 +1169,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is PowerUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(PowerUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is PowerUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(PowerUnit)} is supported.", nameof(unit)); @@ -1368,18 +1333,6 @@ public Power ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not PowerUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(PowerUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/PowerDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/PowerDensity.g.cs index 3324bdaf78..f28f92ed39 100644 --- a/UnitsNet/GeneratedCode/Quantities/PowerDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PowerDensity.g.cs @@ -37,7 +37,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct PowerDensity : - IArithmeticQuantity, + IArithmeticQuantity, IComparable, IComparable, IConvertible, @@ -190,7 +190,7 @@ public PowerDensity(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -565,9 +565,8 @@ public static string GetAbbreviation(PowerDensityUnit unit, IFormatProvider? pro /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromDecawattsPerCubicFoot(QuantityValue decawattspercubicfoot) + public static PowerDensity FromDecawattsPerCubicFoot(double value) { - double value = (double) decawattspercubicfoot; return new PowerDensity(value, PowerDensityUnit.DecawattPerCubicFoot); } @@ -575,9 +574,8 @@ public static PowerDensity FromDecawattsPerCubicFoot(QuantityValue decawattsperc /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromDecawattsPerCubicInch(QuantityValue decawattspercubicinch) + public static PowerDensity FromDecawattsPerCubicInch(double value) { - double value = (double) decawattspercubicinch; return new PowerDensity(value, PowerDensityUnit.DecawattPerCubicInch); } @@ -585,9 +583,8 @@ public static PowerDensity FromDecawattsPerCubicInch(QuantityValue decawattsperc /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromDecawattsPerCubicMeter(QuantityValue decawattspercubicmeter) + public static PowerDensity FromDecawattsPerCubicMeter(double value) { - double value = (double) decawattspercubicmeter; return new PowerDensity(value, PowerDensityUnit.DecawattPerCubicMeter); } @@ -595,9 +592,8 @@ public static PowerDensity FromDecawattsPerCubicMeter(QuantityValue decawattsper /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromDecawattsPerLiter(QuantityValue decawattsperliter) + public static PowerDensity FromDecawattsPerLiter(double value) { - double value = (double) decawattsperliter; return new PowerDensity(value, PowerDensityUnit.DecawattPerLiter); } @@ -605,9 +601,8 @@ public static PowerDensity FromDecawattsPerLiter(QuantityValue decawattsperliter /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromDeciwattsPerCubicFoot(QuantityValue deciwattspercubicfoot) + public static PowerDensity FromDeciwattsPerCubicFoot(double value) { - double value = (double) deciwattspercubicfoot; return new PowerDensity(value, PowerDensityUnit.DeciwattPerCubicFoot); } @@ -615,9 +610,8 @@ public static PowerDensity FromDeciwattsPerCubicFoot(QuantityValue deciwattsperc /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromDeciwattsPerCubicInch(QuantityValue deciwattspercubicinch) + public static PowerDensity FromDeciwattsPerCubicInch(double value) { - double value = (double) deciwattspercubicinch; return new PowerDensity(value, PowerDensityUnit.DeciwattPerCubicInch); } @@ -625,9 +619,8 @@ public static PowerDensity FromDeciwattsPerCubicInch(QuantityValue deciwattsperc /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromDeciwattsPerCubicMeter(QuantityValue deciwattspercubicmeter) + public static PowerDensity FromDeciwattsPerCubicMeter(double value) { - double value = (double) deciwattspercubicmeter; return new PowerDensity(value, PowerDensityUnit.DeciwattPerCubicMeter); } @@ -635,9 +628,8 @@ public static PowerDensity FromDeciwattsPerCubicMeter(QuantityValue deciwattsper /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromDeciwattsPerLiter(QuantityValue deciwattsperliter) + public static PowerDensity FromDeciwattsPerLiter(double value) { - double value = (double) deciwattsperliter; return new PowerDensity(value, PowerDensityUnit.DeciwattPerLiter); } @@ -645,9 +637,8 @@ public static PowerDensity FromDeciwattsPerLiter(QuantityValue deciwattsperliter /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromGigawattsPerCubicFoot(QuantityValue gigawattspercubicfoot) + public static PowerDensity FromGigawattsPerCubicFoot(double value) { - double value = (double) gigawattspercubicfoot; return new PowerDensity(value, PowerDensityUnit.GigawattPerCubicFoot); } @@ -655,9 +646,8 @@ public static PowerDensity FromGigawattsPerCubicFoot(QuantityValue gigawattsperc /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromGigawattsPerCubicInch(QuantityValue gigawattspercubicinch) + public static PowerDensity FromGigawattsPerCubicInch(double value) { - double value = (double) gigawattspercubicinch; return new PowerDensity(value, PowerDensityUnit.GigawattPerCubicInch); } @@ -665,9 +655,8 @@ public static PowerDensity FromGigawattsPerCubicInch(QuantityValue gigawattsperc /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromGigawattsPerCubicMeter(QuantityValue gigawattspercubicmeter) + public static PowerDensity FromGigawattsPerCubicMeter(double value) { - double value = (double) gigawattspercubicmeter; return new PowerDensity(value, PowerDensityUnit.GigawattPerCubicMeter); } @@ -675,9 +664,8 @@ public static PowerDensity FromGigawattsPerCubicMeter(QuantityValue gigawattsper /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromGigawattsPerLiter(QuantityValue gigawattsperliter) + public static PowerDensity FromGigawattsPerLiter(double value) { - double value = (double) gigawattsperliter; return new PowerDensity(value, PowerDensityUnit.GigawattPerLiter); } @@ -685,9 +673,8 @@ public static PowerDensity FromGigawattsPerLiter(QuantityValue gigawattsperliter /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromKilowattsPerCubicFoot(QuantityValue kilowattspercubicfoot) + public static PowerDensity FromKilowattsPerCubicFoot(double value) { - double value = (double) kilowattspercubicfoot; return new PowerDensity(value, PowerDensityUnit.KilowattPerCubicFoot); } @@ -695,9 +682,8 @@ public static PowerDensity FromKilowattsPerCubicFoot(QuantityValue kilowattsperc /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromKilowattsPerCubicInch(QuantityValue kilowattspercubicinch) + public static PowerDensity FromKilowattsPerCubicInch(double value) { - double value = (double) kilowattspercubicinch; return new PowerDensity(value, PowerDensityUnit.KilowattPerCubicInch); } @@ -705,9 +691,8 @@ public static PowerDensity FromKilowattsPerCubicInch(QuantityValue kilowattsperc /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromKilowattsPerCubicMeter(QuantityValue kilowattspercubicmeter) + public static PowerDensity FromKilowattsPerCubicMeter(double value) { - double value = (double) kilowattspercubicmeter; return new PowerDensity(value, PowerDensityUnit.KilowattPerCubicMeter); } @@ -715,9 +700,8 @@ public static PowerDensity FromKilowattsPerCubicMeter(QuantityValue kilowattsper /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromKilowattsPerLiter(QuantityValue kilowattsperliter) + public static PowerDensity FromKilowattsPerLiter(double value) { - double value = (double) kilowattsperliter; return new PowerDensity(value, PowerDensityUnit.KilowattPerLiter); } @@ -725,9 +709,8 @@ public static PowerDensity FromKilowattsPerLiter(QuantityValue kilowattsperliter /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromMegawattsPerCubicFoot(QuantityValue megawattspercubicfoot) + public static PowerDensity FromMegawattsPerCubicFoot(double value) { - double value = (double) megawattspercubicfoot; return new PowerDensity(value, PowerDensityUnit.MegawattPerCubicFoot); } @@ -735,9 +718,8 @@ public static PowerDensity FromMegawattsPerCubicFoot(QuantityValue megawattsperc /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromMegawattsPerCubicInch(QuantityValue megawattspercubicinch) + public static PowerDensity FromMegawattsPerCubicInch(double value) { - double value = (double) megawattspercubicinch; return new PowerDensity(value, PowerDensityUnit.MegawattPerCubicInch); } @@ -745,9 +727,8 @@ public static PowerDensity FromMegawattsPerCubicInch(QuantityValue megawattsperc /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromMegawattsPerCubicMeter(QuantityValue megawattspercubicmeter) + public static PowerDensity FromMegawattsPerCubicMeter(double value) { - double value = (double) megawattspercubicmeter; return new PowerDensity(value, PowerDensityUnit.MegawattPerCubicMeter); } @@ -755,9 +736,8 @@ public static PowerDensity FromMegawattsPerCubicMeter(QuantityValue megawattsper /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromMegawattsPerLiter(QuantityValue megawattsperliter) + public static PowerDensity FromMegawattsPerLiter(double value) { - double value = (double) megawattsperliter; return new PowerDensity(value, PowerDensityUnit.MegawattPerLiter); } @@ -765,9 +745,8 @@ public static PowerDensity FromMegawattsPerLiter(QuantityValue megawattsperliter /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromMicrowattsPerCubicFoot(QuantityValue microwattspercubicfoot) + public static PowerDensity FromMicrowattsPerCubicFoot(double value) { - double value = (double) microwattspercubicfoot; return new PowerDensity(value, PowerDensityUnit.MicrowattPerCubicFoot); } @@ -775,9 +754,8 @@ public static PowerDensity FromMicrowattsPerCubicFoot(QuantityValue microwattspe /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromMicrowattsPerCubicInch(QuantityValue microwattspercubicinch) + public static PowerDensity FromMicrowattsPerCubicInch(double value) { - double value = (double) microwattspercubicinch; return new PowerDensity(value, PowerDensityUnit.MicrowattPerCubicInch); } @@ -785,9 +763,8 @@ public static PowerDensity FromMicrowattsPerCubicInch(QuantityValue microwattspe /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromMicrowattsPerCubicMeter(QuantityValue microwattspercubicmeter) + public static PowerDensity FromMicrowattsPerCubicMeter(double value) { - double value = (double) microwattspercubicmeter; return new PowerDensity(value, PowerDensityUnit.MicrowattPerCubicMeter); } @@ -795,9 +772,8 @@ public static PowerDensity FromMicrowattsPerCubicMeter(QuantityValue microwattsp /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromMicrowattsPerLiter(QuantityValue microwattsperliter) + public static PowerDensity FromMicrowattsPerLiter(double value) { - double value = (double) microwattsperliter; return new PowerDensity(value, PowerDensityUnit.MicrowattPerLiter); } @@ -805,9 +781,8 @@ public static PowerDensity FromMicrowattsPerLiter(QuantityValue microwattsperlit /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromMilliwattsPerCubicFoot(QuantityValue milliwattspercubicfoot) + public static PowerDensity FromMilliwattsPerCubicFoot(double value) { - double value = (double) milliwattspercubicfoot; return new PowerDensity(value, PowerDensityUnit.MilliwattPerCubicFoot); } @@ -815,9 +790,8 @@ public static PowerDensity FromMilliwattsPerCubicFoot(QuantityValue milliwattspe /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromMilliwattsPerCubicInch(QuantityValue milliwattspercubicinch) + public static PowerDensity FromMilliwattsPerCubicInch(double value) { - double value = (double) milliwattspercubicinch; return new PowerDensity(value, PowerDensityUnit.MilliwattPerCubicInch); } @@ -825,9 +799,8 @@ public static PowerDensity FromMilliwattsPerCubicInch(QuantityValue milliwattspe /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromMilliwattsPerCubicMeter(QuantityValue milliwattspercubicmeter) + public static PowerDensity FromMilliwattsPerCubicMeter(double value) { - double value = (double) milliwattspercubicmeter; return new PowerDensity(value, PowerDensityUnit.MilliwattPerCubicMeter); } @@ -835,9 +808,8 @@ public static PowerDensity FromMilliwattsPerCubicMeter(QuantityValue milliwattsp /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromMilliwattsPerLiter(QuantityValue milliwattsperliter) + public static PowerDensity FromMilliwattsPerLiter(double value) { - double value = (double) milliwattsperliter; return new PowerDensity(value, PowerDensityUnit.MilliwattPerLiter); } @@ -845,9 +817,8 @@ public static PowerDensity FromMilliwattsPerLiter(QuantityValue milliwattsperlit /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromNanowattsPerCubicFoot(QuantityValue nanowattspercubicfoot) + public static PowerDensity FromNanowattsPerCubicFoot(double value) { - double value = (double) nanowattspercubicfoot; return new PowerDensity(value, PowerDensityUnit.NanowattPerCubicFoot); } @@ -855,9 +826,8 @@ public static PowerDensity FromNanowattsPerCubicFoot(QuantityValue nanowattsperc /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromNanowattsPerCubicInch(QuantityValue nanowattspercubicinch) + public static PowerDensity FromNanowattsPerCubicInch(double value) { - double value = (double) nanowattspercubicinch; return new PowerDensity(value, PowerDensityUnit.NanowattPerCubicInch); } @@ -865,9 +835,8 @@ public static PowerDensity FromNanowattsPerCubicInch(QuantityValue nanowattsperc /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromNanowattsPerCubicMeter(QuantityValue nanowattspercubicmeter) + public static PowerDensity FromNanowattsPerCubicMeter(double value) { - double value = (double) nanowattspercubicmeter; return new PowerDensity(value, PowerDensityUnit.NanowattPerCubicMeter); } @@ -875,9 +844,8 @@ public static PowerDensity FromNanowattsPerCubicMeter(QuantityValue nanowattsper /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromNanowattsPerLiter(QuantityValue nanowattsperliter) + public static PowerDensity FromNanowattsPerLiter(double value) { - double value = (double) nanowattsperliter; return new PowerDensity(value, PowerDensityUnit.NanowattPerLiter); } @@ -885,9 +853,8 @@ public static PowerDensity FromNanowattsPerLiter(QuantityValue nanowattsperliter /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromPicowattsPerCubicFoot(QuantityValue picowattspercubicfoot) + public static PowerDensity FromPicowattsPerCubicFoot(double value) { - double value = (double) picowattspercubicfoot; return new PowerDensity(value, PowerDensityUnit.PicowattPerCubicFoot); } @@ -895,9 +862,8 @@ public static PowerDensity FromPicowattsPerCubicFoot(QuantityValue picowattsperc /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromPicowattsPerCubicInch(QuantityValue picowattspercubicinch) + public static PowerDensity FromPicowattsPerCubicInch(double value) { - double value = (double) picowattspercubicinch; return new PowerDensity(value, PowerDensityUnit.PicowattPerCubicInch); } @@ -905,9 +871,8 @@ public static PowerDensity FromPicowattsPerCubicInch(QuantityValue picowattsperc /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromPicowattsPerCubicMeter(QuantityValue picowattspercubicmeter) + public static PowerDensity FromPicowattsPerCubicMeter(double value) { - double value = (double) picowattspercubicmeter; return new PowerDensity(value, PowerDensityUnit.PicowattPerCubicMeter); } @@ -915,9 +880,8 @@ public static PowerDensity FromPicowattsPerCubicMeter(QuantityValue picowattsper /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromPicowattsPerLiter(QuantityValue picowattsperliter) + public static PowerDensity FromPicowattsPerLiter(double value) { - double value = (double) picowattsperliter; return new PowerDensity(value, PowerDensityUnit.PicowattPerLiter); } @@ -925,9 +889,8 @@ public static PowerDensity FromPicowattsPerLiter(QuantityValue picowattsperliter /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromTerawattsPerCubicFoot(QuantityValue terawattspercubicfoot) + public static PowerDensity FromTerawattsPerCubicFoot(double value) { - double value = (double) terawattspercubicfoot; return new PowerDensity(value, PowerDensityUnit.TerawattPerCubicFoot); } @@ -935,9 +898,8 @@ public static PowerDensity FromTerawattsPerCubicFoot(QuantityValue terawattsperc /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromTerawattsPerCubicInch(QuantityValue terawattspercubicinch) + public static PowerDensity FromTerawattsPerCubicInch(double value) { - double value = (double) terawattspercubicinch; return new PowerDensity(value, PowerDensityUnit.TerawattPerCubicInch); } @@ -945,9 +907,8 @@ public static PowerDensity FromTerawattsPerCubicInch(QuantityValue terawattsperc /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromTerawattsPerCubicMeter(QuantityValue terawattspercubicmeter) + public static PowerDensity FromTerawattsPerCubicMeter(double value) { - double value = (double) terawattspercubicmeter; return new PowerDensity(value, PowerDensityUnit.TerawattPerCubicMeter); } @@ -955,9 +916,8 @@ public static PowerDensity FromTerawattsPerCubicMeter(QuantityValue terawattsper /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromTerawattsPerLiter(QuantityValue terawattsperliter) + public static PowerDensity FromTerawattsPerLiter(double value) { - double value = (double) terawattsperliter; return new PowerDensity(value, PowerDensityUnit.TerawattPerLiter); } @@ -965,9 +925,8 @@ public static PowerDensity FromTerawattsPerLiter(QuantityValue terawattsperliter /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromWattsPerCubicFoot(QuantityValue wattspercubicfoot) + public static PowerDensity FromWattsPerCubicFoot(double value) { - double value = (double) wattspercubicfoot; return new PowerDensity(value, PowerDensityUnit.WattPerCubicFoot); } @@ -975,9 +934,8 @@ public static PowerDensity FromWattsPerCubicFoot(QuantityValue wattspercubicfoot /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromWattsPerCubicInch(QuantityValue wattspercubicinch) + public static PowerDensity FromWattsPerCubicInch(double value) { - double value = (double) wattspercubicinch; return new PowerDensity(value, PowerDensityUnit.WattPerCubicInch); } @@ -985,9 +943,8 @@ public static PowerDensity FromWattsPerCubicInch(QuantityValue wattspercubicinch /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromWattsPerCubicMeter(QuantityValue wattspercubicmeter) + public static PowerDensity FromWattsPerCubicMeter(double value) { - double value = (double) wattspercubicmeter; return new PowerDensity(value, PowerDensityUnit.WattPerCubicMeter); } @@ -995,9 +952,8 @@ public static PowerDensity FromWattsPerCubicMeter(QuantityValue wattspercubicmet /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromWattsPerLiter(QuantityValue wattsperliter) + public static PowerDensity FromWattsPerLiter(double value) { - double value = (double) wattsperliter; return new PowerDensity(value, PowerDensityUnit.WattPerLiter); } @@ -1007,9 +963,9 @@ public static PowerDensity FromWattsPerLiter(QuantityValue wattsperliter) /// Value to convert from. /// Unit to convert from. /// PowerDensity unit value. - public static PowerDensity From(QuantityValue value, PowerDensityUnit fromUnit) + public static PowerDensity From(double value, PowerDensityUnit fromUnit) { - return new PowerDensity((double)value, fromUnit); + return new PowerDensity(value, fromUnit); } #endregion @@ -1420,15 +1376,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is PowerDensityUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(PowerDensityUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is PowerDensityUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(PowerDensityUnit)} is supported.", nameof(unit)); @@ -1629,18 +1576,6 @@ public PowerDensity ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not PowerDensityUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(PowerDensityUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/PowerRatio.g.cs b/UnitsNet/GeneratedCode/Quantities/PowerRatio.g.cs index ea2ee3c7d6..135515997d 100644 --- a/UnitsNet/GeneratedCode/Quantities/PowerRatio.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PowerRatio.g.cs @@ -37,7 +37,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct PowerRatio : - IArithmeticQuantity, + IArithmeticQuantity, IComparable, IComparable, IConvertible, @@ -148,7 +148,7 @@ public PowerRatio(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -229,9 +229,8 @@ public static string GetAbbreviation(PowerRatioUnit unit, IFormatProvider? provi /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerRatio FromDecibelMilliwatts(QuantityValue decibelmilliwatts) + public static PowerRatio FromDecibelMilliwatts(double value) { - double value = (double) decibelmilliwatts; return new PowerRatio(value, PowerRatioUnit.DecibelMilliwatt); } @@ -239,9 +238,8 @@ public static PowerRatio FromDecibelMilliwatts(QuantityValue decibelmilliwatts) /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerRatio FromDecibelWatts(QuantityValue decibelwatts) + public static PowerRatio FromDecibelWatts(double value) { - double value = (double) decibelwatts; return new PowerRatio(value, PowerRatioUnit.DecibelWatt); } @@ -251,9 +249,9 @@ public static PowerRatio FromDecibelWatts(QuantityValue decibelwatts) /// Value to convert from. /// Unit to convert from. /// PowerRatio unit value. - public static PowerRatio From(QuantityValue value, PowerRatioUnit fromUnit) + public static PowerRatio From(double value, PowerRatioUnit fromUnit) { - return new PowerRatio((double)value, fromUnit); + return new PowerRatio(value, fromUnit); } #endregion @@ -437,14 +435,14 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Power public static PowerRatio operator *(PowerRatio left, double right) { // Logarithmic multiplication = addition - return new PowerRatio(left.Value + (double)right, left.Unit); + return new PowerRatio(left.Value + right, left.Unit); } /// Get from logarithmic division of by value. public static PowerRatio operator /(PowerRatio left, double right) { // Logarithmic division = subtraction - return new PowerRatio(left.Value - (double)right, left.Unit); + return new PowerRatio(left.Value - right, left.Unit); } /// Get ratio value from logarithmic division of by . @@ -672,15 +670,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is PowerRatioUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(PowerRatioUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is PowerRatioUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(PowerRatioUnit)} is supported.", nameof(unit)); @@ -797,18 +786,6 @@ public PowerRatio ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not PowerRatioUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(PowerRatioUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/Pressure.g.cs b/UnitsNet/GeneratedCode/Quantities/Pressure.g.cs index 38e86ad76c..cc8e6aa4d4 100644 --- a/UnitsNet/GeneratedCode/Quantities/Pressure.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Pressure.g.cs @@ -40,7 +40,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct Pressure : - IArithmeticQuantity, + IArithmeticQuantity, #if NET7_0_OR_GREATER IMultiplyOperators, IDivisionOperators, @@ -207,7 +207,7 @@ public Pressure(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -617,9 +617,8 @@ public static string GetAbbreviation(PressureUnit unit, IFormatProvider? provide /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromAtmospheres(QuantityValue atmospheres) + public static Pressure FromAtmospheres(double value) { - double value = (double) atmospheres; return new Pressure(value, PressureUnit.Atmosphere); } @@ -627,9 +626,8 @@ public static Pressure FromAtmospheres(QuantityValue atmospheres) /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromBars(QuantityValue bars) + public static Pressure FromBars(double value) { - double value = (double) bars; return new Pressure(value, PressureUnit.Bar); } @@ -637,9 +635,8 @@ public static Pressure FromBars(QuantityValue bars) /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromCentibars(QuantityValue centibars) + public static Pressure FromCentibars(double value) { - double value = (double) centibars; return new Pressure(value, PressureUnit.Centibar); } @@ -647,9 +644,8 @@ public static Pressure FromCentibars(QuantityValue centibars) /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromCentimetersOfWaterColumn(QuantityValue centimetersofwatercolumn) + public static Pressure FromCentimetersOfWaterColumn(double value) { - double value = (double) centimetersofwatercolumn; return new Pressure(value, PressureUnit.CentimeterOfWaterColumn); } @@ -657,9 +653,8 @@ public static Pressure FromCentimetersOfWaterColumn(QuantityValue centimetersofw /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromDecapascals(QuantityValue decapascals) + public static Pressure FromDecapascals(double value) { - double value = (double) decapascals; return new Pressure(value, PressureUnit.Decapascal); } @@ -667,9 +662,8 @@ public static Pressure FromDecapascals(QuantityValue decapascals) /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromDecibars(QuantityValue decibars) + public static Pressure FromDecibars(double value) { - double value = (double) decibars; return new Pressure(value, PressureUnit.Decibar); } @@ -677,9 +671,8 @@ public static Pressure FromDecibars(QuantityValue decibars) /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromDynesPerSquareCentimeter(QuantityValue dynespersquarecentimeter) + public static Pressure FromDynesPerSquareCentimeter(double value) { - double value = (double) dynespersquarecentimeter; return new Pressure(value, PressureUnit.DynePerSquareCentimeter); } @@ -687,9 +680,8 @@ public static Pressure FromDynesPerSquareCentimeter(QuantityValue dynespersquare /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromFeetOfElevation(QuantityValue feetofelevation) + public static Pressure FromFeetOfElevation(double value) { - double value = (double) feetofelevation; return new Pressure(value, PressureUnit.FootOfElevation); } @@ -697,9 +689,8 @@ public static Pressure FromFeetOfElevation(QuantityValue feetofelevation) /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromFeetOfHead(QuantityValue feetofhead) + public static Pressure FromFeetOfHead(double value) { - double value = (double) feetofhead; return new Pressure(value, PressureUnit.FootOfHead); } @@ -707,9 +698,8 @@ public static Pressure FromFeetOfHead(QuantityValue feetofhead) /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromGigapascals(QuantityValue gigapascals) + public static Pressure FromGigapascals(double value) { - double value = (double) gigapascals; return new Pressure(value, PressureUnit.Gigapascal); } @@ -717,9 +707,8 @@ public static Pressure FromGigapascals(QuantityValue gigapascals) /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromHectopascals(QuantityValue hectopascals) + public static Pressure FromHectopascals(double value) { - double value = (double) hectopascals; return new Pressure(value, PressureUnit.Hectopascal); } @@ -727,9 +716,8 @@ public static Pressure FromHectopascals(QuantityValue hectopascals) /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromInchesOfMercury(QuantityValue inchesofmercury) + public static Pressure FromInchesOfMercury(double value) { - double value = (double) inchesofmercury; return new Pressure(value, PressureUnit.InchOfMercury); } @@ -737,9 +725,8 @@ public static Pressure FromInchesOfMercury(QuantityValue inchesofmercury) /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromInchesOfWaterColumn(QuantityValue inchesofwatercolumn) + public static Pressure FromInchesOfWaterColumn(double value) { - double value = (double) inchesofwatercolumn; return new Pressure(value, PressureUnit.InchOfWaterColumn); } @@ -747,9 +734,8 @@ public static Pressure FromInchesOfWaterColumn(QuantityValue inchesofwatercolumn /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromKilobars(QuantityValue kilobars) + public static Pressure FromKilobars(double value) { - double value = (double) kilobars; return new Pressure(value, PressureUnit.Kilobar); } @@ -757,9 +743,8 @@ public static Pressure FromKilobars(QuantityValue kilobars) /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromKilogramsForcePerSquareCentimeter(QuantityValue kilogramsforcepersquarecentimeter) + public static Pressure FromKilogramsForcePerSquareCentimeter(double value) { - double value = (double) kilogramsforcepersquarecentimeter; return new Pressure(value, PressureUnit.KilogramForcePerSquareCentimeter); } @@ -767,9 +752,8 @@ public static Pressure FromKilogramsForcePerSquareCentimeter(QuantityValue kilog /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromKilogramsForcePerSquareMeter(QuantityValue kilogramsforcepersquaremeter) + public static Pressure FromKilogramsForcePerSquareMeter(double value) { - double value = (double) kilogramsforcepersquaremeter; return new Pressure(value, PressureUnit.KilogramForcePerSquareMeter); } @@ -777,9 +761,8 @@ public static Pressure FromKilogramsForcePerSquareMeter(QuantityValue kilogramsf /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromKilogramsForcePerSquareMillimeter(QuantityValue kilogramsforcepersquaremillimeter) + public static Pressure FromKilogramsForcePerSquareMillimeter(double value) { - double value = (double) kilogramsforcepersquaremillimeter; return new Pressure(value, PressureUnit.KilogramForcePerSquareMillimeter); } @@ -787,9 +770,8 @@ public static Pressure FromKilogramsForcePerSquareMillimeter(QuantityValue kilog /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromKilonewtonsPerSquareCentimeter(QuantityValue kilonewtonspersquarecentimeter) + public static Pressure FromKilonewtonsPerSquareCentimeter(double value) { - double value = (double) kilonewtonspersquarecentimeter; return new Pressure(value, PressureUnit.KilonewtonPerSquareCentimeter); } @@ -797,9 +779,8 @@ public static Pressure FromKilonewtonsPerSquareCentimeter(QuantityValue kilonewt /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromKilonewtonsPerSquareMeter(QuantityValue kilonewtonspersquaremeter) + public static Pressure FromKilonewtonsPerSquareMeter(double value) { - double value = (double) kilonewtonspersquaremeter; return new Pressure(value, PressureUnit.KilonewtonPerSquareMeter); } @@ -807,9 +788,8 @@ public static Pressure FromKilonewtonsPerSquareMeter(QuantityValue kilonewtonspe /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromKilonewtonsPerSquareMillimeter(QuantityValue kilonewtonspersquaremillimeter) + public static Pressure FromKilonewtonsPerSquareMillimeter(double value) { - double value = (double) kilonewtonspersquaremillimeter; return new Pressure(value, PressureUnit.KilonewtonPerSquareMillimeter); } @@ -817,9 +797,8 @@ public static Pressure FromKilonewtonsPerSquareMillimeter(QuantityValue kilonewt /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromKilopascals(QuantityValue kilopascals) + public static Pressure FromKilopascals(double value) { - double value = (double) kilopascals; return new Pressure(value, PressureUnit.Kilopascal); } @@ -827,9 +806,8 @@ public static Pressure FromKilopascals(QuantityValue kilopascals) /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromKilopoundsForcePerSquareFoot(QuantityValue kilopoundsforcepersquarefoot) + public static Pressure FromKilopoundsForcePerSquareFoot(double value) { - double value = (double) kilopoundsforcepersquarefoot; return new Pressure(value, PressureUnit.KilopoundForcePerSquareFoot); } @@ -837,9 +815,8 @@ public static Pressure FromKilopoundsForcePerSquareFoot(QuantityValue kilopounds /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromKilopoundsForcePerSquareInch(QuantityValue kilopoundsforcepersquareinch) + public static Pressure FromKilopoundsForcePerSquareInch(double value) { - double value = (double) kilopoundsforcepersquareinch; return new Pressure(value, PressureUnit.KilopoundForcePerSquareInch); } @@ -847,9 +824,8 @@ public static Pressure FromKilopoundsForcePerSquareInch(QuantityValue kilopounds /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromKilopoundsForcePerSquareMil(QuantityValue kilopoundsforcepersquaremil) + public static Pressure FromKilopoundsForcePerSquareMil(double value) { - double value = (double) kilopoundsforcepersquaremil; return new Pressure(value, PressureUnit.KilopoundForcePerSquareMil); } @@ -857,9 +833,8 @@ public static Pressure FromKilopoundsForcePerSquareMil(QuantityValue kilopoundsf /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromMegabars(QuantityValue megabars) + public static Pressure FromMegabars(double value) { - double value = (double) megabars; return new Pressure(value, PressureUnit.Megabar); } @@ -867,9 +842,8 @@ public static Pressure FromMegabars(QuantityValue megabars) /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromMeganewtonsPerSquareMeter(QuantityValue meganewtonspersquaremeter) + public static Pressure FromMeganewtonsPerSquareMeter(double value) { - double value = (double) meganewtonspersquaremeter; return new Pressure(value, PressureUnit.MeganewtonPerSquareMeter); } @@ -877,9 +851,8 @@ public static Pressure FromMeganewtonsPerSquareMeter(QuantityValue meganewtonspe /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromMegapascals(QuantityValue megapascals) + public static Pressure FromMegapascals(double value) { - double value = (double) megapascals; return new Pressure(value, PressureUnit.Megapascal); } @@ -887,9 +860,8 @@ public static Pressure FromMegapascals(QuantityValue megapascals) /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromMetersOfElevation(QuantityValue metersofelevation) + public static Pressure FromMetersOfElevation(double value) { - double value = (double) metersofelevation; return new Pressure(value, PressureUnit.MeterOfElevation); } @@ -897,9 +869,8 @@ public static Pressure FromMetersOfElevation(QuantityValue metersofelevation) /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromMetersOfHead(QuantityValue metersofhead) + public static Pressure FromMetersOfHead(double value) { - double value = (double) metersofhead; return new Pressure(value, PressureUnit.MeterOfHead); } @@ -907,9 +878,8 @@ public static Pressure FromMetersOfHead(QuantityValue metersofhead) /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromMetersOfWaterColumn(QuantityValue metersofwatercolumn) + public static Pressure FromMetersOfWaterColumn(double value) { - double value = (double) metersofwatercolumn; return new Pressure(value, PressureUnit.MeterOfWaterColumn); } @@ -917,9 +887,8 @@ public static Pressure FromMetersOfWaterColumn(QuantityValue metersofwatercolumn /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromMicrobars(QuantityValue microbars) + public static Pressure FromMicrobars(double value) { - double value = (double) microbars; return new Pressure(value, PressureUnit.Microbar); } @@ -927,9 +896,8 @@ public static Pressure FromMicrobars(QuantityValue microbars) /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromMicropascals(QuantityValue micropascals) + public static Pressure FromMicropascals(double value) { - double value = (double) micropascals; return new Pressure(value, PressureUnit.Micropascal); } @@ -937,9 +905,8 @@ public static Pressure FromMicropascals(QuantityValue micropascals) /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromMillibars(QuantityValue millibars) + public static Pressure FromMillibars(double value) { - double value = (double) millibars; return new Pressure(value, PressureUnit.Millibar); } @@ -947,9 +914,8 @@ public static Pressure FromMillibars(QuantityValue millibars) /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromMillimetersOfMercury(QuantityValue millimetersofmercury) + public static Pressure FromMillimetersOfMercury(double value) { - double value = (double) millimetersofmercury; return new Pressure(value, PressureUnit.MillimeterOfMercury); } @@ -957,9 +923,8 @@ public static Pressure FromMillimetersOfMercury(QuantityValue millimetersofmercu /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromMillimetersOfWaterColumn(QuantityValue millimetersofwatercolumn) + public static Pressure FromMillimetersOfWaterColumn(double value) { - double value = (double) millimetersofwatercolumn; return new Pressure(value, PressureUnit.MillimeterOfWaterColumn); } @@ -967,9 +932,8 @@ public static Pressure FromMillimetersOfWaterColumn(QuantityValue millimetersofw /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromMillipascals(QuantityValue millipascals) + public static Pressure FromMillipascals(double value) { - double value = (double) millipascals; return new Pressure(value, PressureUnit.Millipascal); } @@ -977,9 +941,8 @@ public static Pressure FromMillipascals(QuantityValue millipascals) /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromNewtonsPerSquareCentimeter(QuantityValue newtonspersquarecentimeter) + public static Pressure FromNewtonsPerSquareCentimeter(double value) { - double value = (double) newtonspersquarecentimeter; return new Pressure(value, PressureUnit.NewtonPerSquareCentimeter); } @@ -987,9 +950,8 @@ public static Pressure FromNewtonsPerSquareCentimeter(QuantityValue newtonspersq /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromNewtonsPerSquareMeter(QuantityValue newtonspersquaremeter) + public static Pressure FromNewtonsPerSquareMeter(double value) { - double value = (double) newtonspersquaremeter; return new Pressure(value, PressureUnit.NewtonPerSquareMeter); } @@ -997,9 +959,8 @@ public static Pressure FromNewtonsPerSquareMeter(QuantityValue newtonspersquarem /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromNewtonsPerSquareMillimeter(QuantityValue newtonspersquaremillimeter) + public static Pressure FromNewtonsPerSquareMillimeter(double value) { - double value = (double) newtonspersquaremillimeter; return new Pressure(value, PressureUnit.NewtonPerSquareMillimeter); } @@ -1007,9 +968,8 @@ public static Pressure FromNewtonsPerSquareMillimeter(QuantityValue newtonspersq /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromPascals(QuantityValue pascals) + public static Pressure FromPascals(double value) { - double value = (double) pascals; return new Pressure(value, PressureUnit.Pascal); } @@ -1017,9 +977,8 @@ public static Pressure FromPascals(QuantityValue pascals) /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromPoundsForcePerSquareFoot(QuantityValue poundsforcepersquarefoot) + public static Pressure FromPoundsForcePerSquareFoot(double value) { - double value = (double) poundsforcepersquarefoot; return new Pressure(value, PressureUnit.PoundForcePerSquareFoot); } @@ -1027,9 +986,8 @@ public static Pressure FromPoundsForcePerSquareFoot(QuantityValue poundsforceper /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromPoundsForcePerSquareInch(QuantityValue poundsforcepersquareinch) + public static Pressure FromPoundsForcePerSquareInch(double value) { - double value = (double) poundsforcepersquareinch; return new Pressure(value, PressureUnit.PoundForcePerSquareInch); } @@ -1037,9 +995,8 @@ public static Pressure FromPoundsForcePerSquareInch(QuantityValue poundsforceper /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromPoundsForcePerSquareMil(QuantityValue poundsforcepersquaremil) + public static Pressure FromPoundsForcePerSquareMil(double value) { - double value = (double) poundsforcepersquaremil; return new Pressure(value, PressureUnit.PoundForcePerSquareMil); } @@ -1047,9 +1004,8 @@ public static Pressure FromPoundsForcePerSquareMil(QuantityValue poundsforcepers /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromPoundsPerInchSecondSquared(QuantityValue poundsperinchsecondsquared) + public static Pressure FromPoundsPerInchSecondSquared(double value) { - double value = (double) poundsperinchsecondsquared; return new Pressure(value, PressureUnit.PoundPerInchSecondSquared); } @@ -1057,9 +1013,8 @@ public static Pressure FromPoundsPerInchSecondSquared(QuantityValue poundsperinc /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromTechnicalAtmospheres(QuantityValue technicalatmospheres) + public static Pressure FromTechnicalAtmospheres(double value) { - double value = (double) technicalatmospheres; return new Pressure(value, PressureUnit.TechnicalAtmosphere); } @@ -1067,9 +1022,8 @@ public static Pressure FromTechnicalAtmospheres(QuantityValue technicalatmospher /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromTonnesForcePerSquareCentimeter(QuantityValue tonnesforcepersquarecentimeter) + public static Pressure FromTonnesForcePerSquareCentimeter(double value) { - double value = (double) tonnesforcepersquarecentimeter; return new Pressure(value, PressureUnit.TonneForcePerSquareCentimeter); } @@ -1077,9 +1031,8 @@ public static Pressure FromTonnesForcePerSquareCentimeter(QuantityValue tonnesfo /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromTonnesForcePerSquareMeter(QuantityValue tonnesforcepersquaremeter) + public static Pressure FromTonnesForcePerSquareMeter(double value) { - double value = (double) tonnesforcepersquaremeter; return new Pressure(value, PressureUnit.TonneForcePerSquareMeter); } @@ -1087,9 +1040,8 @@ public static Pressure FromTonnesForcePerSquareMeter(QuantityValue tonnesforcepe /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromTonnesForcePerSquareMillimeter(QuantityValue tonnesforcepersquaremillimeter) + public static Pressure FromTonnesForcePerSquareMillimeter(double value) { - double value = (double) tonnesforcepersquaremillimeter; return new Pressure(value, PressureUnit.TonneForcePerSquareMillimeter); } @@ -1097,9 +1049,8 @@ public static Pressure FromTonnesForcePerSquareMillimeter(QuantityValue tonnesfo /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromTorrs(QuantityValue torrs) + public static Pressure FromTorrs(double value) { - double value = (double) torrs; return new Pressure(value, PressureUnit.Torr); } @@ -1109,9 +1060,9 @@ public static Pressure FromTorrs(QuantityValue torrs) /// Value to convert from. /// Unit to convert from. /// Pressure unit value. - public static Pressure From(QuantityValue value, PressureUnit fromUnit) + public static Pressure From(double value, PressureUnit fromUnit) { - return new Pressure((double)value, fromUnit); + return new Pressure(value, fromUnit); } #endregion @@ -1568,15 +1519,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is PressureUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(PressureUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is PressureUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(PressureUnit)} is supported.", nameof(unit)); @@ -1787,18 +1729,6 @@ public Pressure ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not PressureUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(PressureUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.g.cs b/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.g.cs index 4a857e3e2a..8e1a30cec3 100644 --- a/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.g.cs @@ -40,7 +40,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct PressureChangeRate : - IArithmeticQuantity, + IArithmeticQuantity, #if NET7_0_OR_GREATER IMultiplyOperators, IMultiplyOperators, @@ -171,7 +171,7 @@ public PressureChangeRate(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -364,9 +364,8 @@ public static string GetAbbreviation(PressureChangeRateUnit unit, IFormatProvide /// Creates a from . /// /// If value is NaN or Infinity. - public static PressureChangeRate FromAtmospheresPerSecond(QuantityValue atmospherespersecond) + public static PressureChangeRate FromAtmospheresPerSecond(double value) { - double value = (double) atmospherespersecond; return new PressureChangeRate(value, PressureChangeRateUnit.AtmospherePerSecond); } @@ -374,9 +373,8 @@ public static PressureChangeRate FromAtmospheresPerSecond(QuantityValue atmosphe /// Creates a from . /// /// If value is NaN or Infinity. - public static PressureChangeRate FromBarsPerMinute(QuantityValue barsperminute) + public static PressureChangeRate FromBarsPerMinute(double value) { - double value = (double) barsperminute; return new PressureChangeRate(value, PressureChangeRateUnit.BarPerMinute); } @@ -384,9 +382,8 @@ public static PressureChangeRate FromBarsPerMinute(QuantityValue barsperminute) /// Creates a from . /// /// If value is NaN or Infinity. - public static PressureChangeRate FromBarsPerSecond(QuantityValue barspersecond) + public static PressureChangeRate FromBarsPerSecond(double value) { - double value = (double) barspersecond; return new PressureChangeRate(value, PressureChangeRateUnit.BarPerSecond); } @@ -394,9 +391,8 @@ public static PressureChangeRate FromBarsPerSecond(QuantityValue barspersecond) /// Creates a from . /// /// If value is NaN or Infinity. - public static PressureChangeRate FromKilopascalsPerMinute(QuantityValue kilopascalsperminute) + public static PressureChangeRate FromKilopascalsPerMinute(double value) { - double value = (double) kilopascalsperminute; return new PressureChangeRate(value, PressureChangeRateUnit.KilopascalPerMinute); } @@ -404,9 +400,8 @@ public static PressureChangeRate FromKilopascalsPerMinute(QuantityValue kilopasc /// Creates a from . /// /// If value is NaN or Infinity. - public static PressureChangeRate FromKilopascalsPerSecond(QuantityValue kilopascalspersecond) + public static PressureChangeRate FromKilopascalsPerSecond(double value) { - double value = (double) kilopascalspersecond; return new PressureChangeRate(value, PressureChangeRateUnit.KilopascalPerSecond); } @@ -414,9 +409,8 @@ public static PressureChangeRate FromKilopascalsPerSecond(QuantityValue kilopasc /// Creates a from . /// /// If value is NaN or Infinity. - public static PressureChangeRate FromKilopoundsForcePerSquareInchPerMinute(QuantityValue kilopoundsforcepersquareinchperminute) + public static PressureChangeRate FromKilopoundsForcePerSquareInchPerMinute(double value) { - double value = (double) kilopoundsforcepersquareinchperminute; return new PressureChangeRate(value, PressureChangeRateUnit.KilopoundForcePerSquareInchPerMinute); } @@ -424,9 +418,8 @@ public static PressureChangeRate FromKilopoundsForcePerSquareInchPerMinute(Quant /// Creates a from . /// /// If value is NaN or Infinity. - public static PressureChangeRate FromKilopoundsForcePerSquareInchPerSecond(QuantityValue kilopoundsforcepersquareinchpersecond) + public static PressureChangeRate FromKilopoundsForcePerSquareInchPerSecond(double value) { - double value = (double) kilopoundsforcepersquareinchpersecond; return new PressureChangeRate(value, PressureChangeRateUnit.KilopoundForcePerSquareInchPerSecond); } @@ -434,9 +427,8 @@ public static PressureChangeRate FromKilopoundsForcePerSquareInchPerSecond(Quant /// Creates a from . /// /// If value is NaN or Infinity. - public static PressureChangeRate FromMegapascalsPerMinute(QuantityValue megapascalsperminute) + public static PressureChangeRate FromMegapascalsPerMinute(double value) { - double value = (double) megapascalsperminute; return new PressureChangeRate(value, PressureChangeRateUnit.MegapascalPerMinute); } @@ -444,9 +436,8 @@ public static PressureChangeRate FromMegapascalsPerMinute(QuantityValue megapasc /// Creates a from . /// /// If value is NaN or Infinity. - public static PressureChangeRate FromMegapascalsPerSecond(QuantityValue megapascalspersecond) + public static PressureChangeRate FromMegapascalsPerSecond(double value) { - double value = (double) megapascalspersecond; return new PressureChangeRate(value, PressureChangeRateUnit.MegapascalPerSecond); } @@ -454,9 +445,8 @@ public static PressureChangeRate FromMegapascalsPerSecond(QuantityValue megapasc /// Creates a from . /// /// If value is NaN or Infinity. - public static PressureChangeRate FromMegapoundsForcePerSquareInchPerMinute(QuantityValue megapoundsforcepersquareinchperminute) + public static PressureChangeRate FromMegapoundsForcePerSquareInchPerMinute(double value) { - double value = (double) megapoundsforcepersquareinchperminute; return new PressureChangeRate(value, PressureChangeRateUnit.MegapoundForcePerSquareInchPerMinute); } @@ -464,9 +454,8 @@ public static PressureChangeRate FromMegapoundsForcePerSquareInchPerMinute(Quant /// Creates a from . /// /// If value is NaN or Infinity. - public static PressureChangeRate FromMegapoundsForcePerSquareInchPerSecond(QuantityValue megapoundsforcepersquareinchpersecond) + public static PressureChangeRate FromMegapoundsForcePerSquareInchPerSecond(double value) { - double value = (double) megapoundsforcepersquareinchpersecond; return new PressureChangeRate(value, PressureChangeRateUnit.MegapoundForcePerSquareInchPerSecond); } @@ -474,9 +463,8 @@ public static PressureChangeRate FromMegapoundsForcePerSquareInchPerSecond(Quant /// Creates a from . /// /// If value is NaN or Infinity. - public static PressureChangeRate FromMillibarsPerMinute(QuantityValue millibarsperminute) + public static PressureChangeRate FromMillibarsPerMinute(double value) { - double value = (double) millibarsperminute; return new PressureChangeRate(value, PressureChangeRateUnit.MillibarPerMinute); } @@ -484,9 +472,8 @@ public static PressureChangeRate FromMillibarsPerMinute(QuantityValue millibarsp /// Creates a from . /// /// If value is NaN or Infinity. - public static PressureChangeRate FromMillibarsPerSecond(QuantityValue millibarspersecond) + public static PressureChangeRate FromMillibarsPerSecond(double value) { - double value = (double) millibarspersecond; return new PressureChangeRate(value, PressureChangeRateUnit.MillibarPerSecond); } @@ -494,9 +481,8 @@ public static PressureChangeRate FromMillibarsPerSecond(QuantityValue millibarsp /// Creates a from . /// /// If value is NaN or Infinity. - public static PressureChangeRate FromMillimetersOfMercuryPerSecond(QuantityValue millimetersofmercurypersecond) + public static PressureChangeRate FromMillimetersOfMercuryPerSecond(double value) { - double value = (double) millimetersofmercurypersecond; return new PressureChangeRate(value, PressureChangeRateUnit.MillimeterOfMercuryPerSecond); } @@ -504,9 +490,8 @@ public static PressureChangeRate FromMillimetersOfMercuryPerSecond(QuantityValue /// Creates a from . /// /// If value is NaN or Infinity. - public static PressureChangeRate FromPascalsPerMinute(QuantityValue pascalsperminute) + public static PressureChangeRate FromPascalsPerMinute(double value) { - double value = (double) pascalsperminute; return new PressureChangeRate(value, PressureChangeRateUnit.PascalPerMinute); } @@ -514,9 +499,8 @@ public static PressureChangeRate FromPascalsPerMinute(QuantityValue pascalspermi /// Creates a from . /// /// If value is NaN or Infinity. - public static PressureChangeRate FromPascalsPerSecond(QuantityValue pascalspersecond) + public static PressureChangeRate FromPascalsPerSecond(double value) { - double value = (double) pascalspersecond; return new PressureChangeRate(value, PressureChangeRateUnit.PascalPerSecond); } @@ -524,9 +508,8 @@ public static PressureChangeRate FromPascalsPerSecond(QuantityValue pascalsperse /// Creates a from . /// /// If value is NaN or Infinity. - public static PressureChangeRate FromPoundsForcePerSquareInchPerMinute(QuantityValue poundsforcepersquareinchperminute) + public static PressureChangeRate FromPoundsForcePerSquareInchPerMinute(double value) { - double value = (double) poundsforcepersquareinchperminute; return new PressureChangeRate(value, PressureChangeRateUnit.PoundForcePerSquareInchPerMinute); } @@ -534,9 +517,8 @@ public static PressureChangeRate FromPoundsForcePerSquareInchPerMinute(QuantityV /// Creates a from . /// /// If value is NaN or Infinity. - public static PressureChangeRate FromPoundsForcePerSquareInchPerSecond(QuantityValue poundsforcepersquareinchpersecond) + public static PressureChangeRate FromPoundsForcePerSquareInchPerSecond(double value) { - double value = (double) poundsforcepersquareinchpersecond; return new PressureChangeRate(value, PressureChangeRateUnit.PoundForcePerSquareInchPerSecond); } @@ -546,9 +528,9 @@ public static PressureChangeRate FromPoundsForcePerSquareInchPerSecond(QuantityV /// Value to convert from. /// Unit to convert from. /// PressureChangeRate unit value. - public static PressureChangeRate From(QuantityValue value, PressureChangeRateUnit fromUnit) + public static PressureChangeRate From(double value, PressureChangeRateUnit fromUnit) { - return new PressureChangeRate((double)value, fromUnit); + return new PressureChangeRate(value, fromUnit); } #endregion @@ -981,15 +963,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is PressureChangeRateUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(PressureChangeRateUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is PressureChangeRateUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(PressureChangeRateUnit)} is supported.", nameof(unit)); @@ -1138,18 +1111,6 @@ public PressureChangeRate ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not PressureChangeRateUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(PressureChangeRateUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/RadiationExposure.g.cs b/UnitsNet/GeneratedCode/Quantities/RadiationExposure.g.cs index f7214c4925..c59e62f5aa 100644 --- a/UnitsNet/GeneratedCode/Quantities/RadiationExposure.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RadiationExposure.g.cs @@ -37,7 +37,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct RadiationExposure : - IArithmeticQuantity, + IArithmeticQuantity, IComparable, IComparable, IConvertible, @@ -154,7 +154,7 @@ public RadiationExposure(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -277,9 +277,8 @@ public static string GetAbbreviation(RadiationExposureUnit unit, IFormatProvider /// Creates a from . /// /// If value is NaN or Infinity. - public static RadiationExposure FromCoulombsPerKilogram(QuantityValue coulombsperkilogram) + public static RadiationExposure FromCoulombsPerKilogram(double value) { - double value = (double) coulombsperkilogram; return new RadiationExposure(value, RadiationExposureUnit.CoulombPerKilogram); } @@ -287,9 +286,8 @@ public static RadiationExposure FromCoulombsPerKilogram(QuantityValue coulombspe /// Creates a from . /// /// If value is NaN or Infinity. - public static RadiationExposure FromMicrocoulombsPerKilogram(QuantityValue microcoulombsperkilogram) + public static RadiationExposure FromMicrocoulombsPerKilogram(double value) { - double value = (double) microcoulombsperkilogram; return new RadiationExposure(value, RadiationExposureUnit.MicrocoulombPerKilogram); } @@ -297,9 +295,8 @@ public static RadiationExposure FromMicrocoulombsPerKilogram(QuantityValue micro /// Creates a from . /// /// If value is NaN or Infinity. - public static RadiationExposure FromMicroroentgens(QuantityValue microroentgens) + public static RadiationExposure FromMicroroentgens(double value) { - double value = (double) microroentgens; return new RadiationExposure(value, RadiationExposureUnit.Microroentgen); } @@ -307,9 +304,8 @@ public static RadiationExposure FromMicroroentgens(QuantityValue microroentgens) /// Creates a from . /// /// If value is NaN or Infinity. - public static RadiationExposure FromMillicoulombsPerKilogram(QuantityValue millicoulombsperkilogram) + public static RadiationExposure FromMillicoulombsPerKilogram(double value) { - double value = (double) millicoulombsperkilogram; return new RadiationExposure(value, RadiationExposureUnit.MillicoulombPerKilogram); } @@ -317,9 +313,8 @@ public static RadiationExposure FromMillicoulombsPerKilogram(QuantityValue milli /// Creates a from . /// /// If value is NaN or Infinity. - public static RadiationExposure FromMilliroentgens(QuantityValue milliroentgens) + public static RadiationExposure FromMilliroentgens(double value) { - double value = (double) milliroentgens; return new RadiationExposure(value, RadiationExposureUnit.Milliroentgen); } @@ -327,9 +322,8 @@ public static RadiationExposure FromMilliroentgens(QuantityValue milliroentgens) /// Creates a from . /// /// If value is NaN or Infinity. - public static RadiationExposure FromNanocoulombsPerKilogram(QuantityValue nanocoulombsperkilogram) + public static RadiationExposure FromNanocoulombsPerKilogram(double value) { - double value = (double) nanocoulombsperkilogram; return new RadiationExposure(value, RadiationExposureUnit.NanocoulombPerKilogram); } @@ -337,9 +331,8 @@ public static RadiationExposure FromNanocoulombsPerKilogram(QuantityValue nanoco /// Creates a from . /// /// If value is NaN or Infinity. - public static RadiationExposure FromPicocoulombsPerKilogram(QuantityValue picocoulombsperkilogram) + public static RadiationExposure FromPicocoulombsPerKilogram(double value) { - double value = (double) picocoulombsperkilogram; return new RadiationExposure(value, RadiationExposureUnit.PicocoulombPerKilogram); } @@ -347,9 +340,8 @@ public static RadiationExposure FromPicocoulombsPerKilogram(QuantityValue picoco /// Creates a from . /// /// If value is NaN or Infinity. - public static RadiationExposure FromRoentgens(QuantityValue roentgens) + public static RadiationExposure FromRoentgens(double value) { - double value = (double) roentgens; return new RadiationExposure(value, RadiationExposureUnit.Roentgen); } @@ -359,9 +351,9 @@ public static RadiationExposure FromRoentgens(QuantityValue roentgens) /// Value to convert from. /// Unit to convert from. /// RadiationExposure unit value. - public static RadiationExposure From(QuantityValue value, RadiationExposureUnit fromUnit) + public static RadiationExposure From(double value, RadiationExposureUnit fromUnit) { - return new RadiationExposure((double)value, fromUnit); + return new RadiationExposure(value, fromUnit); } #endregion @@ -772,15 +764,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is RadiationExposureUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(RadiationExposureUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is RadiationExposureUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(RadiationExposureUnit)} is supported.", nameof(unit)); @@ -909,18 +892,6 @@ public RadiationExposure ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not RadiationExposureUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(RadiationExposureUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/Radioactivity.g.cs b/UnitsNet/GeneratedCode/Quantities/Radioactivity.g.cs index 215280f504..3352e42374 100644 --- a/UnitsNet/GeneratedCode/Quantities/Radioactivity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Radioactivity.g.cs @@ -37,7 +37,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct Radioactivity : - IArithmeticQuantity, + IArithmeticQuantity, IComparable, IComparable, IConvertible, @@ -175,7 +175,7 @@ public Radioactivity(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -445,9 +445,8 @@ public static string GetAbbreviation(RadioactivityUnit unit, IFormatProvider? pr /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromBecquerels(QuantityValue becquerels) + public static Radioactivity FromBecquerels(double value) { - double value = (double) becquerels; return new Radioactivity(value, RadioactivityUnit.Becquerel); } @@ -455,9 +454,8 @@ public static Radioactivity FromBecquerels(QuantityValue becquerels) /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromCuries(QuantityValue curies) + public static Radioactivity FromCuries(double value) { - double value = (double) curies; return new Radioactivity(value, RadioactivityUnit.Curie); } @@ -465,9 +463,8 @@ public static Radioactivity FromCuries(QuantityValue curies) /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromExabecquerels(QuantityValue exabecquerels) + public static Radioactivity FromExabecquerels(double value) { - double value = (double) exabecquerels; return new Radioactivity(value, RadioactivityUnit.Exabecquerel); } @@ -475,9 +472,8 @@ public static Radioactivity FromExabecquerels(QuantityValue exabecquerels) /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromGigabecquerels(QuantityValue gigabecquerels) + public static Radioactivity FromGigabecquerels(double value) { - double value = (double) gigabecquerels; return new Radioactivity(value, RadioactivityUnit.Gigabecquerel); } @@ -485,9 +481,8 @@ public static Radioactivity FromGigabecquerels(QuantityValue gigabecquerels) /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromGigacuries(QuantityValue gigacuries) + public static Radioactivity FromGigacuries(double value) { - double value = (double) gigacuries; return new Radioactivity(value, RadioactivityUnit.Gigacurie); } @@ -495,9 +490,8 @@ public static Radioactivity FromGigacuries(QuantityValue gigacuries) /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromGigarutherfords(QuantityValue gigarutherfords) + public static Radioactivity FromGigarutherfords(double value) { - double value = (double) gigarutherfords; return new Radioactivity(value, RadioactivityUnit.Gigarutherford); } @@ -505,9 +499,8 @@ public static Radioactivity FromGigarutherfords(QuantityValue gigarutherfords) /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromKilobecquerels(QuantityValue kilobecquerels) + public static Radioactivity FromKilobecquerels(double value) { - double value = (double) kilobecquerels; return new Radioactivity(value, RadioactivityUnit.Kilobecquerel); } @@ -515,9 +508,8 @@ public static Radioactivity FromKilobecquerels(QuantityValue kilobecquerels) /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromKilocuries(QuantityValue kilocuries) + public static Radioactivity FromKilocuries(double value) { - double value = (double) kilocuries; return new Radioactivity(value, RadioactivityUnit.Kilocurie); } @@ -525,9 +517,8 @@ public static Radioactivity FromKilocuries(QuantityValue kilocuries) /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromKilorutherfords(QuantityValue kilorutherfords) + public static Radioactivity FromKilorutherfords(double value) { - double value = (double) kilorutherfords; return new Radioactivity(value, RadioactivityUnit.Kilorutherford); } @@ -535,9 +526,8 @@ public static Radioactivity FromKilorutherfords(QuantityValue kilorutherfords) /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromMegabecquerels(QuantityValue megabecquerels) + public static Radioactivity FromMegabecquerels(double value) { - double value = (double) megabecquerels; return new Radioactivity(value, RadioactivityUnit.Megabecquerel); } @@ -545,9 +535,8 @@ public static Radioactivity FromMegabecquerels(QuantityValue megabecquerels) /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromMegacuries(QuantityValue megacuries) + public static Radioactivity FromMegacuries(double value) { - double value = (double) megacuries; return new Radioactivity(value, RadioactivityUnit.Megacurie); } @@ -555,9 +544,8 @@ public static Radioactivity FromMegacuries(QuantityValue megacuries) /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromMegarutherfords(QuantityValue megarutherfords) + public static Radioactivity FromMegarutherfords(double value) { - double value = (double) megarutherfords; return new Radioactivity(value, RadioactivityUnit.Megarutherford); } @@ -565,9 +553,8 @@ public static Radioactivity FromMegarutherfords(QuantityValue megarutherfords) /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromMicrobecquerels(QuantityValue microbecquerels) + public static Radioactivity FromMicrobecquerels(double value) { - double value = (double) microbecquerels; return new Radioactivity(value, RadioactivityUnit.Microbecquerel); } @@ -575,9 +562,8 @@ public static Radioactivity FromMicrobecquerels(QuantityValue microbecquerels) /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromMicrocuries(QuantityValue microcuries) + public static Radioactivity FromMicrocuries(double value) { - double value = (double) microcuries; return new Radioactivity(value, RadioactivityUnit.Microcurie); } @@ -585,9 +571,8 @@ public static Radioactivity FromMicrocuries(QuantityValue microcuries) /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromMicrorutherfords(QuantityValue microrutherfords) + public static Radioactivity FromMicrorutherfords(double value) { - double value = (double) microrutherfords; return new Radioactivity(value, RadioactivityUnit.Microrutherford); } @@ -595,9 +580,8 @@ public static Radioactivity FromMicrorutherfords(QuantityValue microrutherfords) /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromMillibecquerels(QuantityValue millibecquerels) + public static Radioactivity FromMillibecquerels(double value) { - double value = (double) millibecquerels; return new Radioactivity(value, RadioactivityUnit.Millibecquerel); } @@ -605,9 +589,8 @@ public static Radioactivity FromMillibecquerels(QuantityValue millibecquerels) /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromMillicuries(QuantityValue millicuries) + public static Radioactivity FromMillicuries(double value) { - double value = (double) millicuries; return new Radioactivity(value, RadioactivityUnit.Millicurie); } @@ -615,9 +598,8 @@ public static Radioactivity FromMillicuries(QuantityValue millicuries) /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromMillirutherfords(QuantityValue millirutherfords) + public static Radioactivity FromMillirutherfords(double value) { - double value = (double) millirutherfords; return new Radioactivity(value, RadioactivityUnit.Millirutherford); } @@ -625,9 +607,8 @@ public static Radioactivity FromMillirutherfords(QuantityValue millirutherfords) /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromNanobecquerels(QuantityValue nanobecquerels) + public static Radioactivity FromNanobecquerels(double value) { - double value = (double) nanobecquerels; return new Radioactivity(value, RadioactivityUnit.Nanobecquerel); } @@ -635,9 +616,8 @@ public static Radioactivity FromNanobecquerels(QuantityValue nanobecquerels) /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromNanocuries(QuantityValue nanocuries) + public static Radioactivity FromNanocuries(double value) { - double value = (double) nanocuries; return new Radioactivity(value, RadioactivityUnit.Nanocurie); } @@ -645,9 +625,8 @@ public static Radioactivity FromNanocuries(QuantityValue nanocuries) /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromNanorutherfords(QuantityValue nanorutherfords) + public static Radioactivity FromNanorutherfords(double value) { - double value = (double) nanorutherfords; return new Radioactivity(value, RadioactivityUnit.Nanorutherford); } @@ -655,9 +634,8 @@ public static Radioactivity FromNanorutherfords(QuantityValue nanorutherfords) /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromPetabecquerels(QuantityValue petabecquerels) + public static Radioactivity FromPetabecquerels(double value) { - double value = (double) petabecquerels; return new Radioactivity(value, RadioactivityUnit.Petabecquerel); } @@ -665,9 +643,8 @@ public static Radioactivity FromPetabecquerels(QuantityValue petabecquerels) /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromPicobecquerels(QuantityValue picobecquerels) + public static Radioactivity FromPicobecquerels(double value) { - double value = (double) picobecquerels; return new Radioactivity(value, RadioactivityUnit.Picobecquerel); } @@ -675,9 +652,8 @@ public static Radioactivity FromPicobecquerels(QuantityValue picobecquerels) /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromPicocuries(QuantityValue picocuries) + public static Radioactivity FromPicocuries(double value) { - double value = (double) picocuries; return new Radioactivity(value, RadioactivityUnit.Picocurie); } @@ -685,9 +661,8 @@ public static Radioactivity FromPicocuries(QuantityValue picocuries) /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromPicorutherfords(QuantityValue picorutherfords) + public static Radioactivity FromPicorutherfords(double value) { - double value = (double) picorutherfords; return new Radioactivity(value, RadioactivityUnit.Picorutherford); } @@ -695,9 +670,8 @@ public static Radioactivity FromPicorutherfords(QuantityValue picorutherfords) /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromRutherfords(QuantityValue rutherfords) + public static Radioactivity FromRutherfords(double value) { - double value = (double) rutherfords; return new Radioactivity(value, RadioactivityUnit.Rutherford); } @@ -705,9 +679,8 @@ public static Radioactivity FromRutherfords(QuantityValue rutherfords) /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromTerabecquerels(QuantityValue terabecquerels) + public static Radioactivity FromTerabecquerels(double value) { - double value = (double) terabecquerels; return new Radioactivity(value, RadioactivityUnit.Terabecquerel); } @@ -715,9 +688,8 @@ public static Radioactivity FromTerabecquerels(QuantityValue terabecquerels) /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromTeracuries(QuantityValue teracuries) + public static Radioactivity FromTeracuries(double value) { - double value = (double) teracuries; return new Radioactivity(value, RadioactivityUnit.Teracurie); } @@ -725,9 +697,8 @@ public static Radioactivity FromTeracuries(QuantityValue teracuries) /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromTerarutherfords(QuantityValue terarutherfords) + public static Radioactivity FromTerarutherfords(double value) { - double value = (double) terarutherfords; return new Radioactivity(value, RadioactivityUnit.Terarutherford); } @@ -737,9 +708,9 @@ public static Radioactivity FromTerarutherfords(QuantityValue terarutherfords) /// Value to convert from. /// Unit to convert from. /// Radioactivity unit value. - public static Radioactivity From(QuantityValue value, RadioactivityUnit fromUnit) + public static Radioactivity From(double value, RadioactivityUnit fromUnit) { - return new Radioactivity((double)value, fromUnit); + return new Radioactivity(value, fromUnit); } #endregion @@ -1150,15 +1121,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is RadioactivityUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(RadioactivityUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is RadioactivityUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(RadioactivityUnit)} is supported.", nameof(unit)); @@ -1329,18 +1291,6 @@ public Radioactivity ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not RadioactivityUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(RadioactivityUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/Ratio.g.cs b/UnitsNet/GeneratedCode/Quantities/Ratio.g.cs index d2e473b6f0..1fb6bbbbcf 100644 --- a/UnitsNet/GeneratedCode/Quantities/Ratio.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Ratio.g.cs @@ -37,7 +37,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct Ratio : - IArithmeticQuantity, + IArithmeticQuantity, IComparable, IComparable, IConvertible, @@ -152,7 +152,7 @@ public Ratio(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -261,9 +261,8 @@ public static string GetAbbreviation(RatioUnit unit, IFormatProvider? provider) /// Creates a from . /// /// If value is NaN or Infinity. - public static Ratio FromDecimalFractions(QuantityValue decimalfractions) + public static Ratio FromDecimalFractions(double value) { - double value = (double) decimalfractions; return new Ratio(value, RatioUnit.DecimalFraction); } @@ -271,9 +270,8 @@ public static Ratio FromDecimalFractions(QuantityValue decimalfractions) /// Creates a from . /// /// If value is NaN or Infinity. - public static Ratio FromPartsPerBillion(QuantityValue partsperbillion) + public static Ratio FromPartsPerBillion(double value) { - double value = (double) partsperbillion; return new Ratio(value, RatioUnit.PartPerBillion); } @@ -281,9 +279,8 @@ public static Ratio FromPartsPerBillion(QuantityValue partsperbillion) /// Creates a from . /// /// If value is NaN or Infinity. - public static Ratio FromPartsPerMillion(QuantityValue partspermillion) + public static Ratio FromPartsPerMillion(double value) { - double value = (double) partspermillion; return new Ratio(value, RatioUnit.PartPerMillion); } @@ -291,9 +288,8 @@ public static Ratio FromPartsPerMillion(QuantityValue partspermillion) /// Creates a from . /// /// If value is NaN or Infinity. - public static Ratio FromPartsPerThousand(QuantityValue partsperthousand) + public static Ratio FromPartsPerThousand(double value) { - double value = (double) partsperthousand; return new Ratio(value, RatioUnit.PartPerThousand); } @@ -301,9 +297,8 @@ public static Ratio FromPartsPerThousand(QuantityValue partsperthousand) /// Creates a from . /// /// If value is NaN or Infinity. - public static Ratio FromPartsPerTrillion(QuantityValue partspertrillion) + public static Ratio FromPartsPerTrillion(double value) { - double value = (double) partspertrillion; return new Ratio(value, RatioUnit.PartPerTrillion); } @@ -311,9 +306,8 @@ public static Ratio FromPartsPerTrillion(QuantityValue partspertrillion) /// Creates a from . /// /// If value is NaN or Infinity. - public static Ratio FromPercent(QuantityValue percent) + public static Ratio FromPercent(double value) { - double value = (double) percent; return new Ratio(value, RatioUnit.Percent); } @@ -323,9 +317,9 @@ public static Ratio FromPercent(QuantityValue percent) /// Value to convert from. /// Unit to convert from. /// Ratio unit value. - public static Ratio From(QuantityValue value, RatioUnit fromUnit) + public static Ratio From(double value, RatioUnit fromUnit) { - return new Ratio((double)value, fromUnit); + return new Ratio(value, fromUnit); } #endregion @@ -736,15 +730,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is RatioUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(RatioUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is RatioUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(RatioUnit)} is supported.", nameof(unit)); @@ -869,18 +854,6 @@ public Ratio ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not RatioUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(RatioUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/RatioChangeRate.g.cs b/UnitsNet/GeneratedCode/Quantities/RatioChangeRate.g.cs index fff23fbc87..260c07aaa3 100644 --- a/UnitsNet/GeneratedCode/Quantities/RatioChangeRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RatioChangeRate.g.cs @@ -37,7 +37,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct RatioChangeRate : - IArithmeticQuantity, + IArithmeticQuantity, IComparable, IComparable, IConvertible, @@ -148,7 +148,7 @@ public RatioChangeRate(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -229,9 +229,8 @@ public static string GetAbbreviation(RatioChangeRateUnit unit, IFormatProvider? /// Creates a from . /// /// If value is NaN or Infinity. - public static RatioChangeRate FromDecimalFractionsPerSecond(QuantityValue decimalfractionspersecond) + public static RatioChangeRate FromDecimalFractionsPerSecond(double value) { - double value = (double) decimalfractionspersecond; return new RatioChangeRate(value, RatioChangeRateUnit.DecimalFractionPerSecond); } @@ -239,9 +238,8 @@ public static RatioChangeRate FromDecimalFractionsPerSecond(QuantityValue decima /// Creates a from . /// /// If value is NaN or Infinity. - public static RatioChangeRate FromPercentsPerSecond(QuantityValue percentspersecond) + public static RatioChangeRate FromPercentsPerSecond(double value) { - double value = (double) percentspersecond; return new RatioChangeRate(value, RatioChangeRateUnit.PercentPerSecond); } @@ -251,9 +249,9 @@ public static RatioChangeRate FromPercentsPerSecond(QuantityValue percentspersec /// Value to convert from. /// Unit to convert from. /// RatioChangeRate unit value. - public static RatioChangeRate From(QuantityValue value, RatioChangeRateUnit fromUnit) + public static RatioChangeRate From(double value, RatioChangeRateUnit fromUnit) { - return new RatioChangeRate((double)value, fromUnit); + return new RatioChangeRate(value, fromUnit); } #endregion @@ -664,15 +662,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is RatioChangeRateUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(RatioChangeRateUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is RatioChangeRateUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(RatioChangeRateUnit)} is supported.", nameof(unit)); @@ -789,18 +778,6 @@ public RatioChangeRate ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not RatioChangeRateUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(RatioChangeRateUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.g.cs b/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.g.cs index 7078170d8f..4bd7c1f568 100644 --- a/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.g.cs @@ -37,7 +37,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct ReactiveEnergy : - IArithmeticQuantity, + IArithmeticQuantity, IComparable, IComparable, IConvertible, @@ -149,7 +149,7 @@ public ReactiveEnergy(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -237,9 +237,8 @@ public static string GetAbbreviation(ReactiveEnergyUnit unit, IFormatProvider? p /// Creates a from . /// /// If value is NaN or Infinity. - public static ReactiveEnergy FromKilovoltampereReactiveHours(QuantityValue kilovoltamperereactivehours) + public static ReactiveEnergy FromKilovoltampereReactiveHours(double value) { - double value = (double) kilovoltamperereactivehours; return new ReactiveEnergy(value, ReactiveEnergyUnit.KilovoltampereReactiveHour); } @@ -247,9 +246,8 @@ public static ReactiveEnergy FromKilovoltampereReactiveHours(QuantityValue kilov /// Creates a from . /// /// If value is NaN or Infinity. - public static ReactiveEnergy FromMegavoltampereReactiveHours(QuantityValue megavoltamperereactivehours) + public static ReactiveEnergy FromMegavoltampereReactiveHours(double value) { - double value = (double) megavoltamperereactivehours; return new ReactiveEnergy(value, ReactiveEnergyUnit.MegavoltampereReactiveHour); } @@ -257,9 +255,8 @@ public static ReactiveEnergy FromMegavoltampereReactiveHours(QuantityValue megav /// Creates a from . /// /// If value is NaN or Infinity. - public static ReactiveEnergy FromVoltampereReactiveHours(QuantityValue voltamperereactivehours) + public static ReactiveEnergy FromVoltampereReactiveHours(double value) { - double value = (double) voltamperereactivehours; return new ReactiveEnergy(value, ReactiveEnergyUnit.VoltampereReactiveHour); } @@ -269,9 +266,9 @@ public static ReactiveEnergy FromVoltampereReactiveHours(QuantityValue voltamper /// Value to convert from. /// Unit to convert from. /// ReactiveEnergy unit value. - public static ReactiveEnergy From(QuantityValue value, ReactiveEnergyUnit fromUnit) + public static ReactiveEnergy From(double value, ReactiveEnergyUnit fromUnit) { - return new ReactiveEnergy((double)value, fromUnit); + return new ReactiveEnergy(value, fromUnit); } #endregion @@ -682,15 +679,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is ReactiveEnergyUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ReactiveEnergyUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is ReactiveEnergyUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ReactiveEnergyUnit)} is supported.", nameof(unit)); @@ -809,18 +797,6 @@ public ReactiveEnergy ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not ReactiveEnergyUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ReactiveEnergyUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/ReactivePower.g.cs b/UnitsNet/GeneratedCode/Quantities/ReactivePower.g.cs index eb13dc9ce0..d17a467580 100644 --- a/UnitsNet/GeneratedCode/Quantities/ReactivePower.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ReactivePower.g.cs @@ -37,7 +37,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct ReactivePower : - IArithmeticQuantity, + IArithmeticQuantity, IComparable, IComparable, IConvertible, @@ -150,7 +150,7 @@ public ReactivePower(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -245,9 +245,8 @@ public static string GetAbbreviation(ReactivePowerUnit unit, IFormatProvider? pr /// Creates a from . /// /// If value is NaN or Infinity. - public static ReactivePower FromGigavoltamperesReactive(QuantityValue gigavoltamperesreactive) + public static ReactivePower FromGigavoltamperesReactive(double value) { - double value = (double) gigavoltamperesreactive; return new ReactivePower(value, ReactivePowerUnit.GigavoltampereReactive); } @@ -255,9 +254,8 @@ public static ReactivePower FromGigavoltamperesReactive(QuantityValue gigavoltam /// Creates a from . /// /// If value is NaN or Infinity. - public static ReactivePower FromKilovoltamperesReactive(QuantityValue kilovoltamperesreactive) + public static ReactivePower FromKilovoltamperesReactive(double value) { - double value = (double) kilovoltamperesreactive; return new ReactivePower(value, ReactivePowerUnit.KilovoltampereReactive); } @@ -265,9 +263,8 @@ public static ReactivePower FromKilovoltamperesReactive(QuantityValue kilovoltam /// Creates a from . /// /// If value is NaN or Infinity. - public static ReactivePower FromMegavoltamperesReactive(QuantityValue megavoltamperesreactive) + public static ReactivePower FromMegavoltamperesReactive(double value) { - double value = (double) megavoltamperesreactive; return new ReactivePower(value, ReactivePowerUnit.MegavoltampereReactive); } @@ -275,9 +272,8 @@ public static ReactivePower FromMegavoltamperesReactive(QuantityValue megavoltam /// Creates a from . /// /// If value is NaN or Infinity. - public static ReactivePower FromVoltamperesReactive(QuantityValue voltamperesreactive) + public static ReactivePower FromVoltamperesReactive(double value) { - double value = (double) voltamperesreactive; return new ReactivePower(value, ReactivePowerUnit.VoltampereReactive); } @@ -287,9 +283,9 @@ public static ReactivePower FromVoltamperesReactive(QuantityValue voltamperesrea /// Value to convert from. /// Unit to convert from. /// ReactivePower unit value. - public static ReactivePower From(QuantityValue value, ReactivePowerUnit fromUnit) + public static ReactivePower From(double value, ReactivePowerUnit fromUnit) { - return new ReactivePower((double)value, fromUnit); + return new ReactivePower(value, fromUnit); } #endregion @@ -700,15 +696,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is ReactivePowerUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ReactivePowerUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is ReactivePowerUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ReactivePowerUnit)} is supported.", nameof(unit)); @@ -829,18 +816,6 @@ public ReactivePower ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not ReactivePowerUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ReactivePowerUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/ReciprocalArea.g.cs b/UnitsNet/GeneratedCode/Quantities/ReciprocalArea.g.cs index 33af7f257e..f199c851f3 100644 --- a/UnitsNet/GeneratedCode/Quantities/ReciprocalArea.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ReciprocalArea.g.cs @@ -43,7 +43,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct ReciprocalArea : - IArithmeticQuantity, + IArithmeticQuantity, #if NET7_0_OR_GREATER IMultiplyOperators, IMultiplyOperators, @@ -168,7 +168,7 @@ public ReciprocalArea(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -312,9 +312,8 @@ public static string GetAbbreviation(ReciprocalAreaUnit unit, IFormatProvider? p /// Creates a from . /// /// If value is NaN or Infinity. - public static ReciprocalArea FromInverseSquareCentimeters(QuantityValue inversesquarecentimeters) + public static ReciprocalArea FromInverseSquareCentimeters(double value) { - double value = (double) inversesquarecentimeters; return new ReciprocalArea(value, ReciprocalAreaUnit.InverseSquareCentimeter); } @@ -322,9 +321,8 @@ public static ReciprocalArea FromInverseSquareCentimeters(QuantityValue inverses /// Creates a from . /// /// If value is NaN or Infinity. - public static ReciprocalArea FromInverseSquareDecimeters(QuantityValue inversesquaredecimeters) + public static ReciprocalArea FromInverseSquareDecimeters(double value) { - double value = (double) inversesquaredecimeters; return new ReciprocalArea(value, ReciprocalAreaUnit.InverseSquareDecimeter); } @@ -332,9 +330,8 @@ public static ReciprocalArea FromInverseSquareDecimeters(QuantityValue inversesq /// Creates a from . /// /// If value is NaN or Infinity. - public static ReciprocalArea FromInverseSquareFeet(QuantityValue inversesquarefeet) + public static ReciprocalArea FromInverseSquareFeet(double value) { - double value = (double) inversesquarefeet; return new ReciprocalArea(value, ReciprocalAreaUnit.InverseSquareFoot); } @@ -342,9 +339,8 @@ public static ReciprocalArea FromInverseSquareFeet(QuantityValue inversesquarefe /// Creates a from . /// /// If value is NaN or Infinity. - public static ReciprocalArea FromInverseSquareInches(QuantityValue inversesquareinches) + public static ReciprocalArea FromInverseSquareInches(double value) { - double value = (double) inversesquareinches; return new ReciprocalArea(value, ReciprocalAreaUnit.InverseSquareInch); } @@ -352,9 +348,8 @@ public static ReciprocalArea FromInverseSquareInches(QuantityValue inversesquare /// Creates a from . /// /// If value is NaN or Infinity. - public static ReciprocalArea FromInverseSquareKilometers(QuantityValue inversesquarekilometers) + public static ReciprocalArea FromInverseSquareKilometers(double value) { - double value = (double) inversesquarekilometers; return new ReciprocalArea(value, ReciprocalAreaUnit.InverseSquareKilometer); } @@ -362,9 +357,8 @@ public static ReciprocalArea FromInverseSquareKilometers(QuantityValue inversesq /// Creates a from . /// /// If value is NaN or Infinity. - public static ReciprocalArea FromInverseSquareMeters(QuantityValue inversesquaremeters) + public static ReciprocalArea FromInverseSquareMeters(double value) { - double value = (double) inversesquaremeters; return new ReciprocalArea(value, ReciprocalAreaUnit.InverseSquareMeter); } @@ -372,9 +366,8 @@ public static ReciprocalArea FromInverseSquareMeters(QuantityValue inversesquare /// Creates a from . /// /// If value is NaN or Infinity. - public static ReciprocalArea FromInverseSquareMicrometers(QuantityValue inversesquaremicrometers) + public static ReciprocalArea FromInverseSquareMicrometers(double value) { - double value = (double) inversesquaremicrometers; return new ReciprocalArea(value, ReciprocalAreaUnit.InverseSquareMicrometer); } @@ -382,9 +375,8 @@ public static ReciprocalArea FromInverseSquareMicrometers(QuantityValue inverses /// Creates a from . /// /// If value is NaN or Infinity. - public static ReciprocalArea FromInverseSquareMiles(QuantityValue inversesquaremiles) + public static ReciprocalArea FromInverseSquareMiles(double value) { - double value = (double) inversesquaremiles; return new ReciprocalArea(value, ReciprocalAreaUnit.InverseSquareMile); } @@ -392,9 +384,8 @@ public static ReciprocalArea FromInverseSquareMiles(QuantityValue inversesquarem /// Creates a from . /// /// If value is NaN or Infinity. - public static ReciprocalArea FromInverseSquareMillimeters(QuantityValue inversesquaremillimeters) + public static ReciprocalArea FromInverseSquareMillimeters(double value) { - double value = (double) inversesquaremillimeters; return new ReciprocalArea(value, ReciprocalAreaUnit.InverseSquareMillimeter); } @@ -402,9 +393,8 @@ public static ReciprocalArea FromInverseSquareMillimeters(QuantityValue inverses /// Creates a from . /// /// If value is NaN or Infinity. - public static ReciprocalArea FromInverseSquareYards(QuantityValue inversesquareyards) + public static ReciprocalArea FromInverseSquareYards(double value) { - double value = (double) inversesquareyards; return new ReciprocalArea(value, ReciprocalAreaUnit.InverseSquareYard); } @@ -412,9 +402,8 @@ public static ReciprocalArea FromInverseSquareYards(QuantityValue inversesquarey /// Creates a from . /// /// If value is NaN or Infinity. - public static ReciprocalArea FromInverseUsSurveySquareFeet(QuantityValue inverseussurveysquarefeet) + public static ReciprocalArea FromInverseUsSurveySquareFeet(double value) { - double value = (double) inverseussurveysquarefeet; return new ReciprocalArea(value, ReciprocalAreaUnit.InverseUsSurveySquareFoot); } @@ -424,9 +413,9 @@ public static ReciprocalArea FromInverseUsSurveySquareFeet(QuantityValue inverse /// Value to convert from. /// Unit to convert from. /// ReciprocalArea unit value. - public static ReciprocalArea From(QuantityValue value, ReciprocalAreaUnit fromUnit) + public static ReciprocalArea From(double value, ReciprocalAreaUnit fromUnit) { - return new ReciprocalArea((double)value, fromUnit); + return new ReciprocalArea(value, fromUnit); } #endregion @@ -866,15 +855,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is ReciprocalAreaUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ReciprocalAreaUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is ReciprocalAreaUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ReciprocalAreaUnit)} is supported.", nameof(unit)); @@ -1009,18 +989,6 @@ public ReciprocalArea ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not ReciprocalAreaUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ReciprocalAreaUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/ReciprocalLength.g.cs b/UnitsNet/GeneratedCode/Quantities/ReciprocalLength.g.cs index e7e14092e9..cd0c508f5c 100644 --- a/UnitsNet/GeneratedCode/Quantities/ReciprocalLength.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ReciprocalLength.g.cs @@ -43,7 +43,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct ReciprocalLength : - IArithmeticQuantity, + IArithmeticQuantity, #if NET7_0_OR_GREATER IMultiplyOperators, IDivisionOperators, @@ -168,7 +168,7 @@ public ReciprocalLength(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -305,9 +305,8 @@ public static string GetAbbreviation(ReciprocalLengthUnit unit, IFormatProvider? /// Creates a from . /// /// If value is NaN or Infinity. - public static ReciprocalLength FromInverseCentimeters(QuantityValue inversecentimeters) + public static ReciprocalLength FromInverseCentimeters(double value) { - double value = (double) inversecentimeters; return new ReciprocalLength(value, ReciprocalLengthUnit.InverseCentimeter); } @@ -315,9 +314,8 @@ public static ReciprocalLength FromInverseCentimeters(QuantityValue inversecenti /// Creates a from . /// /// If value is NaN or Infinity. - public static ReciprocalLength FromInverseFeet(QuantityValue inversefeet) + public static ReciprocalLength FromInverseFeet(double value) { - double value = (double) inversefeet; return new ReciprocalLength(value, ReciprocalLengthUnit.InverseFoot); } @@ -325,9 +323,8 @@ public static ReciprocalLength FromInverseFeet(QuantityValue inversefeet) /// Creates a from . /// /// If value is NaN or Infinity. - public static ReciprocalLength FromInverseInches(QuantityValue inverseinches) + public static ReciprocalLength FromInverseInches(double value) { - double value = (double) inverseinches; return new ReciprocalLength(value, ReciprocalLengthUnit.InverseInch); } @@ -335,9 +332,8 @@ public static ReciprocalLength FromInverseInches(QuantityValue inverseinches) /// Creates a from . /// /// If value is NaN or Infinity. - public static ReciprocalLength FromInverseMeters(QuantityValue inversemeters) + public static ReciprocalLength FromInverseMeters(double value) { - double value = (double) inversemeters; return new ReciprocalLength(value, ReciprocalLengthUnit.InverseMeter); } @@ -345,9 +341,8 @@ public static ReciprocalLength FromInverseMeters(QuantityValue inversemeters) /// Creates a from . /// /// If value is NaN or Infinity. - public static ReciprocalLength FromInverseMicroinches(QuantityValue inversemicroinches) + public static ReciprocalLength FromInverseMicroinches(double value) { - double value = (double) inversemicroinches; return new ReciprocalLength(value, ReciprocalLengthUnit.InverseMicroinch); } @@ -355,9 +350,8 @@ public static ReciprocalLength FromInverseMicroinches(QuantityValue inversemicro /// Creates a from . /// /// If value is NaN or Infinity. - public static ReciprocalLength FromInverseMils(QuantityValue inversemils) + public static ReciprocalLength FromInverseMils(double value) { - double value = (double) inversemils; return new ReciprocalLength(value, ReciprocalLengthUnit.InverseMil); } @@ -365,9 +359,8 @@ public static ReciprocalLength FromInverseMils(QuantityValue inversemils) /// Creates a from . /// /// If value is NaN or Infinity. - public static ReciprocalLength FromInverseMiles(QuantityValue inversemiles) + public static ReciprocalLength FromInverseMiles(double value) { - double value = (double) inversemiles; return new ReciprocalLength(value, ReciprocalLengthUnit.InverseMile); } @@ -375,9 +368,8 @@ public static ReciprocalLength FromInverseMiles(QuantityValue inversemiles) /// Creates a from . /// /// If value is NaN or Infinity. - public static ReciprocalLength FromInverseMillimeters(QuantityValue inversemillimeters) + public static ReciprocalLength FromInverseMillimeters(double value) { - double value = (double) inversemillimeters; return new ReciprocalLength(value, ReciprocalLengthUnit.InverseMillimeter); } @@ -385,9 +377,8 @@ public static ReciprocalLength FromInverseMillimeters(QuantityValue inversemilli /// Creates a from . /// /// If value is NaN or Infinity. - public static ReciprocalLength FromInverseUsSurveyFeet(QuantityValue inverseussurveyfeet) + public static ReciprocalLength FromInverseUsSurveyFeet(double value) { - double value = (double) inverseussurveyfeet; return new ReciprocalLength(value, ReciprocalLengthUnit.InverseUsSurveyFoot); } @@ -395,9 +386,8 @@ public static ReciprocalLength FromInverseUsSurveyFeet(QuantityValue inverseussu /// Creates a from . /// /// If value is NaN or Infinity. - public static ReciprocalLength FromInverseYards(QuantityValue inverseyards) + public static ReciprocalLength FromInverseYards(double value) { - double value = (double) inverseyards; return new ReciprocalLength(value, ReciprocalLengthUnit.InverseYard); } @@ -407,9 +397,9 @@ public static ReciprocalLength FromInverseYards(QuantityValue inverseyards) /// Value to convert from. /// Unit to convert from. /// ReciprocalLength unit value. - public static ReciprocalLength From(QuantityValue value, ReciprocalLengthUnit fromUnit) + public static ReciprocalLength From(double value, ReciprocalLengthUnit fromUnit) { - return new ReciprocalLength((double)value, fromUnit); + return new ReciprocalLength(value, fromUnit); } #endregion @@ -855,15 +845,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is ReciprocalLengthUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ReciprocalLengthUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is ReciprocalLengthUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ReciprocalLengthUnit)} is supported.", nameof(unit)); @@ -996,18 +977,6 @@ public ReciprocalLength ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not ReciprocalLengthUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ReciprocalLengthUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/RelativeHumidity.g.cs b/UnitsNet/GeneratedCode/Quantities/RelativeHumidity.g.cs index e40d9a2225..fed47ea88e 100644 --- a/UnitsNet/GeneratedCode/Quantities/RelativeHumidity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RelativeHumidity.g.cs @@ -37,7 +37,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct RelativeHumidity : - IArithmeticQuantity, + IArithmeticQuantity, IComparable, IComparable, IConvertible, @@ -147,7 +147,7 @@ public RelativeHumidity(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -221,9 +221,8 @@ public static string GetAbbreviation(RelativeHumidityUnit unit, IFormatProvider? /// Creates a from . /// /// If value is NaN or Infinity. - public static RelativeHumidity FromPercent(QuantityValue percent) + public static RelativeHumidity FromPercent(double value) { - double value = (double) percent; return new RelativeHumidity(value, RelativeHumidityUnit.Percent); } @@ -233,9 +232,9 @@ public static RelativeHumidity FromPercent(QuantityValue percent) /// Value to convert from. /// Unit to convert from. /// RelativeHumidity unit value. - public static RelativeHumidity From(QuantityValue value, RelativeHumidityUnit fromUnit) + public static RelativeHumidity From(double value, RelativeHumidityUnit fromUnit) { - return new RelativeHumidity((double)value, fromUnit); + return new RelativeHumidity(value, fromUnit); } #endregion @@ -646,15 +645,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is RelativeHumidityUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(RelativeHumidityUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is RelativeHumidityUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(RelativeHumidityUnit)} is supported.", nameof(unit)); @@ -769,18 +759,6 @@ public RelativeHumidity ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not RelativeHumidityUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(RelativeHumidityUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.g.cs index 69d92b62ea..0e8da007b2 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.g.cs @@ -37,7 +37,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct RotationalAcceleration : - IArithmeticQuantity, + IArithmeticQuantity, IComparable, IComparable, IConvertible, @@ -150,7 +150,7 @@ public RotationalAcceleration(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -245,9 +245,8 @@ public static string GetAbbreviation(RotationalAccelerationUnit unit, IFormatPro /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalAcceleration FromDegreesPerSecondSquared(QuantityValue degreespersecondsquared) + public static RotationalAcceleration FromDegreesPerSecondSquared(double value) { - double value = (double) degreespersecondsquared; return new RotationalAcceleration(value, RotationalAccelerationUnit.DegreePerSecondSquared); } @@ -255,9 +254,8 @@ public static RotationalAcceleration FromDegreesPerSecondSquared(QuantityValue d /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalAcceleration FromRadiansPerSecondSquared(QuantityValue radianspersecondsquared) + public static RotationalAcceleration FromRadiansPerSecondSquared(double value) { - double value = (double) radianspersecondsquared; return new RotationalAcceleration(value, RotationalAccelerationUnit.RadianPerSecondSquared); } @@ -265,9 +263,8 @@ public static RotationalAcceleration FromRadiansPerSecondSquared(QuantityValue r /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalAcceleration FromRevolutionsPerMinutePerSecond(QuantityValue revolutionsperminutepersecond) + public static RotationalAcceleration FromRevolutionsPerMinutePerSecond(double value) { - double value = (double) revolutionsperminutepersecond; return new RotationalAcceleration(value, RotationalAccelerationUnit.RevolutionPerMinutePerSecond); } @@ -275,9 +272,8 @@ public static RotationalAcceleration FromRevolutionsPerMinutePerSecond(QuantityV /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalAcceleration FromRevolutionsPerSecondSquared(QuantityValue revolutionspersecondsquared) + public static RotationalAcceleration FromRevolutionsPerSecondSquared(double value) { - double value = (double) revolutionspersecondsquared; return new RotationalAcceleration(value, RotationalAccelerationUnit.RevolutionPerSecondSquared); } @@ -287,9 +283,9 @@ public static RotationalAcceleration FromRevolutionsPerSecondSquared(QuantityVal /// Value to convert from. /// Unit to convert from. /// RotationalAcceleration unit value. - public static RotationalAcceleration From(QuantityValue value, RotationalAccelerationUnit fromUnit) + public static RotationalAcceleration From(double value, RotationalAccelerationUnit fromUnit) { - return new RotationalAcceleration((double)value, fromUnit); + return new RotationalAcceleration(value, fromUnit); } #endregion @@ -700,15 +696,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is RotationalAccelerationUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(RotationalAccelerationUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is RotationalAccelerationUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(RotationalAccelerationUnit)} is supported.", nameof(unit)); @@ -829,18 +816,6 @@ public RotationalAcceleration ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not RotationalAccelerationUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(RotationalAccelerationUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.g.cs index 72fb597d12..34aba5fcd1 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.g.cs @@ -40,7 +40,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct RotationalSpeed : - IArithmeticQuantity, + IArithmeticQuantity, #if NET7_0_OR_GREATER IMultiplyOperators, IMultiplyOperators, @@ -166,7 +166,7 @@ public RotationalSpeed(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -324,9 +324,8 @@ public static string GetAbbreviation(RotationalSpeedUnit unit, IFormatProvider? /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalSpeed FromCentiradiansPerSecond(QuantityValue centiradianspersecond) + public static RotationalSpeed FromCentiradiansPerSecond(double value) { - double value = (double) centiradianspersecond; return new RotationalSpeed(value, RotationalSpeedUnit.CentiradianPerSecond); } @@ -334,9 +333,8 @@ public static RotationalSpeed FromCentiradiansPerSecond(QuantityValue centiradia /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalSpeed FromDeciradiansPerSecond(QuantityValue deciradianspersecond) + public static RotationalSpeed FromDeciradiansPerSecond(double value) { - double value = (double) deciradianspersecond; return new RotationalSpeed(value, RotationalSpeedUnit.DeciradianPerSecond); } @@ -344,9 +342,8 @@ public static RotationalSpeed FromDeciradiansPerSecond(QuantityValue deciradians /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalSpeed FromDegreesPerMinute(QuantityValue degreesperminute) + public static RotationalSpeed FromDegreesPerMinute(double value) { - double value = (double) degreesperminute; return new RotationalSpeed(value, RotationalSpeedUnit.DegreePerMinute); } @@ -354,9 +351,8 @@ public static RotationalSpeed FromDegreesPerMinute(QuantityValue degreesperminut /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalSpeed FromDegreesPerSecond(QuantityValue degreespersecond) + public static RotationalSpeed FromDegreesPerSecond(double value) { - double value = (double) degreespersecond; return new RotationalSpeed(value, RotationalSpeedUnit.DegreePerSecond); } @@ -364,9 +360,8 @@ public static RotationalSpeed FromDegreesPerSecond(QuantityValue degreespersecon /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalSpeed FromMicrodegreesPerSecond(QuantityValue microdegreespersecond) + public static RotationalSpeed FromMicrodegreesPerSecond(double value) { - double value = (double) microdegreespersecond; return new RotationalSpeed(value, RotationalSpeedUnit.MicrodegreePerSecond); } @@ -374,9 +369,8 @@ public static RotationalSpeed FromMicrodegreesPerSecond(QuantityValue microdegre /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalSpeed FromMicroradiansPerSecond(QuantityValue microradianspersecond) + public static RotationalSpeed FromMicroradiansPerSecond(double value) { - double value = (double) microradianspersecond; return new RotationalSpeed(value, RotationalSpeedUnit.MicroradianPerSecond); } @@ -384,9 +378,8 @@ public static RotationalSpeed FromMicroradiansPerSecond(QuantityValue microradia /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalSpeed FromMillidegreesPerSecond(QuantityValue millidegreespersecond) + public static RotationalSpeed FromMillidegreesPerSecond(double value) { - double value = (double) millidegreespersecond; return new RotationalSpeed(value, RotationalSpeedUnit.MillidegreePerSecond); } @@ -394,9 +387,8 @@ public static RotationalSpeed FromMillidegreesPerSecond(QuantityValue millidegre /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalSpeed FromMilliradiansPerSecond(QuantityValue milliradianspersecond) + public static RotationalSpeed FromMilliradiansPerSecond(double value) { - double value = (double) milliradianspersecond; return new RotationalSpeed(value, RotationalSpeedUnit.MilliradianPerSecond); } @@ -404,9 +396,8 @@ public static RotationalSpeed FromMilliradiansPerSecond(QuantityValue milliradia /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalSpeed FromNanodegreesPerSecond(QuantityValue nanodegreespersecond) + public static RotationalSpeed FromNanodegreesPerSecond(double value) { - double value = (double) nanodegreespersecond; return new RotationalSpeed(value, RotationalSpeedUnit.NanodegreePerSecond); } @@ -414,9 +405,8 @@ public static RotationalSpeed FromNanodegreesPerSecond(QuantityValue nanodegrees /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalSpeed FromNanoradiansPerSecond(QuantityValue nanoradianspersecond) + public static RotationalSpeed FromNanoradiansPerSecond(double value) { - double value = (double) nanoradianspersecond; return new RotationalSpeed(value, RotationalSpeedUnit.NanoradianPerSecond); } @@ -424,9 +414,8 @@ public static RotationalSpeed FromNanoradiansPerSecond(QuantityValue nanoradians /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalSpeed FromRadiansPerSecond(QuantityValue radianspersecond) + public static RotationalSpeed FromRadiansPerSecond(double value) { - double value = (double) radianspersecond; return new RotationalSpeed(value, RotationalSpeedUnit.RadianPerSecond); } @@ -434,9 +423,8 @@ public static RotationalSpeed FromRadiansPerSecond(QuantityValue radianspersecon /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalSpeed FromRevolutionsPerMinute(QuantityValue revolutionsperminute) + public static RotationalSpeed FromRevolutionsPerMinute(double value) { - double value = (double) revolutionsperminute; return new RotationalSpeed(value, RotationalSpeedUnit.RevolutionPerMinute); } @@ -444,9 +432,8 @@ public static RotationalSpeed FromRevolutionsPerMinute(QuantityValue revolutions /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalSpeed FromRevolutionsPerSecond(QuantityValue revolutionspersecond) + public static RotationalSpeed FromRevolutionsPerSecond(double value) { - double value = (double) revolutionspersecond; return new RotationalSpeed(value, RotationalSpeedUnit.RevolutionPerSecond); } @@ -456,9 +443,9 @@ public static RotationalSpeed FromRevolutionsPerSecond(QuantityValue revolutions /// Value to convert from. /// Unit to convert from. /// RotationalSpeed unit value. - public static RotationalSpeed From(QuantityValue value, RotationalSpeedUnit fromUnit) + public static RotationalSpeed From(double value, RotationalSpeedUnit fromUnit) { - return new RotationalSpeed((double)value, fromUnit); + return new RotationalSpeed(value, fromUnit); } #endregion @@ -891,15 +878,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is RotationalSpeedUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(RotationalSpeedUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is RotationalSpeedUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(RotationalSpeedUnit)} is supported.", nameof(unit)); @@ -1038,18 +1016,6 @@ public RotationalSpeed ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not RotationalSpeedUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(RotationalSpeedUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.g.cs index cba3bee86f..1cff4a3834 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.g.cs @@ -40,7 +40,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct RotationalStiffness : - IArithmeticQuantity, + IArithmeticQuantity, #if NET7_0_OR_GREATER IDivisionOperators, IDivisionOperators, @@ -187,7 +187,7 @@ public RotationalStiffness(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -485,9 +485,8 @@ public static string GetAbbreviation(RotationalStiffnessUnit unit, IFormatProvid /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromCentinewtonMetersPerDegree(QuantityValue centinewtonmetersperdegree) + public static RotationalStiffness FromCentinewtonMetersPerDegree(double value) { - double value = (double) centinewtonmetersperdegree; return new RotationalStiffness(value, RotationalStiffnessUnit.CentinewtonMeterPerDegree); } @@ -495,9 +494,8 @@ public static RotationalStiffness FromCentinewtonMetersPerDegree(QuantityValue c /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromCentinewtonMillimetersPerDegree(QuantityValue centinewtonmillimetersperdegree) + public static RotationalStiffness FromCentinewtonMillimetersPerDegree(double value) { - double value = (double) centinewtonmillimetersperdegree; return new RotationalStiffness(value, RotationalStiffnessUnit.CentinewtonMillimeterPerDegree); } @@ -505,9 +503,8 @@ public static RotationalStiffness FromCentinewtonMillimetersPerDegree(QuantityVa /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromCentinewtonMillimetersPerRadian(QuantityValue centinewtonmillimetersperradian) + public static RotationalStiffness FromCentinewtonMillimetersPerRadian(double value) { - double value = (double) centinewtonmillimetersperradian; return new RotationalStiffness(value, RotationalStiffnessUnit.CentinewtonMillimeterPerRadian); } @@ -515,9 +512,8 @@ public static RotationalStiffness FromCentinewtonMillimetersPerRadian(QuantityVa /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromDecanewtonMetersPerDegree(QuantityValue decanewtonmetersperdegree) + public static RotationalStiffness FromDecanewtonMetersPerDegree(double value) { - double value = (double) decanewtonmetersperdegree; return new RotationalStiffness(value, RotationalStiffnessUnit.DecanewtonMeterPerDegree); } @@ -525,9 +521,8 @@ public static RotationalStiffness FromDecanewtonMetersPerDegree(QuantityValue de /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromDecanewtonMillimetersPerDegree(QuantityValue decanewtonmillimetersperdegree) + public static RotationalStiffness FromDecanewtonMillimetersPerDegree(double value) { - double value = (double) decanewtonmillimetersperdegree; return new RotationalStiffness(value, RotationalStiffnessUnit.DecanewtonMillimeterPerDegree); } @@ -535,9 +530,8 @@ public static RotationalStiffness FromDecanewtonMillimetersPerDegree(QuantityVal /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromDecanewtonMillimetersPerRadian(QuantityValue decanewtonmillimetersperradian) + public static RotationalStiffness FromDecanewtonMillimetersPerRadian(double value) { - double value = (double) decanewtonmillimetersperradian; return new RotationalStiffness(value, RotationalStiffnessUnit.DecanewtonMillimeterPerRadian); } @@ -545,9 +539,8 @@ public static RotationalStiffness FromDecanewtonMillimetersPerRadian(QuantityVal /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromDecinewtonMetersPerDegree(QuantityValue decinewtonmetersperdegree) + public static RotationalStiffness FromDecinewtonMetersPerDegree(double value) { - double value = (double) decinewtonmetersperdegree; return new RotationalStiffness(value, RotationalStiffnessUnit.DecinewtonMeterPerDegree); } @@ -555,9 +548,8 @@ public static RotationalStiffness FromDecinewtonMetersPerDegree(QuantityValue de /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromDecinewtonMillimetersPerDegree(QuantityValue decinewtonmillimetersperdegree) + public static RotationalStiffness FromDecinewtonMillimetersPerDegree(double value) { - double value = (double) decinewtonmillimetersperdegree; return new RotationalStiffness(value, RotationalStiffnessUnit.DecinewtonMillimeterPerDegree); } @@ -565,9 +557,8 @@ public static RotationalStiffness FromDecinewtonMillimetersPerDegree(QuantityVal /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromDecinewtonMillimetersPerRadian(QuantityValue decinewtonmillimetersperradian) + public static RotationalStiffness FromDecinewtonMillimetersPerRadian(double value) { - double value = (double) decinewtonmillimetersperradian; return new RotationalStiffness(value, RotationalStiffnessUnit.DecinewtonMillimeterPerRadian); } @@ -575,9 +566,8 @@ public static RotationalStiffness FromDecinewtonMillimetersPerRadian(QuantityVal /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromKilonewtonMetersPerDegree(QuantityValue kilonewtonmetersperdegree) + public static RotationalStiffness FromKilonewtonMetersPerDegree(double value) { - double value = (double) kilonewtonmetersperdegree; return new RotationalStiffness(value, RotationalStiffnessUnit.KilonewtonMeterPerDegree); } @@ -585,9 +575,8 @@ public static RotationalStiffness FromKilonewtonMetersPerDegree(QuantityValue ki /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromKilonewtonMetersPerRadian(QuantityValue kilonewtonmetersperradian) + public static RotationalStiffness FromKilonewtonMetersPerRadian(double value) { - double value = (double) kilonewtonmetersperradian; return new RotationalStiffness(value, RotationalStiffnessUnit.KilonewtonMeterPerRadian); } @@ -595,9 +584,8 @@ public static RotationalStiffness FromKilonewtonMetersPerRadian(QuantityValue ki /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromKilonewtonMillimetersPerDegree(QuantityValue kilonewtonmillimetersperdegree) + public static RotationalStiffness FromKilonewtonMillimetersPerDegree(double value) { - double value = (double) kilonewtonmillimetersperdegree; return new RotationalStiffness(value, RotationalStiffnessUnit.KilonewtonMillimeterPerDegree); } @@ -605,9 +593,8 @@ public static RotationalStiffness FromKilonewtonMillimetersPerDegree(QuantityVal /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromKilonewtonMillimetersPerRadian(QuantityValue kilonewtonmillimetersperradian) + public static RotationalStiffness FromKilonewtonMillimetersPerRadian(double value) { - double value = (double) kilonewtonmillimetersperradian; return new RotationalStiffness(value, RotationalStiffnessUnit.KilonewtonMillimeterPerRadian); } @@ -615,9 +602,8 @@ public static RotationalStiffness FromKilonewtonMillimetersPerRadian(QuantityVal /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromKilopoundForceFeetPerDegrees(QuantityValue kilopoundforcefeetperdegrees) + public static RotationalStiffness FromKilopoundForceFeetPerDegrees(double value) { - double value = (double) kilopoundforcefeetperdegrees; return new RotationalStiffness(value, RotationalStiffnessUnit.KilopoundForceFootPerDegrees); } @@ -625,9 +611,8 @@ public static RotationalStiffness FromKilopoundForceFeetPerDegrees(QuantityValue /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromMeganewtonMetersPerDegree(QuantityValue meganewtonmetersperdegree) + public static RotationalStiffness FromMeganewtonMetersPerDegree(double value) { - double value = (double) meganewtonmetersperdegree; return new RotationalStiffness(value, RotationalStiffnessUnit.MeganewtonMeterPerDegree); } @@ -635,9 +620,8 @@ public static RotationalStiffness FromMeganewtonMetersPerDegree(QuantityValue me /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromMeganewtonMetersPerRadian(QuantityValue meganewtonmetersperradian) + public static RotationalStiffness FromMeganewtonMetersPerRadian(double value) { - double value = (double) meganewtonmetersperradian; return new RotationalStiffness(value, RotationalStiffnessUnit.MeganewtonMeterPerRadian); } @@ -645,9 +629,8 @@ public static RotationalStiffness FromMeganewtonMetersPerRadian(QuantityValue me /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromMeganewtonMillimetersPerDegree(QuantityValue meganewtonmillimetersperdegree) + public static RotationalStiffness FromMeganewtonMillimetersPerDegree(double value) { - double value = (double) meganewtonmillimetersperdegree; return new RotationalStiffness(value, RotationalStiffnessUnit.MeganewtonMillimeterPerDegree); } @@ -655,9 +638,8 @@ public static RotationalStiffness FromMeganewtonMillimetersPerDegree(QuantityVal /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromMeganewtonMillimetersPerRadian(QuantityValue meganewtonmillimetersperradian) + public static RotationalStiffness FromMeganewtonMillimetersPerRadian(double value) { - double value = (double) meganewtonmillimetersperradian; return new RotationalStiffness(value, RotationalStiffnessUnit.MeganewtonMillimeterPerRadian); } @@ -665,9 +647,8 @@ public static RotationalStiffness FromMeganewtonMillimetersPerRadian(QuantityVal /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromMicronewtonMetersPerDegree(QuantityValue micronewtonmetersperdegree) + public static RotationalStiffness FromMicronewtonMetersPerDegree(double value) { - double value = (double) micronewtonmetersperdegree; return new RotationalStiffness(value, RotationalStiffnessUnit.MicronewtonMeterPerDegree); } @@ -675,9 +656,8 @@ public static RotationalStiffness FromMicronewtonMetersPerDegree(QuantityValue m /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromMicronewtonMillimetersPerDegree(QuantityValue micronewtonmillimetersperdegree) + public static RotationalStiffness FromMicronewtonMillimetersPerDegree(double value) { - double value = (double) micronewtonmillimetersperdegree; return new RotationalStiffness(value, RotationalStiffnessUnit.MicronewtonMillimeterPerDegree); } @@ -685,9 +665,8 @@ public static RotationalStiffness FromMicronewtonMillimetersPerDegree(QuantityVa /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromMicronewtonMillimetersPerRadian(QuantityValue micronewtonmillimetersperradian) + public static RotationalStiffness FromMicronewtonMillimetersPerRadian(double value) { - double value = (double) micronewtonmillimetersperradian; return new RotationalStiffness(value, RotationalStiffnessUnit.MicronewtonMillimeterPerRadian); } @@ -695,9 +674,8 @@ public static RotationalStiffness FromMicronewtonMillimetersPerRadian(QuantityVa /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromMillinewtonMetersPerDegree(QuantityValue millinewtonmetersperdegree) + public static RotationalStiffness FromMillinewtonMetersPerDegree(double value) { - double value = (double) millinewtonmetersperdegree; return new RotationalStiffness(value, RotationalStiffnessUnit.MillinewtonMeterPerDegree); } @@ -705,9 +683,8 @@ public static RotationalStiffness FromMillinewtonMetersPerDegree(QuantityValue m /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromMillinewtonMillimetersPerDegree(QuantityValue millinewtonmillimetersperdegree) + public static RotationalStiffness FromMillinewtonMillimetersPerDegree(double value) { - double value = (double) millinewtonmillimetersperdegree; return new RotationalStiffness(value, RotationalStiffnessUnit.MillinewtonMillimeterPerDegree); } @@ -715,9 +692,8 @@ public static RotationalStiffness FromMillinewtonMillimetersPerDegree(QuantityVa /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromMillinewtonMillimetersPerRadian(QuantityValue millinewtonmillimetersperradian) + public static RotationalStiffness FromMillinewtonMillimetersPerRadian(double value) { - double value = (double) millinewtonmillimetersperradian; return new RotationalStiffness(value, RotationalStiffnessUnit.MillinewtonMillimeterPerRadian); } @@ -725,9 +701,8 @@ public static RotationalStiffness FromMillinewtonMillimetersPerRadian(QuantityVa /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromNanonewtonMetersPerDegree(QuantityValue nanonewtonmetersperdegree) + public static RotationalStiffness FromNanonewtonMetersPerDegree(double value) { - double value = (double) nanonewtonmetersperdegree; return new RotationalStiffness(value, RotationalStiffnessUnit.NanonewtonMeterPerDegree); } @@ -735,9 +710,8 @@ public static RotationalStiffness FromNanonewtonMetersPerDegree(QuantityValue na /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromNanonewtonMillimetersPerDegree(QuantityValue nanonewtonmillimetersperdegree) + public static RotationalStiffness FromNanonewtonMillimetersPerDegree(double value) { - double value = (double) nanonewtonmillimetersperdegree; return new RotationalStiffness(value, RotationalStiffnessUnit.NanonewtonMillimeterPerDegree); } @@ -745,9 +719,8 @@ public static RotationalStiffness FromNanonewtonMillimetersPerDegree(QuantityVal /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromNanonewtonMillimetersPerRadian(QuantityValue nanonewtonmillimetersperradian) + public static RotationalStiffness FromNanonewtonMillimetersPerRadian(double value) { - double value = (double) nanonewtonmillimetersperradian; return new RotationalStiffness(value, RotationalStiffnessUnit.NanonewtonMillimeterPerRadian); } @@ -755,9 +728,8 @@ public static RotationalStiffness FromNanonewtonMillimetersPerRadian(QuantityVal /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromNewtonMetersPerDegree(QuantityValue newtonmetersperdegree) + public static RotationalStiffness FromNewtonMetersPerDegree(double value) { - double value = (double) newtonmetersperdegree; return new RotationalStiffness(value, RotationalStiffnessUnit.NewtonMeterPerDegree); } @@ -765,9 +737,8 @@ public static RotationalStiffness FromNewtonMetersPerDegree(QuantityValue newton /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromNewtonMetersPerRadian(QuantityValue newtonmetersperradian) + public static RotationalStiffness FromNewtonMetersPerRadian(double value) { - double value = (double) newtonmetersperradian; return new RotationalStiffness(value, RotationalStiffnessUnit.NewtonMeterPerRadian); } @@ -775,9 +746,8 @@ public static RotationalStiffness FromNewtonMetersPerRadian(QuantityValue newton /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromNewtonMillimetersPerDegree(QuantityValue newtonmillimetersperdegree) + public static RotationalStiffness FromNewtonMillimetersPerDegree(double value) { - double value = (double) newtonmillimetersperdegree; return new RotationalStiffness(value, RotationalStiffnessUnit.NewtonMillimeterPerDegree); } @@ -785,9 +755,8 @@ public static RotationalStiffness FromNewtonMillimetersPerDegree(QuantityValue n /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromNewtonMillimetersPerRadian(QuantityValue newtonmillimetersperradian) + public static RotationalStiffness FromNewtonMillimetersPerRadian(double value) { - double value = (double) newtonmillimetersperradian; return new RotationalStiffness(value, RotationalStiffnessUnit.NewtonMillimeterPerRadian); } @@ -795,9 +764,8 @@ public static RotationalStiffness FromNewtonMillimetersPerRadian(QuantityValue n /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromPoundForceFeetPerRadian(QuantityValue poundforcefeetperradian) + public static RotationalStiffness FromPoundForceFeetPerRadian(double value) { - double value = (double) poundforcefeetperradian; return new RotationalStiffness(value, RotationalStiffnessUnit.PoundForceFeetPerRadian); } @@ -805,9 +773,8 @@ public static RotationalStiffness FromPoundForceFeetPerRadian(QuantityValue poun /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromPoundForceFeetPerDegrees(QuantityValue poundforcefeetperdegrees) + public static RotationalStiffness FromPoundForceFeetPerDegrees(double value) { - double value = (double) poundforcefeetperdegrees; return new RotationalStiffness(value, RotationalStiffnessUnit.PoundForceFootPerDegrees); } @@ -817,9 +784,9 @@ public static RotationalStiffness FromPoundForceFeetPerDegrees(QuantityValue pou /// Value to convert from. /// Unit to convert from. /// RotationalStiffness unit value. - public static RotationalStiffness From(QuantityValue value, RotationalStiffnessUnit fromUnit) + public static RotationalStiffness From(double value, RotationalStiffnessUnit fromUnit) { - return new RotationalStiffness((double)value, fromUnit); + return new RotationalStiffness(value, fromUnit); } #endregion @@ -1252,15 +1219,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is RotationalStiffnessUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(RotationalStiffnessUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is RotationalStiffnessUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(RotationalStiffnessUnit)} is supported.", nameof(unit)); @@ -1439,18 +1397,6 @@ public RotationalStiffness ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not RotationalStiffnessUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(RotationalStiffnessUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.g.cs index 8c914284af..ca069a66c6 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.g.cs @@ -40,7 +40,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct RotationalStiffnessPerLength : - IArithmeticQuantity, + IArithmeticQuantity, #if NET7_0_OR_GREATER IMultiplyOperators, #endif @@ -157,7 +157,7 @@ public RotationalStiffnessPerLength(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -259,9 +259,8 @@ public static string GetAbbreviation(RotationalStiffnessPerLengthUnit unit, IFor /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffnessPerLength FromKilonewtonMetersPerRadianPerMeter(QuantityValue kilonewtonmetersperradianpermeter) + public static RotationalStiffnessPerLength FromKilonewtonMetersPerRadianPerMeter(double value) { - double value = (double) kilonewtonmetersperradianpermeter; return new RotationalStiffnessPerLength(value, RotationalStiffnessPerLengthUnit.KilonewtonMeterPerRadianPerMeter); } @@ -269,9 +268,8 @@ public static RotationalStiffnessPerLength FromKilonewtonMetersPerRadianPerMeter /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffnessPerLength FromKilopoundForceFeetPerDegreesPerFeet(QuantityValue kilopoundforcefeetperdegreesperfeet) + public static RotationalStiffnessPerLength FromKilopoundForceFeetPerDegreesPerFeet(double value) { - double value = (double) kilopoundforcefeetperdegreesperfeet; return new RotationalStiffnessPerLength(value, RotationalStiffnessPerLengthUnit.KilopoundForceFootPerDegreesPerFoot); } @@ -279,9 +277,8 @@ public static RotationalStiffnessPerLength FromKilopoundForceFeetPerDegreesPerFe /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffnessPerLength FromMeganewtonMetersPerRadianPerMeter(QuantityValue meganewtonmetersperradianpermeter) + public static RotationalStiffnessPerLength FromMeganewtonMetersPerRadianPerMeter(double value) { - double value = (double) meganewtonmetersperradianpermeter; return new RotationalStiffnessPerLength(value, RotationalStiffnessPerLengthUnit.MeganewtonMeterPerRadianPerMeter); } @@ -289,9 +286,8 @@ public static RotationalStiffnessPerLength FromMeganewtonMetersPerRadianPerMeter /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffnessPerLength FromNewtonMetersPerRadianPerMeter(QuantityValue newtonmetersperradianpermeter) + public static RotationalStiffnessPerLength FromNewtonMetersPerRadianPerMeter(double value) { - double value = (double) newtonmetersperradianpermeter; return new RotationalStiffnessPerLength(value, RotationalStiffnessPerLengthUnit.NewtonMeterPerRadianPerMeter); } @@ -299,9 +295,8 @@ public static RotationalStiffnessPerLength FromNewtonMetersPerRadianPerMeter(Qua /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffnessPerLength FromPoundForceFeetPerDegreesPerFeet(QuantityValue poundforcefeetperdegreesperfeet) + public static RotationalStiffnessPerLength FromPoundForceFeetPerDegreesPerFeet(double value) { - double value = (double) poundforcefeetperdegreesperfeet; return new RotationalStiffnessPerLength(value, RotationalStiffnessPerLengthUnit.PoundForceFootPerDegreesPerFoot); } @@ -311,9 +306,9 @@ public static RotationalStiffnessPerLength FromPoundForceFeetPerDegreesPerFeet(Q /// Value to convert from. /// Unit to convert from. /// RotationalStiffnessPerLength unit value. - public static RotationalStiffnessPerLength From(QuantityValue value, RotationalStiffnessPerLengthUnit fromUnit) + public static RotationalStiffnessPerLength From(double value, RotationalStiffnessPerLengthUnit fromUnit) { - return new RotationalStiffnessPerLength((double)value, fromUnit); + return new RotationalStiffnessPerLength(value, fromUnit); } #endregion @@ -734,15 +729,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is RotationalStiffnessPerLengthUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(RotationalStiffnessPerLengthUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is RotationalStiffnessPerLengthUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(RotationalStiffnessPerLengthUnit)} is supported.", nameof(unit)); @@ -865,18 +851,6 @@ public RotationalStiffnessPerLength ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not RotationalStiffnessPerLengthUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(RotationalStiffnessPerLengthUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/Scalar.g.cs b/UnitsNet/GeneratedCode/Quantities/Scalar.g.cs index 7e354aaac0..5687e7fa21 100644 --- a/UnitsNet/GeneratedCode/Quantities/Scalar.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Scalar.g.cs @@ -37,7 +37,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct Scalar : - IArithmeticQuantity, + IArithmeticQuantity, IComparable, IComparable, IConvertible, @@ -147,7 +147,7 @@ public Scalar(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -221,9 +221,8 @@ public static string GetAbbreviation(ScalarUnit unit, IFormatProvider? provider) /// Creates a from . /// /// If value is NaN or Infinity. - public static Scalar FromAmount(QuantityValue amount) + public static Scalar FromAmount(double value) { - double value = (double) amount; return new Scalar(value, ScalarUnit.Amount); } @@ -233,9 +232,9 @@ public static Scalar FromAmount(QuantityValue amount) /// Value to convert from. /// Unit to convert from. /// Scalar unit value. - public static Scalar From(QuantityValue value, ScalarUnit fromUnit) + public static Scalar From(double value, ScalarUnit fromUnit) { - return new Scalar((double)value, fromUnit); + return new Scalar(value, fromUnit); } #endregion @@ -646,15 +645,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is ScalarUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ScalarUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is ScalarUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ScalarUnit)} is supported.", nameof(unit)); @@ -769,18 +759,6 @@ public Scalar ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not ScalarUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ScalarUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/SolidAngle.g.cs b/UnitsNet/GeneratedCode/Quantities/SolidAngle.g.cs index d6087d18e6..f6d3019ff0 100644 --- a/UnitsNet/GeneratedCode/Quantities/SolidAngle.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SolidAngle.g.cs @@ -40,7 +40,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct SolidAngle : - IArithmeticQuantity, + IArithmeticQuantity, IComparable, IComparable, IConvertible, @@ -150,7 +150,7 @@ public SolidAngle(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -224,9 +224,8 @@ public static string GetAbbreviation(SolidAngleUnit unit, IFormatProvider? provi /// Creates a from . /// /// If value is NaN or Infinity. - public static SolidAngle FromSteradians(QuantityValue steradians) + public static SolidAngle FromSteradians(double value) { - double value = (double) steradians; return new SolidAngle(value, SolidAngleUnit.Steradian); } @@ -236,9 +235,9 @@ public static SolidAngle FromSteradians(QuantityValue steradians) /// Value to convert from. /// Unit to convert from. /// SolidAngle unit value. - public static SolidAngle From(QuantityValue value, SolidAngleUnit fromUnit) + public static SolidAngle From(double value, SolidAngleUnit fromUnit) { - return new SolidAngle((double)value, fromUnit); + return new SolidAngle(value, fromUnit); } #endregion @@ -649,15 +648,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is SolidAngleUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(SolidAngleUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is SolidAngleUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(SolidAngleUnit)} is supported.", nameof(unit)); @@ -772,18 +762,6 @@ public SolidAngle ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not SolidAngleUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(SolidAngleUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.g.cs index c757fb0091..adedb15a0c 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.g.cs @@ -43,7 +43,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct SpecificEnergy : - IArithmeticQuantity, + IArithmeticQuantity, #if NET7_0_OR_GREATER IMultiplyOperators, IMultiplyOperators, @@ -188,7 +188,7 @@ public SpecificEnergy(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -465,9 +465,8 @@ public static string GetAbbreviation(SpecificEnergyUnit unit, IFormatProvider? p /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromBtuPerPound(QuantityValue btuperpound) + public static SpecificEnergy FromBtuPerPound(double value) { - double value = (double) btuperpound; return new SpecificEnergy(value, SpecificEnergyUnit.BtuPerPound); } @@ -475,9 +474,8 @@ public static SpecificEnergy FromBtuPerPound(QuantityValue btuperpound) /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromCaloriesPerGram(QuantityValue caloriespergram) + public static SpecificEnergy FromCaloriesPerGram(double value) { - double value = (double) caloriespergram; return new SpecificEnergy(value, SpecificEnergyUnit.CaloriePerGram); } @@ -485,9 +483,8 @@ public static SpecificEnergy FromCaloriesPerGram(QuantityValue caloriespergram) /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromGigawattDaysPerKilogram(QuantityValue gigawattdaysperkilogram) + public static SpecificEnergy FromGigawattDaysPerKilogram(double value) { - double value = (double) gigawattdaysperkilogram; return new SpecificEnergy(value, SpecificEnergyUnit.GigawattDayPerKilogram); } @@ -495,9 +492,8 @@ public static SpecificEnergy FromGigawattDaysPerKilogram(QuantityValue gigawattd /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromGigawattDaysPerShortTon(QuantityValue gigawattdayspershortton) + public static SpecificEnergy FromGigawattDaysPerShortTon(double value) { - double value = (double) gigawattdayspershortton; return new SpecificEnergy(value, SpecificEnergyUnit.GigawattDayPerShortTon); } @@ -505,9 +501,8 @@ public static SpecificEnergy FromGigawattDaysPerShortTon(QuantityValue gigawattd /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromGigawattDaysPerTonne(QuantityValue gigawattdayspertonne) + public static SpecificEnergy FromGigawattDaysPerTonne(double value) { - double value = (double) gigawattdayspertonne; return new SpecificEnergy(value, SpecificEnergyUnit.GigawattDayPerTonne); } @@ -515,9 +510,8 @@ public static SpecificEnergy FromGigawattDaysPerTonne(QuantityValue gigawattdays /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromGigawattHoursPerKilogram(QuantityValue gigawatthoursperkilogram) + public static SpecificEnergy FromGigawattHoursPerKilogram(double value) { - double value = (double) gigawatthoursperkilogram; return new SpecificEnergy(value, SpecificEnergyUnit.GigawattHourPerKilogram); } @@ -525,9 +519,8 @@ public static SpecificEnergy FromGigawattHoursPerKilogram(QuantityValue gigawatt /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromGigawattHoursPerPound(QuantityValue gigawatthoursperpound) + public static SpecificEnergy FromGigawattHoursPerPound(double value) { - double value = (double) gigawatthoursperpound; return new SpecificEnergy(value, SpecificEnergyUnit.GigawattHourPerPound); } @@ -535,9 +528,8 @@ public static SpecificEnergy FromGigawattHoursPerPound(QuantityValue gigawatthou /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromJoulesPerKilogram(QuantityValue joulesperkilogram) + public static SpecificEnergy FromJoulesPerKilogram(double value) { - double value = (double) joulesperkilogram; return new SpecificEnergy(value, SpecificEnergyUnit.JoulePerKilogram); } @@ -545,9 +537,8 @@ public static SpecificEnergy FromJoulesPerKilogram(QuantityValue joulesperkilogr /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromKilocaloriesPerGram(QuantityValue kilocaloriespergram) + public static SpecificEnergy FromKilocaloriesPerGram(double value) { - double value = (double) kilocaloriespergram; return new SpecificEnergy(value, SpecificEnergyUnit.KilocaloriePerGram); } @@ -555,9 +546,8 @@ public static SpecificEnergy FromKilocaloriesPerGram(QuantityValue kilocaloriesp /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromKilojoulesPerKilogram(QuantityValue kilojoulesperkilogram) + public static SpecificEnergy FromKilojoulesPerKilogram(double value) { - double value = (double) kilojoulesperkilogram; return new SpecificEnergy(value, SpecificEnergyUnit.KilojoulePerKilogram); } @@ -565,9 +555,8 @@ public static SpecificEnergy FromKilojoulesPerKilogram(QuantityValue kilojoulesp /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromKilowattDaysPerKilogram(QuantityValue kilowattdaysperkilogram) + public static SpecificEnergy FromKilowattDaysPerKilogram(double value) { - double value = (double) kilowattdaysperkilogram; return new SpecificEnergy(value, SpecificEnergyUnit.KilowattDayPerKilogram); } @@ -575,9 +564,8 @@ public static SpecificEnergy FromKilowattDaysPerKilogram(QuantityValue kilowattd /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromKilowattDaysPerShortTon(QuantityValue kilowattdayspershortton) + public static SpecificEnergy FromKilowattDaysPerShortTon(double value) { - double value = (double) kilowattdayspershortton; return new SpecificEnergy(value, SpecificEnergyUnit.KilowattDayPerShortTon); } @@ -585,9 +573,8 @@ public static SpecificEnergy FromKilowattDaysPerShortTon(QuantityValue kilowattd /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromKilowattDaysPerTonne(QuantityValue kilowattdayspertonne) + public static SpecificEnergy FromKilowattDaysPerTonne(double value) { - double value = (double) kilowattdayspertonne; return new SpecificEnergy(value, SpecificEnergyUnit.KilowattDayPerTonne); } @@ -595,9 +582,8 @@ public static SpecificEnergy FromKilowattDaysPerTonne(QuantityValue kilowattdays /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromKilowattHoursPerKilogram(QuantityValue kilowatthoursperkilogram) + public static SpecificEnergy FromKilowattHoursPerKilogram(double value) { - double value = (double) kilowatthoursperkilogram; return new SpecificEnergy(value, SpecificEnergyUnit.KilowattHourPerKilogram); } @@ -605,9 +591,8 @@ public static SpecificEnergy FromKilowattHoursPerKilogram(QuantityValue kilowatt /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromKilowattHoursPerPound(QuantityValue kilowatthoursperpound) + public static SpecificEnergy FromKilowattHoursPerPound(double value) { - double value = (double) kilowatthoursperpound; return new SpecificEnergy(value, SpecificEnergyUnit.KilowattHourPerPound); } @@ -615,9 +600,8 @@ public static SpecificEnergy FromKilowattHoursPerPound(QuantityValue kilowatthou /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromMegajoulesPerKilogram(QuantityValue megajoulesperkilogram) + public static SpecificEnergy FromMegajoulesPerKilogram(double value) { - double value = (double) megajoulesperkilogram; return new SpecificEnergy(value, SpecificEnergyUnit.MegajoulePerKilogram); } @@ -625,9 +609,8 @@ public static SpecificEnergy FromMegajoulesPerKilogram(QuantityValue megajoulesp /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromMegaJoulesPerTonne(QuantityValue megajoulespertonne) + public static SpecificEnergy FromMegaJoulesPerTonne(double value) { - double value = (double) megajoulespertonne; return new SpecificEnergy(value, SpecificEnergyUnit.MegaJoulePerTonne); } @@ -635,9 +618,8 @@ public static SpecificEnergy FromMegaJoulesPerTonne(QuantityValue megajoulespert /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromMegawattDaysPerKilogram(QuantityValue megawattdaysperkilogram) + public static SpecificEnergy FromMegawattDaysPerKilogram(double value) { - double value = (double) megawattdaysperkilogram; return new SpecificEnergy(value, SpecificEnergyUnit.MegawattDayPerKilogram); } @@ -645,9 +627,8 @@ public static SpecificEnergy FromMegawattDaysPerKilogram(QuantityValue megawattd /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromMegawattDaysPerShortTon(QuantityValue megawattdayspershortton) + public static SpecificEnergy FromMegawattDaysPerShortTon(double value) { - double value = (double) megawattdayspershortton; return new SpecificEnergy(value, SpecificEnergyUnit.MegawattDayPerShortTon); } @@ -655,9 +636,8 @@ public static SpecificEnergy FromMegawattDaysPerShortTon(QuantityValue megawattd /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromMegawattDaysPerTonne(QuantityValue megawattdayspertonne) + public static SpecificEnergy FromMegawattDaysPerTonne(double value) { - double value = (double) megawattdayspertonne; return new SpecificEnergy(value, SpecificEnergyUnit.MegawattDayPerTonne); } @@ -665,9 +645,8 @@ public static SpecificEnergy FromMegawattDaysPerTonne(QuantityValue megawattdays /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromMegawattHoursPerKilogram(QuantityValue megawatthoursperkilogram) + public static SpecificEnergy FromMegawattHoursPerKilogram(double value) { - double value = (double) megawatthoursperkilogram; return new SpecificEnergy(value, SpecificEnergyUnit.MegawattHourPerKilogram); } @@ -675,9 +654,8 @@ public static SpecificEnergy FromMegawattHoursPerKilogram(QuantityValue megawatt /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromMegawattHoursPerPound(QuantityValue megawatthoursperpound) + public static SpecificEnergy FromMegawattHoursPerPound(double value) { - double value = (double) megawatthoursperpound; return new SpecificEnergy(value, SpecificEnergyUnit.MegawattHourPerPound); } @@ -685,9 +663,8 @@ public static SpecificEnergy FromMegawattHoursPerPound(QuantityValue megawatthou /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromTerawattDaysPerKilogram(QuantityValue terawattdaysperkilogram) + public static SpecificEnergy FromTerawattDaysPerKilogram(double value) { - double value = (double) terawattdaysperkilogram; return new SpecificEnergy(value, SpecificEnergyUnit.TerawattDayPerKilogram); } @@ -695,9 +672,8 @@ public static SpecificEnergy FromTerawattDaysPerKilogram(QuantityValue terawattd /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromTerawattDaysPerShortTon(QuantityValue terawattdayspershortton) + public static SpecificEnergy FromTerawattDaysPerShortTon(double value) { - double value = (double) terawattdayspershortton; return new SpecificEnergy(value, SpecificEnergyUnit.TerawattDayPerShortTon); } @@ -705,9 +681,8 @@ public static SpecificEnergy FromTerawattDaysPerShortTon(QuantityValue terawattd /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromTerawattDaysPerTonne(QuantityValue terawattdayspertonne) + public static SpecificEnergy FromTerawattDaysPerTonne(double value) { - double value = (double) terawattdayspertonne; return new SpecificEnergy(value, SpecificEnergyUnit.TerawattDayPerTonne); } @@ -715,9 +690,8 @@ public static SpecificEnergy FromTerawattDaysPerTonne(QuantityValue terawattdays /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromWattDaysPerKilogram(QuantityValue wattdaysperkilogram) + public static SpecificEnergy FromWattDaysPerKilogram(double value) { - double value = (double) wattdaysperkilogram; return new SpecificEnergy(value, SpecificEnergyUnit.WattDayPerKilogram); } @@ -725,9 +699,8 @@ public static SpecificEnergy FromWattDaysPerKilogram(QuantityValue wattdaysperki /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromWattDaysPerShortTon(QuantityValue wattdayspershortton) + public static SpecificEnergy FromWattDaysPerShortTon(double value) { - double value = (double) wattdayspershortton; return new SpecificEnergy(value, SpecificEnergyUnit.WattDayPerShortTon); } @@ -735,9 +708,8 @@ public static SpecificEnergy FromWattDaysPerShortTon(QuantityValue wattdayspersh /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromWattDaysPerTonne(QuantityValue wattdayspertonne) + public static SpecificEnergy FromWattDaysPerTonne(double value) { - double value = (double) wattdayspertonne; return new SpecificEnergy(value, SpecificEnergyUnit.WattDayPerTonne); } @@ -745,9 +717,8 @@ public static SpecificEnergy FromWattDaysPerTonne(QuantityValue wattdayspertonne /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromWattHoursPerKilogram(QuantityValue watthoursperkilogram) + public static SpecificEnergy FromWattHoursPerKilogram(double value) { - double value = (double) watthoursperkilogram; return new SpecificEnergy(value, SpecificEnergyUnit.WattHourPerKilogram); } @@ -755,9 +726,8 @@ public static SpecificEnergy FromWattHoursPerKilogram(QuantityValue watthoursper /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromWattHoursPerPound(QuantityValue watthoursperpound) + public static SpecificEnergy FromWattHoursPerPound(double value) { - double value = (double) watthoursperpound; return new SpecificEnergy(value, SpecificEnergyUnit.WattHourPerPound); } @@ -767,9 +737,9 @@ public static SpecificEnergy FromWattHoursPerPound(QuantityValue watthoursperpou /// Value to convert from. /// Unit to convert from. /// SpecificEnergy unit value. - public static SpecificEnergy From(QuantityValue value, SpecificEnergyUnit fromUnit) + public static SpecificEnergy From(double value, SpecificEnergyUnit fromUnit) { - return new SpecificEnergy((double)value, fromUnit); + return new SpecificEnergy(value, fromUnit); } #endregion @@ -1214,15 +1184,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is SpecificEnergyUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(SpecificEnergyUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is SpecificEnergyUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(SpecificEnergyUnit)} is supported.", nameof(unit)); @@ -1395,18 +1356,6 @@ public SpecificEnergy ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not SpecificEnergyUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(SpecificEnergyUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.g.cs index 308a10e0f5..a992921ae0 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.g.cs @@ -40,7 +40,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct SpecificEntropy : - IArithmeticQuantity, + IArithmeticQuantity, #if NET7_0_OR_GREATER IMultiplyOperators, IMultiplyOperators, @@ -162,7 +162,7 @@ public SpecificEntropy(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -292,9 +292,8 @@ public static string GetAbbreviation(SpecificEntropyUnit unit, IFormatProvider? /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEntropy FromBtusPerPoundFahrenheit(QuantityValue btusperpoundfahrenheit) + public static SpecificEntropy FromBtusPerPoundFahrenheit(double value) { - double value = (double) btusperpoundfahrenheit; return new SpecificEntropy(value, SpecificEntropyUnit.BtuPerPoundFahrenheit); } @@ -302,9 +301,8 @@ public static SpecificEntropy FromBtusPerPoundFahrenheit(QuantityValue btusperpo /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEntropy FromCaloriesPerGramKelvin(QuantityValue caloriespergramkelvin) + public static SpecificEntropy FromCaloriesPerGramKelvin(double value) { - double value = (double) caloriespergramkelvin; return new SpecificEntropy(value, SpecificEntropyUnit.CaloriePerGramKelvin); } @@ -312,9 +310,8 @@ public static SpecificEntropy FromCaloriesPerGramKelvin(QuantityValue caloriespe /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEntropy FromJoulesPerKilogramDegreeCelsius(QuantityValue joulesperkilogramdegreecelsius) + public static SpecificEntropy FromJoulesPerKilogramDegreeCelsius(double value) { - double value = (double) joulesperkilogramdegreecelsius; return new SpecificEntropy(value, SpecificEntropyUnit.JoulePerKilogramDegreeCelsius); } @@ -322,9 +319,8 @@ public static SpecificEntropy FromJoulesPerKilogramDegreeCelsius(QuantityValue j /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEntropy FromJoulesPerKilogramKelvin(QuantityValue joulesperkilogramkelvin) + public static SpecificEntropy FromJoulesPerKilogramKelvin(double value) { - double value = (double) joulesperkilogramkelvin; return new SpecificEntropy(value, SpecificEntropyUnit.JoulePerKilogramKelvin); } @@ -332,9 +328,8 @@ public static SpecificEntropy FromJoulesPerKilogramKelvin(QuantityValue joulespe /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEntropy FromKilocaloriesPerGramKelvin(QuantityValue kilocaloriespergramkelvin) + public static SpecificEntropy FromKilocaloriesPerGramKelvin(double value) { - double value = (double) kilocaloriespergramkelvin; return new SpecificEntropy(value, SpecificEntropyUnit.KilocaloriePerGramKelvin); } @@ -342,9 +337,8 @@ public static SpecificEntropy FromKilocaloriesPerGramKelvin(QuantityValue kiloca /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEntropy FromKilojoulesPerKilogramDegreeCelsius(QuantityValue kilojoulesperkilogramdegreecelsius) + public static SpecificEntropy FromKilojoulesPerKilogramDegreeCelsius(double value) { - double value = (double) kilojoulesperkilogramdegreecelsius; return new SpecificEntropy(value, SpecificEntropyUnit.KilojoulePerKilogramDegreeCelsius); } @@ -352,9 +346,8 @@ public static SpecificEntropy FromKilojoulesPerKilogramDegreeCelsius(QuantityVal /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEntropy FromKilojoulesPerKilogramKelvin(QuantityValue kilojoulesperkilogramkelvin) + public static SpecificEntropy FromKilojoulesPerKilogramKelvin(double value) { - double value = (double) kilojoulesperkilogramkelvin; return new SpecificEntropy(value, SpecificEntropyUnit.KilojoulePerKilogramKelvin); } @@ -362,9 +355,8 @@ public static SpecificEntropy FromKilojoulesPerKilogramKelvin(QuantityValue kilo /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEntropy FromMegajoulesPerKilogramDegreeCelsius(QuantityValue megajoulesperkilogramdegreecelsius) + public static SpecificEntropy FromMegajoulesPerKilogramDegreeCelsius(double value) { - double value = (double) megajoulesperkilogramdegreecelsius; return new SpecificEntropy(value, SpecificEntropyUnit.MegajoulePerKilogramDegreeCelsius); } @@ -372,9 +364,8 @@ public static SpecificEntropy FromMegajoulesPerKilogramDegreeCelsius(QuantityVal /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEntropy FromMegajoulesPerKilogramKelvin(QuantityValue megajoulesperkilogramkelvin) + public static SpecificEntropy FromMegajoulesPerKilogramKelvin(double value) { - double value = (double) megajoulesperkilogramkelvin; return new SpecificEntropy(value, SpecificEntropyUnit.MegajoulePerKilogramKelvin); } @@ -384,9 +375,9 @@ public static SpecificEntropy FromMegajoulesPerKilogramKelvin(QuantityValue mega /// Value to convert from. /// Unit to convert from. /// SpecificEntropy unit value. - public static SpecificEntropy From(QuantityValue value, SpecificEntropyUnit fromUnit) + public static SpecificEntropy From(double value, SpecificEntropyUnit fromUnit) { - return new SpecificEntropy((double)value, fromUnit); + return new SpecificEntropy(value, fromUnit); } #endregion @@ -813,15 +804,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is SpecificEntropyUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(SpecificEntropyUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is SpecificEntropyUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(SpecificEntropyUnit)} is supported.", nameof(unit)); @@ -952,18 +934,6 @@ public SpecificEntropy ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not SpecificEntropyUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(SpecificEntropyUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificFuelConsumption.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificFuelConsumption.g.cs index c292ceeef9..9e0b0ddcb3 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificFuelConsumption.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificFuelConsumption.g.cs @@ -40,7 +40,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct SpecificFuelConsumption : - IArithmeticQuantity, + IArithmeticQuantity, IComparable, IComparable, IConvertible, @@ -153,7 +153,7 @@ public SpecificFuelConsumption(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -248,9 +248,8 @@ public static string GetAbbreviation(SpecificFuelConsumptionUnit unit, IFormatPr /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificFuelConsumption FromGramsPerKiloNewtonSecond(QuantityValue gramsperkilonewtonsecond) + public static SpecificFuelConsumption FromGramsPerKiloNewtonSecond(double value) { - double value = (double) gramsperkilonewtonsecond; return new SpecificFuelConsumption(value, SpecificFuelConsumptionUnit.GramPerKiloNewtonSecond); } @@ -258,9 +257,8 @@ public static SpecificFuelConsumption FromGramsPerKiloNewtonSecond(QuantityValue /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificFuelConsumption FromKilogramsPerKilogramForceHour(QuantityValue kilogramsperkilogramforcehour) + public static SpecificFuelConsumption FromKilogramsPerKilogramForceHour(double value) { - double value = (double) kilogramsperkilogramforcehour; return new SpecificFuelConsumption(value, SpecificFuelConsumptionUnit.KilogramPerKilogramForceHour); } @@ -268,9 +266,8 @@ public static SpecificFuelConsumption FromKilogramsPerKilogramForceHour(Quantity /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificFuelConsumption FromKilogramsPerKiloNewtonSecond(QuantityValue kilogramsperkilonewtonsecond) + public static SpecificFuelConsumption FromKilogramsPerKiloNewtonSecond(double value) { - double value = (double) kilogramsperkilonewtonsecond; return new SpecificFuelConsumption(value, SpecificFuelConsumptionUnit.KilogramPerKiloNewtonSecond); } @@ -278,9 +275,8 @@ public static SpecificFuelConsumption FromKilogramsPerKiloNewtonSecond(QuantityV /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificFuelConsumption FromPoundsMassPerPoundForceHour(QuantityValue poundsmassperpoundforcehour) + public static SpecificFuelConsumption FromPoundsMassPerPoundForceHour(double value) { - double value = (double) poundsmassperpoundforcehour; return new SpecificFuelConsumption(value, SpecificFuelConsumptionUnit.PoundMassPerPoundForceHour); } @@ -290,9 +286,9 @@ public static SpecificFuelConsumption FromPoundsMassPerPoundForceHour(QuantityVa /// Value to convert from. /// Unit to convert from. /// SpecificFuelConsumption unit value. - public static SpecificFuelConsumption From(QuantityValue value, SpecificFuelConsumptionUnit fromUnit) + public static SpecificFuelConsumption From(double value, SpecificFuelConsumptionUnit fromUnit) { - return new SpecificFuelConsumption((double)value, fromUnit); + return new SpecificFuelConsumption(value, fromUnit); } #endregion @@ -703,15 +699,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is SpecificFuelConsumptionUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(SpecificFuelConsumptionUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is SpecificFuelConsumptionUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(SpecificFuelConsumptionUnit)} is supported.", nameof(unit)); @@ -832,18 +819,6 @@ public SpecificFuelConsumption ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not SpecificFuelConsumptionUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(SpecificFuelConsumptionUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificVolume.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificVolume.g.cs index bf896f2a04..511ee26cc2 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificVolume.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificVolume.g.cs @@ -40,7 +40,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct SpecificVolume : - IArithmeticQuantity, + IArithmeticQuantity, #if NET7_0_OR_GREATER IMultiplyOperators, #endif @@ -155,7 +155,7 @@ public SpecificVolume(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -243,9 +243,8 @@ public static string GetAbbreviation(SpecificVolumeUnit unit, IFormatProvider? p /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificVolume FromCubicFeetPerPound(QuantityValue cubicfeetperpound) + public static SpecificVolume FromCubicFeetPerPound(double value) { - double value = (double) cubicfeetperpound; return new SpecificVolume(value, SpecificVolumeUnit.CubicFootPerPound); } @@ -253,9 +252,8 @@ public static SpecificVolume FromCubicFeetPerPound(QuantityValue cubicfeetperpou /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificVolume FromCubicMetersPerKilogram(QuantityValue cubicmetersperkilogram) + public static SpecificVolume FromCubicMetersPerKilogram(double value) { - double value = (double) cubicmetersperkilogram; return new SpecificVolume(value, SpecificVolumeUnit.CubicMeterPerKilogram); } @@ -263,9 +261,8 @@ public static SpecificVolume FromCubicMetersPerKilogram(QuantityValue cubicmeter /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificVolume FromMillicubicMetersPerKilogram(QuantityValue millicubicmetersperkilogram) + public static SpecificVolume FromMillicubicMetersPerKilogram(double value) { - double value = (double) millicubicmetersperkilogram; return new SpecificVolume(value, SpecificVolumeUnit.MillicubicMeterPerKilogram); } @@ -275,9 +272,9 @@ public static SpecificVolume FromMillicubicMetersPerKilogram(QuantityValue milli /// Value to convert from. /// Unit to convert from. /// SpecificVolume unit value. - public static SpecificVolume From(QuantityValue value, SpecificVolumeUnit fromUnit) + public static SpecificVolume From(double value, SpecificVolumeUnit fromUnit) { - return new SpecificVolume((double)value, fromUnit); + return new SpecificVolume(value, fromUnit); } #endregion @@ -704,15 +701,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is SpecificVolumeUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(SpecificVolumeUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is SpecificVolumeUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(SpecificVolumeUnit)} is supported.", nameof(unit)); @@ -831,18 +819,6 @@ public SpecificVolume ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not SpecificVolumeUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(SpecificVolumeUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificWeight.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificWeight.g.cs index c6141cac2a..df6748a31f 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificWeight.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificWeight.g.cs @@ -43,7 +43,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct SpecificWeight : - IArithmeticQuantity, + IArithmeticQuantity, #if NET7_0_OR_GREATER IDivisionOperators, IDivisionOperators, @@ -175,7 +175,7 @@ public SpecificWeight(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -361,9 +361,8 @@ public static string GetAbbreviation(SpecificWeightUnit unit, IFormatProvider? p /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificWeight FromKilogramsForcePerCubicCentimeter(QuantityValue kilogramsforcepercubiccentimeter) + public static SpecificWeight FromKilogramsForcePerCubicCentimeter(double value) { - double value = (double) kilogramsforcepercubiccentimeter; return new SpecificWeight(value, SpecificWeightUnit.KilogramForcePerCubicCentimeter); } @@ -371,9 +370,8 @@ public static SpecificWeight FromKilogramsForcePerCubicCentimeter(QuantityValue /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificWeight FromKilogramsForcePerCubicMeter(QuantityValue kilogramsforcepercubicmeter) + public static SpecificWeight FromKilogramsForcePerCubicMeter(double value) { - double value = (double) kilogramsforcepercubicmeter; return new SpecificWeight(value, SpecificWeightUnit.KilogramForcePerCubicMeter); } @@ -381,9 +379,8 @@ public static SpecificWeight FromKilogramsForcePerCubicMeter(QuantityValue kilog /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificWeight FromKilogramsForcePerCubicMillimeter(QuantityValue kilogramsforcepercubicmillimeter) + public static SpecificWeight FromKilogramsForcePerCubicMillimeter(double value) { - double value = (double) kilogramsforcepercubicmillimeter; return new SpecificWeight(value, SpecificWeightUnit.KilogramForcePerCubicMillimeter); } @@ -391,9 +388,8 @@ public static SpecificWeight FromKilogramsForcePerCubicMillimeter(QuantityValue /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificWeight FromKilonewtonsPerCubicCentimeter(QuantityValue kilonewtonspercubiccentimeter) + public static SpecificWeight FromKilonewtonsPerCubicCentimeter(double value) { - double value = (double) kilonewtonspercubiccentimeter; return new SpecificWeight(value, SpecificWeightUnit.KilonewtonPerCubicCentimeter); } @@ -401,9 +397,8 @@ public static SpecificWeight FromKilonewtonsPerCubicCentimeter(QuantityValue kil /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificWeight FromKilonewtonsPerCubicMeter(QuantityValue kilonewtonspercubicmeter) + public static SpecificWeight FromKilonewtonsPerCubicMeter(double value) { - double value = (double) kilonewtonspercubicmeter; return new SpecificWeight(value, SpecificWeightUnit.KilonewtonPerCubicMeter); } @@ -411,9 +406,8 @@ public static SpecificWeight FromKilonewtonsPerCubicMeter(QuantityValue kilonewt /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificWeight FromKilonewtonsPerCubicMillimeter(QuantityValue kilonewtonspercubicmillimeter) + public static SpecificWeight FromKilonewtonsPerCubicMillimeter(double value) { - double value = (double) kilonewtonspercubicmillimeter; return new SpecificWeight(value, SpecificWeightUnit.KilonewtonPerCubicMillimeter); } @@ -421,9 +415,8 @@ public static SpecificWeight FromKilonewtonsPerCubicMillimeter(QuantityValue kil /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificWeight FromKilopoundsForcePerCubicFoot(QuantityValue kilopoundsforcepercubicfoot) + public static SpecificWeight FromKilopoundsForcePerCubicFoot(double value) { - double value = (double) kilopoundsforcepercubicfoot; return new SpecificWeight(value, SpecificWeightUnit.KilopoundForcePerCubicFoot); } @@ -431,9 +424,8 @@ public static SpecificWeight FromKilopoundsForcePerCubicFoot(QuantityValue kilop /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificWeight FromKilopoundsForcePerCubicInch(QuantityValue kilopoundsforcepercubicinch) + public static SpecificWeight FromKilopoundsForcePerCubicInch(double value) { - double value = (double) kilopoundsforcepercubicinch; return new SpecificWeight(value, SpecificWeightUnit.KilopoundForcePerCubicInch); } @@ -441,9 +433,8 @@ public static SpecificWeight FromKilopoundsForcePerCubicInch(QuantityValue kilop /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificWeight FromMeganewtonsPerCubicMeter(QuantityValue meganewtonspercubicmeter) + public static SpecificWeight FromMeganewtonsPerCubicMeter(double value) { - double value = (double) meganewtonspercubicmeter; return new SpecificWeight(value, SpecificWeightUnit.MeganewtonPerCubicMeter); } @@ -451,9 +442,8 @@ public static SpecificWeight FromMeganewtonsPerCubicMeter(QuantityValue meganewt /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificWeight FromNewtonsPerCubicCentimeter(QuantityValue newtonspercubiccentimeter) + public static SpecificWeight FromNewtonsPerCubicCentimeter(double value) { - double value = (double) newtonspercubiccentimeter; return new SpecificWeight(value, SpecificWeightUnit.NewtonPerCubicCentimeter); } @@ -461,9 +451,8 @@ public static SpecificWeight FromNewtonsPerCubicCentimeter(QuantityValue newtons /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificWeight FromNewtonsPerCubicMeter(QuantityValue newtonspercubicmeter) + public static SpecificWeight FromNewtonsPerCubicMeter(double value) { - double value = (double) newtonspercubicmeter; return new SpecificWeight(value, SpecificWeightUnit.NewtonPerCubicMeter); } @@ -471,9 +460,8 @@ public static SpecificWeight FromNewtonsPerCubicMeter(QuantityValue newtonspercu /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificWeight FromNewtonsPerCubicMillimeter(QuantityValue newtonspercubicmillimeter) + public static SpecificWeight FromNewtonsPerCubicMillimeter(double value) { - double value = (double) newtonspercubicmillimeter; return new SpecificWeight(value, SpecificWeightUnit.NewtonPerCubicMillimeter); } @@ -481,9 +469,8 @@ public static SpecificWeight FromNewtonsPerCubicMillimeter(QuantityValue newtons /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificWeight FromPoundsForcePerCubicFoot(QuantityValue poundsforcepercubicfoot) + public static SpecificWeight FromPoundsForcePerCubicFoot(double value) { - double value = (double) poundsforcepercubicfoot; return new SpecificWeight(value, SpecificWeightUnit.PoundForcePerCubicFoot); } @@ -491,9 +478,8 @@ public static SpecificWeight FromPoundsForcePerCubicFoot(QuantityValue poundsfor /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificWeight FromPoundsForcePerCubicInch(QuantityValue poundsforcepercubicinch) + public static SpecificWeight FromPoundsForcePerCubicInch(double value) { - double value = (double) poundsforcepercubicinch; return new SpecificWeight(value, SpecificWeightUnit.PoundForcePerCubicInch); } @@ -501,9 +487,8 @@ public static SpecificWeight FromPoundsForcePerCubicInch(QuantityValue poundsfor /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificWeight FromTonnesForcePerCubicCentimeter(QuantityValue tonnesforcepercubiccentimeter) + public static SpecificWeight FromTonnesForcePerCubicCentimeter(double value) { - double value = (double) tonnesforcepercubiccentimeter; return new SpecificWeight(value, SpecificWeightUnit.TonneForcePerCubicCentimeter); } @@ -511,9 +496,8 @@ public static SpecificWeight FromTonnesForcePerCubicCentimeter(QuantityValue ton /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificWeight FromTonnesForcePerCubicMeter(QuantityValue tonnesforcepercubicmeter) + public static SpecificWeight FromTonnesForcePerCubicMeter(double value) { - double value = (double) tonnesforcepercubicmeter; return new SpecificWeight(value, SpecificWeightUnit.TonneForcePerCubicMeter); } @@ -521,9 +505,8 @@ public static SpecificWeight FromTonnesForcePerCubicMeter(QuantityValue tonnesfo /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificWeight FromTonnesForcePerCubicMillimeter(QuantityValue tonnesforcepercubicmillimeter) + public static SpecificWeight FromTonnesForcePerCubicMillimeter(double value) { - double value = (double) tonnesforcepercubicmillimeter; return new SpecificWeight(value, SpecificWeightUnit.TonneForcePerCubicMillimeter); } @@ -533,9 +516,9 @@ public static SpecificWeight FromTonnesForcePerCubicMillimeter(QuantityValue ton /// Value to convert from. /// Unit to convert from. /// SpecificWeight unit value. - public static SpecificWeight From(QuantityValue value, SpecificWeightUnit fromUnit) + public static SpecificWeight From(double value, SpecificWeightUnit fromUnit) { - return new SpecificWeight((double)value, fromUnit); + return new SpecificWeight(value, fromUnit); } #endregion @@ -974,15 +957,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is SpecificWeightUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(SpecificWeightUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is SpecificWeightUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(SpecificWeightUnit)} is supported.", nameof(unit)); @@ -1129,18 +1103,6 @@ public SpecificWeight ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not SpecificWeightUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(SpecificWeightUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/Speed.g.cs b/UnitsNet/GeneratedCode/Quantities/Speed.g.cs index 06ade9b4bb..be123e3c16 100644 --- a/UnitsNet/GeneratedCode/Quantities/Speed.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Speed.g.cs @@ -40,7 +40,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct Speed : - IArithmeticQuantity, + IArithmeticQuantity, #if NET7_0_OR_GREATER IDivisionOperators, IDivisionOperators, @@ -194,7 +194,7 @@ public Speed(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -492,9 +492,8 @@ public static string GetAbbreviation(SpeedUnit unit, IFormatProvider? provider) /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromCentimetersPerHour(QuantityValue centimetersperhour) + public static Speed FromCentimetersPerHour(double value) { - double value = (double) centimetersperhour; return new Speed(value, SpeedUnit.CentimeterPerHour); } @@ -502,9 +501,8 @@ public static Speed FromCentimetersPerHour(QuantityValue centimetersperhour) /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromCentimetersPerMinute(QuantityValue centimetersperminute) + public static Speed FromCentimetersPerMinute(double value) { - double value = (double) centimetersperminute; return new Speed(value, SpeedUnit.CentimeterPerMinute); } @@ -512,9 +510,8 @@ public static Speed FromCentimetersPerMinute(QuantityValue centimetersperminute) /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromCentimetersPerSecond(QuantityValue centimeterspersecond) + public static Speed FromCentimetersPerSecond(double value) { - double value = (double) centimeterspersecond; return new Speed(value, SpeedUnit.CentimeterPerSecond); } @@ -522,9 +519,8 @@ public static Speed FromCentimetersPerSecond(QuantityValue centimeterspersecond) /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromDecimetersPerMinute(QuantityValue decimetersperminute) + public static Speed FromDecimetersPerMinute(double value) { - double value = (double) decimetersperminute; return new Speed(value, SpeedUnit.DecimeterPerMinute); } @@ -532,9 +528,8 @@ public static Speed FromDecimetersPerMinute(QuantityValue decimetersperminute) /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromDecimetersPerSecond(QuantityValue decimeterspersecond) + public static Speed FromDecimetersPerSecond(double value) { - double value = (double) decimeterspersecond; return new Speed(value, SpeedUnit.DecimeterPerSecond); } @@ -542,9 +537,8 @@ public static Speed FromDecimetersPerSecond(QuantityValue decimeterspersecond) /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromFeetPerHour(QuantityValue feetperhour) + public static Speed FromFeetPerHour(double value) { - double value = (double) feetperhour; return new Speed(value, SpeedUnit.FootPerHour); } @@ -552,9 +546,8 @@ public static Speed FromFeetPerHour(QuantityValue feetperhour) /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromFeetPerMinute(QuantityValue feetperminute) + public static Speed FromFeetPerMinute(double value) { - double value = (double) feetperminute; return new Speed(value, SpeedUnit.FootPerMinute); } @@ -562,9 +555,8 @@ public static Speed FromFeetPerMinute(QuantityValue feetperminute) /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromFeetPerSecond(QuantityValue feetpersecond) + public static Speed FromFeetPerSecond(double value) { - double value = (double) feetpersecond; return new Speed(value, SpeedUnit.FootPerSecond); } @@ -572,9 +564,8 @@ public static Speed FromFeetPerSecond(QuantityValue feetpersecond) /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromInchesPerHour(QuantityValue inchesperhour) + public static Speed FromInchesPerHour(double value) { - double value = (double) inchesperhour; return new Speed(value, SpeedUnit.InchPerHour); } @@ -582,9 +573,8 @@ public static Speed FromInchesPerHour(QuantityValue inchesperhour) /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromInchesPerMinute(QuantityValue inchesperminute) + public static Speed FromInchesPerMinute(double value) { - double value = (double) inchesperminute; return new Speed(value, SpeedUnit.InchPerMinute); } @@ -592,9 +582,8 @@ public static Speed FromInchesPerMinute(QuantityValue inchesperminute) /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromInchesPerSecond(QuantityValue inchespersecond) + public static Speed FromInchesPerSecond(double value) { - double value = (double) inchespersecond; return new Speed(value, SpeedUnit.InchPerSecond); } @@ -602,9 +591,8 @@ public static Speed FromInchesPerSecond(QuantityValue inchespersecond) /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromKilometersPerHour(QuantityValue kilometersperhour) + public static Speed FromKilometersPerHour(double value) { - double value = (double) kilometersperhour; return new Speed(value, SpeedUnit.KilometerPerHour); } @@ -612,9 +600,8 @@ public static Speed FromKilometersPerHour(QuantityValue kilometersperhour) /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromKilometersPerMinute(QuantityValue kilometersperminute) + public static Speed FromKilometersPerMinute(double value) { - double value = (double) kilometersperminute; return new Speed(value, SpeedUnit.KilometerPerMinute); } @@ -622,9 +609,8 @@ public static Speed FromKilometersPerMinute(QuantityValue kilometersperminute) /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromKilometersPerSecond(QuantityValue kilometerspersecond) + public static Speed FromKilometersPerSecond(double value) { - double value = (double) kilometerspersecond; return new Speed(value, SpeedUnit.KilometerPerSecond); } @@ -632,9 +618,8 @@ public static Speed FromKilometersPerSecond(QuantityValue kilometerspersecond) /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromKnots(QuantityValue knots) + public static Speed FromKnots(double value) { - double value = (double) knots; return new Speed(value, SpeedUnit.Knot); } @@ -642,9 +627,8 @@ public static Speed FromKnots(QuantityValue knots) /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromMach(QuantityValue mach) + public static Speed FromMach(double value) { - double value = (double) mach; return new Speed(value, SpeedUnit.Mach); } @@ -652,9 +636,8 @@ public static Speed FromMach(QuantityValue mach) /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromMetersPerHour(QuantityValue metersperhour) + public static Speed FromMetersPerHour(double value) { - double value = (double) metersperhour; return new Speed(value, SpeedUnit.MeterPerHour); } @@ -662,9 +645,8 @@ public static Speed FromMetersPerHour(QuantityValue metersperhour) /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromMetersPerMinute(QuantityValue metersperminute) + public static Speed FromMetersPerMinute(double value) { - double value = (double) metersperminute; return new Speed(value, SpeedUnit.MeterPerMinute); } @@ -672,9 +654,8 @@ public static Speed FromMetersPerMinute(QuantityValue metersperminute) /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromMetersPerSecond(QuantityValue meterspersecond) + public static Speed FromMetersPerSecond(double value) { - double value = (double) meterspersecond; return new Speed(value, SpeedUnit.MeterPerSecond); } @@ -682,9 +663,8 @@ public static Speed FromMetersPerSecond(QuantityValue meterspersecond) /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromMicrometersPerMinute(QuantityValue micrometersperminute) + public static Speed FromMicrometersPerMinute(double value) { - double value = (double) micrometersperminute; return new Speed(value, SpeedUnit.MicrometerPerMinute); } @@ -692,9 +672,8 @@ public static Speed FromMicrometersPerMinute(QuantityValue micrometersperminute) /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromMicrometersPerSecond(QuantityValue micrometerspersecond) + public static Speed FromMicrometersPerSecond(double value) { - double value = (double) micrometerspersecond; return new Speed(value, SpeedUnit.MicrometerPerSecond); } @@ -702,9 +681,8 @@ public static Speed FromMicrometersPerSecond(QuantityValue micrometerspersecond) /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromMilesPerHour(QuantityValue milesperhour) + public static Speed FromMilesPerHour(double value) { - double value = (double) milesperhour; return new Speed(value, SpeedUnit.MilePerHour); } @@ -712,9 +690,8 @@ public static Speed FromMilesPerHour(QuantityValue milesperhour) /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromMillimetersPerHour(QuantityValue millimetersperhour) + public static Speed FromMillimetersPerHour(double value) { - double value = (double) millimetersperhour; return new Speed(value, SpeedUnit.MillimeterPerHour); } @@ -722,9 +699,8 @@ public static Speed FromMillimetersPerHour(QuantityValue millimetersperhour) /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromMillimetersPerMinute(QuantityValue millimetersperminute) + public static Speed FromMillimetersPerMinute(double value) { - double value = (double) millimetersperminute; return new Speed(value, SpeedUnit.MillimeterPerMinute); } @@ -732,9 +708,8 @@ public static Speed FromMillimetersPerMinute(QuantityValue millimetersperminute) /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromMillimetersPerSecond(QuantityValue millimeterspersecond) + public static Speed FromMillimetersPerSecond(double value) { - double value = (double) millimeterspersecond; return new Speed(value, SpeedUnit.MillimeterPerSecond); } @@ -742,9 +717,8 @@ public static Speed FromMillimetersPerSecond(QuantityValue millimeterspersecond) /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromNanometersPerMinute(QuantityValue nanometersperminute) + public static Speed FromNanometersPerMinute(double value) { - double value = (double) nanometersperminute; return new Speed(value, SpeedUnit.NanometerPerMinute); } @@ -752,9 +726,8 @@ public static Speed FromNanometersPerMinute(QuantityValue nanometersperminute) /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromNanometersPerSecond(QuantityValue nanometerspersecond) + public static Speed FromNanometersPerSecond(double value) { - double value = (double) nanometerspersecond; return new Speed(value, SpeedUnit.NanometerPerSecond); } @@ -762,9 +735,8 @@ public static Speed FromNanometersPerSecond(QuantityValue nanometerspersecond) /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromUsSurveyFeetPerHour(QuantityValue ussurveyfeetperhour) + public static Speed FromUsSurveyFeetPerHour(double value) { - double value = (double) ussurveyfeetperhour; return new Speed(value, SpeedUnit.UsSurveyFootPerHour); } @@ -772,9 +744,8 @@ public static Speed FromUsSurveyFeetPerHour(QuantityValue ussurveyfeetperhour) /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromUsSurveyFeetPerMinute(QuantityValue ussurveyfeetperminute) + public static Speed FromUsSurveyFeetPerMinute(double value) { - double value = (double) ussurveyfeetperminute; return new Speed(value, SpeedUnit.UsSurveyFootPerMinute); } @@ -782,9 +753,8 @@ public static Speed FromUsSurveyFeetPerMinute(QuantityValue ussurveyfeetperminut /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromUsSurveyFeetPerSecond(QuantityValue ussurveyfeetpersecond) + public static Speed FromUsSurveyFeetPerSecond(double value) { - double value = (double) ussurveyfeetpersecond; return new Speed(value, SpeedUnit.UsSurveyFootPerSecond); } @@ -792,9 +762,8 @@ public static Speed FromUsSurveyFeetPerSecond(QuantityValue ussurveyfeetpersecon /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromYardsPerHour(QuantityValue yardsperhour) + public static Speed FromYardsPerHour(double value) { - double value = (double) yardsperhour; return new Speed(value, SpeedUnit.YardPerHour); } @@ -802,9 +771,8 @@ public static Speed FromYardsPerHour(QuantityValue yardsperhour) /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromYardsPerMinute(QuantityValue yardsperminute) + public static Speed FromYardsPerMinute(double value) { - double value = (double) yardsperminute; return new Speed(value, SpeedUnit.YardPerMinute); } @@ -812,9 +780,8 @@ public static Speed FromYardsPerMinute(QuantityValue yardsperminute) /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromYardsPerSecond(QuantityValue yardspersecond) + public static Speed FromYardsPerSecond(double value) { - double value = (double) yardspersecond; return new Speed(value, SpeedUnit.YardPerSecond); } @@ -824,9 +791,9 @@ public static Speed FromYardsPerSecond(QuantityValue yardspersecond) /// Value to convert from. /// Unit to convert from. /// Speed unit value. - public static Speed From(QuantityValue value, SpeedUnit fromUnit) + public static Speed From(double value, SpeedUnit fromUnit) { - return new Speed((double)value, fromUnit); + return new Speed(value, fromUnit); } #endregion @@ -1307,15 +1274,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is SpeedUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(SpeedUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is SpeedUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(SpeedUnit)} is supported.", nameof(unit)); @@ -1494,18 +1452,6 @@ public Speed ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not SpeedUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(SpeedUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/StandardVolumeFlow.g.cs b/UnitsNet/GeneratedCode/Quantities/StandardVolumeFlow.g.cs index e229c4b67a..556efa1c3c 100644 --- a/UnitsNet/GeneratedCode/Quantities/StandardVolumeFlow.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/StandardVolumeFlow.g.cs @@ -37,7 +37,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct StandardVolumeFlow : - IArithmeticQuantity, + IArithmeticQuantity, IComparable, IComparable, IConvertible, @@ -155,7 +155,7 @@ public StandardVolumeFlow(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -285,9 +285,8 @@ public static string GetAbbreviation(StandardVolumeFlowUnit unit, IFormatProvide /// Creates a from . /// /// If value is NaN or Infinity. - public static StandardVolumeFlow FromStandardCubicCentimetersPerMinute(QuantityValue standardcubiccentimetersperminute) + public static StandardVolumeFlow FromStandardCubicCentimetersPerMinute(double value) { - double value = (double) standardcubiccentimetersperminute; return new StandardVolumeFlow(value, StandardVolumeFlowUnit.StandardCubicCentimeterPerMinute); } @@ -295,9 +294,8 @@ public static StandardVolumeFlow FromStandardCubicCentimetersPerMinute(QuantityV /// Creates a from . /// /// If value is NaN or Infinity. - public static StandardVolumeFlow FromStandardCubicFeetPerHour(QuantityValue standardcubicfeetperhour) + public static StandardVolumeFlow FromStandardCubicFeetPerHour(double value) { - double value = (double) standardcubicfeetperhour; return new StandardVolumeFlow(value, StandardVolumeFlowUnit.StandardCubicFootPerHour); } @@ -305,9 +303,8 @@ public static StandardVolumeFlow FromStandardCubicFeetPerHour(QuantityValue stan /// Creates a from . /// /// If value is NaN or Infinity. - public static StandardVolumeFlow FromStandardCubicFeetPerMinute(QuantityValue standardcubicfeetperminute) + public static StandardVolumeFlow FromStandardCubicFeetPerMinute(double value) { - double value = (double) standardcubicfeetperminute; return new StandardVolumeFlow(value, StandardVolumeFlowUnit.StandardCubicFootPerMinute); } @@ -315,9 +312,8 @@ public static StandardVolumeFlow FromStandardCubicFeetPerMinute(QuantityValue st /// Creates a from . /// /// If value is NaN or Infinity. - public static StandardVolumeFlow FromStandardCubicFeetPerSecond(QuantityValue standardcubicfeetpersecond) + public static StandardVolumeFlow FromStandardCubicFeetPerSecond(double value) { - double value = (double) standardcubicfeetpersecond; return new StandardVolumeFlow(value, StandardVolumeFlowUnit.StandardCubicFootPerSecond); } @@ -325,9 +321,8 @@ public static StandardVolumeFlow FromStandardCubicFeetPerSecond(QuantityValue st /// Creates a from . /// /// If value is NaN or Infinity. - public static StandardVolumeFlow FromStandardCubicMetersPerDay(QuantityValue standardcubicmetersperday) + public static StandardVolumeFlow FromStandardCubicMetersPerDay(double value) { - double value = (double) standardcubicmetersperday; return new StandardVolumeFlow(value, StandardVolumeFlowUnit.StandardCubicMeterPerDay); } @@ -335,9 +330,8 @@ public static StandardVolumeFlow FromStandardCubicMetersPerDay(QuantityValue sta /// Creates a from . /// /// If value is NaN or Infinity. - public static StandardVolumeFlow FromStandardCubicMetersPerHour(QuantityValue standardcubicmetersperhour) + public static StandardVolumeFlow FromStandardCubicMetersPerHour(double value) { - double value = (double) standardcubicmetersperhour; return new StandardVolumeFlow(value, StandardVolumeFlowUnit.StandardCubicMeterPerHour); } @@ -345,9 +339,8 @@ public static StandardVolumeFlow FromStandardCubicMetersPerHour(QuantityValue st /// Creates a from . /// /// If value is NaN or Infinity. - public static StandardVolumeFlow FromStandardCubicMetersPerMinute(QuantityValue standardcubicmetersperminute) + public static StandardVolumeFlow FromStandardCubicMetersPerMinute(double value) { - double value = (double) standardcubicmetersperminute; return new StandardVolumeFlow(value, StandardVolumeFlowUnit.StandardCubicMeterPerMinute); } @@ -355,9 +348,8 @@ public static StandardVolumeFlow FromStandardCubicMetersPerMinute(QuantityValue /// Creates a from . /// /// If value is NaN or Infinity. - public static StandardVolumeFlow FromStandardCubicMetersPerSecond(QuantityValue standardcubicmeterspersecond) + public static StandardVolumeFlow FromStandardCubicMetersPerSecond(double value) { - double value = (double) standardcubicmeterspersecond; return new StandardVolumeFlow(value, StandardVolumeFlowUnit.StandardCubicMeterPerSecond); } @@ -365,9 +357,8 @@ public static StandardVolumeFlow FromStandardCubicMetersPerSecond(QuantityValue /// Creates a from . /// /// If value is NaN or Infinity. - public static StandardVolumeFlow FromStandardLitersPerMinute(QuantityValue standardlitersperminute) + public static StandardVolumeFlow FromStandardLitersPerMinute(double value) { - double value = (double) standardlitersperminute; return new StandardVolumeFlow(value, StandardVolumeFlowUnit.StandardLiterPerMinute); } @@ -377,9 +368,9 @@ public static StandardVolumeFlow FromStandardLitersPerMinute(QuantityValue stand /// Value to convert from. /// Unit to convert from. /// StandardVolumeFlow unit value. - public static StandardVolumeFlow From(QuantityValue value, StandardVolumeFlowUnit fromUnit) + public static StandardVolumeFlow From(double value, StandardVolumeFlowUnit fromUnit) { - return new StandardVolumeFlow((double)value, fromUnit); + return new StandardVolumeFlow(value, fromUnit); } #endregion @@ -790,15 +781,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is StandardVolumeFlowUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(StandardVolumeFlowUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is StandardVolumeFlowUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(StandardVolumeFlowUnit)} is supported.", nameof(unit)); @@ -929,18 +911,6 @@ public StandardVolumeFlow ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not StandardVolumeFlowUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(StandardVolumeFlowUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/Temperature.g.cs b/UnitsNet/GeneratedCode/Quantities/Temperature.g.cs index 9b89fd2f04..4afd8ff8ca 100644 --- a/UnitsNet/GeneratedCode/Quantities/Temperature.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Temperature.g.cs @@ -37,7 +37,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct Temperature : - IQuantity, + IQuantity, IComparable, IComparable, IConvertible, @@ -153,7 +153,7 @@ public Temperature(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -290,9 +290,8 @@ public static string GetAbbreviation(TemperatureUnit unit, IFormatProvider? prov /// Creates a from . /// /// If value is NaN or Infinity. - public static Temperature FromDegreesCelsius(QuantityValue degreescelsius) + public static Temperature FromDegreesCelsius(double value) { - double value = (double) degreescelsius; return new Temperature(value, TemperatureUnit.DegreeCelsius); } @@ -300,9 +299,8 @@ public static Temperature FromDegreesCelsius(QuantityValue degreescelsius) /// Creates a from . /// /// If value is NaN or Infinity. - public static Temperature FromDegreesDelisle(QuantityValue degreesdelisle) + public static Temperature FromDegreesDelisle(double value) { - double value = (double) degreesdelisle; return new Temperature(value, TemperatureUnit.DegreeDelisle); } @@ -310,9 +308,8 @@ public static Temperature FromDegreesDelisle(QuantityValue degreesdelisle) /// Creates a from . /// /// If value is NaN or Infinity. - public static Temperature FromDegreesFahrenheit(QuantityValue degreesfahrenheit) + public static Temperature FromDegreesFahrenheit(double value) { - double value = (double) degreesfahrenheit; return new Temperature(value, TemperatureUnit.DegreeFahrenheit); } @@ -320,9 +317,8 @@ public static Temperature FromDegreesFahrenheit(QuantityValue degreesfahrenheit) /// Creates a from . /// /// If value is NaN or Infinity. - public static Temperature FromDegreesNewton(QuantityValue degreesnewton) + public static Temperature FromDegreesNewton(double value) { - double value = (double) degreesnewton; return new Temperature(value, TemperatureUnit.DegreeNewton); } @@ -330,9 +326,8 @@ public static Temperature FromDegreesNewton(QuantityValue degreesnewton) /// Creates a from . /// /// If value is NaN or Infinity. - public static Temperature FromDegreesRankine(QuantityValue degreesrankine) + public static Temperature FromDegreesRankine(double value) { - double value = (double) degreesrankine; return new Temperature(value, TemperatureUnit.DegreeRankine); } @@ -340,9 +335,8 @@ public static Temperature FromDegreesRankine(QuantityValue degreesrankine) /// Creates a from . /// /// If value is NaN or Infinity. - public static Temperature FromDegreesReaumur(QuantityValue degreesreaumur) + public static Temperature FromDegreesReaumur(double value) { - double value = (double) degreesreaumur; return new Temperature(value, TemperatureUnit.DegreeReaumur); } @@ -350,9 +344,8 @@ public static Temperature FromDegreesReaumur(QuantityValue degreesreaumur) /// Creates a from . /// /// If value is NaN or Infinity. - public static Temperature FromDegreesRoemer(QuantityValue degreesroemer) + public static Temperature FromDegreesRoemer(double value) { - double value = (double) degreesroemer; return new Temperature(value, TemperatureUnit.DegreeRoemer); } @@ -360,9 +353,8 @@ public static Temperature FromDegreesRoemer(QuantityValue degreesroemer) /// Creates a from . /// /// If value is NaN or Infinity. - public static Temperature FromKelvins(QuantityValue kelvins) + public static Temperature FromKelvins(double value) { - double value = (double) kelvins; return new Temperature(value, TemperatureUnit.Kelvin); } @@ -370,9 +362,8 @@ public static Temperature FromKelvins(QuantityValue kelvins) /// Creates a from . /// /// If value is NaN or Infinity. - public static Temperature FromMillidegreesCelsius(QuantityValue millidegreescelsius) + public static Temperature FromMillidegreesCelsius(double value) { - double value = (double) millidegreescelsius; return new Temperature(value, TemperatureUnit.MillidegreeCelsius); } @@ -380,9 +371,8 @@ public static Temperature FromMillidegreesCelsius(QuantityValue millidegreescels /// Creates a from . /// /// If value is NaN or Infinity. - public static Temperature FromSolarTemperatures(QuantityValue solartemperatures) + public static Temperature FromSolarTemperatures(double value) { - double value = (double) solartemperatures; return new Temperature(value, TemperatureUnit.SolarTemperature); } @@ -392,9 +382,9 @@ public static Temperature FromSolarTemperatures(QuantityValue solartemperatures) /// Value to convert from. /// Unit to convert from. /// Temperature unit value. - public static Temperature From(QuantityValue value, TemperatureUnit fromUnit) + public static Temperature From(double value, TemperatureUnit fromUnit) { - return new Temperature((double)value, fromUnit); + return new Temperature(value, fromUnit); } #endregion @@ -759,15 +749,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is TemperatureUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(TemperatureUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is TemperatureUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(TemperatureUnit)} is supported.", nameof(unit)); @@ -900,18 +881,6 @@ public Temperature ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not TemperatureUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(TemperatureUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.g.cs index 3a397fbf7c..d11a02f09f 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.g.cs @@ -40,7 +40,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct TemperatureChangeRate : - IArithmeticQuantity, + IArithmeticQuantity, #if NET7_0_OR_GREATER IMultiplyOperators, IMultiplyOperators, @@ -163,7 +163,7 @@ public TemperatureChangeRate(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -300,9 +300,8 @@ public static string GetAbbreviation(TemperatureChangeRateUnit unit, IFormatProv /// Creates a from . /// /// If value is NaN or Infinity. - public static TemperatureChangeRate FromCentidegreesCelsiusPerSecond(QuantityValue centidegreescelsiuspersecond) + public static TemperatureChangeRate FromCentidegreesCelsiusPerSecond(double value) { - double value = (double) centidegreescelsiuspersecond; return new TemperatureChangeRate(value, TemperatureChangeRateUnit.CentidegreeCelsiusPerSecond); } @@ -310,9 +309,8 @@ public static TemperatureChangeRate FromCentidegreesCelsiusPerSecond(QuantityVal /// Creates a from . /// /// If value is NaN or Infinity. - public static TemperatureChangeRate FromDecadegreesCelsiusPerSecond(QuantityValue decadegreescelsiuspersecond) + public static TemperatureChangeRate FromDecadegreesCelsiusPerSecond(double value) { - double value = (double) decadegreescelsiuspersecond; return new TemperatureChangeRate(value, TemperatureChangeRateUnit.DecadegreeCelsiusPerSecond); } @@ -320,9 +318,8 @@ public static TemperatureChangeRate FromDecadegreesCelsiusPerSecond(QuantityValu /// Creates a from . /// /// If value is NaN or Infinity. - public static TemperatureChangeRate FromDecidegreesCelsiusPerSecond(QuantityValue decidegreescelsiuspersecond) + public static TemperatureChangeRate FromDecidegreesCelsiusPerSecond(double value) { - double value = (double) decidegreescelsiuspersecond; return new TemperatureChangeRate(value, TemperatureChangeRateUnit.DecidegreeCelsiusPerSecond); } @@ -330,9 +327,8 @@ public static TemperatureChangeRate FromDecidegreesCelsiusPerSecond(QuantityValu /// Creates a from . /// /// If value is NaN or Infinity. - public static TemperatureChangeRate FromDegreesCelsiusPerMinute(QuantityValue degreescelsiusperminute) + public static TemperatureChangeRate FromDegreesCelsiusPerMinute(double value) { - double value = (double) degreescelsiusperminute; return new TemperatureChangeRate(value, TemperatureChangeRateUnit.DegreeCelsiusPerMinute); } @@ -340,9 +336,8 @@ public static TemperatureChangeRate FromDegreesCelsiusPerMinute(QuantityValue de /// Creates a from . /// /// If value is NaN or Infinity. - public static TemperatureChangeRate FromDegreesCelsiusPerSecond(QuantityValue degreescelsiuspersecond) + public static TemperatureChangeRate FromDegreesCelsiusPerSecond(double value) { - double value = (double) degreescelsiuspersecond; return new TemperatureChangeRate(value, TemperatureChangeRateUnit.DegreeCelsiusPerSecond); } @@ -350,9 +345,8 @@ public static TemperatureChangeRate FromDegreesCelsiusPerSecond(QuantityValue de /// Creates a from . /// /// If value is NaN or Infinity. - public static TemperatureChangeRate FromHectodegreesCelsiusPerSecond(QuantityValue hectodegreescelsiuspersecond) + public static TemperatureChangeRate FromHectodegreesCelsiusPerSecond(double value) { - double value = (double) hectodegreescelsiuspersecond; return new TemperatureChangeRate(value, TemperatureChangeRateUnit.HectodegreeCelsiusPerSecond); } @@ -360,9 +354,8 @@ public static TemperatureChangeRate FromHectodegreesCelsiusPerSecond(QuantityVal /// Creates a from . /// /// If value is NaN or Infinity. - public static TemperatureChangeRate FromKilodegreesCelsiusPerSecond(QuantityValue kilodegreescelsiuspersecond) + public static TemperatureChangeRate FromKilodegreesCelsiusPerSecond(double value) { - double value = (double) kilodegreescelsiuspersecond; return new TemperatureChangeRate(value, TemperatureChangeRateUnit.KilodegreeCelsiusPerSecond); } @@ -370,9 +363,8 @@ public static TemperatureChangeRate FromKilodegreesCelsiusPerSecond(QuantityValu /// Creates a from . /// /// If value is NaN or Infinity. - public static TemperatureChangeRate FromMicrodegreesCelsiusPerSecond(QuantityValue microdegreescelsiuspersecond) + public static TemperatureChangeRate FromMicrodegreesCelsiusPerSecond(double value) { - double value = (double) microdegreescelsiuspersecond; return new TemperatureChangeRate(value, TemperatureChangeRateUnit.MicrodegreeCelsiusPerSecond); } @@ -380,9 +372,8 @@ public static TemperatureChangeRate FromMicrodegreesCelsiusPerSecond(QuantityVal /// Creates a from . /// /// If value is NaN or Infinity. - public static TemperatureChangeRate FromMillidegreesCelsiusPerSecond(QuantityValue millidegreescelsiuspersecond) + public static TemperatureChangeRate FromMillidegreesCelsiusPerSecond(double value) { - double value = (double) millidegreescelsiuspersecond; return new TemperatureChangeRate(value, TemperatureChangeRateUnit.MillidegreeCelsiusPerSecond); } @@ -390,9 +381,8 @@ public static TemperatureChangeRate FromMillidegreesCelsiusPerSecond(QuantityVal /// Creates a from . /// /// If value is NaN or Infinity. - public static TemperatureChangeRate FromNanodegreesCelsiusPerSecond(QuantityValue nanodegreescelsiuspersecond) + public static TemperatureChangeRate FromNanodegreesCelsiusPerSecond(double value) { - double value = (double) nanodegreescelsiuspersecond; return new TemperatureChangeRate(value, TemperatureChangeRateUnit.NanodegreeCelsiusPerSecond); } @@ -402,9 +392,9 @@ public static TemperatureChangeRate FromNanodegreesCelsiusPerSecond(QuantityValu /// Value to convert from. /// Unit to convert from. /// TemperatureChangeRate unit value. - public static TemperatureChangeRate From(QuantityValue value, TemperatureChangeRateUnit fromUnit) + public static TemperatureChangeRate From(double value, TemperatureChangeRateUnit fromUnit) { - return new TemperatureChangeRate((double)value, fromUnit); + return new TemperatureChangeRate(value, fromUnit); } #endregion @@ -837,15 +827,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is TemperatureChangeRateUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(TemperatureChangeRateUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is TemperatureChangeRateUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(TemperatureChangeRateUnit)} is supported.", nameof(unit)); @@ -978,18 +959,6 @@ public TemperatureChangeRate ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not TemperatureChangeRateUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(TemperatureChangeRateUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.g.cs index 96d1d1fdf1..ac4bc1b2b9 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.g.cs @@ -40,7 +40,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct TemperatureDelta : - IArithmeticQuantity, + IArithmeticQuantity, #if NET7_0_OR_GREATER IMultiplyOperators, IDivisionOperators, @@ -165,7 +165,7 @@ public TemperatureDelta(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -295,9 +295,8 @@ public static string GetAbbreviation(TemperatureDeltaUnit unit, IFormatProvider? /// Creates a from . /// /// If value is NaN or Infinity. - public static TemperatureDelta FromDegreesCelsius(QuantityValue degreescelsius) + public static TemperatureDelta FromDegreesCelsius(double value) { - double value = (double) degreescelsius; return new TemperatureDelta(value, TemperatureDeltaUnit.DegreeCelsius); } @@ -305,9 +304,8 @@ public static TemperatureDelta FromDegreesCelsius(QuantityValue degreescelsius) /// Creates a from . /// /// If value is NaN or Infinity. - public static TemperatureDelta FromDegreesDelisle(QuantityValue degreesdelisle) + public static TemperatureDelta FromDegreesDelisle(double value) { - double value = (double) degreesdelisle; return new TemperatureDelta(value, TemperatureDeltaUnit.DegreeDelisle); } @@ -315,9 +313,8 @@ public static TemperatureDelta FromDegreesDelisle(QuantityValue degreesdelisle) /// Creates a from . /// /// If value is NaN or Infinity. - public static TemperatureDelta FromDegreesFahrenheit(QuantityValue degreesfahrenheit) + public static TemperatureDelta FromDegreesFahrenheit(double value) { - double value = (double) degreesfahrenheit; return new TemperatureDelta(value, TemperatureDeltaUnit.DegreeFahrenheit); } @@ -325,9 +322,8 @@ public static TemperatureDelta FromDegreesFahrenheit(QuantityValue degreesfahren /// Creates a from . /// /// If value is NaN or Infinity. - public static TemperatureDelta FromDegreesNewton(QuantityValue degreesnewton) + public static TemperatureDelta FromDegreesNewton(double value) { - double value = (double) degreesnewton; return new TemperatureDelta(value, TemperatureDeltaUnit.DegreeNewton); } @@ -335,9 +331,8 @@ public static TemperatureDelta FromDegreesNewton(QuantityValue degreesnewton) /// Creates a from . /// /// If value is NaN or Infinity. - public static TemperatureDelta FromDegreesRankine(QuantityValue degreesrankine) + public static TemperatureDelta FromDegreesRankine(double value) { - double value = (double) degreesrankine; return new TemperatureDelta(value, TemperatureDeltaUnit.DegreeRankine); } @@ -345,9 +340,8 @@ public static TemperatureDelta FromDegreesRankine(QuantityValue degreesrankine) /// Creates a from . /// /// If value is NaN or Infinity. - public static TemperatureDelta FromDegreesReaumur(QuantityValue degreesreaumur) + public static TemperatureDelta FromDegreesReaumur(double value) { - double value = (double) degreesreaumur; return new TemperatureDelta(value, TemperatureDeltaUnit.DegreeReaumur); } @@ -355,9 +349,8 @@ public static TemperatureDelta FromDegreesReaumur(QuantityValue degreesreaumur) /// Creates a from . /// /// If value is NaN or Infinity. - public static TemperatureDelta FromDegreesRoemer(QuantityValue degreesroemer) + public static TemperatureDelta FromDegreesRoemer(double value) { - double value = (double) degreesroemer; return new TemperatureDelta(value, TemperatureDeltaUnit.DegreeRoemer); } @@ -365,9 +358,8 @@ public static TemperatureDelta FromDegreesRoemer(QuantityValue degreesroemer) /// Creates a from . /// /// If value is NaN or Infinity. - public static TemperatureDelta FromKelvins(QuantityValue kelvins) + public static TemperatureDelta FromKelvins(double value) { - double value = (double) kelvins; return new TemperatureDelta(value, TemperatureDeltaUnit.Kelvin); } @@ -375,9 +367,8 @@ public static TemperatureDelta FromKelvins(QuantityValue kelvins) /// Creates a from . /// /// If value is NaN or Infinity. - public static TemperatureDelta FromMillidegreesCelsius(QuantityValue millidegreescelsius) + public static TemperatureDelta FromMillidegreesCelsius(double value) { - double value = (double) millidegreescelsius; return new TemperatureDelta(value, TemperatureDeltaUnit.MillidegreeCelsius); } @@ -387,9 +378,9 @@ public static TemperatureDelta FromMillidegreesCelsius(QuantityValue millidegree /// Value to convert from. /// Unit to convert from. /// TemperatureDelta unit value. - public static TemperatureDelta From(QuantityValue value, TemperatureDeltaUnit fromUnit) + public static TemperatureDelta From(double value, TemperatureDeltaUnit fromUnit) { - return new TemperatureDelta((double)value, fromUnit); + return new TemperatureDelta(value, fromUnit); } #endregion @@ -834,15 +825,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is TemperatureDeltaUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(TemperatureDeltaUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is TemperatureDeltaUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(TemperatureDeltaUnit)} is supported.", nameof(unit)); @@ -973,18 +955,6 @@ public TemperatureDelta ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not TemperatureDeltaUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(TemperatureDeltaUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureGradient.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureGradient.g.cs index cb9e6d6e36..887514b5c0 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureGradient.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureGradient.g.cs @@ -40,7 +40,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct TemperatureGradient : - IArithmeticQuantity, + IArithmeticQuantity, #if NET7_0_OR_GREATER IMultiplyOperators, #endif @@ -156,7 +156,7 @@ public TemperatureGradient(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -251,9 +251,8 @@ public static string GetAbbreviation(TemperatureGradientUnit unit, IFormatProvid /// Creates a from . /// /// If value is NaN or Infinity. - public static TemperatureGradient FromDegreesCelsiusPerKilometer(QuantityValue degreescelsiusperkilometer) + public static TemperatureGradient FromDegreesCelsiusPerKilometer(double value) { - double value = (double) degreescelsiusperkilometer; return new TemperatureGradient(value, TemperatureGradientUnit.DegreeCelsiusPerKilometer); } @@ -261,9 +260,8 @@ public static TemperatureGradient FromDegreesCelsiusPerKilometer(QuantityValue d /// Creates a from . /// /// If value is NaN or Infinity. - public static TemperatureGradient FromDegreesCelsiusPerMeter(QuantityValue degreescelsiuspermeter) + public static TemperatureGradient FromDegreesCelsiusPerMeter(double value) { - double value = (double) degreescelsiuspermeter; return new TemperatureGradient(value, TemperatureGradientUnit.DegreeCelsiusPerMeter); } @@ -271,9 +269,8 @@ public static TemperatureGradient FromDegreesCelsiusPerMeter(QuantityValue degre /// Creates a from . /// /// If value is NaN or Infinity. - public static TemperatureGradient FromDegreesFahrenheitPerFoot(QuantityValue degreesfahrenheitperfoot) + public static TemperatureGradient FromDegreesFahrenheitPerFoot(double value) { - double value = (double) degreesfahrenheitperfoot; return new TemperatureGradient(value, TemperatureGradientUnit.DegreeFahrenheitPerFoot); } @@ -281,9 +278,8 @@ public static TemperatureGradient FromDegreesFahrenheitPerFoot(QuantityValue deg /// Creates a from . /// /// If value is NaN or Infinity. - public static TemperatureGradient FromKelvinsPerMeter(QuantityValue kelvinspermeter) + public static TemperatureGradient FromKelvinsPerMeter(double value) { - double value = (double) kelvinspermeter; return new TemperatureGradient(value, TemperatureGradientUnit.KelvinPerMeter); } @@ -293,9 +289,9 @@ public static TemperatureGradient FromKelvinsPerMeter(QuantityValue kelvinsperme /// Value to convert from. /// Unit to convert from. /// TemperatureGradient unit value. - public static TemperatureGradient From(QuantityValue value, TemperatureGradientUnit fromUnit) + public static TemperatureGradient From(double value, TemperatureGradientUnit fromUnit) { - return new TemperatureGradient((double)value, fromUnit); + return new TemperatureGradient(value, fromUnit); } #endregion @@ -716,15 +712,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is TemperatureGradientUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(TemperatureGradientUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is TemperatureGradientUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(TemperatureGradientUnit)} is supported.", nameof(unit)); @@ -845,18 +832,6 @@ public TemperatureGradient ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not TemperatureGradientUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(TemperatureGradientUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.g.cs b/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.g.cs index 5436d4b4da..b3f9368f74 100644 --- a/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.g.cs @@ -40,7 +40,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct ThermalConductivity : - IArithmeticQuantity, + IArithmeticQuantity, IComparable, IComparable, IConvertible, @@ -151,7 +151,7 @@ public ThermalConductivity(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -232,9 +232,8 @@ public static string GetAbbreviation(ThermalConductivityUnit unit, IFormatProvid /// Creates a from . /// /// If value is NaN or Infinity. - public static ThermalConductivity FromBtusPerHourFootFahrenheit(QuantityValue btusperhourfootfahrenheit) + public static ThermalConductivity FromBtusPerHourFootFahrenheit(double value) { - double value = (double) btusperhourfootfahrenheit; return new ThermalConductivity(value, ThermalConductivityUnit.BtuPerHourFootFahrenheit); } @@ -242,9 +241,8 @@ public static ThermalConductivity FromBtusPerHourFootFahrenheit(QuantityValue bt /// Creates a from . /// /// If value is NaN or Infinity. - public static ThermalConductivity FromWattsPerMeterKelvin(QuantityValue wattspermeterkelvin) + public static ThermalConductivity FromWattsPerMeterKelvin(double value) { - double value = (double) wattspermeterkelvin; return new ThermalConductivity(value, ThermalConductivityUnit.WattPerMeterKelvin); } @@ -254,9 +252,9 @@ public static ThermalConductivity FromWattsPerMeterKelvin(QuantityValue wattsper /// Value to convert from. /// Unit to convert from. /// ThermalConductivity unit value. - public static ThermalConductivity From(QuantityValue value, ThermalConductivityUnit fromUnit) + public static ThermalConductivity From(double value, ThermalConductivityUnit fromUnit) { - return new ThermalConductivity((double)value, fromUnit); + return new ThermalConductivity(value, fromUnit); } #endregion @@ -667,15 +665,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is ThermalConductivityUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ThermalConductivityUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is ThermalConductivityUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ThermalConductivityUnit)} is supported.", nameof(unit)); @@ -792,18 +781,6 @@ public ThermalConductivity ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not ThermalConductivityUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ThermalConductivityUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/ThermalResistance.g.cs b/UnitsNet/GeneratedCode/Quantities/ThermalResistance.g.cs index 0a0a9698bf..83fd1625b9 100644 --- a/UnitsNet/GeneratedCode/Quantities/ThermalResistance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ThermalResistance.g.cs @@ -37,7 +37,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct ThermalResistance : - IArithmeticQuantity, + IArithmeticQuantity, IComparable, IComparable, IConvertible, @@ -152,7 +152,7 @@ public ThermalResistance(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -261,9 +261,8 @@ public static string GetAbbreviation(ThermalResistanceUnit unit, IFormatProvider /// Creates a from . /// /// If value is NaN or Infinity. - public static ThermalResistance FromHourSquareFeetDegreesFahrenheitPerBtu(QuantityValue hoursquarefeetdegreesfahrenheitperbtu) + public static ThermalResistance FromHourSquareFeetDegreesFahrenheitPerBtu(double value) { - double value = (double) hoursquarefeetdegreesfahrenheitperbtu; return new ThermalResistance(value, ThermalResistanceUnit.HourSquareFeetDegreeFahrenheitPerBtu); } @@ -271,9 +270,8 @@ public static ThermalResistance FromHourSquareFeetDegreesFahrenheitPerBtu(Quanti /// Creates a from . /// /// If value is NaN or Infinity. - public static ThermalResistance FromSquareCentimeterHourDegreesCelsiusPerKilocalorie(QuantityValue squarecentimeterhourdegreescelsiusperkilocalorie) + public static ThermalResistance FromSquareCentimeterHourDegreesCelsiusPerKilocalorie(double value) { - double value = (double) squarecentimeterhourdegreescelsiusperkilocalorie; return new ThermalResistance(value, ThermalResistanceUnit.SquareCentimeterHourDegreeCelsiusPerKilocalorie); } @@ -281,9 +279,8 @@ public static ThermalResistance FromSquareCentimeterHourDegreesCelsiusPerKilocal /// Creates a from . /// /// If value is NaN or Infinity. - public static ThermalResistance FromSquareCentimeterKelvinsPerWatt(QuantityValue squarecentimeterkelvinsperwatt) + public static ThermalResistance FromSquareCentimeterKelvinsPerWatt(double value) { - double value = (double) squarecentimeterkelvinsperwatt; return new ThermalResistance(value, ThermalResistanceUnit.SquareCentimeterKelvinPerWatt); } @@ -291,9 +288,8 @@ public static ThermalResistance FromSquareCentimeterKelvinsPerWatt(QuantityValue /// Creates a from . /// /// If value is NaN or Infinity. - public static ThermalResistance FromSquareMeterDegreesCelsiusPerWatt(QuantityValue squaremeterdegreescelsiusperwatt) + public static ThermalResistance FromSquareMeterDegreesCelsiusPerWatt(double value) { - double value = (double) squaremeterdegreescelsiusperwatt; return new ThermalResistance(value, ThermalResistanceUnit.SquareMeterDegreeCelsiusPerWatt); } @@ -301,9 +297,8 @@ public static ThermalResistance FromSquareMeterDegreesCelsiusPerWatt(QuantityVal /// Creates a from . /// /// If value is NaN or Infinity. - public static ThermalResistance FromSquareMeterKelvinsPerKilowatt(QuantityValue squaremeterkelvinsperkilowatt) + public static ThermalResistance FromSquareMeterKelvinsPerKilowatt(double value) { - double value = (double) squaremeterkelvinsperkilowatt; return new ThermalResistance(value, ThermalResistanceUnit.SquareMeterKelvinPerKilowatt); } @@ -311,9 +306,8 @@ public static ThermalResistance FromSquareMeterKelvinsPerKilowatt(QuantityValue /// Creates a from . /// /// If value is NaN or Infinity. - public static ThermalResistance FromSquareMeterKelvinsPerWatt(QuantityValue squaremeterkelvinsperwatt) + public static ThermalResistance FromSquareMeterKelvinsPerWatt(double value) { - double value = (double) squaremeterkelvinsperwatt; return new ThermalResistance(value, ThermalResistanceUnit.SquareMeterKelvinPerWatt); } @@ -323,9 +317,9 @@ public static ThermalResistance FromSquareMeterKelvinsPerWatt(QuantityValue squa /// Value to convert from. /// Unit to convert from. /// ThermalResistance unit value. - public static ThermalResistance From(QuantityValue value, ThermalResistanceUnit fromUnit) + public static ThermalResistance From(double value, ThermalResistanceUnit fromUnit) { - return new ThermalResistance((double)value, fromUnit); + return new ThermalResistance(value, fromUnit); } #endregion @@ -736,15 +730,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is ThermalResistanceUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ThermalResistanceUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is ThermalResistanceUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ThermalResistanceUnit)} is supported.", nameof(unit)); @@ -869,18 +854,6 @@ public ThermalResistance ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not ThermalResistanceUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(ThermalResistanceUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/Torque.g.cs b/UnitsNet/GeneratedCode/Quantities/Torque.g.cs index 96128169ef..c03eb9fc7f 100644 --- a/UnitsNet/GeneratedCode/Quantities/Torque.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Torque.g.cs @@ -40,7 +40,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct Torque : - IArithmeticQuantity, + IArithmeticQuantity, #if NET7_0_OR_GREATER IDivisionOperators, IDivisionOperators, @@ -180,7 +180,7 @@ public Torque(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -422,9 +422,8 @@ public static string GetAbbreviation(TorqueUnit unit, IFormatProvider? provider) /// Creates a from . /// /// If value is NaN or Infinity. - public static Torque FromGramForceCentimeters(QuantityValue gramforcecentimeters) + public static Torque FromGramForceCentimeters(double value) { - double value = (double) gramforcecentimeters; return new Torque(value, TorqueUnit.GramForceCentimeter); } @@ -432,9 +431,8 @@ public static Torque FromGramForceCentimeters(QuantityValue gramforcecentimeters /// Creates a from . /// /// If value is NaN or Infinity. - public static Torque FromGramForceMeters(QuantityValue gramforcemeters) + public static Torque FromGramForceMeters(double value) { - double value = (double) gramforcemeters; return new Torque(value, TorqueUnit.GramForceMeter); } @@ -442,9 +440,8 @@ public static Torque FromGramForceMeters(QuantityValue gramforcemeters) /// Creates a from . /// /// If value is NaN or Infinity. - public static Torque FromGramForceMillimeters(QuantityValue gramforcemillimeters) + public static Torque FromGramForceMillimeters(double value) { - double value = (double) gramforcemillimeters; return new Torque(value, TorqueUnit.GramForceMillimeter); } @@ -452,9 +449,8 @@ public static Torque FromGramForceMillimeters(QuantityValue gramforcemillimeters /// Creates a from . /// /// If value is NaN or Infinity. - public static Torque FromKilogramForceCentimeters(QuantityValue kilogramforcecentimeters) + public static Torque FromKilogramForceCentimeters(double value) { - double value = (double) kilogramforcecentimeters; return new Torque(value, TorqueUnit.KilogramForceCentimeter); } @@ -462,9 +458,8 @@ public static Torque FromKilogramForceCentimeters(QuantityValue kilogramforcecen /// Creates a from . /// /// If value is NaN or Infinity. - public static Torque FromKilogramForceMeters(QuantityValue kilogramforcemeters) + public static Torque FromKilogramForceMeters(double value) { - double value = (double) kilogramforcemeters; return new Torque(value, TorqueUnit.KilogramForceMeter); } @@ -472,9 +467,8 @@ public static Torque FromKilogramForceMeters(QuantityValue kilogramforcemeters) /// Creates a from . /// /// If value is NaN or Infinity. - public static Torque FromKilogramForceMillimeters(QuantityValue kilogramforcemillimeters) + public static Torque FromKilogramForceMillimeters(double value) { - double value = (double) kilogramforcemillimeters; return new Torque(value, TorqueUnit.KilogramForceMillimeter); } @@ -482,9 +476,8 @@ public static Torque FromKilogramForceMillimeters(QuantityValue kilogramforcemil /// Creates a from . /// /// If value is NaN or Infinity. - public static Torque FromKilonewtonCentimeters(QuantityValue kilonewtoncentimeters) + public static Torque FromKilonewtonCentimeters(double value) { - double value = (double) kilonewtoncentimeters; return new Torque(value, TorqueUnit.KilonewtonCentimeter); } @@ -492,9 +485,8 @@ public static Torque FromKilonewtonCentimeters(QuantityValue kilonewtoncentimete /// Creates a from . /// /// If value is NaN or Infinity. - public static Torque FromKilonewtonMeters(QuantityValue kilonewtonmeters) + public static Torque FromKilonewtonMeters(double value) { - double value = (double) kilonewtonmeters; return new Torque(value, TorqueUnit.KilonewtonMeter); } @@ -502,9 +494,8 @@ public static Torque FromKilonewtonMeters(QuantityValue kilonewtonmeters) /// Creates a from . /// /// If value is NaN or Infinity. - public static Torque FromKilonewtonMillimeters(QuantityValue kilonewtonmillimeters) + public static Torque FromKilonewtonMillimeters(double value) { - double value = (double) kilonewtonmillimeters; return new Torque(value, TorqueUnit.KilonewtonMillimeter); } @@ -512,9 +503,8 @@ public static Torque FromKilonewtonMillimeters(QuantityValue kilonewtonmillimete /// Creates a from . /// /// If value is NaN or Infinity. - public static Torque FromKilopoundForceFeet(QuantityValue kilopoundforcefeet) + public static Torque FromKilopoundForceFeet(double value) { - double value = (double) kilopoundforcefeet; return new Torque(value, TorqueUnit.KilopoundForceFoot); } @@ -522,9 +512,8 @@ public static Torque FromKilopoundForceFeet(QuantityValue kilopoundforcefeet) /// Creates a from . /// /// If value is NaN or Infinity. - public static Torque FromKilopoundForceInches(QuantityValue kilopoundforceinches) + public static Torque FromKilopoundForceInches(double value) { - double value = (double) kilopoundforceinches; return new Torque(value, TorqueUnit.KilopoundForceInch); } @@ -532,9 +521,8 @@ public static Torque FromKilopoundForceInches(QuantityValue kilopoundforceinches /// Creates a from . /// /// If value is NaN or Infinity. - public static Torque FromMeganewtonCentimeters(QuantityValue meganewtoncentimeters) + public static Torque FromMeganewtonCentimeters(double value) { - double value = (double) meganewtoncentimeters; return new Torque(value, TorqueUnit.MeganewtonCentimeter); } @@ -542,9 +530,8 @@ public static Torque FromMeganewtonCentimeters(QuantityValue meganewtoncentimete /// Creates a from . /// /// If value is NaN or Infinity. - public static Torque FromMeganewtonMeters(QuantityValue meganewtonmeters) + public static Torque FromMeganewtonMeters(double value) { - double value = (double) meganewtonmeters; return new Torque(value, TorqueUnit.MeganewtonMeter); } @@ -552,9 +539,8 @@ public static Torque FromMeganewtonMeters(QuantityValue meganewtonmeters) /// Creates a from . /// /// If value is NaN or Infinity. - public static Torque FromMeganewtonMillimeters(QuantityValue meganewtonmillimeters) + public static Torque FromMeganewtonMillimeters(double value) { - double value = (double) meganewtonmillimeters; return new Torque(value, TorqueUnit.MeganewtonMillimeter); } @@ -562,9 +548,8 @@ public static Torque FromMeganewtonMillimeters(QuantityValue meganewtonmillimete /// Creates a from . /// /// If value is NaN or Infinity. - public static Torque FromMegapoundForceFeet(QuantityValue megapoundforcefeet) + public static Torque FromMegapoundForceFeet(double value) { - double value = (double) megapoundforcefeet; return new Torque(value, TorqueUnit.MegapoundForceFoot); } @@ -572,9 +557,8 @@ public static Torque FromMegapoundForceFeet(QuantityValue megapoundforcefeet) /// Creates a from . /// /// If value is NaN or Infinity. - public static Torque FromMegapoundForceInches(QuantityValue megapoundforceinches) + public static Torque FromMegapoundForceInches(double value) { - double value = (double) megapoundforceinches; return new Torque(value, TorqueUnit.MegapoundForceInch); } @@ -582,9 +566,8 @@ public static Torque FromMegapoundForceInches(QuantityValue megapoundforceinches /// Creates a from . /// /// If value is NaN or Infinity. - public static Torque FromNewtonCentimeters(QuantityValue newtoncentimeters) + public static Torque FromNewtonCentimeters(double value) { - double value = (double) newtoncentimeters; return new Torque(value, TorqueUnit.NewtonCentimeter); } @@ -592,9 +575,8 @@ public static Torque FromNewtonCentimeters(QuantityValue newtoncentimeters) /// Creates a from . /// /// If value is NaN or Infinity. - public static Torque FromNewtonMeters(QuantityValue newtonmeters) + public static Torque FromNewtonMeters(double value) { - double value = (double) newtonmeters; return new Torque(value, TorqueUnit.NewtonMeter); } @@ -602,9 +584,8 @@ public static Torque FromNewtonMeters(QuantityValue newtonmeters) /// Creates a from . /// /// If value is NaN or Infinity. - public static Torque FromNewtonMillimeters(QuantityValue newtonmillimeters) + public static Torque FromNewtonMillimeters(double value) { - double value = (double) newtonmillimeters; return new Torque(value, TorqueUnit.NewtonMillimeter); } @@ -612,9 +593,8 @@ public static Torque FromNewtonMillimeters(QuantityValue newtonmillimeters) /// Creates a from . /// /// If value is NaN or Infinity. - public static Torque FromPoundalFeet(QuantityValue poundalfeet) + public static Torque FromPoundalFeet(double value) { - double value = (double) poundalfeet; return new Torque(value, TorqueUnit.PoundalFoot); } @@ -622,9 +602,8 @@ public static Torque FromPoundalFeet(QuantityValue poundalfeet) /// Creates a from . /// /// If value is NaN or Infinity. - public static Torque FromPoundForceFeet(QuantityValue poundforcefeet) + public static Torque FromPoundForceFeet(double value) { - double value = (double) poundforcefeet; return new Torque(value, TorqueUnit.PoundForceFoot); } @@ -632,9 +611,8 @@ public static Torque FromPoundForceFeet(QuantityValue poundforcefeet) /// Creates a from . /// /// If value is NaN or Infinity. - public static Torque FromPoundForceInches(QuantityValue poundforceinches) + public static Torque FromPoundForceInches(double value) { - double value = (double) poundforceinches; return new Torque(value, TorqueUnit.PoundForceInch); } @@ -642,9 +620,8 @@ public static Torque FromPoundForceInches(QuantityValue poundforceinches) /// Creates a from . /// /// If value is NaN or Infinity. - public static Torque FromTonneForceCentimeters(QuantityValue tonneforcecentimeters) + public static Torque FromTonneForceCentimeters(double value) { - double value = (double) tonneforcecentimeters; return new Torque(value, TorqueUnit.TonneForceCentimeter); } @@ -652,9 +629,8 @@ public static Torque FromTonneForceCentimeters(QuantityValue tonneforcecentimete /// Creates a from . /// /// If value is NaN or Infinity. - public static Torque FromTonneForceMeters(QuantityValue tonneforcemeters) + public static Torque FromTonneForceMeters(double value) { - double value = (double) tonneforcemeters; return new Torque(value, TorqueUnit.TonneForceMeter); } @@ -662,9 +638,8 @@ public static Torque FromTonneForceMeters(QuantityValue tonneforcemeters) /// Creates a from . /// /// If value is NaN or Infinity. - public static Torque FromTonneForceMillimeters(QuantityValue tonneforcemillimeters) + public static Torque FromTonneForceMillimeters(double value) { - double value = (double) tonneforcemillimeters; return new Torque(value, TorqueUnit.TonneForceMillimeter); } @@ -674,9 +649,9 @@ public static Torque FromTonneForceMillimeters(QuantityValue tonneforcemillimete /// Value to convert from. /// Unit to convert from. /// Torque unit value. - public static Torque From(QuantityValue value, TorqueUnit fromUnit) + public static Torque From(double value, TorqueUnit fromUnit) { - return new Torque((double)value, fromUnit); + return new Torque(value, fromUnit); } #endregion @@ -1115,15 +1090,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is TorqueUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(TorqueUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is TorqueUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(TorqueUnit)} is supported.", nameof(unit)); @@ -1286,18 +1252,6 @@ public Torque ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not TorqueUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(TorqueUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/TorquePerLength.g.cs b/UnitsNet/GeneratedCode/Quantities/TorquePerLength.g.cs index 1abe988cf9..2f9e92a03d 100644 --- a/UnitsNet/GeneratedCode/Quantities/TorquePerLength.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TorquePerLength.g.cs @@ -37,7 +37,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct TorquePerLength : - IArithmeticQuantity, + IArithmeticQuantity, IComparable, IComparable, IConvertible, @@ -167,7 +167,7 @@ public TorquePerLength(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -381,9 +381,8 @@ public static string GetAbbreviation(TorquePerLengthUnit unit, IFormatProvider? /// Creates a from . /// /// If value is NaN or Infinity. - public static TorquePerLength FromKilogramForceCentimetersPerMeter(QuantityValue kilogramforcecentimeterspermeter) + public static TorquePerLength FromKilogramForceCentimetersPerMeter(double value) { - double value = (double) kilogramforcecentimeterspermeter; return new TorquePerLength(value, TorquePerLengthUnit.KilogramForceCentimeterPerMeter); } @@ -391,9 +390,8 @@ public static TorquePerLength FromKilogramForceCentimetersPerMeter(QuantityValue /// Creates a from . /// /// If value is NaN or Infinity. - public static TorquePerLength FromKilogramForceMetersPerMeter(QuantityValue kilogramforcemeterspermeter) + public static TorquePerLength FromKilogramForceMetersPerMeter(double value) { - double value = (double) kilogramforcemeterspermeter; return new TorquePerLength(value, TorquePerLengthUnit.KilogramForceMeterPerMeter); } @@ -401,9 +399,8 @@ public static TorquePerLength FromKilogramForceMetersPerMeter(QuantityValue kilo /// Creates a from . /// /// If value is NaN or Infinity. - public static TorquePerLength FromKilogramForceMillimetersPerMeter(QuantityValue kilogramforcemillimeterspermeter) + public static TorquePerLength FromKilogramForceMillimetersPerMeter(double value) { - double value = (double) kilogramforcemillimeterspermeter; return new TorquePerLength(value, TorquePerLengthUnit.KilogramForceMillimeterPerMeter); } @@ -411,9 +408,8 @@ public static TorquePerLength FromKilogramForceMillimetersPerMeter(QuantityValue /// Creates a from . /// /// If value is NaN or Infinity. - public static TorquePerLength FromKilonewtonCentimetersPerMeter(QuantityValue kilonewtoncentimeterspermeter) + public static TorquePerLength FromKilonewtonCentimetersPerMeter(double value) { - double value = (double) kilonewtoncentimeterspermeter; return new TorquePerLength(value, TorquePerLengthUnit.KilonewtonCentimeterPerMeter); } @@ -421,9 +417,8 @@ public static TorquePerLength FromKilonewtonCentimetersPerMeter(QuantityValue ki /// Creates a from . /// /// If value is NaN or Infinity. - public static TorquePerLength FromKilonewtonMetersPerMeter(QuantityValue kilonewtonmeterspermeter) + public static TorquePerLength FromKilonewtonMetersPerMeter(double value) { - double value = (double) kilonewtonmeterspermeter; return new TorquePerLength(value, TorquePerLengthUnit.KilonewtonMeterPerMeter); } @@ -431,9 +426,8 @@ public static TorquePerLength FromKilonewtonMetersPerMeter(QuantityValue kilonew /// Creates a from . /// /// If value is NaN or Infinity. - public static TorquePerLength FromKilonewtonMillimetersPerMeter(QuantityValue kilonewtonmillimeterspermeter) + public static TorquePerLength FromKilonewtonMillimetersPerMeter(double value) { - double value = (double) kilonewtonmillimeterspermeter; return new TorquePerLength(value, TorquePerLengthUnit.KilonewtonMillimeterPerMeter); } @@ -441,9 +435,8 @@ public static TorquePerLength FromKilonewtonMillimetersPerMeter(QuantityValue ki /// Creates a from . /// /// If value is NaN or Infinity. - public static TorquePerLength FromKilopoundForceFeetPerFoot(QuantityValue kilopoundforcefeetperfoot) + public static TorquePerLength FromKilopoundForceFeetPerFoot(double value) { - double value = (double) kilopoundforcefeetperfoot; return new TorquePerLength(value, TorquePerLengthUnit.KilopoundForceFootPerFoot); } @@ -451,9 +444,8 @@ public static TorquePerLength FromKilopoundForceFeetPerFoot(QuantityValue kilopo /// Creates a from . /// /// If value is NaN or Infinity. - public static TorquePerLength FromKilopoundForceInchesPerFoot(QuantityValue kilopoundforceinchesperfoot) + public static TorquePerLength FromKilopoundForceInchesPerFoot(double value) { - double value = (double) kilopoundforceinchesperfoot; return new TorquePerLength(value, TorquePerLengthUnit.KilopoundForceInchPerFoot); } @@ -461,9 +453,8 @@ public static TorquePerLength FromKilopoundForceInchesPerFoot(QuantityValue kilo /// Creates a from . /// /// If value is NaN or Infinity. - public static TorquePerLength FromMeganewtonCentimetersPerMeter(QuantityValue meganewtoncentimeterspermeter) + public static TorquePerLength FromMeganewtonCentimetersPerMeter(double value) { - double value = (double) meganewtoncentimeterspermeter; return new TorquePerLength(value, TorquePerLengthUnit.MeganewtonCentimeterPerMeter); } @@ -471,9 +462,8 @@ public static TorquePerLength FromMeganewtonCentimetersPerMeter(QuantityValue me /// Creates a from . /// /// If value is NaN or Infinity. - public static TorquePerLength FromMeganewtonMetersPerMeter(QuantityValue meganewtonmeterspermeter) + public static TorquePerLength FromMeganewtonMetersPerMeter(double value) { - double value = (double) meganewtonmeterspermeter; return new TorquePerLength(value, TorquePerLengthUnit.MeganewtonMeterPerMeter); } @@ -481,9 +471,8 @@ public static TorquePerLength FromMeganewtonMetersPerMeter(QuantityValue meganew /// Creates a from . /// /// If value is NaN or Infinity. - public static TorquePerLength FromMeganewtonMillimetersPerMeter(QuantityValue meganewtonmillimeterspermeter) + public static TorquePerLength FromMeganewtonMillimetersPerMeter(double value) { - double value = (double) meganewtonmillimeterspermeter; return new TorquePerLength(value, TorquePerLengthUnit.MeganewtonMillimeterPerMeter); } @@ -491,9 +480,8 @@ public static TorquePerLength FromMeganewtonMillimetersPerMeter(QuantityValue me /// Creates a from . /// /// If value is NaN or Infinity. - public static TorquePerLength FromMegapoundForceFeetPerFoot(QuantityValue megapoundforcefeetperfoot) + public static TorquePerLength FromMegapoundForceFeetPerFoot(double value) { - double value = (double) megapoundforcefeetperfoot; return new TorquePerLength(value, TorquePerLengthUnit.MegapoundForceFootPerFoot); } @@ -501,9 +489,8 @@ public static TorquePerLength FromMegapoundForceFeetPerFoot(QuantityValue megapo /// Creates a from . /// /// If value is NaN or Infinity. - public static TorquePerLength FromMegapoundForceInchesPerFoot(QuantityValue megapoundforceinchesperfoot) + public static TorquePerLength FromMegapoundForceInchesPerFoot(double value) { - double value = (double) megapoundforceinchesperfoot; return new TorquePerLength(value, TorquePerLengthUnit.MegapoundForceInchPerFoot); } @@ -511,9 +498,8 @@ public static TorquePerLength FromMegapoundForceInchesPerFoot(QuantityValue mega /// Creates a from . /// /// If value is NaN or Infinity. - public static TorquePerLength FromNewtonCentimetersPerMeter(QuantityValue newtoncentimeterspermeter) + public static TorquePerLength FromNewtonCentimetersPerMeter(double value) { - double value = (double) newtoncentimeterspermeter; return new TorquePerLength(value, TorquePerLengthUnit.NewtonCentimeterPerMeter); } @@ -521,9 +507,8 @@ public static TorquePerLength FromNewtonCentimetersPerMeter(QuantityValue newton /// Creates a from . /// /// If value is NaN or Infinity. - public static TorquePerLength FromNewtonMetersPerMeter(QuantityValue newtonmeterspermeter) + public static TorquePerLength FromNewtonMetersPerMeter(double value) { - double value = (double) newtonmeterspermeter; return new TorquePerLength(value, TorquePerLengthUnit.NewtonMeterPerMeter); } @@ -531,9 +516,8 @@ public static TorquePerLength FromNewtonMetersPerMeter(QuantityValue newtonmeter /// Creates a from . /// /// If value is NaN or Infinity. - public static TorquePerLength FromNewtonMillimetersPerMeter(QuantityValue newtonmillimeterspermeter) + public static TorquePerLength FromNewtonMillimetersPerMeter(double value) { - double value = (double) newtonmillimeterspermeter; return new TorquePerLength(value, TorquePerLengthUnit.NewtonMillimeterPerMeter); } @@ -541,9 +525,8 @@ public static TorquePerLength FromNewtonMillimetersPerMeter(QuantityValue newton /// Creates a from . /// /// If value is NaN or Infinity. - public static TorquePerLength FromPoundForceFeetPerFoot(QuantityValue poundforcefeetperfoot) + public static TorquePerLength FromPoundForceFeetPerFoot(double value) { - double value = (double) poundforcefeetperfoot; return new TorquePerLength(value, TorquePerLengthUnit.PoundForceFootPerFoot); } @@ -551,9 +534,8 @@ public static TorquePerLength FromPoundForceFeetPerFoot(QuantityValue poundforce /// Creates a from . /// /// If value is NaN or Infinity. - public static TorquePerLength FromPoundForceInchesPerFoot(QuantityValue poundforceinchesperfoot) + public static TorquePerLength FromPoundForceInchesPerFoot(double value) { - double value = (double) poundforceinchesperfoot; return new TorquePerLength(value, TorquePerLengthUnit.PoundForceInchPerFoot); } @@ -561,9 +543,8 @@ public static TorquePerLength FromPoundForceInchesPerFoot(QuantityValue poundfor /// Creates a from . /// /// If value is NaN or Infinity. - public static TorquePerLength FromTonneForceCentimetersPerMeter(QuantityValue tonneforcecentimeterspermeter) + public static TorquePerLength FromTonneForceCentimetersPerMeter(double value) { - double value = (double) tonneforcecentimeterspermeter; return new TorquePerLength(value, TorquePerLengthUnit.TonneForceCentimeterPerMeter); } @@ -571,9 +552,8 @@ public static TorquePerLength FromTonneForceCentimetersPerMeter(QuantityValue to /// Creates a from . /// /// If value is NaN or Infinity. - public static TorquePerLength FromTonneForceMetersPerMeter(QuantityValue tonneforcemeterspermeter) + public static TorquePerLength FromTonneForceMetersPerMeter(double value) { - double value = (double) tonneforcemeterspermeter; return new TorquePerLength(value, TorquePerLengthUnit.TonneForceMeterPerMeter); } @@ -581,9 +561,8 @@ public static TorquePerLength FromTonneForceMetersPerMeter(QuantityValue tonnefo /// Creates a from . /// /// If value is NaN or Infinity. - public static TorquePerLength FromTonneForceMillimetersPerMeter(QuantityValue tonneforcemillimeterspermeter) + public static TorquePerLength FromTonneForceMillimetersPerMeter(double value) { - double value = (double) tonneforcemillimeterspermeter; return new TorquePerLength(value, TorquePerLengthUnit.TonneForceMillimeterPerMeter); } @@ -593,9 +572,9 @@ public static TorquePerLength FromTonneForceMillimetersPerMeter(QuantityValue to /// Value to convert from. /// Unit to convert from. /// TorquePerLength unit value. - public static TorquePerLength From(QuantityValue value, TorquePerLengthUnit fromUnit) + public static TorquePerLength From(double value, TorquePerLengthUnit fromUnit) { - return new TorquePerLength((double)value, fromUnit); + return new TorquePerLength(value, fromUnit); } #endregion @@ -1006,15 +985,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is TorquePerLengthUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(TorquePerLengthUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is TorquePerLengthUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(TorquePerLengthUnit)} is supported.", nameof(unit)); @@ -1169,18 +1139,6 @@ public TorquePerLength ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not TorquePerLengthUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(TorquePerLengthUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/Turbidity.g.cs b/UnitsNet/GeneratedCode/Quantities/Turbidity.g.cs index 17caf386c4..429be531e2 100644 --- a/UnitsNet/GeneratedCode/Quantities/Turbidity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Turbidity.g.cs @@ -40,7 +40,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct Turbidity : - IArithmeticQuantity, + IArithmeticQuantity, IComparable, IComparable, IConvertible, @@ -150,7 +150,7 @@ public Turbidity(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -224,9 +224,8 @@ public static string GetAbbreviation(TurbidityUnit unit, IFormatProvider? provid /// Creates a from . /// /// If value is NaN or Infinity. - public static Turbidity FromNTU(QuantityValue ntu) + public static Turbidity FromNTU(double value) { - double value = (double) ntu; return new Turbidity(value, TurbidityUnit.NTU); } @@ -236,9 +235,9 @@ public static Turbidity FromNTU(QuantityValue ntu) /// Value to convert from. /// Unit to convert from. /// Turbidity unit value. - public static Turbidity From(QuantityValue value, TurbidityUnit fromUnit) + public static Turbidity From(double value, TurbidityUnit fromUnit) { - return new Turbidity((double)value, fromUnit); + return new Turbidity(value, fromUnit); } #endregion @@ -649,15 +648,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is TurbidityUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(TurbidityUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is TurbidityUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(TurbidityUnit)} is supported.", nameof(unit)); @@ -772,18 +762,6 @@ public Turbidity ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not TurbidityUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(TurbidityUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/VitaminA.g.cs b/UnitsNet/GeneratedCode/Quantities/VitaminA.g.cs index c28ce6e569..21481bfd60 100644 --- a/UnitsNet/GeneratedCode/Quantities/VitaminA.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VitaminA.g.cs @@ -37,7 +37,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct VitaminA : - IArithmeticQuantity, + IArithmeticQuantity, IComparable, IComparable, IConvertible, @@ -147,7 +147,7 @@ public VitaminA(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -221,9 +221,8 @@ public static string GetAbbreviation(VitaminAUnit unit, IFormatProvider? provide /// Creates a from . /// /// If value is NaN or Infinity. - public static VitaminA FromInternationalUnits(QuantityValue internationalunits) + public static VitaminA FromInternationalUnits(double value) { - double value = (double) internationalunits; return new VitaminA(value, VitaminAUnit.InternationalUnit); } @@ -233,9 +232,9 @@ public static VitaminA FromInternationalUnits(QuantityValue internationalunits) /// Value to convert from. /// Unit to convert from. /// VitaminA unit value. - public static VitaminA From(QuantityValue value, VitaminAUnit fromUnit) + public static VitaminA From(double value, VitaminAUnit fromUnit) { - return new VitaminA((double)value, fromUnit); + return new VitaminA(value, fromUnit); } #endregion @@ -646,15 +645,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is VitaminAUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(VitaminAUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is VitaminAUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(VitaminAUnit)} is supported.", nameof(unit)); @@ -769,18 +759,6 @@ public VitaminA ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not VitaminAUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(VitaminAUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/Volume.g.cs b/UnitsNet/GeneratedCode/Quantities/Volume.g.cs index 0f241b68e8..ed7177bf43 100644 --- a/UnitsNet/GeneratedCode/Quantities/Volume.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Volume.g.cs @@ -40,7 +40,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct Volume : - IArithmeticQuantity, + IArithmeticQuantity, #if NET7_0_OR_GREATER IDivisionOperators, IMultiplyOperators, @@ -212,7 +212,7 @@ public Volume(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -657,9 +657,8 @@ public static string GetAbbreviation(VolumeUnit unit, IFormatProvider? provider) /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromAcreFeet(QuantityValue acrefeet) + public static Volume FromAcreFeet(double value) { - double value = (double) acrefeet; return new Volume(value, VolumeUnit.AcreFoot); } @@ -667,9 +666,8 @@ public static Volume FromAcreFeet(QuantityValue acrefeet) /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromAuTablespoons(QuantityValue autablespoons) + public static Volume FromAuTablespoons(double value) { - double value = (double) autablespoons; return new Volume(value, VolumeUnit.AuTablespoon); } @@ -677,9 +675,8 @@ public static Volume FromAuTablespoons(QuantityValue autablespoons) /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromBoardFeet(QuantityValue boardfeet) + public static Volume FromBoardFeet(double value) { - double value = (double) boardfeet; return new Volume(value, VolumeUnit.BoardFoot); } @@ -687,9 +684,8 @@ public static Volume FromBoardFeet(QuantityValue boardfeet) /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromCentiliters(QuantityValue centiliters) + public static Volume FromCentiliters(double value) { - double value = (double) centiliters; return new Volume(value, VolumeUnit.Centiliter); } @@ -697,9 +693,8 @@ public static Volume FromCentiliters(QuantityValue centiliters) /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromCubicCentimeters(QuantityValue cubiccentimeters) + public static Volume FromCubicCentimeters(double value) { - double value = (double) cubiccentimeters; return new Volume(value, VolumeUnit.CubicCentimeter); } @@ -707,9 +702,8 @@ public static Volume FromCubicCentimeters(QuantityValue cubiccentimeters) /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromCubicDecimeters(QuantityValue cubicdecimeters) + public static Volume FromCubicDecimeters(double value) { - double value = (double) cubicdecimeters; return new Volume(value, VolumeUnit.CubicDecimeter); } @@ -717,9 +711,8 @@ public static Volume FromCubicDecimeters(QuantityValue cubicdecimeters) /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromCubicFeet(QuantityValue cubicfeet) + public static Volume FromCubicFeet(double value) { - double value = (double) cubicfeet; return new Volume(value, VolumeUnit.CubicFoot); } @@ -727,9 +720,8 @@ public static Volume FromCubicFeet(QuantityValue cubicfeet) /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromCubicHectometers(QuantityValue cubichectometers) + public static Volume FromCubicHectometers(double value) { - double value = (double) cubichectometers; return new Volume(value, VolumeUnit.CubicHectometer); } @@ -737,9 +729,8 @@ public static Volume FromCubicHectometers(QuantityValue cubichectometers) /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromCubicInches(QuantityValue cubicinches) + public static Volume FromCubicInches(double value) { - double value = (double) cubicinches; return new Volume(value, VolumeUnit.CubicInch); } @@ -747,9 +738,8 @@ public static Volume FromCubicInches(QuantityValue cubicinches) /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromCubicKilometers(QuantityValue cubickilometers) + public static Volume FromCubicKilometers(double value) { - double value = (double) cubickilometers; return new Volume(value, VolumeUnit.CubicKilometer); } @@ -757,9 +747,8 @@ public static Volume FromCubicKilometers(QuantityValue cubickilometers) /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromCubicMeters(QuantityValue cubicmeters) + public static Volume FromCubicMeters(double value) { - double value = (double) cubicmeters; return new Volume(value, VolumeUnit.CubicMeter); } @@ -767,9 +756,8 @@ public static Volume FromCubicMeters(QuantityValue cubicmeters) /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromCubicMicrometers(QuantityValue cubicmicrometers) + public static Volume FromCubicMicrometers(double value) { - double value = (double) cubicmicrometers; return new Volume(value, VolumeUnit.CubicMicrometer); } @@ -777,9 +765,8 @@ public static Volume FromCubicMicrometers(QuantityValue cubicmicrometers) /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromCubicMiles(QuantityValue cubicmiles) + public static Volume FromCubicMiles(double value) { - double value = (double) cubicmiles; return new Volume(value, VolumeUnit.CubicMile); } @@ -787,9 +774,8 @@ public static Volume FromCubicMiles(QuantityValue cubicmiles) /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromCubicMillimeters(QuantityValue cubicmillimeters) + public static Volume FromCubicMillimeters(double value) { - double value = (double) cubicmillimeters; return new Volume(value, VolumeUnit.CubicMillimeter); } @@ -797,9 +783,8 @@ public static Volume FromCubicMillimeters(QuantityValue cubicmillimeters) /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromCubicYards(QuantityValue cubicyards) + public static Volume FromCubicYards(double value) { - double value = (double) cubicyards; return new Volume(value, VolumeUnit.CubicYard); } @@ -807,9 +792,8 @@ public static Volume FromCubicYards(QuantityValue cubicyards) /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromDecaliters(QuantityValue decaliters) + public static Volume FromDecaliters(double value) { - double value = (double) decaliters; return new Volume(value, VolumeUnit.Decaliter); } @@ -817,9 +801,8 @@ public static Volume FromDecaliters(QuantityValue decaliters) /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromDecausGallons(QuantityValue decausgallons) + public static Volume FromDecausGallons(double value) { - double value = (double) decausgallons; return new Volume(value, VolumeUnit.DecausGallon); } @@ -827,9 +810,8 @@ public static Volume FromDecausGallons(QuantityValue decausgallons) /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromDeciliters(QuantityValue deciliters) + public static Volume FromDeciliters(double value) { - double value = (double) deciliters; return new Volume(value, VolumeUnit.Deciliter); } @@ -837,9 +819,8 @@ public static Volume FromDeciliters(QuantityValue deciliters) /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromDeciusGallons(QuantityValue deciusgallons) + public static Volume FromDeciusGallons(double value) { - double value = (double) deciusgallons; return new Volume(value, VolumeUnit.DeciusGallon); } @@ -847,9 +828,8 @@ public static Volume FromDeciusGallons(QuantityValue deciusgallons) /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromHectocubicFeet(QuantityValue hectocubicfeet) + public static Volume FromHectocubicFeet(double value) { - double value = (double) hectocubicfeet; return new Volume(value, VolumeUnit.HectocubicFoot); } @@ -857,9 +837,8 @@ public static Volume FromHectocubicFeet(QuantityValue hectocubicfeet) /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromHectocubicMeters(QuantityValue hectocubicmeters) + public static Volume FromHectocubicMeters(double value) { - double value = (double) hectocubicmeters; return new Volume(value, VolumeUnit.HectocubicMeter); } @@ -867,9 +846,8 @@ public static Volume FromHectocubicMeters(QuantityValue hectocubicmeters) /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromHectoliters(QuantityValue hectoliters) + public static Volume FromHectoliters(double value) { - double value = (double) hectoliters; return new Volume(value, VolumeUnit.Hectoliter); } @@ -877,9 +855,8 @@ public static Volume FromHectoliters(QuantityValue hectoliters) /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromHectousGallons(QuantityValue hectousgallons) + public static Volume FromHectousGallons(double value) { - double value = (double) hectousgallons; return new Volume(value, VolumeUnit.HectousGallon); } @@ -887,9 +864,8 @@ public static Volume FromHectousGallons(QuantityValue hectousgallons) /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromImperialBeerBarrels(QuantityValue imperialbeerbarrels) + public static Volume FromImperialBeerBarrels(double value) { - double value = (double) imperialbeerbarrels; return new Volume(value, VolumeUnit.ImperialBeerBarrel); } @@ -897,9 +873,8 @@ public static Volume FromImperialBeerBarrels(QuantityValue imperialbeerbarrels) /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromImperialGallons(QuantityValue imperialgallons) + public static Volume FromImperialGallons(double value) { - double value = (double) imperialgallons; return new Volume(value, VolumeUnit.ImperialGallon); } @@ -907,9 +882,8 @@ public static Volume FromImperialGallons(QuantityValue imperialgallons) /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromImperialOunces(QuantityValue imperialounces) + public static Volume FromImperialOunces(double value) { - double value = (double) imperialounces; return new Volume(value, VolumeUnit.ImperialOunce); } @@ -917,9 +891,8 @@ public static Volume FromImperialOunces(QuantityValue imperialounces) /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromImperialPints(QuantityValue imperialpints) + public static Volume FromImperialPints(double value) { - double value = (double) imperialpints; return new Volume(value, VolumeUnit.ImperialPint); } @@ -927,9 +900,8 @@ public static Volume FromImperialPints(QuantityValue imperialpints) /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromImperialQuarts(QuantityValue imperialquarts) + public static Volume FromImperialQuarts(double value) { - double value = (double) imperialquarts; return new Volume(value, VolumeUnit.ImperialQuart); } @@ -937,9 +909,8 @@ public static Volume FromImperialQuarts(QuantityValue imperialquarts) /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromKilocubicFeet(QuantityValue kilocubicfeet) + public static Volume FromKilocubicFeet(double value) { - double value = (double) kilocubicfeet; return new Volume(value, VolumeUnit.KilocubicFoot); } @@ -947,9 +918,8 @@ public static Volume FromKilocubicFeet(QuantityValue kilocubicfeet) /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromKilocubicMeters(QuantityValue kilocubicmeters) + public static Volume FromKilocubicMeters(double value) { - double value = (double) kilocubicmeters; return new Volume(value, VolumeUnit.KilocubicMeter); } @@ -957,9 +927,8 @@ public static Volume FromKilocubicMeters(QuantityValue kilocubicmeters) /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromKiloimperialGallons(QuantityValue kiloimperialgallons) + public static Volume FromKiloimperialGallons(double value) { - double value = (double) kiloimperialgallons; return new Volume(value, VolumeUnit.KiloimperialGallon); } @@ -967,9 +936,8 @@ public static Volume FromKiloimperialGallons(QuantityValue kiloimperialgallons) /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromKiloliters(QuantityValue kiloliters) + public static Volume FromKiloliters(double value) { - double value = (double) kiloliters; return new Volume(value, VolumeUnit.Kiloliter); } @@ -977,9 +945,8 @@ public static Volume FromKiloliters(QuantityValue kiloliters) /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromKilousGallons(QuantityValue kilousgallons) + public static Volume FromKilousGallons(double value) { - double value = (double) kilousgallons; return new Volume(value, VolumeUnit.KilousGallon); } @@ -987,9 +954,8 @@ public static Volume FromKilousGallons(QuantityValue kilousgallons) /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromLiters(QuantityValue liters) + public static Volume FromLiters(double value) { - double value = (double) liters; return new Volume(value, VolumeUnit.Liter); } @@ -997,9 +963,8 @@ public static Volume FromLiters(QuantityValue liters) /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromMegacubicFeet(QuantityValue megacubicfeet) + public static Volume FromMegacubicFeet(double value) { - double value = (double) megacubicfeet; return new Volume(value, VolumeUnit.MegacubicFoot); } @@ -1007,9 +972,8 @@ public static Volume FromMegacubicFeet(QuantityValue megacubicfeet) /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromMegaimperialGallons(QuantityValue megaimperialgallons) + public static Volume FromMegaimperialGallons(double value) { - double value = (double) megaimperialgallons; return new Volume(value, VolumeUnit.MegaimperialGallon); } @@ -1017,9 +981,8 @@ public static Volume FromMegaimperialGallons(QuantityValue megaimperialgallons) /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromMegaliters(QuantityValue megaliters) + public static Volume FromMegaliters(double value) { - double value = (double) megaliters; return new Volume(value, VolumeUnit.Megaliter); } @@ -1027,9 +990,8 @@ public static Volume FromMegaliters(QuantityValue megaliters) /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromMegausGallons(QuantityValue megausgallons) + public static Volume FromMegausGallons(double value) { - double value = (double) megausgallons; return new Volume(value, VolumeUnit.MegausGallon); } @@ -1037,9 +999,8 @@ public static Volume FromMegausGallons(QuantityValue megausgallons) /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromMetricCups(QuantityValue metriccups) + public static Volume FromMetricCups(double value) { - double value = (double) metriccups; return new Volume(value, VolumeUnit.MetricCup); } @@ -1047,9 +1008,8 @@ public static Volume FromMetricCups(QuantityValue metriccups) /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromMetricTeaspoons(QuantityValue metricteaspoons) + public static Volume FromMetricTeaspoons(double value) { - double value = (double) metricteaspoons; return new Volume(value, VolumeUnit.MetricTeaspoon); } @@ -1057,9 +1017,8 @@ public static Volume FromMetricTeaspoons(QuantityValue metricteaspoons) /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromMicroliters(QuantityValue microliters) + public static Volume FromMicroliters(double value) { - double value = (double) microliters; return new Volume(value, VolumeUnit.Microliter); } @@ -1067,9 +1026,8 @@ public static Volume FromMicroliters(QuantityValue microliters) /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromMilliliters(QuantityValue milliliters) + public static Volume FromMilliliters(double value) { - double value = (double) milliliters; return new Volume(value, VolumeUnit.Milliliter); } @@ -1077,9 +1035,8 @@ public static Volume FromMilliliters(QuantityValue milliliters) /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromNanoliters(QuantityValue nanoliters) + public static Volume FromNanoliters(double value) { - double value = (double) nanoliters; return new Volume(value, VolumeUnit.Nanoliter); } @@ -1087,9 +1044,8 @@ public static Volume FromNanoliters(QuantityValue nanoliters) /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromOilBarrels(QuantityValue oilbarrels) + public static Volume FromOilBarrels(double value) { - double value = (double) oilbarrels; return new Volume(value, VolumeUnit.OilBarrel); } @@ -1097,9 +1053,8 @@ public static Volume FromOilBarrels(QuantityValue oilbarrels) /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromUkTablespoons(QuantityValue uktablespoons) + public static Volume FromUkTablespoons(double value) { - double value = (double) uktablespoons; return new Volume(value, VolumeUnit.UkTablespoon); } @@ -1107,9 +1062,8 @@ public static Volume FromUkTablespoons(QuantityValue uktablespoons) /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromUsBeerBarrels(QuantityValue usbeerbarrels) + public static Volume FromUsBeerBarrels(double value) { - double value = (double) usbeerbarrels; return new Volume(value, VolumeUnit.UsBeerBarrel); } @@ -1117,9 +1071,8 @@ public static Volume FromUsBeerBarrels(QuantityValue usbeerbarrels) /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromUsCustomaryCups(QuantityValue uscustomarycups) + public static Volume FromUsCustomaryCups(double value) { - double value = (double) uscustomarycups; return new Volume(value, VolumeUnit.UsCustomaryCup); } @@ -1127,9 +1080,8 @@ public static Volume FromUsCustomaryCups(QuantityValue uscustomarycups) /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromUsGallons(QuantityValue usgallons) + public static Volume FromUsGallons(double value) { - double value = (double) usgallons; return new Volume(value, VolumeUnit.UsGallon); } @@ -1137,9 +1089,8 @@ public static Volume FromUsGallons(QuantityValue usgallons) /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromUsLegalCups(QuantityValue uslegalcups) + public static Volume FromUsLegalCups(double value) { - double value = (double) uslegalcups; return new Volume(value, VolumeUnit.UsLegalCup); } @@ -1147,9 +1098,8 @@ public static Volume FromUsLegalCups(QuantityValue uslegalcups) /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromUsOunces(QuantityValue usounces) + public static Volume FromUsOunces(double value) { - double value = (double) usounces; return new Volume(value, VolumeUnit.UsOunce); } @@ -1157,9 +1107,8 @@ public static Volume FromUsOunces(QuantityValue usounces) /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromUsPints(QuantityValue uspints) + public static Volume FromUsPints(double value) { - double value = (double) uspints; return new Volume(value, VolumeUnit.UsPint); } @@ -1167,9 +1116,8 @@ public static Volume FromUsPints(QuantityValue uspints) /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromUsQuarts(QuantityValue usquarts) + public static Volume FromUsQuarts(double value) { - double value = (double) usquarts; return new Volume(value, VolumeUnit.UsQuart); } @@ -1177,9 +1125,8 @@ public static Volume FromUsQuarts(QuantityValue usquarts) /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromUsTablespoons(QuantityValue ustablespoons) + public static Volume FromUsTablespoons(double value) { - double value = (double) ustablespoons; return new Volume(value, VolumeUnit.UsTablespoon); } @@ -1187,9 +1134,8 @@ public static Volume FromUsTablespoons(QuantityValue ustablespoons) /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromUsTeaspoons(QuantityValue usteaspoons) + public static Volume FromUsTeaspoons(double value) { - double value = (double) usteaspoons; return new Volume(value, VolumeUnit.UsTeaspoon); } @@ -1199,9 +1145,9 @@ public static Volume FromUsTeaspoons(QuantityValue usteaspoons) /// Value to convert from. /// Unit to convert from. /// Volume unit value. - public static Volume From(QuantityValue value, VolumeUnit fromUnit) + public static Volume From(double value, VolumeUnit fromUnit) { - return new Volume((double)value, fromUnit); + return new Volume(value, fromUnit); } #endregion @@ -1658,15 +1604,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is VolumeUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(VolumeUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is VolumeUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(VolumeUnit)} is supported.", nameof(unit)); @@ -1887,18 +1824,6 @@ public Volume ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not VolumeUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(VolumeUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/VolumeConcentration.g.cs b/UnitsNet/GeneratedCode/Quantities/VolumeConcentration.g.cs index 93895cf334..4cdee12390 100644 --- a/UnitsNet/GeneratedCode/Quantities/VolumeConcentration.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VolumeConcentration.g.cs @@ -43,7 +43,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct VolumeConcentration : - IArithmeticQuantity, + IArithmeticQuantity, #if NET7_0_OR_GREATER IMultiplyOperators, IMultiplyOperators, @@ -176,7 +176,7 @@ public VolumeConcentration(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -383,9 +383,8 @@ public static string GetAbbreviation(VolumeConcentrationUnit unit, IFormatProvid /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeConcentration FromCentilitersPerLiter(QuantityValue centilitersperliter) + public static VolumeConcentration FromCentilitersPerLiter(double value) { - double value = (double) centilitersperliter; return new VolumeConcentration(value, VolumeConcentrationUnit.CentilitersPerLiter); } @@ -393,9 +392,8 @@ public static VolumeConcentration FromCentilitersPerLiter(QuantityValue centilit /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeConcentration FromCentilitersPerMililiter(QuantityValue centiliterspermililiter) + public static VolumeConcentration FromCentilitersPerMililiter(double value) { - double value = (double) centiliterspermililiter; return new VolumeConcentration(value, VolumeConcentrationUnit.CentilitersPerMililiter); } @@ -403,9 +401,8 @@ public static VolumeConcentration FromCentilitersPerMililiter(QuantityValue cent /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeConcentration FromDecilitersPerLiter(QuantityValue decilitersperliter) + public static VolumeConcentration FromDecilitersPerLiter(double value) { - double value = (double) decilitersperliter; return new VolumeConcentration(value, VolumeConcentrationUnit.DecilitersPerLiter); } @@ -413,9 +410,8 @@ public static VolumeConcentration FromDecilitersPerLiter(QuantityValue deciliter /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeConcentration FromDecilitersPerMililiter(QuantityValue deciliterspermililiter) + public static VolumeConcentration FromDecilitersPerMililiter(double value) { - double value = (double) deciliterspermililiter; return new VolumeConcentration(value, VolumeConcentrationUnit.DecilitersPerMililiter); } @@ -423,9 +419,8 @@ public static VolumeConcentration FromDecilitersPerMililiter(QuantityValue decil /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeConcentration FromDecimalFractions(QuantityValue decimalfractions) + public static VolumeConcentration FromDecimalFractions(double value) { - double value = (double) decimalfractions; return new VolumeConcentration(value, VolumeConcentrationUnit.DecimalFraction); } @@ -433,9 +428,8 @@ public static VolumeConcentration FromDecimalFractions(QuantityValue decimalfrac /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeConcentration FromLitersPerLiter(QuantityValue litersperliter) + public static VolumeConcentration FromLitersPerLiter(double value) { - double value = (double) litersperliter; return new VolumeConcentration(value, VolumeConcentrationUnit.LitersPerLiter); } @@ -443,9 +437,8 @@ public static VolumeConcentration FromLitersPerLiter(QuantityValue litersperlite /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeConcentration FromLitersPerMililiter(QuantityValue literspermililiter) + public static VolumeConcentration FromLitersPerMililiter(double value) { - double value = (double) literspermililiter; return new VolumeConcentration(value, VolumeConcentrationUnit.LitersPerMililiter); } @@ -453,9 +446,8 @@ public static VolumeConcentration FromLitersPerMililiter(QuantityValue litersper /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeConcentration FromMicrolitersPerLiter(QuantityValue microlitersperliter) + public static VolumeConcentration FromMicrolitersPerLiter(double value) { - double value = (double) microlitersperliter; return new VolumeConcentration(value, VolumeConcentrationUnit.MicrolitersPerLiter); } @@ -463,9 +455,8 @@ public static VolumeConcentration FromMicrolitersPerLiter(QuantityValue microlit /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeConcentration FromMicrolitersPerMililiter(QuantityValue microliterspermililiter) + public static VolumeConcentration FromMicrolitersPerMililiter(double value) { - double value = (double) microliterspermililiter; return new VolumeConcentration(value, VolumeConcentrationUnit.MicrolitersPerMililiter); } @@ -473,9 +464,8 @@ public static VolumeConcentration FromMicrolitersPerMililiter(QuantityValue micr /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeConcentration FromMillilitersPerLiter(QuantityValue millilitersperliter) + public static VolumeConcentration FromMillilitersPerLiter(double value) { - double value = (double) millilitersperliter; return new VolumeConcentration(value, VolumeConcentrationUnit.MillilitersPerLiter); } @@ -483,9 +473,8 @@ public static VolumeConcentration FromMillilitersPerLiter(QuantityValue millilit /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeConcentration FromMillilitersPerMililiter(QuantityValue milliliterspermililiter) + public static VolumeConcentration FromMillilitersPerMililiter(double value) { - double value = (double) milliliterspermililiter; return new VolumeConcentration(value, VolumeConcentrationUnit.MillilitersPerMililiter); } @@ -493,9 +482,8 @@ public static VolumeConcentration FromMillilitersPerMililiter(QuantityValue mill /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeConcentration FromNanolitersPerLiter(QuantityValue nanolitersperliter) + public static VolumeConcentration FromNanolitersPerLiter(double value) { - double value = (double) nanolitersperliter; return new VolumeConcentration(value, VolumeConcentrationUnit.NanolitersPerLiter); } @@ -503,9 +491,8 @@ public static VolumeConcentration FromNanolitersPerLiter(QuantityValue nanoliter /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeConcentration FromNanolitersPerMililiter(QuantityValue nanoliterspermililiter) + public static VolumeConcentration FromNanolitersPerMililiter(double value) { - double value = (double) nanoliterspermililiter; return new VolumeConcentration(value, VolumeConcentrationUnit.NanolitersPerMililiter); } @@ -513,9 +500,8 @@ public static VolumeConcentration FromNanolitersPerMililiter(QuantityValue nanol /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeConcentration FromPartsPerBillion(QuantityValue partsperbillion) + public static VolumeConcentration FromPartsPerBillion(double value) { - double value = (double) partsperbillion; return new VolumeConcentration(value, VolumeConcentrationUnit.PartPerBillion); } @@ -523,9 +509,8 @@ public static VolumeConcentration FromPartsPerBillion(QuantityValue partsperbill /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeConcentration FromPartsPerMillion(QuantityValue partspermillion) + public static VolumeConcentration FromPartsPerMillion(double value) { - double value = (double) partspermillion; return new VolumeConcentration(value, VolumeConcentrationUnit.PartPerMillion); } @@ -533,9 +518,8 @@ public static VolumeConcentration FromPartsPerMillion(QuantityValue partspermill /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeConcentration FromPartsPerThousand(QuantityValue partsperthousand) + public static VolumeConcentration FromPartsPerThousand(double value) { - double value = (double) partsperthousand; return new VolumeConcentration(value, VolumeConcentrationUnit.PartPerThousand); } @@ -543,9 +527,8 @@ public static VolumeConcentration FromPartsPerThousand(QuantityValue partspertho /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeConcentration FromPartsPerTrillion(QuantityValue partspertrillion) + public static VolumeConcentration FromPartsPerTrillion(double value) { - double value = (double) partspertrillion; return new VolumeConcentration(value, VolumeConcentrationUnit.PartPerTrillion); } @@ -553,9 +536,8 @@ public static VolumeConcentration FromPartsPerTrillion(QuantityValue partspertri /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeConcentration FromPercent(QuantityValue percent) + public static VolumeConcentration FromPercent(double value) { - double value = (double) percent; return new VolumeConcentration(value, VolumeConcentrationUnit.Percent); } @@ -563,9 +545,8 @@ public static VolumeConcentration FromPercent(QuantityValue percent) /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeConcentration FromPicolitersPerLiter(QuantityValue picolitersperliter) + public static VolumeConcentration FromPicolitersPerLiter(double value) { - double value = (double) picolitersperliter; return new VolumeConcentration(value, VolumeConcentrationUnit.PicolitersPerLiter); } @@ -573,9 +554,8 @@ public static VolumeConcentration FromPicolitersPerLiter(QuantityValue picoliter /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeConcentration FromPicolitersPerMililiter(QuantityValue picoliterspermililiter) + public static VolumeConcentration FromPicolitersPerMililiter(double value) { - double value = (double) picoliterspermililiter; return new VolumeConcentration(value, VolumeConcentrationUnit.PicolitersPerMililiter); } @@ -585,9 +565,9 @@ public static VolumeConcentration FromPicolitersPerMililiter(QuantityValue picol /// Value to convert from. /// Unit to convert from. /// VolumeConcentration unit value. - public static VolumeConcentration From(QuantityValue value, VolumeConcentrationUnit fromUnit) + public static VolumeConcentration From(double value, VolumeConcentrationUnit fromUnit) { - return new VolumeConcentration((double)value, fromUnit); + return new VolumeConcentration(value, fromUnit); } #endregion @@ -1014,15 +994,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is VolumeConcentrationUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(VolumeConcentrationUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is VolumeConcentrationUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(VolumeConcentrationUnit)} is supported.", nameof(unit)); @@ -1175,18 +1146,6 @@ public VolumeConcentration ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not VolumeConcentrationUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(VolumeConcentrationUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/VolumeFlow.g.cs b/UnitsNet/GeneratedCode/Quantities/VolumeFlow.g.cs index a76a9f150a..9f224a0c95 100644 --- a/UnitsNet/GeneratedCode/Quantities/VolumeFlow.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VolumeFlow.g.cs @@ -40,7 +40,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct VolumeFlow : - IArithmeticQuantity, + IArithmeticQuantity, #if NET7_0_OR_GREATER IDivisionOperators, IMultiplyOperators, @@ -223,7 +223,7 @@ public VolumeFlow(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -759,9 +759,8 @@ public static string GetAbbreviation(VolumeFlowUnit unit, IFormatProvider? provi /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromAcreFeetPerDay(QuantityValue acrefeetperday) + public static VolumeFlow FromAcreFeetPerDay(double value) { - double value = (double) acrefeetperday; return new VolumeFlow(value, VolumeFlowUnit.AcreFootPerDay); } @@ -769,9 +768,8 @@ public static VolumeFlow FromAcreFeetPerDay(QuantityValue acrefeetperday) /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromAcreFeetPerHour(QuantityValue acrefeetperhour) + public static VolumeFlow FromAcreFeetPerHour(double value) { - double value = (double) acrefeetperhour; return new VolumeFlow(value, VolumeFlowUnit.AcreFootPerHour); } @@ -779,9 +777,8 @@ public static VolumeFlow FromAcreFeetPerHour(QuantityValue acrefeetperhour) /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromAcreFeetPerMinute(QuantityValue acrefeetperminute) + public static VolumeFlow FromAcreFeetPerMinute(double value) { - double value = (double) acrefeetperminute; return new VolumeFlow(value, VolumeFlowUnit.AcreFootPerMinute); } @@ -789,9 +786,8 @@ public static VolumeFlow FromAcreFeetPerMinute(QuantityValue acrefeetperminute) /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromAcreFeetPerSecond(QuantityValue acrefeetpersecond) + public static VolumeFlow FromAcreFeetPerSecond(double value) { - double value = (double) acrefeetpersecond; return new VolumeFlow(value, VolumeFlowUnit.AcreFootPerSecond); } @@ -799,9 +795,8 @@ public static VolumeFlow FromAcreFeetPerSecond(QuantityValue acrefeetpersecond) /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromCentilitersPerDay(QuantityValue centilitersperday) + public static VolumeFlow FromCentilitersPerDay(double value) { - double value = (double) centilitersperday; return new VolumeFlow(value, VolumeFlowUnit.CentiliterPerDay); } @@ -809,9 +804,8 @@ public static VolumeFlow FromCentilitersPerDay(QuantityValue centilitersperday) /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromCentilitersPerHour(QuantityValue centilitersperhour) + public static VolumeFlow FromCentilitersPerHour(double value) { - double value = (double) centilitersperhour; return new VolumeFlow(value, VolumeFlowUnit.CentiliterPerHour); } @@ -819,9 +813,8 @@ public static VolumeFlow FromCentilitersPerHour(QuantityValue centilitersperhour /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromCentilitersPerMinute(QuantityValue centilitersperminute) + public static VolumeFlow FromCentilitersPerMinute(double value) { - double value = (double) centilitersperminute; return new VolumeFlow(value, VolumeFlowUnit.CentiliterPerMinute); } @@ -829,9 +822,8 @@ public static VolumeFlow FromCentilitersPerMinute(QuantityValue centiliterspermi /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromCentilitersPerSecond(QuantityValue centiliterspersecond) + public static VolumeFlow FromCentilitersPerSecond(double value) { - double value = (double) centiliterspersecond; return new VolumeFlow(value, VolumeFlowUnit.CentiliterPerSecond); } @@ -839,9 +831,8 @@ public static VolumeFlow FromCentilitersPerSecond(QuantityValue centilitersperse /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromCubicCentimetersPerMinute(QuantityValue cubiccentimetersperminute) + public static VolumeFlow FromCubicCentimetersPerMinute(double value) { - double value = (double) cubiccentimetersperminute; return new VolumeFlow(value, VolumeFlowUnit.CubicCentimeterPerMinute); } @@ -849,9 +840,8 @@ public static VolumeFlow FromCubicCentimetersPerMinute(QuantityValue cubiccentim /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromCubicDecimetersPerMinute(QuantityValue cubicdecimetersperminute) + public static VolumeFlow FromCubicDecimetersPerMinute(double value) { - double value = (double) cubicdecimetersperminute; return new VolumeFlow(value, VolumeFlowUnit.CubicDecimeterPerMinute); } @@ -859,9 +849,8 @@ public static VolumeFlow FromCubicDecimetersPerMinute(QuantityValue cubicdecimet /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromCubicFeetPerHour(QuantityValue cubicfeetperhour) + public static VolumeFlow FromCubicFeetPerHour(double value) { - double value = (double) cubicfeetperhour; return new VolumeFlow(value, VolumeFlowUnit.CubicFootPerHour); } @@ -869,9 +858,8 @@ public static VolumeFlow FromCubicFeetPerHour(QuantityValue cubicfeetperhour) /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromCubicFeetPerMinute(QuantityValue cubicfeetperminute) + public static VolumeFlow FromCubicFeetPerMinute(double value) { - double value = (double) cubicfeetperminute; return new VolumeFlow(value, VolumeFlowUnit.CubicFootPerMinute); } @@ -879,9 +867,8 @@ public static VolumeFlow FromCubicFeetPerMinute(QuantityValue cubicfeetperminute /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromCubicFeetPerSecond(QuantityValue cubicfeetpersecond) + public static VolumeFlow FromCubicFeetPerSecond(double value) { - double value = (double) cubicfeetpersecond; return new VolumeFlow(value, VolumeFlowUnit.CubicFootPerSecond); } @@ -889,9 +876,8 @@ public static VolumeFlow FromCubicFeetPerSecond(QuantityValue cubicfeetpersecond /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromCubicMetersPerDay(QuantityValue cubicmetersperday) + public static VolumeFlow FromCubicMetersPerDay(double value) { - double value = (double) cubicmetersperday; return new VolumeFlow(value, VolumeFlowUnit.CubicMeterPerDay); } @@ -899,9 +885,8 @@ public static VolumeFlow FromCubicMetersPerDay(QuantityValue cubicmetersperday) /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromCubicMetersPerHour(QuantityValue cubicmetersperhour) + public static VolumeFlow FromCubicMetersPerHour(double value) { - double value = (double) cubicmetersperhour; return new VolumeFlow(value, VolumeFlowUnit.CubicMeterPerHour); } @@ -909,9 +894,8 @@ public static VolumeFlow FromCubicMetersPerHour(QuantityValue cubicmetersperhour /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromCubicMetersPerMinute(QuantityValue cubicmetersperminute) + public static VolumeFlow FromCubicMetersPerMinute(double value) { - double value = (double) cubicmetersperminute; return new VolumeFlow(value, VolumeFlowUnit.CubicMeterPerMinute); } @@ -919,9 +903,8 @@ public static VolumeFlow FromCubicMetersPerMinute(QuantityValue cubicmeterspermi /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromCubicMetersPerSecond(QuantityValue cubicmeterspersecond) + public static VolumeFlow FromCubicMetersPerSecond(double value) { - double value = (double) cubicmeterspersecond; return new VolumeFlow(value, VolumeFlowUnit.CubicMeterPerSecond); } @@ -929,9 +912,8 @@ public static VolumeFlow FromCubicMetersPerSecond(QuantityValue cubicmetersperse /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromCubicMillimetersPerSecond(QuantityValue cubicmillimeterspersecond) + public static VolumeFlow FromCubicMillimetersPerSecond(double value) { - double value = (double) cubicmillimeterspersecond; return new VolumeFlow(value, VolumeFlowUnit.CubicMillimeterPerSecond); } @@ -939,9 +921,8 @@ public static VolumeFlow FromCubicMillimetersPerSecond(QuantityValue cubicmillim /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromCubicYardsPerDay(QuantityValue cubicyardsperday) + public static VolumeFlow FromCubicYardsPerDay(double value) { - double value = (double) cubicyardsperday; return new VolumeFlow(value, VolumeFlowUnit.CubicYardPerDay); } @@ -949,9 +930,8 @@ public static VolumeFlow FromCubicYardsPerDay(QuantityValue cubicyardsperday) /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromCubicYardsPerHour(QuantityValue cubicyardsperhour) + public static VolumeFlow FromCubicYardsPerHour(double value) { - double value = (double) cubicyardsperhour; return new VolumeFlow(value, VolumeFlowUnit.CubicYardPerHour); } @@ -959,9 +939,8 @@ public static VolumeFlow FromCubicYardsPerHour(QuantityValue cubicyardsperhour) /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromCubicYardsPerMinute(QuantityValue cubicyardsperminute) + public static VolumeFlow FromCubicYardsPerMinute(double value) { - double value = (double) cubicyardsperminute; return new VolumeFlow(value, VolumeFlowUnit.CubicYardPerMinute); } @@ -969,9 +948,8 @@ public static VolumeFlow FromCubicYardsPerMinute(QuantityValue cubicyardsperminu /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromCubicYardsPerSecond(QuantityValue cubicyardspersecond) + public static VolumeFlow FromCubicYardsPerSecond(double value) { - double value = (double) cubicyardspersecond; return new VolumeFlow(value, VolumeFlowUnit.CubicYardPerSecond); } @@ -979,9 +957,8 @@ public static VolumeFlow FromCubicYardsPerSecond(QuantityValue cubicyardsperseco /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromDecilitersPerDay(QuantityValue decilitersperday) + public static VolumeFlow FromDecilitersPerDay(double value) { - double value = (double) decilitersperday; return new VolumeFlow(value, VolumeFlowUnit.DeciliterPerDay); } @@ -989,9 +966,8 @@ public static VolumeFlow FromDecilitersPerDay(QuantityValue decilitersperday) /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromDecilitersPerHour(QuantityValue decilitersperhour) + public static VolumeFlow FromDecilitersPerHour(double value) { - double value = (double) decilitersperhour; return new VolumeFlow(value, VolumeFlowUnit.DeciliterPerHour); } @@ -999,9 +975,8 @@ public static VolumeFlow FromDecilitersPerHour(QuantityValue decilitersperhour) /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromDecilitersPerMinute(QuantityValue decilitersperminute) + public static VolumeFlow FromDecilitersPerMinute(double value) { - double value = (double) decilitersperminute; return new VolumeFlow(value, VolumeFlowUnit.DeciliterPerMinute); } @@ -1009,9 +984,8 @@ public static VolumeFlow FromDecilitersPerMinute(QuantityValue decilitersperminu /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromDecilitersPerSecond(QuantityValue deciliterspersecond) + public static VolumeFlow FromDecilitersPerSecond(double value) { - double value = (double) deciliterspersecond; return new VolumeFlow(value, VolumeFlowUnit.DeciliterPerSecond); } @@ -1019,9 +993,8 @@ public static VolumeFlow FromDecilitersPerSecond(QuantityValue decilitersperseco /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromKilolitersPerDay(QuantityValue kilolitersperday) + public static VolumeFlow FromKilolitersPerDay(double value) { - double value = (double) kilolitersperday; return new VolumeFlow(value, VolumeFlowUnit.KiloliterPerDay); } @@ -1029,9 +1002,8 @@ public static VolumeFlow FromKilolitersPerDay(QuantityValue kilolitersperday) /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromKilolitersPerHour(QuantityValue kilolitersperhour) + public static VolumeFlow FromKilolitersPerHour(double value) { - double value = (double) kilolitersperhour; return new VolumeFlow(value, VolumeFlowUnit.KiloliterPerHour); } @@ -1039,9 +1011,8 @@ public static VolumeFlow FromKilolitersPerHour(QuantityValue kilolitersperhour) /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromKilolitersPerMinute(QuantityValue kilolitersperminute) + public static VolumeFlow FromKilolitersPerMinute(double value) { - double value = (double) kilolitersperminute; return new VolumeFlow(value, VolumeFlowUnit.KiloliterPerMinute); } @@ -1049,9 +1020,8 @@ public static VolumeFlow FromKilolitersPerMinute(QuantityValue kilolitersperminu /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromKilolitersPerSecond(QuantityValue kiloliterspersecond) + public static VolumeFlow FromKilolitersPerSecond(double value) { - double value = (double) kiloliterspersecond; return new VolumeFlow(value, VolumeFlowUnit.KiloliterPerSecond); } @@ -1059,9 +1029,8 @@ public static VolumeFlow FromKilolitersPerSecond(QuantityValue kilolitersperseco /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromKilousGallonsPerMinute(QuantityValue kilousgallonsperminute) + public static VolumeFlow FromKilousGallonsPerMinute(double value) { - double value = (double) kilousgallonsperminute; return new VolumeFlow(value, VolumeFlowUnit.KilousGallonPerMinute); } @@ -1069,9 +1038,8 @@ public static VolumeFlow FromKilousGallonsPerMinute(QuantityValue kilousgallonsp /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromLitersPerDay(QuantityValue litersperday) + public static VolumeFlow FromLitersPerDay(double value) { - double value = (double) litersperday; return new VolumeFlow(value, VolumeFlowUnit.LiterPerDay); } @@ -1079,9 +1047,8 @@ public static VolumeFlow FromLitersPerDay(QuantityValue litersperday) /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromLitersPerHour(QuantityValue litersperhour) + public static VolumeFlow FromLitersPerHour(double value) { - double value = (double) litersperhour; return new VolumeFlow(value, VolumeFlowUnit.LiterPerHour); } @@ -1089,9 +1056,8 @@ public static VolumeFlow FromLitersPerHour(QuantityValue litersperhour) /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromLitersPerMinute(QuantityValue litersperminute) + public static VolumeFlow FromLitersPerMinute(double value) { - double value = (double) litersperminute; return new VolumeFlow(value, VolumeFlowUnit.LiterPerMinute); } @@ -1099,9 +1065,8 @@ public static VolumeFlow FromLitersPerMinute(QuantityValue litersperminute) /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromLitersPerSecond(QuantityValue literspersecond) + public static VolumeFlow FromLitersPerSecond(double value) { - double value = (double) literspersecond; return new VolumeFlow(value, VolumeFlowUnit.LiterPerSecond); } @@ -1109,9 +1074,8 @@ public static VolumeFlow FromLitersPerSecond(QuantityValue literspersecond) /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromMegalitersPerDay(QuantityValue megalitersperday) + public static VolumeFlow FromMegalitersPerDay(double value) { - double value = (double) megalitersperday; return new VolumeFlow(value, VolumeFlowUnit.MegaliterPerDay); } @@ -1119,9 +1083,8 @@ public static VolumeFlow FromMegalitersPerDay(QuantityValue megalitersperday) /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromMegalitersPerHour(QuantityValue megalitersperhour) + public static VolumeFlow FromMegalitersPerHour(double value) { - double value = (double) megalitersperhour; return new VolumeFlow(value, VolumeFlowUnit.MegaliterPerHour); } @@ -1129,9 +1092,8 @@ public static VolumeFlow FromMegalitersPerHour(QuantityValue megalitersperhour) /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromMegalitersPerMinute(QuantityValue megalitersperminute) + public static VolumeFlow FromMegalitersPerMinute(double value) { - double value = (double) megalitersperminute; return new VolumeFlow(value, VolumeFlowUnit.MegaliterPerMinute); } @@ -1139,9 +1101,8 @@ public static VolumeFlow FromMegalitersPerMinute(QuantityValue megalitersperminu /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromMegalitersPerSecond(QuantityValue megaliterspersecond) + public static VolumeFlow FromMegalitersPerSecond(double value) { - double value = (double) megaliterspersecond; return new VolumeFlow(value, VolumeFlowUnit.MegaliterPerSecond); } @@ -1149,9 +1110,8 @@ public static VolumeFlow FromMegalitersPerSecond(QuantityValue megalitersperseco /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromMegaukGallonsPerDay(QuantityValue megaukgallonsperday) + public static VolumeFlow FromMegaukGallonsPerDay(double value) { - double value = (double) megaukgallonsperday; return new VolumeFlow(value, VolumeFlowUnit.MegaukGallonPerDay); } @@ -1159,9 +1119,8 @@ public static VolumeFlow FromMegaukGallonsPerDay(QuantityValue megaukgallonsperd /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromMegaukGallonsPerSecond(QuantityValue megaukgallonspersecond) + public static VolumeFlow FromMegaukGallonsPerSecond(double value) { - double value = (double) megaukgallonspersecond; return new VolumeFlow(value, VolumeFlowUnit.MegaukGallonPerSecond); } @@ -1169,9 +1128,8 @@ public static VolumeFlow FromMegaukGallonsPerSecond(QuantityValue megaukgallonsp /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromMegausGallonsPerDay(QuantityValue megausgallonsperday) + public static VolumeFlow FromMegausGallonsPerDay(double value) { - double value = (double) megausgallonsperday; return new VolumeFlow(value, VolumeFlowUnit.MegausGallonPerDay); } @@ -1179,9 +1137,8 @@ public static VolumeFlow FromMegausGallonsPerDay(QuantityValue megausgallonsperd /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromMicrolitersPerDay(QuantityValue microlitersperday) + public static VolumeFlow FromMicrolitersPerDay(double value) { - double value = (double) microlitersperday; return new VolumeFlow(value, VolumeFlowUnit.MicroliterPerDay); } @@ -1189,9 +1146,8 @@ public static VolumeFlow FromMicrolitersPerDay(QuantityValue microlitersperday) /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromMicrolitersPerHour(QuantityValue microlitersperhour) + public static VolumeFlow FromMicrolitersPerHour(double value) { - double value = (double) microlitersperhour; return new VolumeFlow(value, VolumeFlowUnit.MicroliterPerHour); } @@ -1199,9 +1155,8 @@ public static VolumeFlow FromMicrolitersPerHour(QuantityValue microlitersperhour /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromMicrolitersPerMinute(QuantityValue microlitersperminute) + public static VolumeFlow FromMicrolitersPerMinute(double value) { - double value = (double) microlitersperminute; return new VolumeFlow(value, VolumeFlowUnit.MicroliterPerMinute); } @@ -1209,9 +1164,8 @@ public static VolumeFlow FromMicrolitersPerMinute(QuantityValue microliterspermi /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromMicrolitersPerSecond(QuantityValue microliterspersecond) + public static VolumeFlow FromMicrolitersPerSecond(double value) { - double value = (double) microliterspersecond; return new VolumeFlow(value, VolumeFlowUnit.MicroliterPerSecond); } @@ -1219,9 +1173,8 @@ public static VolumeFlow FromMicrolitersPerSecond(QuantityValue microlitersperse /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromMillilitersPerDay(QuantityValue millilitersperday) + public static VolumeFlow FromMillilitersPerDay(double value) { - double value = (double) millilitersperday; return new VolumeFlow(value, VolumeFlowUnit.MilliliterPerDay); } @@ -1229,9 +1182,8 @@ public static VolumeFlow FromMillilitersPerDay(QuantityValue millilitersperday) /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromMillilitersPerHour(QuantityValue millilitersperhour) + public static VolumeFlow FromMillilitersPerHour(double value) { - double value = (double) millilitersperhour; return new VolumeFlow(value, VolumeFlowUnit.MilliliterPerHour); } @@ -1239,9 +1191,8 @@ public static VolumeFlow FromMillilitersPerHour(QuantityValue millilitersperhour /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromMillilitersPerMinute(QuantityValue millilitersperminute) + public static VolumeFlow FromMillilitersPerMinute(double value) { - double value = (double) millilitersperminute; return new VolumeFlow(value, VolumeFlowUnit.MilliliterPerMinute); } @@ -1249,9 +1200,8 @@ public static VolumeFlow FromMillilitersPerMinute(QuantityValue milliliterspermi /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromMillilitersPerSecond(QuantityValue milliliterspersecond) + public static VolumeFlow FromMillilitersPerSecond(double value) { - double value = (double) milliliterspersecond; return new VolumeFlow(value, VolumeFlowUnit.MilliliterPerSecond); } @@ -1259,9 +1209,8 @@ public static VolumeFlow FromMillilitersPerSecond(QuantityValue millilitersperse /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromMillionUsGallonsPerDay(QuantityValue millionusgallonsperday) + public static VolumeFlow FromMillionUsGallonsPerDay(double value) { - double value = (double) millionusgallonsperday; return new VolumeFlow(value, VolumeFlowUnit.MillionUsGallonPerDay); } @@ -1269,9 +1218,8 @@ public static VolumeFlow FromMillionUsGallonsPerDay(QuantityValue millionusgallo /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromNanolitersPerDay(QuantityValue nanolitersperday) + public static VolumeFlow FromNanolitersPerDay(double value) { - double value = (double) nanolitersperday; return new VolumeFlow(value, VolumeFlowUnit.NanoliterPerDay); } @@ -1279,9 +1227,8 @@ public static VolumeFlow FromNanolitersPerDay(QuantityValue nanolitersperday) /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromNanolitersPerHour(QuantityValue nanolitersperhour) + public static VolumeFlow FromNanolitersPerHour(double value) { - double value = (double) nanolitersperhour; return new VolumeFlow(value, VolumeFlowUnit.NanoliterPerHour); } @@ -1289,9 +1236,8 @@ public static VolumeFlow FromNanolitersPerHour(QuantityValue nanolitersperhour) /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromNanolitersPerMinute(QuantityValue nanolitersperminute) + public static VolumeFlow FromNanolitersPerMinute(double value) { - double value = (double) nanolitersperminute; return new VolumeFlow(value, VolumeFlowUnit.NanoliterPerMinute); } @@ -1299,9 +1245,8 @@ public static VolumeFlow FromNanolitersPerMinute(QuantityValue nanolitersperminu /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromNanolitersPerSecond(QuantityValue nanoliterspersecond) + public static VolumeFlow FromNanolitersPerSecond(double value) { - double value = (double) nanoliterspersecond; return new VolumeFlow(value, VolumeFlowUnit.NanoliterPerSecond); } @@ -1309,9 +1254,8 @@ public static VolumeFlow FromNanolitersPerSecond(QuantityValue nanolitersperseco /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromOilBarrelsPerDay(QuantityValue oilbarrelsperday) + public static VolumeFlow FromOilBarrelsPerDay(double value) { - double value = (double) oilbarrelsperday; return new VolumeFlow(value, VolumeFlowUnit.OilBarrelPerDay); } @@ -1319,9 +1263,8 @@ public static VolumeFlow FromOilBarrelsPerDay(QuantityValue oilbarrelsperday) /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromOilBarrelsPerHour(QuantityValue oilbarrelsperhour) + public static VolumeFlow FromOilBarrelsPerHour(double value) { - double value = (double) oilbarrelsperhour; return new VolumeFlow(value, VolumeFlowUnit.OilBarrelPerHour); } @@ -1329,9 +1272,8 @@ public static VolumeFlow FromOilBarrelsPerHour(QuantityValue oilbarrelsperhour) /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromOilBarrelsPerMinute(QuantityValue oilbarrelsperminute) + public static VolumeFlow FromOilBarrelsPerMinute(double value) { - double value = (double) oilbarrelsperminute; return new VolumeFlow(value, VolumeFlowUnit.OilBarrelPerMinute); } @@ -1339,9 +1281,8 @@ public static VolumeFlow FromOilBarrelsPerMinute(QuantityValue oilbarrelsperminu /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromOilBarrelsPerSecond(QuantityValue oilbarrelspersecond) + public static VolumeFlow FromOilBarrelsPerSecond(double value) { - double value = (double) oilbarrelspersecond; return new VolumeFlow(value, VolumeFlowUnit.OilBarrelPerSecond); } @@ -1349,9 +1290,8 @@ public static VolumeFlow FromOilBarrelsPerSecond(QuantityValue oilbarrelsperseco /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromUkGallonsPerDay(QuantityValue ukgallonsperday) + public static VolumeFlow FromUkGallonsPerDay(double value) { - double value = (double) ukgallonsperday; return new VolumeFlow(value, VolumeFlowUnit.UkGallonPerDay); } @@ -1359,9 +1299,8 @@ public static VolumeFlow FromUkGallonsPerDay(QuantityValue ukgallonsperday) /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromUkGallonsPerHour(QuantityValue ukgallonsperhour) + public static VolumeFlow FromUkGallonsPerHour(double value) { - double value = (double) ukgallonsperhour; return new VolumeFlow(value, VolumeFlowUnit.UkGallonPerHour); } @@ -1369,9 +1308,8 @@ public static VolumeFlow FromUkGallonsPerHour(QuantityValue ukgallonsperhour) /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromUkGallonsPerMinute(QuantityValue ukgallonsperminute) + public static VolumeFlow FromUkGallonsPerMinute(double value) { - double value = (double) ukgallonsperminute; return new VolumeFlow(value, VolumeFlowUnit.UkGallonPerMinute); } @@ -1379,9 +1317,8 @@ public static VolumeFlow FromUkGallonsPerMinute(QuantityValue ukgallonsperminute /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromUkGallonsPerSecond(QuantityValue ukgallonspersecond) + public static VolumeFlow FromUkGallonsPerSecond(double value) { - double value = (double) ukgallonspersecond; return new VolumeFlow(value, VolumeFlowUnit.UkGallonPerSecond); } @@ -1389,9 +1326,8 @@ public static VolumeFlow FromUkGallonsPerSecond(QuantityValue ukgallonspersecond /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromUsGallonsPerDay(QuantityValue usgallonsperday) + public static VolumeFlow FromUsGallonsPerDay(double value) { - double value = (double) usgallonsperday; return new VolumeFlow(value, VolumeFlowUnit.UsGallonPerDay); } @@ -1399,9 +1335,8 @@ public static VolumeFlow FromUsGallonsPerDay(QuantityValue usgallonsperday) /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromUsGallonsPerHour(QuantityValue usgallonsperhour) + public static VolumeFlow FromUsGallonsPerHour(double value) { - double value = (double) usgallonsperhour; return new VolumeFlow(value, VolumeFlowUnit.UsGallonPerHour); } @@ -1409,9 +1344,8 @@ public static VolumeFlow FromUsGallonsPerHour(QuantityValue usgallonsperhour) /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromUsGallonsPerMinute(QuantityValue usgallonsperminute) + public static VolumeFlow FromUsGallonsPerMinute(double value) { - double value = (double) usgallonsperminute; return new VolumeFlow(value, VolumeFlowUnit.UsGallonPerMinute); } @@ -1419,9 +1353,8 @@ public static VolumeFlow FromUsGallonsPerMinute(QuantityValue usgallonsperminute /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromUsGallonsPerSecond(QuantityValue usgallonspersecond) + public static VolumeFlow FromUsGallonsPerSecond(double value) { - double value = (double) usgallonspersecond; return new VolumeFlow(value, VolumeFlowUnit.UsGallonPerSecond); } @@ -1431,9 +1364,9 @@ public static VolumeFlow FromUsGallonsPerSecond(QuantityValue usgallonspersecond /// Value to convert from. /// Unit to convert from. /// VolumeFlow unit value. - public static VolumeFlow From(QuantityValue value, VolumeFlowUnit fromUnit) + public static VolumeFlow From(double value, VolumeFlowUnit fromUnit) { - return new VolumeFlow((double)value, fromUnit); + return new VolumeFlow(value, fromUnit); } #endregion @@ -1884,15 +1817,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is VolumeFlowUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(VolumeFlowUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is VolumeFlowUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(VolumeFlowUnit)} is supported.", nameof(unit)); @@ -2139,18 +2063,6 @@ public VolumeFlow ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not VolumeFlowUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(VolumeFlowUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/VolumeFlowPerArea.g.cs b/UnitsNet/GeneratedCode/Quantities/VolumeFlowPerArea.g.cs index 058ca287dd..e157221bd3 100644 --- a/UnitsNet/GeneratedCode/Quantities/VolumeFlowPerArea.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VolumeFlowPerArea.g.cs @@ -37,7 +37,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct VolumeFlowPerArea : - IArithmeticQuantity, + IArithmeticQuantity, IComparable, IComparable, IConvertible, @@ -148,7 +148,7 @@ public VolumeFlowPerArea(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -229,9 +229,8 @@ public static string GetAbbreviation(VolumeFlowPerAreaUnit unit, IFormatProvider /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlowPerArea FromCubicFeetPerMinutePerSquareFoot(QuantityValue cubicfeetperminutepersquarefoot) + public static VolumeFlowPerArea FromCubicFeetPerMinutePerSquareFoot(double value) { - double value = (double) cubicfeetperminutepersquarefoot; return new VolumeFlowPerArea(value, VolumeFlowPerAreaUnit.CubicFootPerMinutePerSquareFoot); } @@ -239,9 +238,8 @@ public static VolumeFlowPerArea FromCubicFeetPerMinutePerSquareFoot(QuantityValu /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlowPerArea FromCubicMetersPerSecondPerSquareMeter(QuantityValue cubicmeterspersecondpersquaremeter) + public static VolumeFlowPerArea FromCubicMetersPerSecondPerSquareMeter(double value) { - double value = (double) cubicmeterspersecondpersquaremeter; return new VolumeFlowPerArea(value, VolumeFlowPerAreaUnit.CubicMeterPerSecondPerSquareMeter); } @@ -251,9 +249,9 @@ public static VolumeFlowPerArea FromCubicMetersPerSecondPerSquareMeter(QuantityV /// Value to convert from. /// Unit to convert from. /// VolumeFlowPerArea unit value. - public static VolumeFlowPerArea From(QuantityValue value, VolumeFlowPerAreaUnit fromUnit) + public static VolumeFlowPerArea From(double value, VolumeFlowPerAreaUnit fromUnit) { - return new VolumeFlowPerArea((double)value, fromUnit); + return new VolumeFlowPerArea(value, fromUnit); } #endregion @@ -664,15 +662,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is VolumeFlowPerAreaUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(VolumeFlowPerAreaUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is VolumeFlowPerAreaUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(VolumeFlowPerAreaUnit)} is supported.", nameof(unit)); @@ -789,18 +778,6 @@ public VolumeFlowPerArea ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not VolumeFlowPerAreaUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(VolumeFlowPerAreaUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/VolumePerLength.g.cs b/UnitsNet/GeneratedCode/Quantities/VolumePerLength.g.cs index a51dabcde1..99c89dcbe3 100644 --- a/UnitsNet/GeneratedCode/Quantities/VolumePerLength.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VolumePerLength.g.cs @@ -37,7 +37,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct VolumePerLength : - IArithmeticQuantity, + IArithmeticQuantity, IComparable, IComparable, IConvertible, @@ -155,7 +155,7 @@ public VolumePerLength(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -285,9 +285,8 @@ public static string GetAbbreviation(VolumePerLengthUnit unit, IFormatProvider? /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumePerLength FromCubicMetersPerMeter(QuantityValue cubicmeterspermeter) + public static VolumePerLength FromCubicMetersPerMeter(double value) { - double value = (double) cubicmeterspermeter; return new VolumePerLength(value, VolumePerLengthUnit.CubicMeterPerMeter); } @@ -295,9 +294,8 @@ public static VolumePerLength FromCubicMetersPerMeter(QuantityValue cubicmetersp /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumePerLength FromCubicYardsPerFoot(QuantityValue cubicyardsperfoot) + public static VolumePerLength FromCubicYardsPerFoot(double value) { - double value = (double) cubicyardsperfoot; return new VolumePerLength(value, VolumePerLengthUnit.CubicYardPerFoot); } @@ -305,9 +303,8 @@ public static VolumePerLength FromCubicYardsPerFoot(QuantityValue cubicyardsperf /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumePerLength FromCubicYardsPerUsSurveyFoot(QuantityValue cubicyardsperussurveyfoot) + public static VolumePerLength FromCubicYardsPerUsSurveyFoot(double value) { - double value = (double) cubicyardsperussurveyfoot; return new VolumePerLength(value, VolumePerLengthUnit.CubicYardPerUsSurveyFoot); } @@ -315,9 +312,8 @@ public static VolumePerLength FromCubicYardsPerUsSurveyFoot(QuantityValue cubicy /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumePerLength FromImperialGallonsPerMile(QuantityValue imperialgallonspermile) + public static VolumePerLength FromImperialGallonsPerMile(double value) { - double value = (double) imperialgallonspermile; return new VolumePerLength(value, VolumePerLengthUnit.ImperialGallonPerMile); } @@ -325,9 +321,8 @@ public static VolumePerLength FromImperialGallonsPerMile(QuantityValue imperialg /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumePerLength FromLitersPerKilometer(QuantityValue litersperkilometer) + public static VolumePerLength FromLitersPerKilometer(double value) { - double value = (double) litersperkilometer; return new VolumePerLength(value, VolumePerLengthUnit.LiterPerKilometer); } @@ -335,9 +330,8 @@ public static VolumePerLength FromLitersPerKilometer(QuantityValue litersperkilo /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumePerLength FromLitersPerMeter(QuantityValue literspermeter) + public static VolumePerLength FromLitersPerMeter(double value) { - double value = (double) literspermeter; return new VolumePerLength(value, VolumePerLengthUnit.LiterPerMeter); } @@ -345,9 +339,8 @@ public static VolumePerLength FromLitersPerMeter(QuantityValue literspermeter) /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumePerLength FromLitersPerMillimeter(QuantityValue literspermillimeter) + public static VolumePerLength FromLitersPerMillimeter(double value) { - double value = (double) literspermillimeter; return new VolumePerLength(value, VolumePerLengthUnit.LiterPerMillimeter); } @@ -355,9 +348,8 @@ public static VolumePerLength FromLitersPerMillimeter(QuantityValue literspermil /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumePerLength FromOilBarrelsPerFoot(QuantityValue oilbarrelsperfoot) + public static VolumePerLength FromOilBarrelsPerFoot(double value) { - double value = (double) oilbarrelsperfoot; return new VolumePerLength(value, VolumePerLengthUnit.OilBarrelPerFoot); } @@ -365,9 +357,8 @@ public static VolumePerLength FromOilBarrelsPerFoot(QuantityValue oilbarrelsperf /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumePerLength FromUsGallonsPerMile(QuantityValue usgallonspermile) + public static VolumePerLength FromUsGallonsPerMile(double value) { - double value = (double) usgallonspermile; return new VolumePerLength(value, VolumePerLengthUnit.UsGallonPerMile); } @@ -377,9 +368,9 @@ public static VolumePerLength FromUsGallonsPerMile(QuantityValue usgallonspermil /// Value to convert from. /// Unit to convert from. /// VolumePerLength unit value. - public static VolumePerLength From(QuantityValue value, VolumePerLengthUnit fromUnit) + public static VolumePerLength From(double value, VolumePerLengthUnit fromUnit) { - return new VolumePerLength((double)value, fromUnit); + return new VolumePerLength(value, fromUnit); } #endregion @@ -790,15 +781,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is VolumePerLengthUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(VolumePerLengthUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is VolumePerLengthUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(VolumePerLengthUnit)} is supported.", nameof(unit)); @@ -929,18 +911,6 @@ public VolumePerLength ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not VolumePerLengthUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(VolumePerLengthUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/VolumetricHeatCapacity.g.cs b/UnitsNet/GeneratedCode/Quantities/VolumetricHeatCapacity.g.cs index 3e141d1649..f78bf80fca 100644 --- a/UnitsNet/GeneratedCode/Quantities/VolumetricHeatCapacity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VolumetricHeatCapacity.g.cs @@ -40,7 +40,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct VolumetricHeatCapacity : - IArithmeticQuantity, + IArithmeticQuantity, IComparable, IComparable, IConvertible, @@ -158,7 +158,7 @@ public VolumetricHeatCapacity(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -288,9 +288,8 @@ public static string GetAbbreviation(VolumetricHeatCapacityUnit unit, IFormatPro /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumetricHeatCapacity FromBtusPerCubicFootDegreeFahrenheit(QuantityValue btuspercubicfootdegreefahrenheit) + public static VolumetricHeatCapacity FromBtusPerCubicFootDegreeFahrenheit(double value) { - double value = (double) btuspercubicfootdegreefahrenheit; return new VolumetricHeatCapacity(value, VolumetricHeatCapacityUnit.BtuPerCubicFootDegreeFahrenheit); } @@ -298,9 +297,8 @@ public static VolumetricHeatCapacity FromBtusPerCubicFootDegreeFahrenheit(Quanti /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumetricHeatCapacity FromCaloriesPerCubicCentimeterDegreeCelsius(QuantityValue caloriespercubiccentimeterdegreecelsius) + public static VolumetricHeatCapacity FromCaloriesPerCubicCentimeterDegreeCelsius(double value) { - double value = (double) caloriespercubiccentimeterdegreecelsius; return new VolumetricHeatCapacity(value, VolumetricHeatCapacityUnit.CaloriePerCubicCentimeterDegreeCelsius); } @@ -308,9 +306,8 @@ public static VolumetricHeatCapacity FromCaloriesPerCubicCentimeterDegreeCelsius /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumetricHeatCapacity FromJoulesPerCubicMeterDegreeCelsius(QuantityValue joulespercubicmeterdegreecelsius) + public static VolumetricHeatCapacity FromJoulesPerCubicMeterDegreeCelsius(double value) { - double value = (double) joulespercubicmeterdegreecelsius; return new VolumetricHeatCapacity(value, VolumetricHeatCapacityUnit.JoulePerCubicMeterDegreeCelsius); } @@ -318,9 +315,8 @@ public static VolumetricHeatCapacity FromJoulesPerCubicMeterDegreeCelsius(Quanti /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumetricHeatCapacity FromJoulesPerCubicMeterKelvin(QuantityValue joulespercubicmeterkelvin) + public static VolumetricHeatCapacity FromJoulesPerCubicMeterKelvin(double value) { - double value = (double) joulespercubicmeterkelvin; return new VolumetricHeatCapacity(value, VolumetricHeatCapacityUnit.JoulePerCubicMeterKelvin); } @@ -328,9 +324,8 @@ public static VolumetricHeatCapacity FromJoulesPerCubicMeterKelvin(QuantityValue /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumetricHeatCapacity FromKilocaloriesPerCubicCentimeterDegreeCelsius(QuantityValue kilocaloriespercubiccentimeterdegreecelsius) + public static VolumetricHeatCapacity FromKilocaloriesPerCubicCentimeterDegreeCelsius(double value) { - double value = (double) kilocaloriespercubiccentimeterdegreecelsius; return new VolumetricHeatCapacity(value, VolumetricHeatCapacityUnit.KilocaloriePerCubicCentimeterDegreeCelsius); } @@ -338,9 +333,8 @@ public static VolumetricHeatCapacity FromKilocaloriesPerCubicCentimeterDegreeCel /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumetricHeatCapacity FromKilojoulesPerCubicMeterDegreeCelsius(QuantityValue kilojoulespercubicmeterdegreecelsius) + public static VolumetricHeatCapacity FromKilojoulesPerCubicMeterDegreeCelsius(double value) { - double value = (double) kilojoulespercubicmeterdegreecelsius; return new VolumetricHeatCapacity(value, VolumetricHeatCapacityUnit.KilojoulePerCubicMeterDegreeCelsius); } @@ -348,9 +342,8 @@ public static VolumetricHeatCapacity FromKilojoulesPerCubicMeterDegreeCelsius(Qu /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumetricHeatCapacity FromKilojoulesPerCubicMeterKelvin(QuantityValue kilojoulespercubicmeterkelvin) + public static VolumetricHeatCapacity FromKilojoulesPerCubicMeterKelvin(double value) { - double value = (double) kilojoulespercubicmeterkelvin; return new VolumetricHeatCapacity(value, VolumetricHeatCapacityUnit.KilojoulePerCubicMeterKelvin); } @@ -358,9 +351,8 @@ public static VolumetricHeatCapacity FromKilojoulesPerCubicMeterKelvin(QuantityV /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumetricHeatCapacity FromMegajoulesPerCubicMeterDegreeCelsius(QuantityValue megajoulespercubicmeterdegreecelsius) + public static VolumetricHeatCapacity FromMegajoulesPerCubicMeterDegreeCelsius(double value) { - double value = (double) megajoulespercubicmeterdegreecelsius; return new VolumetricHeatCapacity(value, VolumetricHeatCapacityUnit.MegajoulePerCubicMeterDegreeCelsius); } @@ -368,9 +360,8 @@ public static VolumetricHeatCapacity FromMegajoulesPerCubicMeterDegreeCelsius(Qu /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumetricHeatCapacity FromMegajoulesPerCubicMeterKelvin(QuantityValue megajoulespercubicmeterkelvin) + public static VolumetricHeatCapacity FromMegajoulesPerCubicMeterKelvin(double value) { - double value = (double) megajoulespercubicmeterkelvin; return new VolumetricHeatCapacity(value, VolumetricHeatCapacityUnit.MegajoulePerCubicMeterKelvin); } @@ -380,9 +371,9 @@ public static VolumetricHeatCapacity FromMegajoulesPerCubicMeterKelvin(QuantityV /// Value to convert from. /// Unit to convert from. /// VolumetricHeatCapacity unit value. - public static VolumetricHeatCapacity From(QuantityValue value, VolumetricHeatCapacityUnit fromUnit) + public static VolumetricHeatCapacity From(double value, VolumetricHeatCapacityUnit fromUnit) { - return new VolumetricHeatCapacity((double)value, fromUnit); + return new VolumetricHeatCapacity(value, fromUnit); } #endregion @@ -793,15 +784,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is VolumetricHeatCapacityUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(VolumetricHeatCapacityUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is VolumetricHeatCapacityUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(VolumetricHeatCapacityUnit)} is supported.", nameof(unit)); @@ -932,18 +914,6 @@ public VolumetricHeatCapacity ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not VolumetricHeatCapacityUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(VolumetricHeatCapacityUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantities/WarpingMomentOfInertia.g.cs b/UnitsNet/GeneratedCode/Quantities/WarpingMomentOfInertia.g.cs index 42412a843b..6a7397b701 100644 --- a/UnitsNet/GeneratedCode/Quantities/WarpingMomentOfInertia.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/WarpingMomentOfInertia.g.cs @@ -37,7 +37,7 @@ namespace UnitsNet /// [DataContract] public readonly partial struct WarpingMomentOfInertia : - IArithmeticQuantity, + IArithmeticQuantity, IComparable, IComparable, IConvertible, @@ -152,7 +152,7 @@ public WarpingMomentOfInertia(double value, UnitSystem unitSystem) public double Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -261,9 +261,8 @@ public static string GetAbbreviation(WarpingMomentOfInertiaUnit unit, IFormatPro /// Creates a from . /// /// If value is NaN or Infinity. - public static WarpingMomentOfInertia FromCentimetersToTheSixth(QuantityValue centimeterstothesixth) + public static WarpingMomentOfInertia FromCentimetersToTheSixth(double value) { - double value = (double) centimeterstothesixth; return new WarpingMomentOfInertia(value, WarpingMomentOfInertiaUnit.CentimeterToTheSixth); } @@ -271,9 +270,8 @@ public static WarpingMomentOfInertia FromCentimetersToTheSixth(QuantityValue cen /// Creates a from . /// /// If value is NaN or Infinity. - public static WarpingMomentOfInertia FromDecimetersToTheSixth(QuantityValue decimeterstothesixth) + public static WarpingMomentOfInertia FromDecimetersToTheSixth(double value) { - double value = (double) decimeterstothesixth; return new WarpingMomentOfInertia(value, WarpingMomentOfInertiaUnit.DecimeterToTheSixth); } @@ -281,9 +279,8 @@ public static WarpingMomentOfInertia FromDecimetersToTheSixth(QuantityValue deci /// Creates a from . /// /// If value is NaN or Infinity. - public static WarpingMomentOfInertia FromFeetToTheSixth(QuantityValue feettothesixth) + public static WarpingMomentOfInertia FromFeetToTheSixth(double value) { - double value = (double) feettothesixth; return new WarpingMomentOfInertia(value, WarpingMomentOfInertiaUnit.FootToTheSixth); } @@ -291,9 +288,8 @@ public static WarpingMomentOfInertia FromFeetToTheSixth(QuantityValue feettothes /// Creates a from . /// /// If value is NaN or Infinity. - public static WarpingMomentOfInertia FromInchesToTheSixth(QuantityValue inchestothesixth) + public static WarpingMomentOfInertia FromInchesToTheSixth(double value) { - double value = (double) inchestothesixth; return new WarpingMomentOfInertia(value, WarpingMomentOfInertiaUnit.InchToTheSixth); } @@ -301,9 +297,8 @@ public static WarpingMomentOfInertia FromInchesToTheSixth(QuantityValue inchesto /// Creates a from . /// /// If value is NaN or Infinity. - public static WarpingMomentOfInertia FromMetersToTheSixth(QuantityValue meterstothesixth) + public static WarpingMomentOfInertia FromMetersToTheSixth(double value) { - double value = (double) meterstothesixth; return new WarpingMomentOfInertia(value, WarpingMomentOfInertiaUnit.MeterToTheSixth); } @@ -311,9 +306,8 @@ public static WarpingMomentOfInertia FromMetersToTheSixth(QuantityValue metersto /// Creates a from . /// /// If value is NaN or Infinity. - public static WarpingMomentOfInertia FromMillimetersToTheSixth(QuantityValue millimeterstothesixth) + public static WarpingMomentOfInertia FromMillimetersToTheSixth(double value) { - double value = (double) millimeterstothesixth; return new WarpingMomentOfInertia(value, WarpingMomentOfInertiaUnit.MillimeterToTheSixth); } @@ -323,9 +317,9 @@ public static WarpingMomentOfInertia FromMillimetersToTheSixth(QuantityValue mil /// Value to convert from. /// Unit to convert from. /// WarpingMomentOfInertia unit value. - public static WarpingMomentOfInertia From(QuantityValue value, WarpingMomentOfInertiaUnit fromUnit) + public static WarpingMomentOfInertia From(double value, WarpingMomentOfInertiaUnit fromUnit) { - return new WarpingMomentOfInertia((double)value, fromUnit); + return new WarpingMomentOfInertia(value, fromUnit); } #endregion @@ -736,15 +730,6 @@ public double As(UnitSystem unitSystem) /// double IQuantity.As(Enum unit) - { - if (!(unit is WarpingMomentOfInertiaUnit typedUnit)) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(WarpingMomentOfInertiaUnit)} is supported.", nameof(unit)); - - return (double)As(typedUnit); - } - - /// - double IValueQuantity.As(Enum unit) { if (!(unit is WarpingMomentOfInertiaUnit typedUnit)) throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(WarpingMomentOfInertiaUnit)} is supported.", nameof(unit)); @@ -869,18 +854,6 @@ public WarpingMomentOfInertia ToUnit(UnitSystem unitSystem) /// IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - /// - IValueQuantity IValueQuantity.ToUnit(Enum unit) - { - if (unit is not WarpingMomentOfInertiaUnit typedUnit) - throw new ArgumentException($"The given unit is of type {unit.GetType()}. Only {typeof(WarpingMomentOfInertiaUnit)} is supported.", nameof(unit)); - - return ToUnit(typedUnit); - } - - /// - IValueQuantity IValueQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); - #endregion #region ToString Methods diff --git a/UnitsNet/GeneratedCode/Quantity.g.cs b/UnitsNet/GeneratedCode/Quantity.g.cs index 3f09a75aa4..8f90900f35 100644 --- a/UnitsNet/GeneratedCode/Quantity.g.cs +++ b/UnitsNet/GeneratedCode/Quantity.g.cs @@ -169,7 +169,7 @@ public partial class Quantity /// The of the quantity to create. /// The value to construct the quantity with. /// The created quantity. - public static IQuantity FromQuantityInfo(QuantityInfo quantityInfo, QuantityValue value) + public static IQuantity FromQuantityInfo(QuantityInfo quantityInfo, double value) { return quantityInfo.Name switch { @@ -307,7 +307,7 @@ public static IQuantity FromQuantityInfo(QuantityInfo quantityInfo, QuantityValu /// Unit enum value. /// The resulting quantity if successful, otherwise default. /// True if successful with assigned the value, otherwise false. - public static bool TryFrom(QuantityValue value, Enum? unit, [NotNullWhen(true)] out IQuantity? quantity) + public static bool TryFrom(double value, Enum? unit, [NotNullWhen(true)] out IQuantity? quantity) { quantity = unit switch { diff --git a/UnitsNet/GenericMath/DecimalGenericMathExtensions.cs b/UnitsNet/GenericMath/DecimalGenericMathExtensions.cs deleted file mode 100644 index 2c686c9d90..0000000000 --- a/UnitsNet/GenericMath/DecimalGenericMathExtensions.cs +++ /dev/null @@ -1,50 +0,0 @@ -// Licensed under MIT No Attribution, see LICENSE file at the root. -// Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet. - -#if NET7_0_OR_GREATER - -using System.Collections.Generic; -using System.Linq; -using System.Numerics; - -namespace UnitsNet.GenericMath; - -/// -/// Provides generic math operations to test out the new generic math interfaces implemented in .NET7 for UnitsNet -/// quantities using as the internal value type, such as , and -/// . -/// -/// -/// See for quantities using as the internal value type. -/// -public static class DecimalGenericMathExtensions -{ - /// - /// Returns the average of values. - /// - /// - /// This method is experimental and intended to test out the new generic math interfaces implemented in .NET7 for - /// UnitsNet quantities.
- /// Generic math interfaces might replace .
- /// Generic math LINQ support is still missing in the BCL, but is being worked on: - /// - /// API Proposal: Generic LINQ Numeric Operators · Issue - /// #64031 · dotnet/runtime - /// - ///
- /// The values. - /// The value type. - /// The average. - public static T Average(this IEnumerable source) - where T : IAdditionOperators, IAdditiveIdentity, IDivisionOperators - { - // Put accumulator on right hand side of the addition operator to construct quantities with the same unit as the values. - // The addition operator implementation picks the unit from the left hand side, and the additive identity (e.g. Length.Zero) is always the base unit. - (T value, int count) result = source.Aggregate( - (value: T.AdditiveIdentity, count: 0), - (acc, item) => (value: item + acc.value, count: acc.count + 1)); - - return result.value / result.count; - } -} -#endif diff --git a/UnitsNet/GenericMath/GenericMathExtensions.cs b/UnitsNet/GenericMath/GenericMathExtensions.cs index c9b46844ce..9ef41a69e4 100644 --- a/UnitsNet/GenericMath/GenericMathExtensions.cs +++ b/UnitsNet/GenericMath/GenericMathExtensions.cs @@ -12,10 +12,6 @@ namespace UnitsNet.GenericMath; /// Provides generic math operations to test out the new generic math interfaces implemented in .NET7 for UnitsNet /// quantities using as the internal value type, which is the majority of quantities. /// -/// -/// See for quantities using as the internal value -/// type. -/// public static class GenericMathExtensions { /// diff --git a/UnitsNet/IArithmeticQuantity.cs b/UnitsNet/IArithmeticQuantity.cs index 7e9ce19b06..031a4510e0 100644 --- a/UnitsNet/IArithmeticQuantity.cs +++ b/UnitsNet/IArithmeticQuantity.cs @@ -7,26 +7,21 @@ namespace UnitsNet; /// -/// An that (in .NET 7+) implements generic math interfaces for arithmetic operations. +/// An that (in .NET 7+) implements generic math interfaces for arithmetic operations. /// /// The type itself, for the CRT pattern. /// The underlying unit enum type. -/// The underlying value type for internal representation. -public interface IArithmeticQuantity : IQuantity +public interface IArithmeticQuantity : IQuantity #if NET7_0_OR_GREATER , IAdditionOperators , IAdditiveIdentity , ISubtractionOperators - , IMultiplyOperators - , IDivisionOperators + , IMultiplyOperators + , IDivisionOperators , IUnaryNegationOperators #endif - where TSelf : IArithmeticQuantity + where TSelf : IArithmeticQuantity where TUnitType : Enum - where TValueType : struct -#if NET7_0_OR_GREATER - , INumber -#endif { #if NET7_0_OR_GREATER /// diff --git a/UnitsNet/IQuantity.cs b/UnitsNet/IQuantity.cs index a67d33d382..c3ff8b17d6 100644 --- a/UnitsNet/IQuantity.cs +++ b/UnitsNet/IQuantity.cs @@ -72,7 +72,7 @@ public interface IQuantity : IFormattable /// /// The value this quantity was constructed with. See also . /// - QuantityValue Value { get; } + double Value { get; } /// /// Converts this to an in the given . @@ -142,49 +142,22 @@ public interface IQuantity : IQuantity new IQuantity ToUnit(UnitSystem unitSystem); } - /// - /// A quantity backed by a particular value type with a stronger typed interface where the unit enum type is known, to avoid passing in the - /// wrong unit enum type and not having to cast from . - /// - /// The unit type of the quantity. - /// The value type of the quantity. - public interface IQuantity : IQuantity, IValueQuantity - where TUnitType : Enum -#if NET7_0_OR_GREATER - where TValueType : INumber -#else - where TValueType : struct -#endif - { - /// - /// Convert to a unit representation . - /// - /// Value converted to the specified unit. - new TValueType As(TUnitType unit); - } - /// /// An that (in .NET 7+) implements generic math interfaces for equality, comparison and parsing. /// /// The type itself, for the CRT pattern. /// The underlying unit enum type. - /// The underlying value type for internal representation. #if NET7_0_OR_GREATER - public interface IQuantity - : IQuantity + public interface IQuantity + : IQuantity , IComparisonOperators , IParsable #else - public interface IQuantity - : IQuantity + public interface IQuantity + : IQuantity #endif - where TSelf : IQuantity + where TSelf : IQuantity where TUnitType : Enum -#if NET7_0_OR_GREATER - where TValueType : INumber -#else - where TValueType : struct -#endif { /// /// diff --git a/UnitsNet/IValueQuantity.cs b/UnitsNet/IValueQuantity.cs deleted file mode 100644 index 0b458787d1..0000000000 --- a/UnitsNet/IValueQuantity.cs +++ /dev/null @@ -1,71 +0,0 @@ -using System; -using System.Numerics; -using UnitsNet.Units; - -namespace UnitsNet -{ - /// - /// Represents a quantity backed by a particular value type, such as or . - /// - /// - /// Currently, only 3 quantities are backed by : , and . - ///

- /// The future of decimal support is uncertain. We may either change everything to double to simplify, or use generics or - /// more broadly to better support any value type. - ///

- /// The quantity originally introduced decimal due to precision issues with large units and due to the implementation at that - /// time storing the value in the base unit. This is no longer as big of a problem after changing to unit-value representation, since you typically - /// convert to similar sized units. There is also the option of specifying conversion functions directly between any 2 units to further improve precision. - ///

- /// /, however, do map more naturally to decimal, since its smallest unit is an integer value, - /// similar to 100ns ticks as the smallest unit in and . - ///
- /// The value type of the quantity. - public interface IValueQuantity : IQuantity -#if NET7_0_OR_GREATER - where TValueType : INumber -#else - where TValueType : struct -#endif - { - /// - /// The value this quantity was constructed with. See also . - /// - new TValueType Value { get; } - - /// - /// Gets the value in the given unit. - /// - /// The unit enum value. The unit must be compatible, so for you should provide a value. - /// Value converted to the specified unit. - /// Wrong unit enum type was given. - new TValueType As(Enum unit); - - /// - /// Gets the value in the unit determined by the given . If multiple units were found for the given , - /// the first match will be used. - /// - /// The to convert the quantity value to. - /// The converted value. - new TValueType As(UnitSystem unitSystem); - - /// - /// Converts this to an in the given . - /// - /// - /// The unit value. The must be compatible with the units of the . - /// For example, if the is a , you should provide a value. - /// - /// Conversion was not possible from this to . - /// A new in the given . - new IValueQuantity ToUnit(Enum unit); - - /// - /// Converts to a quantity with a unit determined by the given , which affects things like . - /// If multiple units were found for the given , the first match will be used. - /// - /// The to convert the quantity to. - /// A new with the determined unit. - new IValueQuantity ToUnit(UnitSystem unitSystem); - } -} diff --git a/UnitsNet/QuantityFormatter.cs b/UnitsNet/QuantityFormatter.cs index 4d8a10d1ce..fcbca7350d 100644 --- a/UnitsNet/QuantityFormatter.cs +++ b/UnitsNet/QuantityFormatter.cs @@ -180,10 +180,8 @@ private static string FormatUntrimmed(IQuantity quantity, private static string ToStringWithSignificantDigitsAfterRadix(IQuantity quantity, IFormatProvider formatProvider, int number) where TUnitType : Enum { - // When a fixed number of digits after the dot is expected, double and decimal behave the same. - var value = (double)quantity.Value; - string formatForSignificantDigits = UnitFormatter.GetFormat(value, number); - object[] formatArgs = UnitFormatter.GetFormatArgs(quantity.Unit, value, formatProvider, Enumerable.Empty()); + string formatForSignificantDigits = UnitFormatter.GetFormat(quantity.Value, number); + object[] formatArgs = UnitFormatter.GetFormatArgs(quantity.Unit, quantity.Value, formatProvider, Enumerable.Empty()); return string.Format(formatProvider, formatForSignificantDigits, formatArgs); } } diff --git a/UnitsNet/QuantityInfoLookup.cs b/UnitsNet/QuantityInfoLookup.cs index 745d322239..386e797cf0 100644 --- a/UnitsNet/QuantityInfoLookup.cs +++ b/UnitsNet/QuantityInfoLookup.cs @@ -103,7 +103,7 @@ public void AddUnitInfo(Enum unit, UnitInfo unitInfo) /// Unit enum value. /// An object. /// Unit value is not a know unit enum type. - public IQuantity From(QuantityValue value, Enum unit) + public IQuantity From(double value, Enum unit) { // TODO Support custom units, currently only hardcoded built-in quantities are supported. return Quantity.TryFrom(value, unit, out IQuantity? quantity) @@ -111,7 +111,7 @@ public IQuantity From(QuantityValue value, Enum unit) : throw new UnitNotFoundException($"Unit value {unit} of type {unit.GetType()} is not a known unit enum type. Expected types like UnitsNet.Units.LengthUnit. Did you pass in a custom enum type defined outside the UnitsNet library?"); } - /// + /// public bool TryFrom(double value, Enum unit, [NotNullWhen(true)] out IQuantity? quantity) { // Implicit cast to QuantityValue would prevent TryFrom from being called, @@ -123,7 +123,7 @@ public bool TryFrom(double value, Enum unit, [NotNullWhen(true)] out IQuantity? } // TODO Support custom units, currently only hardcoded built-in quantities are supported. - return Quantity.TryFrom((QuantityValue)value, unit, out quantity); + return Quantity.TryFrom(value, unit, out quantity); } /// diff --git a/UnitsNet/QuantityValue.cs b/UnitsNet/QuantityValue.cs deleted file mode 100644 index a5ea81418a..0000000000 --- a/UnitsNet/QuantityValue.cs +++ /dev/null @@ -1,340 +0,0 @@ -// Licensed under MIT No Attribution, see LICENSE file at the root. -// Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet. - -using System; -using System.Diagnostics; -using System.Runtime.InteropServices; -using System.Text; -using System.Globalization; -using UnitsNet.InternalHelpers; - -namespace UnitsNet -{ - /// - /// A type that supports implicit cast from all .NET numeric types, in order to avoid a large number of overloads - /// and binary size for all From(value, unit) factory methods, for each of the 700+ units in the library. - /// stores the value internally with the proper type to preserve the range or precision of the original value: - /// - /// for [byte, short, int, long, float, double] - /// for [decimal] to preserve the 128-bit precision - /// - /// - /// - /// At the time of this writing, this reduces the number of From(value, unit) overloads to 1/4th: - /// From 8 (int, long, double, decimal + each nullable) down to 2 (QuantityValue and QuantityValue?). - /// This also adds more numeric types with no extra overhead, such as float, short and byte. - /// So far, the internal representation can be either or , - /// but as this struct is realized as a union struct with overlapping fields, only the amount of memory of the largest data type is used. - /// This allows for adding support for smaller data types without increasing the overall size. - /// - [StructLayout(LayoutKind.Explicit)] - [DebuggerDisplay("{GetDebugRepresentation()}")] - public readonly struct QuantityValue : IFormattable, IEquatable, IComparable, IComparable - { - /// - /// The value 0 - /// - public static readonly QuantityValue Zero = new QuantityValue(0, 0); - - /// - /// Value assigned when implicitly casting from all numeric types except , since - /// has the greatest range. - /// - [FieldOffset(8)] // so that it does not interfere with the Type field - private readonly double _doubleValue; - - /// - /// Value assigned when implicitly casting from type, since it has a greater precision than - /// and we want to preserve that when constructing quantities that use - /// as their value type. - /// - [FieldOffset(0)] - // bytes layout: 0-1 unused, 2 exponent, 3 sign (only highest bit), 4-15 number - private readonly decimal _decimalValue; - - /// - /// Determines the underlying type of this . - /// - [FieldOffset(0)] // using unused byte for storing type - public readonly UnderlyingDataType Type; - - private QuantityValue(double val) : this() - { - _doubleValue = val; - Type = UnderlyingDataType.Double; - } - - private QuantityValue(decimal val) : this() - { - _decimalValue = val; - Type = UnderlyingDataType.Decimal; - } - - private QuantityValue(double value, decimal valueDecimal) : this() - { - if (valueDecimal != 0) - { - _decimalValue = valueDecimal; - Type = UnderlyingDataType.Decimal; - } - else - { - _doubleValue = value; - Type = UnderlyingDataType.Double; - } - } - - /// - /// Returns true if the underlying value is stored as a decimal - /// - public bool IsDecimal => Type == UnderlyingDataType.Decimal; - - #region To QuantityValue - - // Prefer double for integer types, since most quantities use that type as of now and - // that avoids unnecessary casts back and forth. - // If we later change to use decimal more, we should revisit this. - /// Implicit cast from to . - public static implicit operator QuantityValue(byte val) => new QuantityValue((double) val); - /// Implicit cast from to . - public static implicit operator QuantityValue(short val) => new QuantityValue((double) val); - /// Implicit cast from to . - public static implicit operator QuantityValue(int val) => new QuantityValue((double) val); - /// Implicit cast from to . - public static implicit operator QuantityValue(long val) => new QuantityValue((double) val); - /// Implicit cast from to . - public static implicit operator QuantityValue(float val) => new QuantityValue(val); // double - /// Implicit cast from to . - public static implicit operator QuantityValue(double val) => new QuantityValue(val); // double - /// Implicit cast from to . - public static implicit operator QuantityValue(decimal val) => new QuantityValue(val); // decimal - #endregion - - #region To double - - /// Explicit cast from to . - public static explicit operator double(QuantityValue number) - => number.Type switch - { - UnderlyingDataType.Decimal => (double)number._decimalValue, - UnderlyingDataType.Double => number._doubleValue, - _ => throw new NotImplementedException() - }; - - #endregion - - #region To decimal - - /// Explicit cast from to . - public static explicit operator decimal(QuantityValue number) - => number.Type switch - { - UnderlyingDataType.Decimal => number._decimalValue, - UnderlyingDataType.Double => (decimal)number._doubleValue, - _ => throw new NotImplementedException() - }; - - #endregion - - #region Operators and Comparators - - /// - public override bool Equals(object? other) - { - if (other is QuantityValue qv) - { - return Equals(qv); - } - - return false; - } - - /// - public override int GetHashCode() - { - if (IsDecimal) - { - return _decimalValue.GetHashCode(); - } - else - { - return _doubleValue.GetHashCode(); - } - } - - /// - /// Performs an equality comparison on two instances of . - /// Note that rounding might occur if the two values don't use the same base type. - /// - /// The value to compare to - /// True on exact equality, false otherwise - public bool Equals(QuantityValue other) - { - return CompareTo(other) == 0; - } - - /// Equality comparator - public static bool operator ==(QuantityValue a, QuantityValue b) - { - return a.CompareTo(b) == 0; - } - - /// Inequality comparator - public static bool operator !=(QuantityValue a, QuantityValue b) - { - return a.CompareTo(b) != 0; - } - - /// - /// Greater-than operator - /// - public static bool operator >(QuantityValue a, QuantityValue b) - { - return a.CompareTo(b) > 0; - } - - /// - /// Less-than operator - /// - public static bool operator <(QuantityValue a, QuantityValue b) - { - return a.CompareTo(b) < 0; - } - - /// - /// Greater-than-or-equal operator - /// - public static bool operator >=(QuantityValue a, QuantityValue b) - { - return a.CompareTo(b) >= 0; - } - - /// - /// Less-than-or-equal operator - /// - public static bool operator <=(QuantityValue a, QuantityValue b) - { - return a.CompareTo(b) <= 0; - } - - /// - public int CompareTo(QuantityValue other) - { - if (IsDecimal && other.IsDecimal) - { - return _decimalValue.CompareTo(other._decimalValue); - } - else if (IsDecimal) - { - return _decimalValue.CompareTo((decimal)other._doubleValue); - } - else if (other.IsDecimal) - { - return ((decimal)_doubleValue).CompareTo(other._decimalValue); - } - else - { - return _doubleValue.CompareTo(other._doubleValue); - } - } - - /// - public int CompareTo(object? obj) - { - if (obj is null) throw new ArgumentNullException(nameof(obj)); - if (!(obj is QuantityValue other)) throw new ArgumentException("Expected type QuantityValue.", nameof(obj)); - - return CompareTo(other); - } - - /// - /// Returns the negated value of the operand - /// - /// Value to negate - /// -v - public static QuantityValue operator -(QuantityValue v) - { - if (v.IsDecimal) - { - return new QuantityValue(-v._decimalValue); - } - else - { - return new QuantityValue(-v._doubleValue); - } - } - - #endregion - - /// Returns the string representation of the numeric value. - public override string ToString() - => Type switch - { - UnderlyingDataType.Decimal => _decimalValue.ToString(CultureInfo.CurrentCulture), - UnderlyingDataType.Double => _doubleValue.ToString(CultureInfo.CurrentCulture), - _ => throw new NotImplementedException() - }; - - private string GetDebugRepresentation() - { - StringBuilder builder = new($"{Type} {ToString()} Hex:"); - - byte[] bytes = BytesUtility.GetBytes(this); - for (int i = bytes.Length - 1; i >= 0; i--) - { - builder.Append($" {bytes[i]:X2}"); - } - - return builder.ToString(); - } - - /// - /// Returns the string representation of the numeric value, formatted using the given standard numeric format string - /// - /// A standard numeric format string (must be valid for either double or decimal, depending on the base type) - /// The string representation - public string ToString(string format) - { - return ToString(format, CultureInfo.CurrentCulture); - } - - /// - /// Returns the string representation of the numeric value, formatted using the given standard numeric format string - /// - /// The culture to use - /// The string representation - public string ToString(IFormatProvider formatProvider) - { - return ToString(string.Empty, formatProvider); - } - - /// - /// Returns the string representation of the underlying value - /// - /// Standard format specifiers. Because the underlying value can be double or decimal, the meaning can vary - /// Culture specific settings - /// A string representation of the number - public string ToString(string? format, IFormatProvider? formatProvider) - { - if (IsDecimal) - { - return _decimalValue.ToString(format, formatProvider); - } - else - { - return _doubleValue.ToString(format, formatProvider); - } - } - - /// - /// Describes the underlying type of a . - /// - public enum UnderlyingDataType : byte - { - /// must have the value 0 due to the bit structure of . - Decimal = 0, - /// - Double = 1 - } - } -} diff --git a/UnitsNet/UnitConverter.cs b/UnitsNet/UnitConverter.cs index af16bbe001..4f030b422b 100644 --- a/UnitsNet/UnitConverter.cs +++ b/UnitsNet/UnitConverter.cs @@ -278,7 +278,7 @@ public bool TryGetConversionFunction(ConversionFunctionLookupKey lookupKey, [Not /// From unit enum value. /// To unit enum value, must be compatible with . /// The converted value in the new unit representation. - public static double Convert(QuantityValue fromValue, Enum fromUnitValue, Enum toUnitValue) + public static double Convert(double fromValue, Enum fromUnitValue, Enum toUnitValue) { return Quantity .From(fromValue, fromUnitValue) @@ -293,7 +293,7 @@ public static double Convert(QuantityValue fromValue, Enum fromUnitValue, Enum t /// To unit enum value, must be compatible with . /// The converted value, if successful. Otherwise default. /// True if successful. - public static bool TryConvert(QuantityValue fromValue, Enum fromUnitValue, Enum toUnitValue, out double convertedValue) + public static bool TryConvert(double fromValue, Enum fromUnitValue, Enum toUnitValue, out double convertedValue) { convertedValue = 0; if (!Quantity.TryFrom(fromValue, fromUnitValue, out IQuantity? fromQuantity)) @@ -330,7 +330,7 @@ public static bool TryConvert(QuantityValue fromValue, Enum fromUnitValue, Enum /// Output value as the result of converting to . /// No units match the abbreviation. /// More than one unit matches the abbreviation. - public static double ConvertByName(QuantityValue fromValue, string quantityName, string fromUnit, string toUnit) + public static double ConvertByName(double fromValue, string quantityName, string fromUnit, string toUnit) { if (!TryParseUnit(quantityName, toUnit, out Enum? toUnitValue)) // ex: LengthUnit.Centimeter { @@ -358,7 +358,7 @@ public static double ConvertByName(QuantityValue fromValue, string quantityName, /// Result if conversion was successful, 0 if not. /// bool ok = TryConvertByName(5, "Length", "Meter", "Centimeter", out double centimeters); // 500 /// True if conversion was successful. - public static bool TryConvertByName(QuantityValue inputValue, string quantityName, string fromUnit, string toUnit, out double result) + public static bool TryConvertByName(double inputValue, string quantityName, string fromUnit, string toUnit, out double result) { result = 0d; @@ -395,7 +395,7 @@ public static bool TryConvertByName(QuantityValue inputValue, string quantityNam /// The abbreviation of the unit in the thread's current culture, such as "m". /// double centimeters = ConvertByName(5, "Length", "m", "cm"); // 500 /// Output value as the result of converting to . - public static double ConvertByAbbreviation(QuantityValue fromValue, string quantityName, string fromUnitAbbrev, string toUnitAbbrev) + public static double ConvertByAbbreviation(double fromValue, string quantityName, string fromUnitAbbrev, string toUnitAbbrev) { return ConvertByAbbreviation(fromValue, quantityName, fromUnitAbbrev, toUnitAbbrev, null); } @@ -423,7 +423,7 @@ public static double ConvertByAbbreviation(QuantityValue fromValue, string quant /// are mapped to the abbreviation. /// /// More than one unit matches the abbreviation. - public static double ConvertByAbbreviation(QuantityValue fromValue, string quantityName, string fromUnitAbbrev, string toUnitAbbrev, string? culture) + public static double ConvertByAbbreviation(double fromValue, string quantityName, string fromUnitAbbrev, string toUnitAbbrev, string? culture) { if (!TryGetUnitType(quantityName, out Type? unitType)) throw new UnitNotFoundException($"The unit type for the given quantity was not found: {quantityName}"); @@ -455,7 +455,7 @@ public static double ConvertByAbbreviation(QuantityValue fromValue, string quant /// Result if conversion was successful, 0 if not. /// double centimeters = ConvertByName(5, "Length", "m", "cm"); // 500 /// True if conversion was successful. - public static bool TryConvertByAbbreviation(QuantityValue fromValue, string quantityName, string fromUnitAbbrev, string toUnitAbbrev, out double result) + public static bool TryConvertByAbbreviation(double fromValue, string quantityName, string fromUnitAbbrev, string toUnitAbbrev, out double result) { return TryConvertByAbbreviation(fromValue, quantityName, fromUnitAbbrev, toUnitAbbrev, out result, null); } @@ -479,7 +479,7 @@ public static bool TryConvertByAbbreviation(QuantityValue fromValue, string quan /// Result if conversion was successful, 0 if not. /// double centimeters = ConvertByName(5, "Length", "m", "cm"); // 500 /// True if conversion was successful. - public static bool TryConvertByAbbreviation(QuantityValue fromValue, string quantityName, string fromUnitAbbrev, string toUnitAbbrev, out double result, + public static bool TryConvertByAbbreviation(double fromValue, string quantityName, string fromUnitAbbrev, string toUnitAbbrev, out double result, string? culture) { result = 0d; diff --git a/UnitsNet/UnitMath.cs b/UnitsNet/UnitMath.cs index f9ab87d1c8..472f25c9b7 100644 --- a/UnitsNet/UnitMath.cs +++ b/UnitsNet/UnitMath.cs @@ -17,7 +17,7 @@ public static class UnitMath /// A quantity with a value, such that 0 ≤ value ≤ . public static TQuantity Abs(this TQuantity value) where TQuantity : IQuantity { - return value.Value >= QuantityValue.Zero ? value : (TQuantity) Quantity.From(-value.Value, value.Unit); + return value.Value >= 0 ? value : (TQuantity) Quantity.From(-value.Value, value.Unit); } /// Computes the sum of a sequence of values. @@ -220,7 +220,7 @@ public static TQuantity Clamp(TQuantity value, TQuantity min, TQuanti { var minValue = (TQuantity)min.ToUnit(value.Unit); var maxValue = (TQuantity)max.ToUnit(value.Unit); - + if (minValue.CompareTo(maxValue) > 0) { throw new ArgumentException($"min ({min}) cannot be greater than max ({max})", nameof(min)); @@ -238,25 +238,5 @@ public static TQuantity Clamp(TQuantity value, TQuantity min, TQuanti return value; } - - /// - /// Explicitly create a instance from a double - /// - /// The input value - /// An instance of - public static QuantityValue ToQuantityValue(this double value) - { - return value; // Implicit cast - } - - /// - /// Explicitly create a instance from a decimal - /// - /// The input value - /// An instance of - public static QuantityValue ToQuantityValue(this decimal value) - { - return value; // Implicit cast - } } }