From 5dc3dd5d3105ede626870d256a06440685603f12 Mon Sep 17 00:00:00 2001 From: Muximize Date: Thu, 25 Jan 2024 01:57:15 +0100 Subject: [PATCH 01/11] Remove QuantityValue --- .../UnitsNetGen/NumberExtensionsGenerator.cs | 2 +- .../UnitsNetGen/QuantityGenerator.cs | 6 +- .../UnitsNetGen/StaticQuantityGenerator.cs | 4 +- .../AbbreviatedUnitsConverterTests.cs | 10 - .../AbbreviatedUnitsConverter.cs | 6 +- .../UnitsNetBaseJsonConverter.cs | 8 +- UnitsNet.Tests/CustomQuantities/HowMuch.cs | 2 +- UnitsNet.Tests/DummyIQuantity.cs | 2 +- UnitsNet/CustomCode/Quantity.cs | 30 +- UnitsNet/CustomCode/QuantityParser.cs | 2 +- UnitsNet/IQuantity.cs | 2 +- UnitsNet/IValueQuantity.cs | 2 +- UnitsNet/QuantityInfoLookup.cs | 6 +- UnitsNet/QuantityValue.cs | 340 ------------------ UnitsNet/UnitConverter.cs | 16 +- UnitsNet/UnitMath.cs | 22 +- 16 files changed, 36 insertions(+), 424 deletions(-) delete mode 100644 UnitsNet/QuantityValue.cs 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..28f2c4cafb 100644 --- a/CodeGen/Generators/UnitsNetGen/QuantityGenerator.cs +++ b/CodeGen/Generators/UnitsNetGen/QuantityGenerator.cs @@ -299,7 +299,7 @@ private void GenerateProperties() public {_valueType} Value => _value; /// - QuantityValue IQuantity.Value => _value; + double IQuantity.Value => _value; Enum IQuantity.Unit => Unit; @@ -429,7 +429,7 @@ 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 {valueParamName}) {{ {_valueType} value = ({_valueType}) {valueParamName}; return new {_quantity.Name}(value, {_unitEnumName}.{unit.SingularName}); @@ -444,7 +444,7 @@ 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); }} 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/UnitsNet.Serialization.JsonNet.Tests/AbbreviatedUnitsConverterTests.cs b/UnitsNet.Serialization.JsonNet.Tests/AbbreviatedUnitsConverterTests.cs index 10de4f9a3c..e26fb8c26b 100644 --- a/UnitsNet.Serialization.JsonNet.Tests/AbbreviatedUnitsConverterTests.cs +++ b/UnitsNet.Serialization.JsonNet.Tests/AbbreviatedUnitsConverterTests.cs @@ -342,16 +342,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/AbbreviatedUnitsConverter.cs b/UnitsNet.Serialization.JsonNet/AbbreviatedUnitsConverter.cs index ba06ab91d8..10618cef25 100644 --- a/UnitsNet.Serialization.JsonNet/AbbreviatedUnitsConverter.cs +++ b/UnitsNet.Serialization.JsonNet/AbbreviatedUnitsConverter.cs @@ -172,15 +172,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..8bbfa5770a 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. /// @@ -113,11 +113,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) 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/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/IQuantity.cs b/UnitsNet/IQuantity.cs index a67d33d382..0056bbedf5 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 . diff --git a/UnitsNet/IValueQuantity.cs b/UnitsNet/IValueQuantity.cs index 0b458787d1..a660be089a 100644 --- a/UnitsNet/IValueQuantity.cs +++ b/UnitsNet/IValueQuantity.cs @@ -10,7 +10,7 @@ namespace UnitsNet /// /// 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 + /// The future of decimal support is uncertain. We may either change everything to double to simplify, or use generics or QuantityValue /// 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 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..a38184033d 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.0 ? value : (TQuantity) Quantity.From(-value.Value, value.Unit); } /// Computes the sum of a sequence of values. @@ -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 - } } } From 911b480f5ac6bab301517d0b2ce658d596ab0711 Mon Sep 17 00:00:00 2001 From: Muximize Date: Sat, 27 Jan 2024 00:14:39 +0100 Subject: [PATCH 02/11] Remove IValueQuantity --- .../UnitsNetGen/QuantityGenerator.cs | 21 ------ .../UnitsNetGen/UnitTestBaseClassGenerator.cs | 5 +- .../AbbreviatedUnitsConverter.cs | 10 +-- .../UnitsNetBaseJsonConverter.cs | 12 ---- UnitsNet.Tests/IValueQuantityTests.cs | 47 ------------ UnitsNet/IQuantity.cs | 2 +- UnitsNet/IValueQuantity.cs | 71 ------------------- 7 files changed, 3 insertions(+), 165 deletions(-) delete mode 100644 UnitsNet.Tests/IValueQuantityTests.cs delete mode 100644 UnitsNet/IValueQuantity.cs diff --git a/CodeGen/Generators/UnitsNetGen/QuantityGenerator.cs b/CodeGen/Generators/UnitsNetGen/QuantityGenerator.cs index 28f2c4cafb..7ce1b611e7 100644 --- a/CodeGen/Generators/UnitsNetGen/QuantityGenerator.cs +++ b/CodeGen/Generators/UnitsNetGen/QuantityGenerator.cs @@ -1068,15 +1068,6 @@ double IQuantity.As(Enum 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)); - - return As(typedUnit); - }} - /// /// Converts this {_quantity.Name} to another {_quantity.Name} with the unit representation . /// @@ -1206,18 +1197,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/UnitTestBaseClassGenerator.cs b/CodeGen/Generators/UnitsNetGen/UnitTestBaseClassGenerator.cs index 1c39c9824f..5579d69895 100644 --- a/CodeGen/Generators/UnitsNetGen/UnitTestBaseClassGenerator.cs +++ b/CodeGen/Generators/UnitsNetGen/UnitTestBaseClassGenerator.cs @@ -162,10 +162,7 @@ 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); }} "); diff --git a/UnitsNet.Serialization.JsonNet/AbbreviatedUnitsConverter.cs b/UnitsNet.Serialization.JsonNet/AbbreviatedUnitsConverter.cs index 10618cef25..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); diff --git a/UnitsNet.Serialization.JsonNet/UnitsNetBaseJsonConverter.cs b/UnitsNet.Serialization.JsonNet/UnitsNetBaseJsonConverter.cs index 8bbfa5770a..9dae845683 100644 --- a/UnitsNet.Serialization.JsonNet/UnitsNetBaseJsonConverter.cs +++ b/UnitsNet.Serialization.JsonNet/UnitsNetBaseJsonConverter.cs @@ -178,18 +178,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}"}; } 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/IQuantity.cs b/UnitsNet/IQuantity.cs index 0056bbedf5..680f353863 100644 --- a/UnitsNet/IQuantity.cs +++ b/UnitsNet/IQuantity.cs @@ -148,7 +148,7 @@ public interface IQuantity : IQuantity ///
/// The unit type of the quantity. /// The value type of the quantity. - public interface IQuantity : IQuantity, IValueQuantity + public interface IQuantity : IQuantity where TUnitType : Enum #if NET7_0_OR_GREATER where TValueType : INumber diff --git a/UnitsNet/IValueQuantity.cs b/UnitsNet/IValueQuantity.cs deleted file mode 100644 index a660be089a..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 QuantityValue - /// 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); - } -} From f9474990b9943112ba164711a6a7defa5f86e25b Mon Sep 17 00:00:00 2001 From: Muximize Date: Sat, 27 Jan 2024 00:32:41 +0100 Subject: [PATCH 03/11] Remove TValueType from IQuantity --- .../UnitsNetGen/QuantityGenerator.cs | 2 +- UnitsNet.Tests/CustomCode/IQuantityTests.cs | 22 ----------- UnitsNet.Tests/QuantityTests.cs | 12 +++--- UnitsNet/IArithmeticQuantity.cs | 15 +++----- UnitsNet/IQuantity.cs | 37 +++---------------- 5 files changed, 17 insertions(+), 71 deletions(-) diff --git a/CodeGen/Generators/UnitsNetGen/QuantityGenerator.cs b/CodeGen/Generators/UnitsNetGen/QuantityGenerator.cs index 7ce1b611e7..8f9fa6fa1d 100644 --- a/CodeGen/Generators/UnitsNetGen/QuantityGenerator.cs +++ b/CodeGen/Generators/UnitsNetGen/QuantityGenerator.cs @@ -69,7 +69,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 "/")) { 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/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/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 680f353863..c3ff8b17d6 100644 --- a/UnitsNet/IQuantity.cs +++ b/UnitsNet/IQuantity.cs @@ -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 - 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 { /// /// From 4594e50b00b6539c4cbc729aa4c7da9fddf4e163 Mon Sep 17 00:00:00 2001 From: Muximize Date: Sat, 27 Jan 2024 01:16:34 +0100 Subject: [PATCH 04/11] Remove decimal support from Serialization --- .../AbbreviatedUnitsConverterTests.cs | 110 --------------- .../UnitsNetBaseJsonConverterTest.cs | 131 ------------------ .../UnitsNetBaseJsonConverter.cs | 46 +----- 3 files changed, 3 insertions(+), 284 deletions(-) diff --git a/UnitsNet.Serialization.JsonNet.Tests/AbbreviatedUnitsConverterTests.cs b/UnitsNet.Serialization.JsonNet.Tests/AbbreviatedUnitsConverterTests.cs index e26fb8c26b..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 diff --git a/UnitsNet.Serialization.JsonNet.Tests/UnitsNetBaseJsonConverterTest.cs b/UnitsNet.Serialization.JsonNet.Tests/UnitsNetBaseJsonConverterTest.cs index ceb4481ec9..112f65de2a 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; @@ -38,16 +37,6 @@ public void UnitsNetBaseJsonConverter_ConvertIQuantity_throws_ArgumentNullExcept Assert.Equal("Value cannot be null. (Parameter 'quantity')", result.Message); } - [Fact] - public void UnitsNetBaseJsonConverter_ConvertValueUnit_works_as_expected() - { - var result = _sut.Test_ConvertDecimalValueUnit("PowerUnit.Watt", 10.2365m); - - Assert.NotNull(result); - Assert.IsType(result); - Assert.True(Power.FromWatts(10.2365).Equals((Power)result, 1e-5, ComparisonType.Absolute)); - } - [Fact] public void UnitsNetBaseJsonConverter_ConvertValueUnit_throws_UnitsNetException_when_unit_does_not_exist() { @@ -58,16 +47,6 @@ public void UnitsNetBaseJsonConverter_ConvertValueUnit_throws_UnitsNetException_ Assert.Equal("UnitsNet.Units.SomeImaginaryUnit,UnitsNet", result.Data["type"]); } - [Fact] - public void UnitsNetBaseJsonConverter_ConvertValueUnit_throws_UnitsNetException_when_unit_is_in_unexpected_format() - { - var result = Assert.Throws(() => _sut.Test_ConvertDecimalValueUnit("PowerUnit Watt", 10.2365m)); - - Assert.Equal("\"PowerUnit Watt\" is not a valid unit.", result.Message); - Assert.True(result.Data.Contains("type")); - Assert.Equal("PowerUnit Watt", result.Data["type"]); - } - [Fact] public void UnitsNetBaseJsonConverter_CreateLocalSerializer_works_as_expected() { @@ -107,38 +86,6 @@ public void UnitsNetBaseJsonConverter_ReadValueUnit_works_with_double_quantity() Assert.Equal(10.2365, result?.Value); } - [Fact] - public void UnitsNetBaseJsonConverter_ReadValueUnit_works_with_decimal_quantity() - { - var token = new JObject {{"Unit", "PowerUnit.Watt"}, {"Value", 10.2365m}, {"ValueString", "10.2365"}, {"ValueType", "decimal"}}; - - var result = _sut.Test_ReadDecimalValueUnit(token); - - Assert.NotNull(result); - Assert.Equal("PowerUnit.Watt", result?.Unit); - Assert.Equal(10.2365m, result?.Value); - } - - [Fact] - public void UnitsNetBaseJsonConverter_ReadValueUnit_returns_null_when_value_is_a_string() - { - 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); - - Assert.Null(result); - } - [Fact] public void UnitsNetBaseJsonConverter_ReadDoubleValueUnit_works_with_empty_token() { @@ -149,55 +96,6 @@ public void UnitsNetBaseJsonConverter_ReadDoubleValueUnit_works_with_empty_token Assert.Null(result); } - [Theory] - [InlineData(false, true)] - [InlineData(true, false)] - public void UnitsNetBaseJsonConverter_ReadValueUnit_returns_null_when_unit_or_value_is_missing(bool withUnit, bool withValue) - { - var token = new JObject(); - - if (withUnit) - { - token.Add("Unit", "PowerUnit.Watt"); - } - - if (withValue) - { - token.Add("Value", 10.2365m); - } - - var result = _sut.Test_ReadDecimalValueUnit(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")] - public void UnitsNetBaseJsonConverter_ReadValueUnit_works_case_insensitive( - string unitPropertyName, - string valuePropertyName, - string valueStringPropertyName, - string valueTypePropertyName) - { - var token = new JObject - { - {unitPropertyName, "PowerUnit.Watt"}, - {valuePropertyName, 10.2365m}, - {valueStringPropertyName, 10.2365m.ToString(CultureInfo.InvariantCulture)}, - {valueTypePropertyName, "decimal"} - }; - - var result = _sut.Test_ReadDecimalValueUnit(token); - - Assert.NotNull(result); - Assert.Equal("PowerUnit.Watt", result?.Unit); - Assert.Equal(10.2365m, result?.Value); - } - /// /// Dummy converter, used to access protected methods on abstract UnitsNetBaseJsonConverter{T} /// @@ -214,24 +112,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 +128,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/UnitsNetBaseJsonConverter.cs b/UnitsNet.Serialization.JsonNet/UnitsNetBaseJsonConverter.cs index 9dae845683..6e9d2940bd 100644 --- a/UnitsNet.Serialization.JsonNet/UnitsNetBaseJsonConverter.cs +++ b/UnitsNet.Serialization.JsonNet/UnitsNetBaseJsonConverter.cs @@ -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() }; } @@ -247,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; } - } } } From ef1569a19ac084b811994f54c0d8e3250009c008 Mon Sep 17 00:00:00 2001 From: Muximize Date: Thu, 25 Jan 2024 02:02:14 +0100 Subject: [PATCH 05/11] Remove last bits of decimal support --- UnitsNet.Tests/AssertEx.cs | 18 --- UnitsNet/Comparison.cs | 112 ------------------ .../DecimalGenericMathExtensions.cs | 50 -------- UnitsNet/GenericMath/GenericMathExtensions.cs | 4 - UnitsNet/QuantityFormatter.cs | 6 +- 5 files changed, 2 insertions(+), 188 deletions(-) delete mode 100644 UnitsNet/GenericMath/DecimalGenericMathExtensions.cs 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/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/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/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); } } From 137d6014d6c4b66285f41311889d7100ee91e750 Mon Sep 17 00:00:00 2001 From: Muximize Date: Sat, 27 Jan 2024 00:57:55 +0100 Subject: [PATCH 06/11] Remove decimal support from CodeGen --- .../NanoFrameworkGen/QuantityGenerator.cs | 37 +++------ CodeGen/Generators/NanoFrameworkGenerator.cs | 14 ---- CodeGen/Generators/QuantityJsonFilesParser.cs | 15 ---- .../UnitsNetGen/QuantityGenerator.cs | 77 ++++++------------- .../UnitsNetGen/UnitTestBaseClassGenerator.cs | 38 ++++----- CodeGen/JsonTypes/Quantity.cs | 1 - CodeGen/PrefixInfo.cs | 3 - 7 files changed, 48 insertions(+), 137 deletions(-) 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/QuantityGenerator.cs b/CodeGen/Generators/UnitsNetGen/QuantityGenerator.cs index 8f9fa6fa1d..72a9b5cfdc 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; @@ -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,7 +291,7 @@ private void GenerateProperties() /// /// The numeric value this quantity was constructed with. /// - public {_valueType} Value => _value; + public double Value => _value; /// double IQuantity.Value => _value; @@ -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}); "); } @@ -431,8 +426,7 @@ private void GenerateStaticFactoryMethods() Writer.WL($@" public static {_quantity.Name} From{unit.PluralName}(double {valueParamName}) {{ - {_valueType} value = ({_valueType}) {valueParamName}; - return new {_quantity.Name}(value, {_unitEnumName}.{unit.SingularName}); + return new {_quantity.Name}({valueParamName}, {_unitEnumName}.{unit.SingularName}); }} "); } @@ -446,7 +440,7 @@ private void GenerateStaticFactoryMethods() /// {_quantity.Name} unit value. 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 +629,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 +687,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 +697,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 . @@ -783,13 +777,10 @@ private void GenerateRelationalOperators() { rightParameter = rightPart = "value"; } + + var expression = $"{leftPart} {relation.Operator} {rightPart}"; - 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}"; - - 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 +938,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 +946,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 +1000,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 +1009,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,17 +1027,6 @@ 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) @@ -1065,7 +1034,7 @@ 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); + return As(typedUnit); }} /// diff --git a/CodeGen/Generators/UnitsNetGen/UnitTestBaseClassGenerator.cs b/CodeGen/Generators/UnitsNetGen/UnitTestBaseClassGenerator.cs index 5579d69895..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 {{"); @@ -165,8 +159,7 @@ public void DefaultCtor_ReturnsQuantityWithZeroValueAndBaseUnit() Assert.Equal(0, quantity.Value); Assert.Equal({_baseUnitFullName}, quantity.Unit); }} -"); - if (_quantity.ValueType == "double") Writer.WL($@" + [Fact] public void Ctor_WithInfinityValue_DoNotThrowsArgumentException() {{ @@ -184,7 +177,6 @@ public void Ctor_WithNaNValue_DoNotThrowsArgumentException() Assert.Null(exception); }} -"); Writer.WL($@" [Fact] public void Ctor_NullAsUnitSystem_ThrowsArgumentNullException() @@ -247,8 +239,7 @@ public void From_ValueAndUnit_ReturnsQuantityWithSameValueAndUnit() } Writer.WL($@" }} -"); - if (_quantity.ValueType == "double") Writer.WL($@" + [Fact] public void From{_baseUnit.PluralName}_WithInfinityValue_DoNotThrowsArgumentException() {{ @@ -266,7 +257,6 @@ public void From_ValueAndUnit_ReturnsQuantityWithSameValueAndUnit() Assert.Null(exception); }} -"); Writer.WL($@" [Fact] public void As() @@ -518,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); @@ -639,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 {{ @@ -654,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, "仄")), From 8f655e40510c445d27aa0f2d8680c5da30b5ce95 Mon Sep 17 00:00:00 2001 From: Muximize Date: Mon, 19 Feb 2024 17:09:35 +0100 Subject: [PATCH 07/11] Generate code --- ...rbedDoseOfIonizingRadiationExtensions.g.cs | 32 +- .../NumberToAccelerationExtensions.g.cs | 28 +- .../NumberToAmountOfSubstanceExtensions.g.cs | 34 +- .../NumberToAmplitudeRatioExtensions.g.cs | 8 +- .../NumberToAngleExtensions.g.cs | 32 +- .../NumberToApparentEnergyExtensions.g.cs | 6 +- .../NumberToApparentPowerExtensions.g.cs | 12 +- .../NumberToAreaDensityExtensions.g.cs | 6 +- .../GeneratedCode/NumberToAreaExtensions.g.cs | 28 +- ...NumberToAreaMomentOfInertiaExtensions.g.cs | 12 +- .../NumberToBitRateExtensions.g.cs | 52 +-- ...rakeSpecificFuelConsumptionExtensions.g.cs | 6 +- .../NumberToCapacitanceExtensions.g.cs | 14 +- ...efficientOfThermalExpansionExtensions.g.cs | 18 +- .../NumberToCompressibilityExtensions.g.cs | 14 +- .../NumberToDensityExtensions.g.cs | 112 +++--- .../NumberToDurationExtensions.g.cs | 22 +- .../NumberToDynamicViscosityExtensions.g.cs | 20 +- .../NumberToElectricAdmittanceExtensions.g.cs | 8 +- ...mberToElectricChargeDensityExtensions.g.cs | 2 +- .../NumberToElectricChargeExtensions.g.cs | 22 +- ...NumberToElectricConductanceExtensions.g.cs | 10 +- ...umberToElectricConductivityExtensions.g.cs | 12 +- ...berToElectricCurrentDensityExtensions.g.cs | 6 +- .../NumberToElectricCurrentExtensions.g.cs | 18 +- ...erToElectricCurrentGradientExtensions.g.cs | 14 +- .../NumberToElectricFieldExtensions.g.cs | 2 +- .../NumberToElectricInductanceExtensions.g.cs | 10 +- ...NumberToElectricPotentialAcExtensions.g.cs | 10 +- ...ElectricPotentialChangeRateExtensions.g.cs | 40 +- ...NumberToElectricPotentialDcExtensions.g.cs | 10 +- .../NumberToElectricPotentialExtensions.g.cs | 12 +- .../NumberToElectricResistanceExtensions.g.cs | 14 +- ...NumberToElectricResistivityExtensions.g.cs | 28 +- ...lectricSurfaceChargeDensityExtensions.g.cs | 6 +- .../NumberToEnergyDensityExtensions.g.cs | 24 +- .../NumberToEnergyExtensions.g.cs | 80 ++-- .../NumberToEntropyExtensions.g.cs | 14 +- .../NumberToForceChangeRateExtensions.g.cs | 30 +- .../NumberToForceExtensions.g.cs | 30 +- .../NumberToForcePerLengthExtensions.g.cs | 76 ++-- .../NumberToFrequencyExtensions.g.cs | 26 +- .../NumberToFuelEfficiencyExtensions.g.cs | 8 +- .../NumberToHeatFluxExtensions.g.cs | 36 +- ...erToHeatTransferCoefficientExtensions.g.cs | 12 +- .../NumberToIlluminanceExtensions.g.cs | 8 +- .../NumberToImpulseExtensions.g.cs | 26 +- .../NumberToInformationExtensions.g.cs | 52 +-- .../NumberToIrradianceExtensions.g.cs | 28 +- .../NumberToIrradiationExtensions.g.cs | 14 +- .../GeneratedCode/NumberToJerkExtensions.g.cs | 22 +- .../NumberToKinematicViscosityExtensions.g.cs | 18 +- .../NumberToLeakRateExtensions.g.cs | 6 +- .../NumberToLengthExtensions.g.cs | 84 ++-- .../NumberToLevelExtensions.g.cs | 4 +- .../NumberToLinearDensityExtensions.g.cs | 28 +- .../NumberToLinearPowerDensityExtensions.g.cs | 50 +-- .../NumberToLuminanceExtensions.g.cs | 20 +- .../NumberToLuminosityExtensions.g.cs | 28 +- .../NumberToLuminousFluxExtensions.g.cs | 2 +- .../NumberToLuminousIntensityExtensions.g.cs | 2 +- .../NumberToMagneticFieldExtensions.g.cs | 12 +- .../NumberToMagneticFluxExtensions.g.cs | 2 +- .../NumberToMagnetizationExtensions.g.cs | 2 +- .../NumberToMassConcentrationExtensions.g.cs | 98 ++--- .../GeneratedCode/NumberToMassExtensions.g.cs | 54 +-- .../NumberToMassFlowExtensions.g.cs | 66 ++-- .../NumberToMassFluxExtensions.g.cs | 24 +- .../NumberToMassFractionExtensions.g.cs | 48 +-- ...NumberToMassMomentOfInertiaExtensions.g.cs | 56 +-- .../NumberToMolalityExtensions.g.cs | 4 +- .../NumberToMolarEnergyExtensions.g.cs | 6 +- .../NumberToMolarEntropyExtensions.g.cs | 6 +- .../NumberToMolarFlowExtensions.g.cs | 18 +- .../NumberToMolarMassExtensions.g.cs | 26 +- .../NumberToMolarityExtensions.g.cs | 22 +- .../NumberToPermeabilityExtensions.g.cs | 2 +- .../NumberToPermittivityExtensions.g.cs | 2 +- ...rToPorousMediumPermeabilityExtensions.g.cs | 10 +- .../NumberToPowerDensityExtensions.g.cs | 88 ++--- .../NumberToPowerExtensions.g.cs | 52 +-- .../NumberToPowerRatioExtensions.g.cs | 4 +- .../NumberToPressureChangeRateExtensions.g.cs | 36 +- .../NumberToPressureExtensions.g.cs | 98 ++--- .../NumberToRadiationExposureExtensions.g.cs | 16 +- .../NumberToRadioactivityExtensions.g.cs | 58 +-- .../NumberToRatioChangeRateExtensions.g.cs | 4 +- .../NumberToRatioExtensions.g.cs | 12 +- .../NumberToReactiveEnergyExtensions.g.cs | 6 +- .../NumberToReactivePowerExtensions.g.cs | 8 +- .../NumberToReciprocalAreaExtensions.g.cs | 22 +- .../NumberToReciprocalLengthExtensions.g.cs | 20 +- .../NumberToRelativeHumidityExtensions.g.cs | 2 +- ...berToRotationalAccelerationExtensions.g.cs | 8 +- .../NumberToRotationalSpeedExtensions.g.cs | 26 +- ...NumberToRotationalStiffnessExtensions.g.cs | 66 ++-- ...otationalStiffnessPerLengthExtensions.g.cs | 10 +- .../NumberToScalarExtensions.g.cs | 2 +- .../NumberToSolidAngleExtensions.g.cs | 2 +- .../NumberToSpecificEnergyExtensions.g.cs | 60 +-- .../NumberToSpecificEntropyExtensions.g.cs | 18 +- ...erToSpecificFuelConsumptionExtensions.g.cs | 8 +- .../NumberToSpecificVolumeExtensions.g.cs | 6 +- .../NumberToSpecificWeightExtensions.g.cs | 34 +- .../NumberToSpeedExtensions.g.cs | 66 ++-- .../NumberToStandardVolumeFlowExtensions.g.cs | 18 +- ...mberToTemperatureChangeRateExtensions.g.cs | 20 +- .../NumberToTemperatureDeltaExtensions.g.cs | 18 +- .../NumberToTemperatureExtensions.g.cs | 20 +- ...NumberToTemperatureGradientExtensions.g.cs | 8 +- ...NumberToThermalConductivityExtensions.g.cs | 4 +- .../NumberToThermalResistanceExtensions.g.cs | 12 +- .../NumberToTorqueExtensions.g.cs | 50 +-- .../NumberToTorquePerLengthExtensions.g.cs | 42 +- .../NumberToTurbidityExtensions.g.cs | 2 +- .../NumberToVitaminAExtensions.g.cs | 2 +- ...NumberToVolumeConcentrationExtensions.g.cs | 40 +- .../NumberToVolumeExtensions.g.cs | 108 +++--- .../NumberToVolumeFlowExtensions.g.cs | 134 +++---- .../NumberToVolumeFlowPerAreaExtensions.g.cs | 4 +- .../NumberToVolumePerLengthExtensions.g.cs | 18 +- ...berToVolumetricHeatCapacityExtensions.g.cs | 18 +- ...berToWarpingMomentOfInertiaExtensions.g.cs | 12 +- .../AbsorbedDoseOfIonizingRadiation.g.cs | 109 ++---- .../Quantities/Acceleration.g.cs | 99 ++--- .../Quantities/AmountOfSubstance.g.cs | 114 ++---- .../Quantities/AmplitudeRatio.g.cs | 53 +-- UnitsNet/GeneratedCode/Quantities/Angle.g.cs | 109 ++---- .../Quantities/ApparentEnergy.g.cs | 44 +-- .../Quantities/ApparentPower.g.cs | 59 +-- UnitsNet/GeneratedCode/Quantities/Area.g.cs | 99 ++--- .../GeneratedCode/Quantities/AreaDensity.g.cs | 44 +-- .../Quantities/AreaMomentOfInertia.g.cs | 59 +-- .../GeneratedCode/Quantities/BitRate.g.cs | 159 +++----- .../BrakeSpecificFuelConsumption.g.cs | 44 +-- .../GeneratedCode/Quantities/Capacitance.g.cs | 64 +-- .../CoefficientOfThermalExpansion.g.cs | 74 ++-- .../Quantities/Compressibility.g.cs | 64 +-- .../GeneratedCode/Quantities/Density.g.cs | 309 ++++++--------- .../GeneratedCode/Quantities/Duration.g.cs | 84 ++-- .../Quantities/DynamicViscosity.g.cs | 79 ++-- .../Quantities/ElectricAdmittance.g.cs | 49 +-- .../Quantities/ElectricCharge.g.cs | 84 ++-- .../Quantities/ElectricChargeDensity.g.cs | 34 +- .../Quantities/ElectricConductance.g.cs | 54 +-- .../Quantities/ElectricConductivity.g.cs | 59 +-- .../Quantities/ElectricCurrent.g.cs | 74 ++-- .../Quantities/ElectricCurrentDensity.g.cs | 44 +-- .../Quantities/ElectricCurrentGradient.g.cs | 64 +-- .../Quantities/ElectricField.g.cs | 34 +- .../Quantities/ElectricInductance.g.cs | 54 +-- .../Quantities/ElectricPotential.g.cs | 59 +-- .../Quantities/ElectricPotentialAc.g.cs | 54 +-- .../ElectricPotentialChangeRate.g.cs | 129 +++---- .../Quantities/ElectricPotentialDc.g.cs | 54 +-- .../Quantities/ElectricResistance.g.cs | 64 +-- .../Quantities/ElectricResistivity.g.cs | 99 ++--- .../ElectricSurfaceChargeDensity.g.cs | 44 +-- UnitsNet/GeneratedCode/Quantities/Energy.g.cs | 229 ++++------- .../Quantities/EnergyDensity.g.cs | 89 ++--- .../GeneratedCode/Quantities/Entropy.g.cs | 64 +-- UnitsNet/GeneratedCode/Quantities/Force.g.cs | 104 ++--- .../Quantities/ForceChangeRate.g.cs | 104 ++--- .../Quantities/ForcePerLength.g.cs | 219 ++++------- .../GeneratedCode/Quantities/Frequency.g.cs | 94 ++--- .../Quantities/FuelEfficiency.g.cs | 49 +-- .../GeneratedCode/Quantities/HeatFlux.g.cs | 119 ++---- .../Quantities/HeatTransferCoefficient.g.cs | 59 +-- .../GeneratedCode/Quantities/Illuminance.g.cs | 49 +-- .../GeneratedCode/Quantities/Impulse.g.cs | 94 ++--- .../GeneratedCode/Quantities/Information.g.cs | 159 +++----- .../GeneratedCode/Quantities/Irradiance.g.cs | 99 ++--- .../GeneratedCode/Quantities/Irradiation.g.cs | 64 +-- UnitsNet/GeneratedCode/Quantities/Jerk.g.cs | 84 ++-- .../Quantities/KinematicViscosity.g.cs | 74 ++-- .../GeneratedCode/Quantities/LeakRate.g.cs | 44 +-- UnitsNet/GeneratedCode/Quantities/Length.g.cs | 239 +++++------- UnitsNet/GeneratedCode/Quantities/Level.g.cs | 43 +-- .../Quantities/LinearDensity.g.cs | 99 ++--- .../Quantities/LinearPowerDensity.g.cs | 154 +++----- .../GeneratedCode/Quantities/Luminance.g.cs | 79 ++-- .../GeneratedCode/Quantities/Luminosity.g.cs | 99 ++--- .../Quantities/LuminousFlux.g.cs | 34 +- .../Quantities/LuminousIntensity.g.cs | 34 +- .../Quantities/MagneticField.g.cs | 59 +-- .../Quantities/MagneticFlux.g.cs | 34 +- .../Quantities/Magnetization.g.cs | 34 +- UnitsNet/GeneratedCode/Quantities/Mass.g.cs | 164 +++----- .../Quantities/MassConcentration.g.cs | 274 +++++-------- .../GeneratedCode/Quantities/MassFlow.g.cs | 194 ++++------ .../GeneratedCode/Quantities/MassFlux.g.cs | 89 ++--- .../Quantities/MassFraction.g.cs | 149 +++---- .../Quantities/MassMomentOfInertia.g.cs | 169 +++----- .../GeneratedCode/Quantities/Molality.g.cs | 39 +- .../GeneratedCode/Quantities/MolarEnergy.g.cs | 44 +-- .../Quantities/MolarEntropy.g.cs | 44 +-- .../GeneratedCode/Quantities/MolarFlow.g.cs | 74 ++-- .../GeneratedCode/Quantities/MolarMass.g.cs | 94 ++--- .../GeneratedCode/Quantities/Molarity.g.cs | 84 ++-- .../Quantities/Permeability.g.cs | 34 +- .../Quantities/Permittivity.g.cs | 34 +- .../Quantities/PorousMediumPermeability.g.cs | 54 +-- UnitsNet/GeneratedCode/Quantities/Power.g.cs | 159 +++----- .../Quantities/PowerDensity.g.cs | 249 +++++------- .../GeneratedCode/Quantities/PowerRatio.g.cs | 43 +-- .../GeneratedCode/Quantities/Pressure.g.cs | 274 +++++-------- .../Quantities/PressureChangeRate.g.cs | 119 ++---- .../Quantities/RadiationExposure.g.cs | 69 +--- .../Quantities/Radioactivity.g.cs | 174 +++------ UnitsNet/GeneratedCode/Quantities/Ratio.g.cs | 59 +-- .../Quantities/RatioChangeRate.g.cs | 39 +- .../Quantities/ReactiveEnergy.g.cs | 44 +-- .../Quantities/ReactivePower.g.cs | 49 +-- .../Quantities/ReciprocalArea.g.cs | 84 ++-- .../Quantities/ReciprocalLength.g.cs | 79 ++-- .../Quantities/RelativeHumidity.g.cs | 34 +- .../Quantities/RotationalAcceleration.g.cs | 49 +-- .../Quantities/RotationalSpeed.g.cs | 94 ++--- .../Quantities/RotationalStiffness.g.cs | 194 ++++------ .../RotationalStiffnessPerLength.g.cs | 54 +-- UnitsNet/GeneratedCode/Quantities/Scalar.g.cs | 34 +- .../GeneratedCode/Quantities/SolidAngle.g.cs | 34 +- .../Quantities/SpecificEnergy.g.cs | 179 +++------ .../Quantities/SpecificEntropy.g.cs | 74 ++-- .../Quantities/SpecificFuelConsumption.g.cs | 49 +-- .../Quantities/SpecificVolume.g.cs | 44 +-- .../Quantities/SpecificWeight.g.cs | 114 ++---- UnitsNet/GeneratedCode/Quantities/Speed.g.cs | 194 ++++------ .../Quantities/StandardVolumeFlow.g.cs | 74 ++-- .../GeneratedCode/Quantities/Temperature.g.cs | 79 ++-- .../Quantities/TemperatureChangeRate.g.cs | 79 ++-- .../Quantities/TemperatureDelta.g.cs | 74 ++-- .../Quantities/TemperatureGradient.g.cs | 49 +-- .../Quantities/ThermalConductivity.g.cs | 39 +- .../Quantities/ThermalResistance.g.cs | 59 +-- UnitsNet/GeneratedCode/Quantities/Torque.g.cs | 154 +++----- .../Quantities/TorquePerLength.g.cs | 134 +++---- .../GeneratedCode/Quantities/Turbidity.g.cs | 34 +- .../GeneratedCode/Quantities/VitaminA.g.cs | 34 +- UnitsNet/GeneratedCode/Quantities/Volume.g.cs | 299 ++++++-------- .../Quantities/VolumeConcentration.g.cs | 129 +++---- .../GeneratedCode/Quantities/VolumeFlow.g.cs | 364 +++++++----------- .../Quantities/VolumeFlowPerArea.g.cs | 39 +- .../Quantities/VolumePerLength.g.cs | 74 ++-- .../Quantities/VolumetricHeatCapacity.g.cs | 74 ++-- .../Quantities/WarpingMomentOfInertia.g.cs | 59 +-- UnitsNet/GeneratedCode/Quantity.g.cs | 4 +- 247 files changed, 5192 insertions(+), 9339 deletions(-) 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/GeneratedCode/Quantities/AbsorbedDoseOfIonizingRadiation.g.cs b/UnitsNet/GeneratedCode/Quantities/AbsorbedDoseOfIonizingRadiation.g.cs index da5528afdc..cd1a5e3dc8 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,160 +344,144 @@ 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 centigrays) { - double value = (double) centigrays; - return new AbsorbedDoseOfIonizingRadiation(value, AbsorbedDoseOfIonizingRadiationUnit.Centigray); + return new AbsorbedDoseOfIonizingRadiation(centigrays, AbsorbedDoseOfIonizingRadiationUnit.Centigray); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AbsorbedDoseOfIonizingRadiation FromFemtograys(QuantityValue femtograys) + public static AbsorbedDoseOfIonizingRadiation FromFemtograys(double femtograys) { - double value = (double) femtograys; - return new AbsorbedDoseOfIonizingRadiation(value, AbsorbedDoseOfIonizingRadiationUnit.Femtogray); + return new AbsorbedDoseOfIonizingRadiation(femtograys, AbsorbedDoseOfIonizingRadiationUnit.Femtogray); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AbsorbedDoseOfIonizingRadiation FromGigagrays(QuantityValue gigagrays) + public static AbsorbedDoseOfIonizingRadiation FromGigagrays(double gigagrays) { - double value = (double) gigagrays; - return new AbsorbedDoseOfIonizingRadiation(value, AbsorbedDoseOfIonizingRadiationUnit.Gigagray); + return new AbsorbedDoseOfIonizingRadiation(gigagrays, AbsorbedDoseOfIonizingRadiationUnit.Gigagray); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AbsorbedDoseOfIonizingRadiation FromGrays(QuantityValue grays) + public static AbsorbedDoseOfIonizingRadiation FromGrays(double grays) { - double value = (double) grays; - return new AbsorbedDoseOfIonizingRadiation(value, AbsorbedDoseOfIonizingRadiationUnit.Gray); + return new AbsorbedDoseOfIonizingRadiation(grays, AbsorbedDoseOfIonizingRadiationUnit.Gray); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AbsorbedDoseOfIonizingRadiation FromKilograys(QuantityValue kilograys) + public static AbsorbedDoseOfIonizingRadiation FromKilograys(double kilograys) { - double value = (double) kilograys; - return new AbsorbedDoseOfIonizingRadiation(value, AbsorbedDoseOfIonizingRadiationUnit.Kilogray); + return new AbsorbedDoseOfIonizingRadiation(kilograys, AbsorbedDoseOfIonizingRadiationUnit.Kilogray); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AbsorbedDoseOfIonizingRadiation FromKilorads(QuantityValue kilorads) + public static AbsorbedDoseOfIonizingRadiation FromKilorads(double kilorads) { - double value = (double) kilorads; - return new AbsorbedDoseOfIonizingRadiation(value, AbsorbedDoseOfIonizingRadiationUnit.Kilorad); + return new AbsorbedDoseOfIonizingRadiation(kilorads, AbsorbedDoseOfIonizingRadiationUnit.Kilorad); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AbsorbedDoseOfIonizingRadiation FromMegagrays(QuantityValue megagrays) + public static AbsorbedDoseOfIonizingRadiation FromMegagrays(double megagrays) { - double value = (double) megagrays; - return new AbsorbedDoseOfIonizingRadiation(value, AbsorbedDoseOfIonizingRadiationUnit.Megagray); + return new AbsorbedDoseOfIonizingRadiation(megagrays, AbsorbedDoseOfIonizingRadiationUnit.Megagray); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AbsorbedDoseOfIonizingRadiation FromMegarads(QuantityValue megarads) + public static AbsorbedDoseOfIonizingRadiation FromMegarads(double megarads) { - double value = (double) megarads; - return new AbsorbedDoseOfIonizingRadiation(value, AbsorbedDoseOfIonizingRadiationUnit.Megarad); + return new AbsorbedDoseOfIonizingRadiation(megarads, AbsorbedDoseOfIonizingRadiationUnit.Megarad); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AbsorbedDoseOfIonizingRadiation FromMicrograys(QuantityValue micrograys) + public static AbsorbedDoseOfIonizingRadiation FromMicrograys(double micrograys) { - double value = (double) micrograys; - return new AbsorbedDoseOfIonizingRadiation(value, AbsorbedDoseOfIonizingRadiationUnit.Microgray); + return new AbsorbedDoseOfIonizingRadiation(micrograys, AbsorbedDoseOfIonizingRadiationUnit.Microgray); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AbsorbedDoseOfIonizingRadiation FromMilligrays(QuantityValue milligrays) + public static AbsorbedDoseOfIonizingRadiation FromMilligrays(double milligrays) { - double value = (double) milligrays; - return new AbsorbedDoseOfIonizingRadiation(value, AbsorbedDoseOfIonizingRadiationUnit.Milligray); + return new AbsorbedDoseOfIonizingRadiation(milligrays, AbsorbedDoseOfIonizingRadiationUnit.Milligray); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AbsorbedDoseOfIonizingRadiation FromMillirads(QuantityValue millirads) + public static AbsorbedDoseOfIonizingRadiation FromMillirads(double millirads) { - double value = (double) millirads; - return new AbsorbedDoseOfIonizingRadiation(value, AbsorbedDoseOfIonizingRadiationUnit.Millirad); + return new AbsorbedDoseOfIonizingRadiation(millirads, AbsorbedDoseOfIonizingRadiationUnit.Millirad); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AbsorbedDoseOfIonizingRadiation FromNanograys(QuantityValue nanograys) + public static AbsorbedDoseOfIonizingRadiation FromNanograys(double nanograys) { - double value = (double) nanograys; - return new AbsorbedDoseOfIonizingRadiation(value, AbsorbedDoseOfIonizingRadiationUnit.Nanogray); + return new AbsorbedDoseOfIonizingRadiation(nanograys, AbsorbedDoseOfIonizingRadiationUnit.Nanogray); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AbsorbedDoseOfIonizingRadiation FromPetagrays(QuantityValue petagrays) + public static AbsorbedDoseOfIonizingRadiation FromPetagrays(double petagrays) { - double value = (double) petagrays; - return new AbsorbedDoseOfIonizingRadiation(value, AbsorbedDoseOfIonizingRadiationUnit.Petagray); + return new AbsorbedDoseOfIonizingRadiation(petagrays, AbsorbedDoseOfIonizingRadiationUnit.Petagray); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AbsorbedDoseOfIonizingRadiation FromPicograys(QuantityValue picograys) + public static AbsorbedDoseOfIonizingRadiation FromPicograys(double picograys) { - double value = (double) picograys; - return new AbsorbedDoseOfIonizingRadiation(value, AbsorbedDoseOfIonizingRadiationUnit.Picogray); + return new AbsorbedDoseOfIonizingRadiation(picograys, AbsorbedDoseOfIonizingRadiationUnit.Picogray); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AbsorbedDoseOfIonizingRadiation FromRads(QuantityValue rads) + public static AbsorbedDoseOfIonizingRadiation FromRads(double rads) { - double value = (double) rads; - return new AbsorbedDoseOfIonizingRadiation(value, AbsorbedDoseOfIonizingRadiationUnit.Rad); + return new AbsorbedDoseOfIonizingRadiation(rads, AbsorbedDoseOfIonizingRadiationUnit.Rad); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AbsorbedDoseOfIonizingRadiation FromTeragrays(QuantityValue teragrays) + public static AbsorbedDoseOfIonizingRadiation FromTeragrays(double teragrays) { - double value = (double) teragrays; - return new AbsorbedDoseOfIonizingRadiation(value, AbsorbedDoseOfIonizingRadiationUnit.Teragray); + return new AbsorbedDoseOfIonizingRadiation(teragrays, 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..7c0dda39bc 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,140 +336,126 @@ 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 centimeterspersecondsquared) { - double value = (double) centimeterspersecondsquared; - return new Acceleration(value, AccelerationUnit.CentimeterPerSecondSquared); + return new Acceleration(centimeterspersecondsquared, AccelerationUnit.CentimeterPerSecondSquared); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Acceleration FromDecimetersPerSecondSquared(QuantityValue decimeterspersecondsquared) + public static Acceleration FromDecimetersPerSecondSquared(double decimeterspersecondsquared) { - double value = (double) decimeterspersecondsquared; - return new Acceleration(value, AccelerationUnit.DecimeterPerSecondSquared); + return new Acceleration(decimeterspersecondsquared, AccelerationUnit.DecimeterPerSecondSquared); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Acceleration FromFeetPerSecondSquared(QuantityValue feetpersecondsquared) + public static Acceleration FromFeetPerSecondSquared(double feetpersecondsquared) { - double value = (double) feetpersecondsquared; - return new Acceleration(value, AccelerationUnit.FootPerSecondSquared); + return new Acceleration(feetpersecondsquared, AccelerationUnit.FootPerSecondSquared); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Acceleration FromInchesPerSecondSquared(QuantityValue inchespersecondsquared) + public static Acceleration FromInchesPerSecondSquared(double inchespersecondsquared) { - double value = (double) inchespersecondsquared; - return new Acceleration(value, AccelerationUnit.InchPerSecondSquared); + return new Acceleration(inchespersecondsquared, AccelerationUnit.InchPerSecondSquared); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Acceleration FromKilometersPerSecondSquared(QuantityValue kilometerspersecondsquared) + public static Acceleration FromKilometersPerSecondSquared(double kilometerspersecondsquared) { - double value = (double) kilometerspersecondsquared; - return new Acceleration(value, AccelerationUnit.KilometerPerSecondSquared); + return new Acceleration(kilometerspersecondsquared, AccelerationUnit.KilometerPerSecondSquared); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Acceleration FromKnotsPerHour(QuantityValue knotsperhour) + public static Acceleration FromKnotsPerHour(double knotsperhour) { - double value = (double) knotsperhour; - return new Acceleration(value, AccelerationUnit.KnotPerHour); + return new Acceleration(knotsperhour, AccelerationUnit.KnotPerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Acceleration FromKnotsPerMinute(QuantityValue knotsperminute) + public static Acceleration FromKnotsPerMinute(double knotsperminute) { - double value = (double) knotsperminute; - return new Acceleration(value, AccelerationUnit.KnotPerMinute); + return new Acceleration(knotsperminute, AccelerationUnit.KnotPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Acceleration FromKnotsPerSecond(QuantityValue knotspersecond) + public static Acceleration FromKnotsPerSecond(double knotspersecond) { - double value = (double) knotspersecond; - return new Acceleration(value, AccelerationUnit.KnotPerSecond); + return new Acceleration(knotspersecond, AccelerationUnit.KnotPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Acceleration FromMetersPerSecondSquared(QuantityValue meterspersecondsquared) + public static Acceleration FromMetersPerSecondSquared(double meterspersecondsquared) { - double value = (double) meterspersecondsquared; - return new Acceleration(value, AccelerationUnit.MeterPerSecondSquared); + return new Acceleration(meterspersecondsquared, AccelerationUnit.MeterPerSecondSquared); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Acceleration FromMicrometersPerSecondSquared(QuantityValue micrometerspersecondsquared) + public static Acceleration FromMicrometersPerSecondSquared(double micrometerspersecondsquared) { - double value = (double) micrometerspersecondsquared; - return new Acceleration(value, AccelerationUnit.MicrometerPerSecondSquared); + return new Acceleration(micrometerspersecondsquared, AccelerationUnit.MicrometerPerSecondSquared); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Acceleration FromMillimetersPerSecondSquared(QuantityValue millimeterspersecondsquared) + public static Acceleration FromMillimetersPerSecondSquared(double millimeterspersecondsquared) { - double value = (double) millimeterspersecondsquared; - return new Acceleration(value, AccelerationUnit.MillimeterPerSecondSquared); + return new Acceleration(millimeterspersecondsquared, AccelerationUnit.MillimeterPerSecondSquared); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Acceleration FromMillistandardGravity(QuantityValue millistandardgravity) + public static Acceleration FromMillistandardGravity(double millistandardgravity) { - double value = (double) millistandardgravity; - return new Acceleration(value, AccelerationUnit.MillistandardGravity); + return new Acceleration(millistandardgravity, AccelerationUnit.MillistandardGravity); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Acceleration FromNanometersPerSecondSquared(QuantityValue nanometerspersecondsquared) + public static Acceleration FromNanometersPerSecondSquared(double nanometerspersecondsquared) { - double value = (double) nanometerspersecondsquared; - return new Acceleration(value, AccelerationUnit.NanometerPerSecondSquared); + return new Acceleration(nanometerspersecondsquared, AccelerationUnit.NanometerPerSecondSquared); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Acceleration FromStandardGravity(QuantityValue standardgravity) + public static Acceleration FromStandardGravity(double standardgravity) { - double value = (double) standardgravity; - return new Acceleration(value, AccelerationUnit.StandardGravity); + return new Acceleration(standardgravity, 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..af5a890bd8 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,170 +357,153 @@ 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 centimoles) { - double value = (double) centimoles; - return new AmountOfSubstance(value, AmountOfSubstanceUnit.Centimole); + return new AmountOfSubstance(centimoles, AmountOfSubstanceUnit.Centimole); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AmountOfSubstance FromCentipoundMoles(QuantityValue centipoundmoles) + public static AmountOfSubstance FromCentipoundMoles(double centipoundmoles) { - double value = (double) centipoundmoles; - return new AmountOfSubstance(value, AmountOfSubstanceUnit.CentipoundMole); + return new AmountOfSubstance(centipoundmoles, AmountOfSubstanceUnit.CentipoundMole); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AmountOfSubstance FromDecimoles(QuantityValue decimoles) + public static AmountOfSubstance FromDecimoles(double decimoles) { - double value = (double) decimoles; - return new AmountOfSubstance(value, AmountOfSubstanceUnit.Decimole); + return new AmountOfSubstance(decimoles, AmountOfSubstanceUnit.Decimole); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AmountOfSubstance FromDecipoundMoles(QuantityValue decipoundmoles) + public static AmountOfSubstance FromDecipoundMoles(double decipoundmoles) { - double value = (double) decipoundmoles; - return new AmountOfSubstance(value, AmountOfSubstanceUnit.DecipoundMole); + return new AmountOfSubstance(decipoundmoles, AmountOfSubstanceUnit.DecipoundMole); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AmountOfSubstance FromFemtomoles(QuantityValue femtomoles) + public static AmountOfSubstance FromFemtomoles(double femtomoles) { - double value = (double) femtomoles; - return new AmountOfSubstance(value, AmountOfSubstanceUnit.Femtomole); + return new AmountOfSubstance(femtomoles, AmountOfSubstanceUnit.Femtomole); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AmountOfSubstance FromKilomoles(QuantityValue kilomoles) + public static AmountOfSubstance FromKilomoles(double kilomoles) { - double value = (double) kilomoles; - return new AmountOfSubstance(value, AmountOfSubstanceUnit.Kilomole); + return new AmountOfSubstance(kilomoles, AmountOfSubstanceUnit.Kilomole); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AmountOfSubstance FromKilopoundMoles(QuantityValue kilopoundmoles) + public static AmountOfSubstance FromKilopoundMoles(double kilopoundmoles) { - double value = (double) kilopoundmoles; - return new AmountOfSubstance(value, AmountOfSubstanceUnit.KilopoundMole); + return new AmountOfSubstance(kilopoundmoles, AmountOfSubstanceUnit.KilopoundMole); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AmountOfSubstance FromMegamoles(QuantityValue megamoles) + public static AmountOfSubstance FromMegamoles(double megamoles) { - double value = (double) megamoles; - return new AmountOfSubstance(value, AmountOfSubstanceUnit.Megamole); + return new AmountOfSubstance(megamoles, AmountOfSubstanceUnit.Megamole); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AmountOfSubstance FromMicromoles(QuantityValue micromoles) + public static AmountOfSubstance FromMicromoles(double micromoles) { - double value = (double) micromoles; - return new AmountOfSubstance(value, AmountOfSubstanceUnit.Micromole); + return new AmountOfSubstance(micromoles, AmountOfSubstanceUnit.Micromole); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AmountOfSubstance FromMicropoundMoles(QuantityValue micropoundmoles) + public static AmountOfSubstance FromMicropoundMoles(double micropoundmoles) { - double value = (double) micropoundmoles; - return new AmountOfSubstance(value, AmountOfSubstanceUnit.MicropoundMole); + return new AmountOfSubstance(micropoundmoles, AmountOfSubstanceUnit.MicropoundMole); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AmountOfSubstance FromMillimoles(QuantityValue millimoles) + public static AmountOfSubstance FromMillimoles(double millimoles) { - double value = (double) millimoles; - return new AmountOfSubstance(value, AmountOfSubstanceUnit.Millimole); + return new AmountOfSubstance(millimoles, AmountOfSubstanceUnit.Millimole); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AmountOfSubstance FromMillipoundMoles(QuantityValue millipoundmoles) + public static AmountOfSubstance FromMillipoundMoles(double millipoundmoles) { - double value = (double) millipoundmoles; - return new AmountOfSubstance(value, AmountOfSubstanceUnit.MillipoundMole); + return new AmountOfSubstance(millipoundmoles, AmountOfSubstanceUnit.MillipoundMole); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AmountOfSubstance FromMoles(QuantityValue moles) + public static AmountOfSubstance FromMoles(double moles) { - double value = (double) moles; - return new AmountOfSubstance(value, AmountOfSubstanceUnit.Mole); + return new AmountOfSubstance(moles, AmountOfSubstanceUnit.Mole); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AmountOfSubstance FromNanomoles(QuantityValue nanomoles) + public static AmountOfSubstance FromNanomoles(double nanomoles) { - double value = (double) nanomoles; - return new AmountOfSubstance(value, AmountOfSubstanceUnit.Nanomole); + return new AmountOfSubstance(nanomoles, AmountOfSubstanceUnit.Nanomole); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AmountOfSubstance FromNanopoundMoles(QuantityValue nanopoundmoles) + public static AmountOfSubstance FromNanopoundMoles(double nanopoundmoles) { - double value = (double) nanopoundmoles; - return new AmountOfSubstance(value, AmountOfSubstanceUnit.NanopoundMole); + return new AmountOfSubstance(nanopoundmoles, AmountOfSubstanceUnit.NanopoundMole); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AmountOfSubstance FromPicomoles(QuantityValue picomoles) + public static AmountOfSubstance FromPicomoles(double picomoles) { - double value = (double) picomoles; - return new AmountOfSubstance(value, AmountOfSubstanceUnit.Picomole); + return new AmountOfSubstance(picomoles, AmountOfSubstanceUnit.Picomole); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AmountOfSubstance FromPoundMoles(QuantityValue poundmoles) + public static AmountOfSubstance FromPoundMoles(double poundmoles) { - double value = (double) poundmoles; - return new AmountOfSubstance(value, AmountOfSubstanceUnit.PoundMole); + return new AmountOfSubstance(poundmoles, 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..28965ce755 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,40 +245,36 @@ 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 decibelmicrovolts) { - double value = (double) decibelmicrovolts; - return new AmplitudeRatio(value, AmplitudeRatioUnit.DecibelMicrovolt); + return new AmplitudeRatio(decibelmicrovolts, AmplitudeRatioUnit.DecibelMicrovolt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AmplitudeRatio FromDecibelMillivolts(QuantityValue decibelmillivolts) + public static AmplitudeRatio FromDecibelMillivolts(double decibelmillivolts) { - double value = (double) decibelmillivolts; - return new AmplitudeRatio(value, AmplitudeRatioUnit.DecibelMillivolt); + return new AmplitudeRatio(decibelmillivolts, AmplitudeRatioUnit.DecibelMillivolt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AmplitudeRatio FromDecibelsUnloaded(QuantityValue decibelsunloaded) + public static AmplitudeRatio FromDecibelsUnloaded(double decibelsunloaded) { - double value = (double) decibelsunloaded; - return new AmplitudeRatio(value, AmplitudeRatioUnit.DecibelUnloaded); + return new AmplitudeRatio(decibelsunloaded, AmplitudeRatioUnit.DecibelUnloaded); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AmplitudeRatio FromDecibelVolts(QuantityValue decibelvolts) + public static AmplitudeRatio FromDecibelVolts(double decibelvolts) { - double value = (double) decibelvolts; - return new AmplitudeRatio(value, AmplitudeRatioUnit.DecibelVolt); + return new AmplitudeRatio(decibelvolts, 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..9154199798 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,160 +349,144 @@ 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 arcminutes) { - double value = (double) arcminutes; - return new Angle(value, AngleUnit.Arcminute); + return new Angle(arcminutes, AngleUnit.Arcminute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Angle FromArcseconds(QuantityValue arcseconds) + public static Angle FromArcseconds(double arcseconds) { - double value = (double) arcseconds; - return new Angle(value, AngleUnit.Arcsecond); + return new Angle(arcseconds, AngleUnit.Arcsecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Angle FromCentiradians(QuantityValue centiradians) + public static Angle FromCentiradians(double centiradians) { - double value = (double) centiradians; - return new Angle(value, AngleUnit.Centiradian); + return new Angle(centiradians, AngleUnit.Centiradian); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Angle FromDeciradians(QuantityValue deciradians) + public static Angle FromDeciradians(double deciradians) { - double value = (double) deciradians; - return new Angle(value, AngleUnit.Deciradian); + return new Angle(deciradians, AngleUnit.Deciradian); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Angle FromDegrees(QuantityValue degrees) + public static Angle FromDegrees(double degrees) { - double value = (double) degrees; - return new Angle(value, AngleUnit.Degree); + return new Angle(degrees, AngleUnit.Degree); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Angle FromGradians(QuantityValue gradians) + public static Angle FromGradians(double gradians) { - double value = (double) gradians; - return new Angle(value, AngleUnit.Gradian); + return new Angle(gradians, AngleUnit.Gradian); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Angle FromMicrodegrees(QuantityValue microdegrees) + public static Angle FromMicrodegrees(double microdegrees) { - double value = (double) microdegrees; - return new Angle(value, AngleUnit.Microdegree); + return new Angle(microdegrees, AngleUnit.Microdegree); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Angle FromMicroradians(QuantityValue microradians) + public static Angle FromMicroradians(double microradians) { - double value = (double) microradians; - return new Angle(value, AngleUnit.Microradian); + return new Angle(microradians, AngleUnit.Microradian); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Angle FromMillidegrees(QuantityValue millidegrees) + public static Angle FromMillidegrees(double millidegrees) { - double value = (double) millidegrees; - return new Angle(value, AngleUnit.Millidegree); + return new Angle(millidegrees, AngleUnit.Millidegree); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Angle FromMilliradians(QuantityValue milliradians) + public static Angle FromMilliradians(double milliradians) { - double value = (double) milliradians; - return new Angle(value, AngleUnit.Milliradian); + return new Angle(milliradians, AngleUnit.Milliradian); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Angle FromNanodegrees(QuantityValue nanodegrees) + public static Angle FromNanodegrees(double nanodegrees) { - double value = (double) nanodegrees; - return new Angle(value, AngleUnit.Nanodegree); + return new Angle(nanodegrees, AngleUnit.Nanodegree); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Angle FromNanoradians(QuantityValue nanoradians) + public static Angle FromNanoradians(double nanoradians) { - double value = (double) nanoradians; - return new Angle(value, AngleUnit.Nanoradian); + return new Angle(nanoradians, AngleUnit.Nanoradian); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Angle FromNatoMils(QuantityValue natomils) + public static Angle FromNatoMils(double natomils) { - double value = (double) natomils; - return new Angle(value, AngleUnit.NatoMil); + return new Angle(natomils, AngleUnit.NatoMil); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Angle FromRadians(QuantityValue radians) + public static Angle FromRadians(double radians) { - double value = (double) radians; - return new Angle(value, AngleUnit.Radian); + return new Angle(radians, AngleUnit.Radian); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Angle FromRevolutions(QuantityValue revolutions) + public static Angle FromRevolutions(double revolutions) { - double value = (double) revolutions; - return new Angle(value, AngleUnit.Revolution); + return new Angle(revolutions, AngleUnit.Revolution); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Angle FromTilt(QuantityValue tilt) + public static Angle FromTilt(double tilt) { - double value = (double) tilt; - return new Angle(value, AngleUnit.Tilt); + return new Angle(tilt, 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..368a86ea9f 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,30 +237,27 @@ 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 kilovoltamperehours) { - double value = (double) kilovoltamperehours; - return new ApparentEnergy(value, ApparentEnergyUnit.KilovoltampereHour); + return new ApparentEnergy(kilovoltamperehours, ApparentEnergyUnit.KilovoltampereHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ApparentEnergy FromMegavoltampereHours(QuantityValue megavoltamperehours) + public static ApparentEnergy FromMegavoltampereHours(double megavoltamperehours) { - double value = (double) megavoltamperehours; - return new ApparentEnergy(value, ApparentEnergyUnit.MegavoltampereHour); + return new ApparentEnergy(megavoltamperehours, ApparentEnergyUnit.MegavoltampereHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ApparentEnergy FromVoltampereHours(QuantityValue voltamperehours) + public static ApparentEnergy FromVoltampereHours(double voltamperehours) { - double value = (double) voltamperehours; - return new ApparentEnergy(value, ApparentEnergyUnit.VoltampereHour); + return new ApparentEnergy(voltamperehours, 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..b05a40ab9e 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,60 +261,54 @@ 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 gigavoltamperes) { - double value = (double) gigavoltamperes; - return new ApparentPower(value, ApparentPowerUnit.Gigavoltampere); + return new ApparentPower(gigavoltamperes, ApparentPowerUnit.Gigavoltampere); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ApparentPower FromKilovoltamperes(QuantityValue kilovoltamperes) + public static ApparentPower FromKilovoltamperes(double kilovoltamperes) { - double value = (double) kilovoltamperes; - return new ApparentPower(value, ApparentPowerUnit.Kilovoltampere); + return new ApparentPower(kilovoltamperes, ApparentPowerUnit.Kilovoltampere); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ApparentPower FromMegavoltamperes(QuantityValue megavoltamperes) + public static ApparentPower FromMegavoltamperes(double megavoltamperes) { - double value = (double) megavoltamperes; - return new ApparentPower(value, ApparentPowerUnit.Megavoltampere); + return new ApparentPower(megavoltamperes, ApparentPowerUnit.Megavoltampere); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ApparentPower FromMicrovoltamperes(QuantityValue microvoltamperes) + public static ApparentPower FromMicrovoltamperes(double microvoltamperes) { - double value = (double) microvoltamperes; - return new ApparentPower(value, ApparentPowerUnit.Microvoltampere); + return new ApparentPower(microvoltamperes, ApparentPowerUnit.Microvoltampere); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ApparentPower FromMillivoltamperes(QuantityValue millivoltamperes) + public static ApparentPower FromMillivoltamperes(double millivoltamperes) { - double value = (double) millivoltamperes; - return new ApparentPower(value, ApparentPowerUnit.Millivoltampere); + return new ApparentPower(millivoltamperes, ApparentPowerUnit.Millivoltampere); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ApparentPower FromVoltamperes(QuantityValue voltamperes) + public static ApparentPower FromVoltamperes(double voltamperes) { - double value = (double) voltamperes; - return new ApparentPower(value, ApparentPowerUnit.Voltampere); + return new ApparentPower(voltamperes, 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..4f8c25c7a0 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,140 +342,126 @@ 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 acres) { - double value = (double) acres; - return new Area(value, AreaUnit.Acre); + return new Area(acres, AreaUnit.Acre); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Area FromHectares(QuantityValue hectares) + public static Area FromHectares(double hectares) { - double value = (double) hectares; - return new Area(value, AreaUnit.Hectare); + return new Area(hectares, AreaUnit.Hectare); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Area FromSquareCentimeters(QuantityValue squarecentimeters) + public static Area FromSquareCentimeters(double squarecentimeters) { - double value = (double) squarecentimeters; - return new Area(value, AreaUnit.SquareCentimeter); + return new Area(squarecentimeters, AreaUnit.SquareCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Area FromSquareDecimeters(QuantityValue squaredecimeters) + public static Area FromSquareDecimeters(double squaredecimeters) { - double value = (double) squaredecimeters; - return new Area(value, AreaUnit.SquareDecimeter); + return new Area(squaredecimeters, AreaUnit.SquareDecimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Area FromSquareFeet(QuantityValue squarefeet) + public static Area FromSquareFeet(double squarefeet) { - double value = (double) squarefeet; - return new Area(value, AreaUnit.SquareFoot); + return new Area(squarefeet, AreaUnit.SquareFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Area FromSquareInches(QuantityValue squareinches) + public static Area FromSquareInches(double squareinches) { - double value = (double) squareinches; - return new Area(value, AreaUnit.SquareInch); + return new Area(squareinches, AreaUnit.SquareInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Area FromSquareKilometers(QuantityValue squarekilometers) + public static Area FromSquareKilometers(double squarekilometers) { - double value = (double) squarekilometers; - return new Area(value, AreaUnit.SquareKilometer); + return new Area(squarekilometers, AreaUnit.SquareKilometer); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Area FromSquareMeters(QuantityValue squaremeters) + public static Area FromSquareMeters(double squaremeters) { - double value = (double) squaremeters; - return new Area(value, AreaUnit.SquareMeter); + return new Area(squaremeters, AreaUnit.SquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Area FromSquareMicrometers(QuantityValue squaremicrometers) + public static Area FromSquareMicrometers(double squaremicrometers) { - double value = (double) squaremicrometers; - return new Area(value, AreaUnit.SquareMicrometer); + return new Area(squaremicrometers, AreaUnit.SquareMicrometer); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Area FromSquareMiles(QuantityValue squaremiles) + public static Area FromSquareMiles(double squaremiles) { - double value = (double) squaremiles; - return new Area(value, AreaUnit.SquareMile); + return new Area(squaremiles, AreaUnit.SquareMile); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Area FromSquareMillimeters(QuantityValue squaremillimeters) + public static Area FromSquareMillimeters(double squaremillimeters) { - double value = (double) squaremillimeters; - return new Area(value, AreaUnit.SquareMillimeter); + return new Area(squaremillimeters, AreaUnit.SquareMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Area FromSquareNauticalMiles(QuantityValue squarenauticalmiles) + public static Area FromSquareNauticalMiles(double squarenauticalmiles) { - double value = (double) squarenauticalmiles; - return new Area(value, AreaUnit.SquareNauticalMile); + return new Area(squarenauticalmiles, AreaUnit.SquareNauticalMile); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Area FromSquareYards(QuantityValue squareyards) + public static Area FromSquareYards(double squareyards) { - double value = (double) squareyards; - return new Area(value, AreaUnit.SquareYard); + return new Area(squareyards, AreaUnit.SquareYard); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Area FromUsSurveySquareFeet(QuantityValue ussurveysquarefeet) + public static Area FromUsSurveySquareFeet(double ussurveysquarefeet) { - double value = (double) ussurveysquarefeet; - return new Area(value, AreaUnit.UsSurveySquareFoot); + return new Area(ussurveysquarefeet, 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..dc3473d5dc 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,30 +243,27 @@ 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 gramspersquaremeter) { - double value = (double) gramspersquaremeter; - return new AreaDensity(value, AreaDensityUnit.GramPerSquareMeter); + return new AreaDensity(gramspersquaremeter, AreaDensityUnit.GramPerSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AreaDensity FromKilogramsPerSquareMeter(QuantityValue kilogramspersquaremeter) + public static AreaDensity FromKilogramsPerSquareMeter(double kilogramspersquaremeter) { - double value = (double) kilogramspersquaremeter; - return new AreaDensity(value, AreaDensityUnit.KilogramPerSquareMeter); + return new AreaDensity(kilogramspersquaremeter, AreaDensityUnit.KilogramPerSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AreaDensity FromMilligramsPerSquareMeter(QuantityValue milligramspersquaremeter) + public static AreaDensity FromMilligramsPerSquareMeter(double milligramspersquaremeter) { - double value = (double) milligramspersquaremeter; - return new AreaDensity(value, AreaDensityUnit.MilligramPerSquareMeter); + return new AreaDensity(milligramspersquaremeter, 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..78f1ad2b29 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,60 +267,54 @@ 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 centimeterstothefourth) { - double value = (double) centimeterstothefourth; - return new AreaMomentOfInertia(value, AreaMomentOfInertiaUnit.CentimeterToTheFourth); + return new AreaMomentOfInertia(centimeterstothefourth, AreaMomentOfInertiaUnit.CentimeterToTheFourth); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AreaMomentOfInertia FromDecimetersToTheFourth(QuantityValue decimeterstothefourth) + public static AreaMomentOfInertia FromDecimetersToTheFourth(double decimeterstothefourth) { - double value = (double) decimeterstothefourth; - return new AreaMomentOfInertia(value, AreaMomentOfInertiaUnit.DecimeterToTheFourth); + return new AreaMomentOfInertia(decimeterstothefourth, AreaMomentOfInertiaUnit.DecimeterToTheFourth); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AreaMomentOfInertia FromFeetToTheFourth(QuantityValue feettothefourth) + public static AreaMomentOfInertia FromFeetToTheFourth(double feettothefourth) { - double value = (double) feettothefourth; - return new AreaMomentOfInertia(value, AreaMomentOfInertiaUnit.FootToTheFourth); + return new AreaMomentOfInertia(feettothefourth, AreaMomentOfInertiaUnit.FootToTheFourth); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AreaMomentOfInertia FromInchesToTheFourth(QuantityValue inchestothefourth) + public static AreaMomentOfInertia FromInchesToTheFourth(double inchestothefourth) { - double value = (double) inchestothefourth; - return new AreaMomentOfInertia(value, AreaMomentOfInertiaUnit.InchToTheFourth); + return new AreaMomentOfInertia(inchestothefourth, AreaMomentOfInertiaUnit.InchToTheFourth); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AreaMomentOfInertia FromMetersToTheFourth(QuantityValue meterstothefourth) + public static AreaMomentOfInertia FromMetersToTheFourth(double meterstothefourth) { - double value = (double) meterstothefourth; - return new AreaMomentOfInertia(value, AreaMomentOfInertiaUnit.MeterToTheFourth); + return new AreaMomentOfInertia(meterstothefourth, AreaMomentOfInertiaUnit.MeterToTheFourth); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AreaMomentOfInertia FromMillimetersToTheFourth(QuantityValue millimeterstothefourth) + public static AreaMomentOfInertia FromMillimetersToTheFourth(double millimeterstothefourth) { - double value = (double) millimeterstothefourth; - return new AreaMomentOfInertia(value, AreaMomentOfInertiaUnit.MillimeterToTheFourth); + return new AreaMomentOfInertia(millimeterstothefourth, 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..ccfb357344 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,260 +424,234 @@ 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 bitspersecond) { - double value = (double) bitspersecond; - return new BitRate(value, BitRateUnit.BitPerSecond); + return new BitRate(bitspersecond, BitRateUnit.BitPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static BitRate FromBytesPerSecond(QuantityValue bytespersecond) + public static BitRate FromBytesPerSecond(double bytespersecond) { - double value = (double) bytespersecond; - return new BitRate(value, BitRateUnit.BytePerSecond); + return new BitRate(bytespersecond, BitRateUnit.BytePerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static BitRate FromExabitsPerSecond(QuantityValue exabitspersecond) + public static BitRate FromExabitsPerSecond(double exabitspersecond) { - double value = (double) exabitspersecond; - return new BitRate(value, BitRateUnit.ExabitPerSecond); + return new BitRate(exabitspersecond, BitRateUnit.ExabitPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static BitRate FromExabytesPerSecond(QuantityValue exabytespersecond) + public static BitRate FromExabytesPerSecond(double exabytespersecond) { - double value = (double) exabytespersecond; - return new BitRate(value, BitRateUnit.ExabytePerSecond); + return new BitRate(exabytespersecond, BitRateUnit.ExabytePerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static BitRate FromExbibitsPerSecond(QuantityValue exbibitspersecond) + public static BitRate FromExbibitsPerSecond(double exbibitspersecond) { - double value = (double) exbibitspersecond; - return new BitRate(value, BitRateUnit.ExbibitPerSecond); + return new BitRate(exbibitspersecond, BitRateUnit.ExbibitPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static BitRate FromExbibytesPerSecond(QuantityValue exbibytespersecond) + public static BitRate FromExbibytesPerSecond(double exbibytespersecond) { - double value = (double) exbibytespersecond; - return new BitRate(value, BitRateUnit.ExbibytePerSecond); + return new BitRate(exbibytespersecond, BitRateUnit.ExbibytePerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static BitRate FromGibibitsPerSecond(QuantityValue gibibitspersecond) + public static BitRate FromGibibitsPerSecond(double gibibitspersecond) { - double value = (double) gibibitspersecond; - return new BitRate(value, BitRateUnit.GibibitPerSecond); + return new BitRate(gibibitspersecond, BitRateUnit.GibibitPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static BitRate FromGibibytesPerSecond(QuantityValue gibibytespersecond) + public static BitRate FromGibibytesPerSecond(double gibibytespersecond) { - double value = (double) gibibytespersecond; - return new BitRate(value, BitRateUnit.GibibytePerSecond); + return new BitRate(gibibytespersecond, BitRateUnit.GibibytePerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static BitRate FromGigabitsPerSecond(QuantityValue gigabitspersecond) + public static BitRate FromGigabitsPerSecond(double gigabitspersecond) { - double value = (double) gigabitspersecond; - return new BitRate(value, BitRateUnit.GigabitPerSecond); + return new BitRate(gigabitspersecond, BitRateUnit.GigabitPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static BitRate FromGigabytesPerSecond(QuantityValue gigabytespersecond) + public static BitRate FromGigabytesPerSecond(double gigabytespersecond) { - double value = (double) gigabytespersecond; - return new BitRate(value, BitRateUnit.GigabytePerSecond); + return new BitRate(gigabytespersecond, BitRateUnit.GigabytePerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static BitRate FromKibibitsPerSecond(QuantityValue kibibitspersecond) + public static BitRate FromKibibitsPerSecond(double kibibitspersecond) { - double value = (double) kibibitspersecond; - return new BitRate(value, BitRateUnit.KibibitPerSecond); + return new BitRate(kibibitspersecond, BitRateUnit.KibibitPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static BitRate FromKibibytesPerSecond(QuantityValue kibibytespersecond) + public static BitRate FromKibibytesPerSecond(double kibibytespersecond) { - double value = (double) kibibytespersecond; - return new BitRate(value, BitRateUnit.KibibytePerSecond); + return new BitRate(kibibytespersecond, BitRateUnit.KibibytePerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static BitRate FromKilobitsPerSecond(QuantityValue kilobitspersecond) + public static BitRate FromKilobitsPerSecond(double kilobitspersecond) { - double value = (double) kilobitspersecond; - return new BitRate(value, BitRateUnit.KilobitPerSecond); + return new BitRate(kilobitspersecond, BitRateUnit.KilobitPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static BitRate FromKilobytesPerSecond(QuantityValue kilobytespersecond) + public static BitRate FromKilobytesPerSecond(double kilobytespersecond) { - double value = (double) kilobytespersecond; - return new BitRate(value, BitRateUnit.KilobytePerSecond); + return new BitRate(kilobytespersecond, BitRateUnit.KilobytePerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static BitRate FromMebibitsPerSecond(QuantityValue mebibitspersecond) + public static BitRate FromMebibitsPerSecond(double mebibitspersecond) { - double value = (double) mebibitspersecond; - return new BitRate(value, BitRateUnit.MebibitPerSecond); + return new BitRate(mebibitspersecond, BitRateUnit.MebibitPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static BitRate FromMebibytesPerSecond(QuantityValue mebibytespersecond) + public static BitRate FromMebibytesPerSecond(double mebibytespersecond) { - double value = (double) mebibytespersecond; - return new BitRate(value, BitRateUnit.MebibytePerSecond); + return new BitRate(mebibytespersecond, BitRateUnit.MebibytePerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static BitRate FromMegabitsPerSecond(QuantityValue megabitspersecond) + public static BitRate FromMegabitsPerSecond(double megabitspersecond) { - double value = (double) megabitspersecond; - return new BitRate(value, BitRateUnit.MegabitPerSecond); + return new BitRate(megabitspersecond, BitRateUnit.MegabitPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static BitRate FromMegabytesPerSecond(QuantityValue megabytespersecond) + public static BitRate FromMegabytesPerSecond(double megabytespersecond) { - double value = (double) megabytespersecond; - return new BitRate(value, BitRateUnit.MegabytePerSecond); + return new BitRate(megabytespersecond, BitRateUnit.MegabytePerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static BitRate FromPebibitsPerSecond(QuantityValue pebibitspersecond) + public static BitRate FromPebibitsPerSecond(double pebibitspersecond) { - double value = (double) pebibitspersecond; - return new BitRate(value, BitRateUnit.PebibitPerSecond); + return new BitRate(pebibitspersecond, BitRateUnit.PebibitPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static BitRate FromPebibytesPerSecond(QuantityValue pebibytespersecond) + public static BitRate FromPebibytesPerSecond(double pebibytespersecond) { - double value = (double) pebibytespersecond; - return new BitRate(value, BitRateUnit.PebibytePerSecond); + return new BitRate(pebibytespersecond, BitRateUnit.PebibytePerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static BitRate FromPetabitsPerSecond(QuantityValue petabitspersecond) + public static BitRate FromPetabitsPerSecond(double petabitspersecond) { - double value = (double) petabitspersecond; - return new BitRate(value, BitRateUnit.PetabitPerSecond); + return new BitRate(petabitspersecond, BitRateUnit.PetabitPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static BitRate FromPetabytesPerSecond(QuantityValue petabytespersecond) + public static BitRate FromPetabytesPerSecond(double petabytespersecond) { - double value = (double) petabytespersecond; - return new BitRate(value, BitRateUnit.PetabytePerSecond); + return new BitRate(petabytespersecond, BitRateUnit.PetabytePerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static BitRate FromTebibitsPerSecond(QuantityValue tebibitspersecond) + public static BitRate FromTebibitsPerSecond(double tebibitspersecond) { - double value = (double) tebibitspersecond; - return new BitRate(value, BitRateUnit.TebibitPerSecond); + return new BitRate(tebibitspersecond, BitRateUnit.TebibitPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static BitRate FromTebibytesPerSecond(QuantityValue tebibytespersecond) + public static BitRate FromTebibytesPerSecond(double tebibytespersecond) { - double value = (double) tebibytespersecond; - return new BitRate(value, BitRateUnit.TebibytePerSecond); + return new BitRate(tebibytespersecond, BitRateUnit.TebibytePerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static BitRate FromTerabitsPerSecond(QuantityValue terabitspersecond) + public static BitRate FromTerabitsPerSecond(double terabitspersecond) { - double value = (double) terabitspersecond; - return new BitRate(value, BitRateUnit.TerabitPerSecond); + return new BitRate(terabitspersecond, BitRateUnit.TerabitPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static BitRate FromTerabytesPerSecond(QuantityValue terabytespersecond) + public static BitRate FromTerabytesPerSecond(double terabytespersecond) { - double value = (double) terabytespersecond; - return new BitRate(value, BitRateUnit.TerabytePerSecond); + return new BitRate(terabytespersecond, 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..f206c16e94 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,30 +244,27 @@ 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 gramsperkilowatthour) { - double value = (double) gramsperkilowatthour; - return new BrakeSpecificFuelConsumption(value, BrakeSpecificFuelConsumptionUnit.GramPerKiloWattHour); + return new BrakeSpecificFuelConsumption(gramsperkilowatthour, BrakeSpecificFuelConsumptionUnit.GramPerKiloWattHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static BrakeSpecificFuelConsumption FromKilogramsPerJoule(QuantityValue kilogramsperjoule) + public static BrakeSpecificFuelConsumption FromKilogramsPerJoule(double kilogramsperjoule) { - double value = (double) kilogramsperjoule; - return new BrakeSpecificFuelConsumption(value, BrakeSpecificFuelConsumptionUnit.KilogramPerJoule); + return new BrakeSpecificFuelConsumption(kilogramsperjoule, BrakeSpecificFuelConsumptionUnit.KilogramPerJoule); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static BrakeSpecificFuelConsumption FromPoundsPerMechanicalHorsepowerHour(QuantityValue poundspermechanicalhorsepowerhour) + public static BrakeSpecificFuelConsumption FromPoundsPerMechanicalHorsepowerHour(double poundspermechanicalhorsepowerhour) { - double value = (double) poundspermechanicalhorsepowerhour; - return new BrakeSpecificFuelConsumption(value, BrakeSpecificFuelConsumptionUnit.PoundPerMechanicalHorsepowerHour); + return new BrakeSpecificFuelConsumption(poundspermechanicalhorsepowerhour, 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..8d9907fa89 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,70 +272,63 @@ 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 farads) { - double value = (double) farads; - return new Capacitance(value, CapacitanceUnit.Farad); + return new Capacitance(farads, CapacitanceUnit.Farad); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Capacitance FromKilofarads(QuantityValue kilofarads) + public static Capacitance FromKilofarads(double kilofarads) { - double value = (double) kilofarads; - return new Capacitance(value, CapacitanceUnit.Kilofarad); + return new Capacitance(kilofarads, CapacitanceUnit.Kilofarad); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Capacitance FromMegafarads(QuantityValue megafarads) + public static Capacitance FromMegafarads(double megafarads) { - double value = (double) megafarads; - return new Capacitance(value, CapacitanceUnit.Megafarad); + return new Capacitance(megafarads, CapacitanceUnit.Megafarad); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Capacitance FromMicrofarads(QuantityValue microfarads) + public static Capacitance FromMicrofarads(double microfarads) { - double value = (double) microfarads; - return new Capacitance(value, CapacitanceUnit.Microfarad); + return new Capacitance(microfarads, CapacitanceUnit.Microfarad); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Capacitance FromMillifarads(QuantityValue millifarads) + public static Capacitance FromMillifarads(double millifarads) { - double value = (double) millifarads; - return new Capacitance(value, CapacitanceUnit.Millifarad); + return new Capacitance(millifarads, CapacitanceUnit.Millifarad); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Capacitance FromNanofarads(QuantityValue nanofarads) + public static Capacitance FromNanofarads(double nanofarads) { - double value = (double) nanofarads; - return new Capacitance(value, CapacitanceUnit.Nanofarad); + return new Capacitance(nanofarads, CapacitanceUnit.Nanofarad); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Capacitance FromPicofarads(QuantityValue picofarads) + public static Capacitance FromPicofarads(double picofarads) { - double value = (double) picofarads; - return new Capacitance(value, CapacitanceUnit.Picofarad); + return new Capacitance(picofarads, 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..cbd02a5a19 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,10 +295,9 @@ 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 inversedegreecelsius) { - double value = (double) inversedegreecelsius; - return new CoefficientOfThermalExpansion(value, CoefficientOfThermalExpansionUnit.InverseDegreeCelsius); + return new CoefficientOfThermalExpansion(inversedegreecelsius, CoefficientOfThermalExpansionUnit.InverseDegreeCelsius); } /// @@ -306,10 +305,9 @@ 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 inversedegreefahrenheit) { - double value = (double) inversedegreefahrenheit; - return new CoefficientOfThermalExpansion(value, CoefficientOfThermalExpansionUnit.InverseDegreeFahrenheit); + return new CoefficientOfThermalExpansion(inversedegreefahrenheit, CoefficientOfThermalExpansionUnit.InverseDegreeFahrenheit); } /// @@ -317,70 +315,63 @@ 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 inversekelvin) { - double value = (double) inversekelvin; - return new CoefficientOfThermalExpansion(value, CoefficientOfThermalExpansionUnit.InverseKelvin); + return new CoefficientOfThermalExpansion(inversekelvin, CoefficientOfThermalExpansionUnit.InverseKelvin); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static CoefficientOfThermalExpansion FromPerDegreeCelsius(QuantityValue perdegreecelsius) + public static CoefficientOfThermalExpansion FromPerDegreeCelsius(double perdegreecelsius) { - double value = (double) perdegreecelsius; - return new CoefficientOfThermalExpansion(value, CoefficientOfThermalExpansionUnit.PerDegreeCelsius); + return new CoefficientOfThermalExpansion(perdegreecelsius, CoefficientOfThermalExpansionUnit.PerDegreeCelsius); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static CoefficientOfThermalExpansion FromPerDegreeFahrenheit(QuantityValue perdegreefahrenheit) + public static CoefficientOfThermalExpansion FromPerDegreeFahrenheit(double perdegreefahrenheit) { - double value = (double) perdegreefahrenheit; - return new CoefficientOfThermalExpansion(value, CoefficientOfThermalExpansionUnit.PerDegreeFahrenheit); + return new CoefficientOfThermalExpansion(perdegreefahrenheit, CoefficientOfThermalExpansionUnit.PerDegreeFahrenheit); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static CoefficientOfThermalExpansion FromPerKelvin(QuantityValue perkelvin) + public static CoefficientOfThermalExpansion FromPerKelvin(double perkelvin) { - double value = (double) perkelvin; - return new CoefficientOfThermalExpansion(value, CoefficientOfThermalExpansionUnit.PerKelvin); + return new CoefficientOfThermalExpansion(perkelvin, CoefficientOfThermalExpansionUnit.PerKelvin); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static CoefficientOfThermalExpansion FromPpmPerDegreeCelsius(QuantityValue ppmperdegreecelsius) + public static CoefficientOfThermalExpansion FromPpmPerDegreeCelsius(double ppmperdegreecelsius) { - double value = (double) ppmperdegreecelsius; - return new CoefficientOfThermalExpansion(value, CoefficientOfThermalExpansionUnit.PpmPerDegreeCelsius); + return new CoefficientOfThermalExpansion(ppmperdegreecelsius, CoefficientOfThermalExpansionUnit.PpmPerDegreeCelsius); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static CoefficientOfThermalExpansion FromPpmPerDegreeFahrenheit(QuantityValue ppmperdegreefahrenheit) + public static CoefficientOfThermalExpansion FromPpmPerDegreeFahrenheit(double ppmperdegreefahrenheit) { - double value = (double) ppmperdegreefahrenheit; - return new CoefficientOfThermalExpansion(value, CoefficientOfThermalExpansionUnit.PpmPerDegreeFahrenheit); + return new CoefficientOfThermalExpansion(ppmperdegreefahrenheit, CoefficientOfThermalExpansionUnit.PpmPerDegreeFahrenheit); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static CoefficientOfThermalExpansion FromPpmPerKelvin(QuantityValue ppmperkelvin) + public static CoefficientOfThermalExpansion FromPpmPerKelvin(double ppmperkelvin) { - double value = (double) ppmperkelvin; - return new CoefficientOfThermalExpansion(value, CoefficientOfThermalExpansionUnit.PpmPerKelvin); + return new CoefficientOfThermalExpansion(ppmperkelvin, 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..c0dd43106d 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,70 +269,63 @@ 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 inverseatmospheres) { - double value = (double) inverseatmospheres; - return new Compressibility(value, CompressibilityUnit.InverseAtmosphere); + return new Compressibility(inverseatmospheres, CompressibilityUnit.InverseAtmosphere); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Compressibility FromInverseBars(QuantityValue inversebars) + public static Compressibility FromInverseBars(double inversebars) { - double value = (double) inversebars; - return new Compressibility(value, CompressibilityUnit.InverseBar); + return new Compressibility(inversebars, CompressibilityUnit.InverseBar); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Compressibility FromInverseKilopascals(QuantityValue inversekilopascals) + public static Compressibility FromInverseKilopascals(double inversekilopascals) { - double value = (double) inversekilopascals; - return new Compressibility(value, CompressibilityUnit.InverseKilopascal); + return new Compressibility(inversekilopascals, CompressibilityUnit.InverseKilopascal); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Compressibility FromInverseMegapascals(QuantityValue inversemegapascals) + public static Compressibility FromInverseMegapascals(double inversemegapascals) { - double value = (double) inversemegapascals; - return new Compressibility(value, CompressibilityUnit.InverseMegapascal); + return new Compressibility(inversemegapascals, CompressibilityUnit.InverseMegapascal); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Compressibility FromInverseMillibars(QuantityValue inversemillibars) + public static Compressibility FromInverseMillibars(double inversemillibars) { - double value = (double) inversemillibars; - return new Compressibility(value, CompressibilityUnit.InverseMillibar); + return new Compressibility(inversemillibars, CompressibilityUnit.InverseMillibar); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Compressibility FromInversePascals(QuantityValue inversepascals) + public static Compressibility FromInversePascals(double inversepascals) { - double value = (double) inversepascals; - return new Compressibility(value, CompressibilityUnit.InversePascal); + return new Compressibility(inversepascals, CompressibilityUnit.InversePascal); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Compressibility FromInversePoundsForcePerSquareInch(QuantityValue inversepoundsforcepersquareinch) + public static Compressibility FromInversePoundsForcePerSquareInch(double inversepoundsforcepersquareinch) { - double value = (double) inversepoundsforcepersquareinch; - return new Compressibility(value, CompressibilityUnit.InversePoundForcePerSquareInch); + return new Compressibility(inversepoundsforcepersquareinch, 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..f0760bf017 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,560 +676,504 @@ 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 centigramsperdeciliter) { - double value = (double) centigramsperdeciliter; - return new Density(value, DensityUnit.CentigramPerDeciliter); + return new Density(centigramsperdeciliter, DensityUnit.CentigramPerDeciliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromCentigramsPerLiter(QuantityValue centigramsperliter) + public static Density FromCentigramsPerLiter(double centigramsperliter) { - double value = (double) centigramsperliter; - return new Density(value, DensityUnit.CentigramPerLiter); + return new Density(centigramsperliter, DensityUnit.CentigramPerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromCentigramsPerMilliliter(QuantityValue centigramspermilliliter) + public static Density FromCentigramsPerMilliliter(double centigramspermilliliter) { - double value = (double) centigramspermilliliter; - return new Density(value, DensityUnit.CentigramPerMilliliter); + return new Density(centigramspermilliliter, DensityUnit.CentigramPerMilliliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromDecigramsPerDeciliter(QuantityValue decigramsperdeciliter) + public static Density FromDecigramsPerDeciliter(double decigramsperdeciliter) { - double value = (double) decigramsperdeciliter; - return new Density(value, DensityUnit.DecigramPerDeciliter); + return new Density(decigramsperdeciliter, DensityUnit.DecigramPerDeciliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromDecigramsPerLiter(QuantityValue decigramsperliter) + public static Density FromDecigramsPerLiter(double decigramsperliter) { - double value = (double) decigramsperliter; - return new Density(value, DensityUnit.DecigramPerLiter); + return new Density(decigramsperliter, DensityUnit.DecigramPerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromDecigramsPerMilliliter(QuantityValue decigramspermilliliter) + public static Density FromDecigramsPerMilliliter(double decigramspermilliliter) { - double value = (double) decigramspermilliliter; - return new Density(value, DensityUnit.DecigramPerMilliliter); + return new Density(decigramspermilliliter, DensityUnit.DecigramPerMilliliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromFemtogramsPerDeciliter(QuantityValue femtogramsperdeciliter) + public static Density FromFemtogramsPerDeciliter(double femtogramsperdeciliter) { - double value = (double) femtogramsperdeciliter; - return new Density(value, DensityUnit.FemtogramPerDeciliter); + return new Density(femtogramsperdeciliter, DensityUnit.FemtogramPerDeciliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromFemtogramsPerLiter(QuantityValue femtogramsperliter) + public static Density FromFemtogramsPerLiter(double femtogramsperliter) { - double value = (double) femtogramsperliter; - return new Density(value, DensityUnit.FemtogramPerLiter); + return new Density(femtogramsperliter, DensityUnit.FemtogramPerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromFemtogramsPerMilliliter(QuantityValue femtogramspermilliliter) + public static Density FromFemtogramsPerMilliliter(double femtogramspermilliliter) { - double value = (double) femtogramspermilliliter; - return new Density(value, DensityUnit.FemtogramPerMilliliter); + return new Density(femtogramspermilliliter, DensityUnit.FemtogramPerMilliliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromGramsPerCubicCentimeter(QuantityValue gramspercubiccentimeter) + public static Density FromGramsPerCubicCentimeter(double gramspercubiccentimeter) { - double value = (double) gramspercubiccentimeter; - return new Density(value, DensityUnit.GramPerCubicCentimeter); + return new Density(gramspercubiccentimeter, DensityUnit.GramPerCubicCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromGramsPerCubicFoot(QuantityValue gramspercubicfoot) + public static Density FromGramsPerCubicFoot(double gramspercubicfoot) { - double value = (double) gramspercubicfoot; - return new Density(value, DensityUnit.GramPerCubicFoot); + return new Density(gramspercubicfoot, DensityUnit.GramPerCubicFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromGramsPerCubicInch(QuantityValue gramspercubicinch) + public static Density FromGramsPerCubicInch(double gramspercubicinch) { - double value = (double) gramspercubicinch; - return new Density(value, DensityUnit.GramPerCubicInch); + return new Density(gramspercubicinch, DensityUnit.GramPerCubicInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromGramsPerCubicMeter(QuantityValue gramspercubicmeter) + public static Density FromGramsPerCubicMeter(double gramspercubicmeter) { - double value = (double) gramspercubicmeter; - return new Density(value, DensityUnit.GramPerCubicMeter); + return new Density(gramspercubicmeter, DensityUnit.GramPerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromGramsPerCubicMillimeter(QuantityValue gramspercubicmillimeter) + public static Density FromGramsPerCubicMillimeter(double gramspercubicmillimeter) { - double value = (double) gramspercubicmillimeter; - return new Density(value, DensityUnit.GramPerCubicMillimeter); + return new Density(gramspercubicmillimeter, DensityUnit.GramPerCubicMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromGramsPerDeciliter(QuantityValue gramsperdeciliter) + public static Density FromGramsPerDeciliter(double gramsperdeciliter) { - double value = (double) gramsperdeciliter; - return new Density(value, DensityUnit.GramPerDeciliter); + return new Density(gramsperdeciliter, DensityUnit.GramPerDeciliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromGramsPerLiter(QuantityValue gramsperliter) + public static Density FromGramsPerLiter(double gramsperliter) { - double value = (double) gramsperliter; - return new Density(value, DensityUnit.GramPerLiter); + return new Density(gramsperliter, DensityUnit.GramPerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromGramsPerMilliliter(QuantityValue gramspermilliliter) + public static Density FromGramsPerMilliliter(double gramspermilliliter) { - double value = (double) gramspermilliliter; - return new Density(value, DensityUnit.GramPerMilliliter); + return new Density(gramspermilliliter, DensityUnit.GramPerMilliliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromKilogramsPerCubicCentimeter(QuantityValue kilogramspercubiccentimeter) + public static Density FromKilogramsPerCubicCentimeter(double kilogramspercubiccentimeter) { - double value = (double) kilogramspercubiccentimeter; - return new Density(value, DensityUnit.KilogramPerCubicCentimeter); + return new Density(kilogramspercubiccentimeter, DensityUnit.KilogramPerCubicCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromKilogramsPerCubicMeter(QuantityValue kilogramspercubicmeter) + public static Density FromKilogramsPerCubicMeter(double kilogramspercubicmeter) { - double value = (double) kilogramspercubicmeter; - return new Density(value, DensityUnit.KilogramPerCubicMeter); + return new Density(kilogramspercubicmeter, DensityUnit.KilogramPerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromKilogramsPerCubicMillimeter(QuantityValue kilogramspercubicmillimeter) + public static Density FromKilogramsPerCubicMillimeter(double kilogramspercubicmillimeter) { - double value = (double) kilogramspercubicmillimeter; - return new Density(value, DensityUnit.KilogramPerCubicMillimeter); + return new Density(kilogramspercubicmillimeter, DensityUnit.KilogramPerCubicMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromKilogramsPerLiter(QuantityValue kilogramsperliter) + public static Density FromKilogramsPerLiter(double kilogramsperliter) { - double value = (double) kilogramsperliter; - return new Density(value, DensityUnit.KilogramPerLiter); + return new Density(kilogramsperliter, DensityUnit.KilogramPerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromKilopoundsPerCubicFoot(QuantityValue kilopoundspercubicfoot) + public static Density FromKilopoundsPerCubicFoot(double kilopoundspercubicfoot) { - double value = (double) kilopoundspercubicfoot; - return new Density(value, DensityUnit.KilopoundPerCubicFoot); + return new Density(kilopoundspercubicfoot, DensityUnit.KilopoundPerCubicFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromKilopoundsPerCubicInch(QuantityValue kilopoundspercubicinch) + public static Density FromKilopoundsPerCubicInch(double kilopoundspercubicinch) { - double value = (double) kilopoundspercubicinch; - return new Density(value, DensityUnit.KilopoundPerCubicInch); + return new Density(kilopoundspercubicinch, DensityUnit.KilopoundPerCubicInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromKilopoundsPerCubicYard(QuantityValue kilopoundspercubicyard) + public static Density FromKilopoundsPerCubicYard(double kilopoundspercubicyard) { - double value = (double) kilopoundspercubicyard; - return new Density(value, DensityUnit.KilopoundPerCubicYard); + return new Density(kilopoundspercubicyard, DensityUnit.KilopoundPerCubicYard); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromMicrogramsPerCubicMeter(QuantityValue microgramspercubicmeter) + public static Density FromMicrogramsPerCubicMeter(double microgramspercubicmeter) { - double value = (double) microgramspercubicmeter; - return new Density(value, DensityUnit.MicrogramPerCubicMeter); + return new Density(microgramspercubicmeter, DensityUnit.MicrogramPerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromMicrogramsPerDeciliter(QuantityValue microgramsperdeciliter) + public static Density FromMicrogramsPerDeciliter(double microgramsperdeciliter) { - double value = (double) microgramsperdeciliter; - return new Density(value, DensityUnit.MicrogramPerDeciliter); + return new Density(microgramsperdeciliter, DensityUnit.MicrogramPerDeciliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromMicrogramsPerLiter(QuantityValue microgramsperliter) + public static Density FromMicrogramsPerLiter(double microgramsperliter) { - double value = (double) microgramsperliter; - return new Density(value, DensityUnit.MicrogramPerLiter); + return new Density(microgramsperliter, DensityUnit.MicrogramPerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromMicrogramsPerMilliliter(QuantityValue microgramspermilliliter) + public static Density FromMicrogramsPerMilliliter(double microgramspermilliliter) { - double value = (double) microgramspermilliliter; - return new Density(value, DensityUnit.MicrogramPerMilliliter); + return new Density(microgramspermilliliter, DensityUnit.MicrogramPerMilliliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromMilligramsPerCubicMeter(QuantityValue milligramspercubicmeter) + public static Density FromMilligramsPerCubicMeter(double milligramspercubicmeter) { - double value = (double) milligramspercubicmeter; - return new Density(value, DensityUnit.MilligramPerCubicMeter); + return new Density(milligramspercubicmeter, DensityUnit.MilligramPerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromMilligramsPerDeciliter(QuantityValue milligramsperdeciliter) + public static Density FromMilligramsPerDeciliter(double milligramsperdeciliter) { - double value = (double) milligramsperdeciliter; - return new Density(value, DensityUnit.MilligramPerDeciliter); + return new Density(milligramsperdeciliter, DensityUnit.MilligramPerDeciliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromMilligramsPerLiter(QuantityValue milligramsperliter) + public static Density FromMilligramsPerLiter(double milligramsperliter) { - double value = (double) milligramsperliter; - return new Density(value, DensityUnit.MilligramPerLiter); + return new Density(milligramsperliter, DensityUnit.MilligramPerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromMilligramsPerMilliliter(QuantityValue milligramspermilliliter) + public static Density FromMilligramsPerMilliliter(double milligramspermilliliter) { - double value = (double) milligramspermilliliter; - return new Density(value, DensityUnit.MilligramPerMilliliter); + return new Density(milligramspermilliliter, DensityUnit.MilligramPerMilliliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromNanogramsPerDeciliter(QuantityValue nanogramsperdeciliter) + public static Density FromNanogramsPerDeciliter(double nanogramsperdeciliter) { - double value = (double) nanogramsperdeciliter; - return new Density(value, DensityUnit.NanogramPerDeciliter); + return new Density(nanogramsperdeciliter, DensityUnit.NanogramPerDeciliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromNanogramsPerLiter(QuantityValue nanogramsperliter) + public static Density FromNanogramsPerLiter(double nanogramsperliter) { - double value = (double) nanogramsperliter; - return new Density(value, DensityUnit.NanogramPerLiter); + return new Density(nanogramsperliter, DensityUnit.NanogramPerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromNanogramsPerMilliliter(QuantityValue nanogramspermilliliter) + public static Density FromNanogramsPerMilliliter(double nanogramspermilliliter) { - double value = (double) nanogramspermilliliter; - return new Density(value, DensityUnit.NanogramPerMilliliter); + return new Density(nanogramspermilliliter, DensityUnit.NanogramPerMilliliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromPicogramsPerDeciliter(QuantityValue picogramsperdeciliter) + public static Density FromPicogramsPerDeciliter(double picogramsperdeciliter) { - double value = (double) picogramsperdeciliter; - return new Density(value, DensityUnit.PicogramPerDeciliter); + return new Density(picogramsperdeciliter, DensityUnit.PicogramPerDeciliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromPicogramsPerLiter(QuantityValue picogramsperliter) + public static Density FromPicogramsPerLiter(double picogramsperliter) { - double value = (double) picogramsperliter; - return new Density(value, DensityUnit.PicogramPerLiter); + return new Density(picogramsperliter, DensityUnit.PicogramPerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromPicogramsPerMilliliter(QuantityValue picogramspermilliliter) + public static Density FromPicogramsPerMilliliter(double picogramspermilliliter) { - double value = (double) picogramspermilliliter; - return new Density(value, DensityUnit.PicogramPerMilliliter); + return new Density(picogramspermilliliter, DensityUnit.PicogramPerMilliliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromPoundsPerCubicCentimeter(QuantityValue poundspercubiccentimeter) + public static Density FromPoundsPerCubicCentimeter(double poundspercubiccentimeter) { - double value = (double) poundspercubiccentimeter; - return new Density(value, DensityUnit.PoundPerCubicCentimeter); + return new Density(poundspercubiccentimeter, DensityUnit.PoundPerCubicCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromPoundsPerCubicFoot(QuantityValue poundspercubicfoot) + public static Density FromPoundsPerCubicFoot(double poundspercubicfoot) { - double value = (double) poundspercubicfoot; - return new Density(value, DensityUnit.PoundPerCubicFoot); + return new Density(poundspercubicfoot, DensityUnit.PoundPerCubicFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromPoundsPerCubicInch(QuantityValue poundspercubicinch) + public static Density FromPoundsPerCubicInch(double poundspercubicinch) { - double value = (double) poundspercubicinch; - return new Density(value, DensityUnit.PoundPerCubicInch); + return new Density(poundspercubicinch, DensityUnit.PoundPerCubicInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromPoundsPerCubicMeter(QuantityValue poundspercubicmeter) + public static Density FromPoundsPerCubicMeter(double poundspercubicmeter) { - double value = (double) poundspercubicmeter; - return new Density(value, DensityUnit.PoundPerCubicMeter); + return new Density(poundspercubicmeter, DensityUnit.PoundPerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromPoundsPerCubicMillimeter(QuantityValue poundspercubicmillimeter) + public static Density FromPoundsPerCubicMillimeter(double poundspercubicmillimeter) { - double value = (double) poundspercubicmillimeter; - return new Density(value, DensityUnit.PoundPerCubicMillimeter); + return new Density(poundspercubicmillimeter, DensityUnit.PoundPerCubicMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromPoundsPerCubicYard(QuantityValue poundspercubicyard) + public static Density FromPoundsPerCubicYard(double poundspercubicyard) { - double value = (double) poundspercubicyard; - return new Density(value, DensityUnit.PoundPerCubicYard); + return new Density(poundspercubicyard, DensityUnit.PoundPerCubicYard); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromPoundsPerImperialGallon(QuantityValue poundsperimperialgallon) + public static Density FromPoundsPerImperialGallon(double poundsperimperialgallon) { - double value = (double) poundsperimperialgallon; - return new Density(value, DensityUnit.PoundPerImperialGallon); + return new Density(poundsperimperialgallon, DensityUnit.PoundPerImperialGallon); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromPoundsPerUSGallon(QuantityValue poundsperusgallon) + public static Density FromPoundsPerUSGallon(double poundsperusgallon) { - double value = (double) poundsperusgallon; - return new Density(value, DensityUnit.PoundPerUSGallon); + return new Density(poundsperusgallon, DensityUnit.PoundPerUSGallon); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromSlugsPerCubicCentimeter(QuantityValue slugspercubiccentimeter) + public static Density FromSlugsPerCubicCentimeter(double slugspercubiccentimeter) { - double value = (double) slugspercubiccentimeter; - return new Density(value, DensityUnit.SlugPerCubicCentimeter); + return new Density(slugspercubiccentimeter, DensityUnit.SlugPerCubicCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromSlugsPerCubicFoot(QuantityValue slugspercubicfoot) + public static Density FromSlugsPerCubicFoot(double slugspercubicfoot) { - double value = (double) slugspercubicfoot; - return new Density(value, DensityUnit.SlugPerCubicFoot); + return new Density(slugspercubicfoot, DensityUnit.SlugPerCubicFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromSlugsPerCubicInch(QuantityValue slugspercubicinch) + public static Density FromSlugsPerCubicInch(double slugspercubicinch) { - double value = (double) slugspercubicinch; - return new Density(value, DensityUnit.SlugPerCubicInch); + return new Density(slugspercubicinch, DensityUnit.SlugPerCubicInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromSlugsPerCubicMeter(QuantityValue slugspercubicmeter) + public static Density FromSlugsPerCubicMeter(double slugspercubicmeter) { - double value = (double) slugspercubicmeter; - return new Density(value, DensityUnit.SlugPerCubicMeter); + return new Density(slugspercubicmeter, DensityUnit.SlugPerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromSlugsPerCubicMillimeter(QuantityValue slugspercubicmillimeter) + public static Density FromSlugsPerCubicMillimeter(double slugspercubicmillimeter) { - double value = (double) slugspercubicmillimeter; - return new Density(value, DensityUnit.SlugPerCubicMillimeter); + return new Density(slugspercubicmillimeter, DensityUnit.SlugPerCubicMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromTonnesPerCubicCentimeter(QuantityValue tonnespercubiccentimeter) + public static Density FromTonnesPerCubicCentimeter(double tonnespercubiccentimeter) { - double value = (double) tonnespercubiccentimeter; - return new Density(value, DensityUnit.TonnePerCubicCentimeter); + return new Density(tonnespercubiccentimeter, DensityUnit.TonnePerCubicCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromTonnesPerCubicFoot(QuantityValue tonnespercubicfoot) + public static Density FromTonnesPerCubicFoot(double tonnespercubicfoot) { - double value = (double) tonnespercubicfoot; - return new Density(value, DensityUnit.TonnePerCubicFoot); + return new Density(tonnespercubicfoot, DensityUnit.TonnePerCubicFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromTonnesPerCubicInch(QuantityValue tonnespercubicinch) + public static Density FromTonnesPerCubicInch(double tonnespercubicinch) { - double value = (double) tonnespercubicinch; - return new Density(value, DensityUnit.TonnePerCubicInch); + return new Density(tonnespercubicinch, DensityUnit.TonnePerCubicInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromTonnesPerCubicMeter(QuantityValue tonnespercubicmeter) + public static Density FromTonnesPerCubicMeter(double tonnespercubicmeter) { - double value = (double) tonnespercubicmeter; - return new Density(value, DensityUnit.TonnePerCubicMeter); + return new Density(tonnespercubicmeter, DensityUnit.TonnePerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromTonnesPerCubicMillimeter(QuantityValue tonnespercubicmillimeter) + public static Density FromTonnesPerCubicMillimeter(double tonnespercubicmillimeter) { - double value = (double) tonnespercubicmillimeter; - return new Density(value, DensityUnit.TonnePerCubicMillimeter); + return new Density(tonnespercubicmillimeter, 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..ed094880bb 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,110 +319,99 @@ 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 days) { - double value = (double) days; - return new Duration(value, DurationUnit.Day); + return new Duration(days, DurationUnit.Day); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Duration FromHours(QuantityValue hours) + public static Duration FromHours(double hours) { - double value = (double) hours; - return new Duration(value, DurationUnit.Hour); + return new Duration(hours, DurationUnit.Hour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Duration FromJulianYears(QuantityValue julianyears) + public static Duration FromJulianYears(double julianyears) { - double value = (double) julianyears; - return new Duration(value, DurationUnit.JulianYear); + return new Duration(julianyears, DurationUnit.JulianYear); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Duration FromMicroseconds(QuantityValue microseconds) + public static Duration FromMicroseconds(double microseconds) { - double value = (double) microseconds; - return new Duration(value, DurationUnit.Microsecond); + return new Duration(microseconds, DurationUnit.Microsecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Duration FromMilliseconds(QuantityValue milliseconds) + public static Duration FromMilliseconds(double milliseconds) { - double value = (double) milliseconds; - return new Duration(value, DurationUnit.Millisecond); + return new Duration(milliseconds, DurationUnit.Millisecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Duration FromMinutes(QuantityValue minutes) + public static Duration FromMinutes(double minutes) { - double value = (double) minutes; - return new Duration(value, DurationUnit.Minute); + return new Duration(minutes, DurationUnit.Minute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Duration FromMonths30(QuantityValue months30) + public static Duration FromMonths30(double months30) { - double value = (double) months30; - return new Duration(value, DurationUnit.Month30); + return new Duration(months30, DurationUnit.Month30); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Duration FromNanoseconds(QuantityValue nanoseconds) + public static Duration FromNanoseconds(double nanoseconds) { - double value = (double) nanoseconds; - return new Duration(value, DurationUnit.Nanosecond); + return new Duration(nanoseconds, DurationUnit.Nanosecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Duration FromSeconds(QuantityValue seconds) + public static Duration FromSeconds(double seconds) { - double value = (double) seconds; - return new Duration(value, DurationUnit.Second); + return new Duration(seconds, DurationUnit.Second); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Duration FromWeeks(QuantityValue weeks) + public static Duration FromWeeks(double weeks) { - double value = (double) weeks; - return new Duration(value, DurationUnit.Week); + return new Duration(weeks, DurationUnit.Week); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Duration FromYears365(QuantityValue years365) + public static Duration FromYears365(double years365) { - double value = (double) years365; - return new Duration(value, DurationUnit.Year365); + return new Duration(years365, 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..982af348d6 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,100 +302,90 @@ 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 centipoise) { - double value = (double) centipoise; - return new DynamicViscosity(value, DynamicViscosityUnit.Centipoise); + return new DynamicViscosity(centipoise, DynamicViscosityUnit.Centipoise); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static DynamicViscosity FromMicropascalSeconds(QuantityValue micropascalseconds) + public static DynamicViscosity FromMicropascalSeconds(double micropascalseconds) { - double value = (double) micropascalseconds; - return new DynamicViscosity(value, DynamicViscosityUnit.MicropascalSecond); + return new DynamicViscosity(micropascalseconds, DynamicViscosityUnit.MicropascalSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static DynamicViscosity FromMillipascalSeconds(QuantityValue millipascalseconds) + public static DynamicViscosity FromMillipascalSeconds(double millipascalseconds) { - double value = (double) millipascalseconds; - return new DynamicViscosity(value, DynamicViscosityUnit.MillipascalSecond); + return new DynamicViscosity(millipascalseconds, DynamicViscosityUnit.MillipascalSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static DynamicViscosity FromNewtonSecondsPerMeterSquared(QuantityValue newtonsecondspermetersquared) + public static DynamicViscosity FromNewtonSecondsPerMeterSquared(double newtonsecondspermetersquared) { - double value = (double) newtonsecondspermetersquared; - return new DynamicViscosity(value, DynamicViscosityUnit.NewtonSecondPerMeterSquared); + return new DynamicViscosity(newtonsecondspermetersquared, DynamicViscosityUnit.NewtonSecondPerMeterSquared); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static DynamicViscosity FromPascalSeconds(QuantityValue pascalseconds) + public static DynamicViscosity FromPascalSeconds(double pascalseconds) { - double value = (double) pascalseconds; - return new DynamicViscosity(value, DynamicViscosityUnit.PascalSecond); + return new DynamicViscosity(pascalseconds, DynamicViscosityUnit.PascalSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static DynamicViscosity FromPoise(QuantityValue poise) + public static DynamicViscosity FromPoise(double poise) { - double value = (double) poise; - return new DynamicViscosity(value, DynamicViscosityUnit.Poise); + return new DynamicViscosity(poise, DynamicViscosityUnit.Poise); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static DynamicViscosity FromPoundsForceSecondPerSquareFoot(QuantityValue poundsforcesecondpersquarefoot) + public static DynamicViscosity FromPoundsForceSecondPerSquareFoot(double poundsforcesecondpersquarefoot) { - double value = (double) poundsforcesecondpersquarefoot; - return new DynamicViscosity(value, DynamicViscosityUnit.PoundForceSecondPerSquareFoot); + return new DynamicViscosity(poundsforcesecondpersquarefoot, DynamicViscosityUnit.PoundForceSecondPerSquareFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static DynamicViscosity FromPoundsForceSecondPerSquareInch(QuantityValue poundsforcesecondpersquareinch) + public static DynamicViscosity FromPoundsForceSecondPerSquareInch(double poundsforcesecondpersquareinch) { - double value = (double) poundsforcesecondpersquareinch; - return new DynamicViscosity(value, DynamicViscosityUnit.PoundForceSecondPerSquareInch); + return new DynamicViscosity(poundsforcesecondpersquareinch, DynamicViscosityUnit.PoundForceSecondPerSquareInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static DynamicViscosity FromPoundsPerFootSecond(QuantityValue poundsperfootsecond) + public static DynamicViscosity FromPoundsPerFootSecond(double poundsperfootsecond) { - double value = (double) poundsperfootsecond; - return new DynamicViscosity(value, DynamicViscosityUnit.PoundPerFootSecond); + return new DynamicViscosity(poundsperfootsecond, DynamicViscosityUnit.PoundPerFootSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static DynamicViscosity FromReyns(QuantityValue reyns) + public static DynamicViscosity FromReyns(double reyns) { - double value = (double) reyns; - return new DynamicViscosity(value, DynamicViscosityUnit.Reyn); + return new DynamicViscosity(reyns, 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..fd7f91d288 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,40 +245,36 @@ 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 microsiemens) { - double value = (double) microsiemens; - return new ElectricAdmittance(value, ElectricAdmittanceUnit.Microsiemens); + return new ElectricAdmittance(microsiemens, ElectricAdmittanceUnit.Microsiemens); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricAdmittance FromMillisiemens(QuantityValue millisiemens) + public static ElectricAdmittance FromMillisiemens(double millisiemens) { - double value = (double) millisiemens; - return new ElectricAdmittance(value, ElectricAdmittanceUnit.Millisiemens); + return new ElectricAdmittance(millisiemens, ElectricAdmittanceUnit.Millisiemens); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricAdmittance FromNanosiemens(QuantityValue nanosiemens) + public static ElectricAdmittance FromNanosiemens(double nanosiemens) { - double value = (double) nanosiemens; - return new ElectricAdmittance(value, ElectricAdmittanceUnit.Nanosiemens); + return new ElectricAdmittance(nanosiemens, ElectricAdmittanceUnit.Nanosiemens); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricAdmittance FromSiemens(QuantityValue siemens) + public static ElectricAdmittance FromSiemens(double siemens) { - double value = (double) siemens; - return new ElectricAdmittance(value, ElectricAdmittanceUnit.Siemens); + return new ElectricAdmittance(siemens, 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..dde56c8b82 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,110 +313,99 @@ 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 amperehours) { - double value = (double) amperehours; - return new ElectricCharge(value, ElectricChargeUnit.AmpereHour); + return new ElectricCharge(amperehours, ElectricChargeUnit.AmpereHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCharge FromCoulombs(QuantityValue coulombs) + public static ElectricCharge FromCoulombs(double coulombs) { - double value = (double) coulombs; - return new ElectricCharge(value, ElectricChargeUnit.Coulomb); + return new ElectricCharge(coulombs, ElectricChargeUnit.Coulomb); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCharge FromKiloampereHours(QuantityValue kiloamperehours) + public static ElectricCharge FromKiloampereHours(double kiloamperehours) { - double value = (double) kiloamperehours; - return new ElectricCharge(value, ElectricChargeUnit.KiloampereHour); + return new ElectricCharge(kiloamperehours, ElectricChargeUnit.KiloampereHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCharge FromKilocoulombs(QuantityValue kilocoulombs) + public static ElectricCharge FromKilocoulombs(double kilocoulombs) { - double value = (double) kilocoulombs; - return new ElectricCharge(value, ElectricChargeUnit.Kilocoulomb); + return new ElectricCharge(kilocoulombs, ElectricChargeUnit.Kilocoulomb); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCharge FromMegaampereHours(QuantityValue megaamperehours) + public static ElectricCharge FromMegaampereHours(double megaamperehours) { - double value = (double) megaamperehours; - return new ElectricCharge(value, ElectricChargeUnit.MegaampereHour); + return new ElectricCharge(megaamperehours, ElectricChargeUnit.MegaampereHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCharge FromMegacoulombs(QuantityValue megacoulombs) + public static ElectricCharge FromMegacoulombs(double megacoulombs) { - double value = (double) megacoulombs; - return new ElectricCharge(value, ElectricChargeUnit.Megacoulomb); + return new ElectricCharge(megacoulombs, ElectricChargeUnit.Megacoulomb); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCharge FromMicrocoulombs(QuantityValue microcoulombs) + public static ElectricCharge FromMicrocoulombs(double microcoulombs) { - double value = (double) microcoulombs; - return new ElectricCharge(value, ElectricChargeUnit.Microcoulomb); + return new ElectricCharge(microcoulombs, ElectricChargeUnit.Microcoulomb); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCharge FromMilliampereHours(QuantityValue milliamperehours) + public static ElectricCharge FromMilliampereHours(double milliamperehours) { - double value = (double) milliamperehours; - return new ElectricCharge(value, ElectricChargeUnit.MilliampereHour); + return new ElectricCharge(milliamperehours, ElectricChargeUnit.MilliampereHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCharge FromMillicoulombs(QuantityValue millicoulombs) + public static ElectricCharge FromMillicoulombs(double millicoulombs) { - double value = (double) millicoulombs; - return new ElectricCharge(value, ElectricChargeUnit.Millicoulomb); + return new ElectricCharge(millicoulombs, ElectricChargeUnit.Millicoulomb); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCharge FromNanocoulombs(QuantityValue nanocoulombs) + public static ElectricCharge FromNanocoulombs(double nanocoulombs) { - double value = (double) nanocoulombs; - return new ElectricCharge(value, ElectricChargeUnit.Nanocoulomb); + return new ElectricCharge(nanocoulombs, ElectricChargeUnit.Nanocoulomb); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCharge FromPicocoulombs(QuantityValue picocoulombs) + public static ElectricCharge FromPicocoulombs(double picocoulombs) { - double value = (double) picocoulombs; - return new ElectricCharge(value, ElectricChargeUnit.Picocoulomb); + return new ElectricCharge(picocoulombs, 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..0b7f5315d8 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,10 +224,9 @@ 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 coulombspercubicmeter) { - double value = (double) coulombspercubicmeter; - return new ElectricChargeDensity(value, ElectricChargeDensityUnit.CoulombPerCubicMeter); + return new ElectricChargeDensity(coulombspercubicmeter, 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..7d3ecf9956 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,50 +256,45 @@ 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 kilosiemens) { - double value = (double) kilosiemens; - return new ElectricConductance(value, ElectricConductanceUnit.Kilosiemens); + return new ElectricConductance(kilosiemens, ElectricConductanceUnit.Kilosiemens); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricConductance FromMicrosiemens(QuantityValue microsiemens) + public static ElectricConductance FromMicrosiemens(double microsiemens) { - double value = (double) microsiemens; - return new ElectricConductance(value, ElectricConductanceUnit.Microsiemens); + return new ElectricConductance(microsiemens, ElectricConductanceUnit.Microsiemens); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricConductance FromMillisiemens(QuantityValue millisiemens) + public static ElectricConductance FromMillisiemens(double millisiemens) { - double value = (double) millisiemens; - return new ElectricConductance(value, ElectricConductanceUnit.Millisiemens); + return new ElectricConductance(millisiemens, ElectricConductanceUnit.Millisiemens); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricConductance FromNanosiemens(QuantityValue nanosiemens) + public static ElectricConductance FromNanosiemens(double nanosiemens) { - double value = (double) nanosiemens; - return new ElectricConductance(value, ElectricConductanceUnit.Nanosiemens); + return new ElectricConductance(nanosiemens, ElectricConductanceUnit.Nanosiemens); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricConductance FromSiemens(QuantityValue siemens) + public static ElectricConductance FromSiemens(double siemens) { - double value = (double) siemens; - return new ElectricConductance(value, ElectricConductanceUnit.Siemens); + return new ElectricConductance(siemens, 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..778999e06a 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,60 +264,54 @@ 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 microsiemenspercentimeter) { - double value = (double) microsiemenspercentimeter; - return new ElectricConductivity(value, ElectricConductivityUnit.MicrosiemensPerCentimeter); + return new ElectricConductivity(microsiemenspercentimeter, ElectricConductivityUnit.MicrosiemensPerCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricConductivity FromMillisiemensPerCentimeter(QuantityValue millisiemenspercentimeter) + public static ElectricConductivity FromMillisiemensPerCentimeter(double millisiemenspercentimeter) { - double value = (double) millisiemenspercentimeter; - return new ElectricConductivity(value, ElectricConductivityUnit.MillisiemensPerCentimeter); + return new ElectricConductivity(millisiemenspercentimeter, ElectricConductivityUnit.MillisiemensPerCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricConductivity FromSiemensPerCentimeter(QuantityValue siemenspercentimeter) + public static ElectricConductivity FromSiemensPerCentimeter(double siemenspercentimeter) { - double value = (double) siemenspercentimeter; - return new ElectricConductivity(value, ElectricConductivityUnit.SiemensPerCentimeter); + return new ElectricConductivity(siemenspercentimeter, ElectricConductivityUnit.SiemensPerCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricConductivity FromSiemensPerFoot(QuantityValue siemensperfoot) + public static ElectricConductivity FromSiemensPerFoot(double siemensperfoot) { - double value = (double) siemensperfoot; - return new ElectricConductivity(value, ElectricConductivityUnit.SiemensPerFoot); + return new ElectricConductivity(siemensperfoot, ElectricConductivityUnit.SiemensPerFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricConductivity FromSiemensPerInch(QuantityValue siemensperinch) + public static ElectricConductivity FromSiemensPerInch(double siemensperinch) { - double value = (double) siemensperinch; - return new ElectricConductivity(value, ElectricConductivityUnit.SiemensPerInch); + return new ElectricConductivity(siemensperinch, ElectricConductivityUnit.SiemensPerInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricConductivity FromSiemensPerMeter(QuantityValue siemenspermeter) + public static ElectricConductivity FromSiemensPerMeter(double siemenspermeter) { - double value = (double) siemenspermeter; - return new ElectricConductivity(value, ElectricConductivityUnit.SiemensPerMeter); + return new ElectricConductivity(siemenspermeter, 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..d5760a8a01 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,90 +296,81 @@ 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 amperes) { - double value = (double) amperes; - return new ElectricCurrent(value, ElectricCurrentUnit.Ampere); + return new ElectricCurrent(amperes, ElectricCurrentUnit.Ampere); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCurrent FromCentiamperes(QuantityValue centiamperes) + public static ElectricCurrent FromCentiamperes(double centiamperes) { - double value = (double) centiamperes; - return new ElectricCurrent(value, ElectricCurrentUnit.Centiampere); + return new ElectricCurrent(centiamperes, ElectricCurrentUnit.Centiampere); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCurrent FromFemtoamperes(QuantityValue femtoamperes) + public static ElectricCurrent FromFemtoamperes(double femtoamperes) { - double value = (double) femtoamperes; - return new ElectricCurrent(value, ElectricCurrentUnit.Femtoampere); + return new ElectricCurrent(femtoamperes, ElectricCurrentUnit.Femtoampere); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCurrent FromKiloamperes(QuantityValue kiloamperes) + public static ElectricCurrent FromKiloamperes(double kiloamperes) { - double value = (double) kiloamperes; - return new ElectricCurrent(value, ElectricCurrentUnit.Kiloampere); + return new ElectricCurrent(kiloamperes, ElectricCurrentUnit.Kiloampere); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCurrent FromMegaamperes(QuantityValue megaamperes) + public static ElectricCurrent FromMegaamperes(double megaamperes) { - double value = (double) megaamperes; - return new ElectricCurrent(value, ElectricCurrentUnit.Megaampere); + return new ElectricCurrent(megaamperes, ElectricCurrentUnit.Megaampere); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCurrent FromMicroamperes(QuantityValue microamperes) + public static ElectricCurrent FromMicroamperes(double microamperes) { - double value = (double) microamperes; - return new ElectricCurrent(value, ElectricCurrentUnit.Microampere); + return new ElectricCurrent(microamperes, ElectricCurrentUnit.Microampere); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCurrent FromMilliamperes(QuantityValue milliamperes) + public static ElectricCurrent FromMilliamperes(double milliamperes) { - double value = (double) milliamperes; - return new ElectricCurrent(value, ElectricCurrentUnit.Milliampere); + return new ElectricCurrent(milliamperes, ElectricCurrentUnit.Milliampere); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCurrent FromNanoamperes(QuantityValue nanoamperes) + public static ElectricCurrent FromNanoamperes(double nanoamperes) { - double value = (double) nanoamperes; - return new ElectricCurrent(value, ElectricCurrentUnit.Nanoampere); + return new ElectricCurrent(nanoamperes, ElectricCurrentUnit.Nanoampere); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCurrent FromPicoamperes(QuantityValue picoamperes) + public static ElectricCurrent FromPicoamperes(double picoamperes) { - double value = (double) picoamperes; - return new ElectricCurrent(value, ElectricCurrentUnit.Picoampere); + return new ElectricCurrent(picoamperes, 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..5f0f5f3ebe 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,30 +240,27 @@ 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 amperespersquarefoot) { - double value = (double) amperespersquarefoot; - return new ElectricCurrentDensity(value, ElectricCurrentDensityUnit.AmperePerSquareFoot); + return new ElectricCurrentDensity(amperespersquarefoot, ElectricCurrentDensityUnit.AmperePerSquareFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCurrentDensity FromAmperesPerSquareInch(QuantityValue amperespersquareinch) + public static ElectricCurrentDensity FromAmperesPerSquareInch(double amperespersquareinch) { - double value = (double) amperespersquareinch; - return new ElectricCurrentDensity(value, ElectricCurrentDensityUnit.AmperePerSquareInch); + return new ElectricCurrentDensity(amperespersquareinch, ElectricCurrentDensityUnit.AmperePerSquareInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCurrentDensity FromAmperesPerSquareMeter(QuantityValue amperespersquaremeter) + public static ElectricCurrentDensity FromAmperesPerSquareMeter(double amperespersquaremeter) { - double value = (double) amperespersquaremeter; - return new ElectricCurrentDensity(value, ElectricCurrentDensityUnit.AmperePerSquareMeter); + return new ElectricCurrentDensity(amperespersquaremeter, 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..a0715fa4e7 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,70 +276,63 @@ 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 amperespermicrosecond) { - double value = (double) amperespermicrosecond; - return new ElectricCurrentGradient(value, ElectricCurrentGradientUnit.AmperePerMicrosecond); + return new ElectricCurrentGradient(amperespermicrosecond, ElectricCurrentGradientUnit.AmperePerMicrosecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCurrentGradient FromAmperesPerMillisecond(QuantityValue amperespermillisecond) + public static ElectricCurrentGradient FromAmperesPerMillisecond(double amperespermillisecond) { - double value = (double) amperespermillisecond; - return new ElectricCurrentGradient(value, ElectricCurrentGradientUnit.AmperePerMillisecond); + return new ElectricCurrentGradient(amperespermillisecond, ElectricCurrentGradientUnit.AmperePerMillisecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCurrentGradient FromAmperesPerMinute(QuantityValue amperesperminute) + public static ElectricCurrentGradient FromAmperesPerMinute(double amperesperminute) { - double value = (double) amperesperminute; - return new ElectricCurrentGradient(value, ElectricCurrentGradientUnit.AmperePerMinute); + return new ElectricCurrentGradient(amperesperminute, ElectricCurrentGradientUnit.AmperePerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCurrentGradient FromAmperesPerNanosecond(QuantityValue amperespernanosecond) + public static ElectricCurrentGradient FromAmperesPerNanosecond(double amperespernanosecond) { - double value = (double) amperespernanosecond; - return new ElectricCurrentGradient(value, ElectricCurrentGradientUnit.AmperePerNanosecond); + return new ElectricCurrentGradient(amperespernanosecond, ElectricCurrentGradientUnit.AmperePerNanosecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCurrentGradient FromAmperesPerSecond(QuantityValue amperespersecond) + public static ElectricCurrentGradient FromAmperesPerSecond(double amperespersecond) { - double value = (double) amperespersecond; - return new ElectricCurrentGradient(value, ElectricCurrentGradientUnit.AmperePerSecond); + return new ElectricCurrentGradient(amperespersecond, ElectricCurrentGradientUnit.AmperePerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCurrentGradient FromMilliamperesPerMinute(QuantityValue milliamperesperminute) + public static ElectricCurrentGradient FromMilliamperesPerMinute(double milliamperesperminute) { - double value = (double) milliamperesperminute; - return new ElectricCurrentGradient(value, ElectricCurrentGradientUnit.MilliamperePerMinute); + return new ElectricCurrentGradient(milliamperesperminute, ElectricCurrentGradientUnit.MilliamperePerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCurrentGradient FromMilliamperesPerSecond(QuantityValue milliamperespersecond) + public static ElectricCurrentGradient FromMilliamperesPerSecond(double milliamperespersecond) { - double value = (double) milliamperespersecond; - return new ElectricCurrentGradient(value, ElectricCurrentGradientUnit.MilliamperePerSecond); + return new ElectricCurrentGradient(milliamperespersecond, 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..1d73e8c481 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,10 +224,9 @@ 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 voltspermeter) { - double value = (double) voltspermeter; - return new ElectricField(value, ElectricFieldUnit.VoltPerMeter); + return new ElectricField(voltspermeter, 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..cef87cde96 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,50 +256,45 @@ 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 henries) { - double value = (double) henries; - return new ElectricInductance(value, ElectricInductanceUnit.Henry); + return new ElectricInductance(henries, ElectricInductanceUnit.Henry); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricInductance FromMicrohenries(QuantityValue microhenries) + public static ElectricInductance FromMicrohenries(double microhenries) { - double value = (double) microhenries; - return new ElectricInductance(value, ElectricInductanceUnit.Microhenry); + return new ElectricInductance(microhenries, ElectricInductanceUnit.Microhenry); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricInductance FromMillihenries(QuantityValue millihenries) + public static ElectricInductance FromMillihenries(double millihenries) { - double value = (double) millihenries; - return new ElectricInductance(value, ElectricInductanceUnit.Millihenry); + return new ElectricInductance(millihenries, ElectricInductanceUnit.Millihenry); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricInductance FromNanohenries(QuantityValue nanohenries) + public static ElectricInductance FromNanohenries(double nanohenries) { - double value = (double) nanohenries; - return new ElectricInductance(value, ElectricInductanceUnit.Nanohenry); + return new ElectricInductance(nanohenries, ElectricInductanceUnit.Nanohenry); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricInductance FromPicohenries(QuantityValue picohenries) + public static ElectricInductance FromPicohenries(double picohenries) { - double value = (double) picohenries; - return new ElectricInductance(value, ElectricInductanceUnit.Picohenry); + return new ElectricInductance(picohenries, 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..0fd783a39a 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,60 +270,54 @@ 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 kilovolts) { - double value = (double) kilovolts; - return new ElectricPotential(value, ElectricPotentialUnit.Kilovolt); + return new ElectricPotential(kilovolts, ElectricPotentialUnit.Kilovolt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotential FromMegavolts(QuantityValue megavolts) + public static ElectricPotential FromMegavolts(double megavolts) { - double value = (double) megavolts; - return new ElectricPotential(value, ElectricPotentialUnit.Megavolt); + return new ElectricPotential(megavolts, ElectricPotentialUnit.Megavolt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotential FromMicrovolts(QuantityValue microvolts) + public static ElectricPotential FromMicrovolts(double microvolts) { - double value = (double) microvolts; - return new ElectricPotential(value, ElectricPotentialUnit.Microvolt); + return new ElectricPotential(microvolts, ElectricPotentialUnit.Microvolt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotential FromMillivolts(QuantityValue millivolts) + public static ElectricPotential FromMillivolts(double millivolts) { - double value = (double) millivolts; - return new ElectricPotential(value, ElectricPotentialUnit.Millivolt); + return new ElectricPotential(millivolts, ElectricPotentialUnit.Millivolt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotential FromNanovolts(QuantityValue nanovolts) + public static ElectricPotential FromNanovolts(double nanovolts) { - double value = (double) nanovolts; - return new ElectricPotential(value, ElectricPotentialUnit.Nanovolt); + return new ElectricPotential(nanovolts, ElectricPotentialUnit.Nanovolt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotential FromVolts(QuantityValue volts) + public static ElectricPotential FromVolts(double volts) { - double value = (double) volts; - return new ElectricPotential(value, ElectricPotentialUnit.Volt); + return new ElectricPotential(volts, 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..529a67a34c 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,50 +253,45 @@ 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 kilovoltsac) { - double value = (double) kilovoltsac; - return new ElectricPotentialAc(value, ElectricPotentialAcUnit.KilovoltAc); + return new ElectricPotentialAc(kilovoltsac, ElectricPotentialAcUnit.KilovoltAc); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialAc FromMegavoltsAc(QuantityValue megavoltsac) + public static ElectricPotentialAc FromMegavoltsAc(double megavoltsac) { - double value = (double) megavoltsac; - return new ElectricPotentialAc(value, ElectricPotentialAcUnit.MegavoltAc); + return new ElectricPotentialAc(megavoltsac, ElectricPotentialAcUnit.MegavoltAc); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialAc FromMicrovoltsAc(QuantityValue microvoltsac) + public static ElectricPotentialAc FromMicrovoltsAc(double microvoltsac) { - double value = (double) microvoltsac; - return new ElectricPotentialAc(value, ElectricPotentialAcUnit.MicrovoltAc); + return new ElectricPotentialAc(microvoltsac, ElectricPotentialAcUnit.MicrovoltAc); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialAc FromMillivoltsAc(QuantityValue millivoltsac) + public static ElectricPotentialAc FromMillivoltsAc(double millivoltsac) { - double value = (double) millivoltsac; - return new ElectricPotentialAc(value, ElectricPotentialAcUnit.MillivoltAc); + return new ElectricPotentialAc(millivoltsac, ElectricPotentialAcUnit.MillivoltAc); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialAc FromVoltsAc(QuantityValue voltsac) + public static ElectricPotentialAc FromVoltsAc(double voltsac) { - double value = (double) voltsac; - return new ElectricPotentialAc(value, ElectricPotentialAcUnit.VoltAc); + return new ElectricPotentialAc(voltsac, 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..876ccd5ebf 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,200 +373,180 @@ 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 kilovoltsperhour) { - double value = (double) kilovoltsperhour; - return new ElectricPotentialChangeRate(value, ElectricPotentialChangeRateUnit.KilovoltPerHour); + return new ElectricPotentialChangeRate(kilovoltsperhour, ElectricPotentialChangeRateUnit.KilovoltPerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialChangeRate FromKilovoltsPerMicrosecond(QuantityValue kilovoltspermicrosecond) + public static ElectricPotentialChangeRate FromKilovoltsPerMicrosecond(double kilovoltspermicrosecond) { - double value = (double) kilovoltspermicrosecond; - return new ElectricPotentialChangeRate(value, ElectricPotentialChangeRateUnit.KilovoltPerMicrosecond); + return new ElectricPotentialChangeRate(kilovoltspermicrosecond, ElectricPotentialChangeRateUnit.KilovoltPerMicrosecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialChangeRate FromKilovoltsPerMinute(QuantityValue kilovoltsperminute) + public static ElectricPotentialChangeRate FromKilovoltsPerMinute(double kilovoltsperminute) { - double value = (double) kilovoltsperminute; - return new ElectricPotentialChangeRate(value, ElectricPotentialChangeRateUnit.KilovoltPerMinute); + return new ElectricPotentialChangeRate(kilovoltsperminute, ElectricPotentialChangeRateUnit.KilovoltPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialChangeRate FromKilovoltsPerSecond(QuantityValue kilovoltspersecond) + public static ElectricPotentialChangeRate FromKilovoltsPerSecond(double kilovoltspersecond) { - double value = (double) kilovoltspersecond; - return new ElectricPotentialChangeRate(value, ElectricPotentialChangeRateUnit.KilovoltPerSecond); + return new ElectricPotentialChangeRate(kilovoltspersecond, ElectricPotentialChangeRateUnit.KilovoltPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialChangeRate FromMegavoltsPerHour(QuantityValue megavoltsperhour) + public static ElectricPotentialChangeRate FromMegavoltsPerHour(double megavoltsperhour) { - double value = (double) megavoltsperhour; - return new ElectricPotentialChangeRate(value, ElectricPotentialChangeRateUnit.MegavoltPerHour); + return new ElectricPotentialChangeRate(megavoltsperhour, ElectricPotentialChangeRateUnit.MegavoltPerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialChangeRate FromMegavoltsPerMicrosecond(QuantityValue megavoltspermicrosecond) + public static ElectricPotentialChangeRate FromMegavoltsPerMicrosecond(double megavoltspermicrosecond) { - double value = (double) megavoltspermicrosecond; - return new ElectricPotentialChangeRate(value, ElectricPotentialChangeRateUnit.MegavoltPerMicrosecond); + return new ElectricPotentialChangeRate(megavoltspermicrosecond, ElectricPotentialChangeRateUnit.MegavoltPerMicrosecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialChangeRate FromMegavoltsPerMinute(QuantityValue megavoltsperminute) + public static ElectricPotentialChangeRate FromMegavoltsPerMinute(double megavoltsperminute) { - double value = (double) megavoltsperminute; - return new ElectricPotentialChangeRate(value, ElectricPotentialChangeRateUnit.MegavoltPerMinute); + return new ElectricPotentialChangeRate(megavoltsperminute, ElectricPotentialChangeRateUnit.MegavoltPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialChangeRate FromMegavoltsPerSecond(QuantityValue megavoltspersecond) + public static ElectricPotentialChangeRate FromMegavoltsPerSecond(double megavoltspersecond) { - double value = (double) megavoltspersecond; - return new ElectricPotentialChangeRate(value, ElectricPotentialChangeRateUnit.MegavoltPerSecond); + return new ElectricPotentialChangeRate(megavoltspersecond, ElectricPotentialChangeRateUnit.MegavoltPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialChangeRate FromMicrovoltsPerHour(QuantityValue microvoltsperhour) + public static ElectricPotentialChangeRate FromMicrovoltsPerHour(double microvoltsperhour) { - double value = (double) microvoltsperhour; - return new ElectricPotentialChangeRate(value, ElectricPotentialChangeRateUnit.MicrovoltPerHour); + return new ElectricPotentialChangeRate(microvoltsperhour, ElectricPotentialChangeRateUnit.MicrovoltPerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialChangeRate FromMicrovoltsPerMicrosecond(QuantityValue microvoltspermicrosecond) + public static ElectricPotentialChangeRate FromMicrovoltsPerMicrosecond(double microvoltspermicrosecond) { - double value = (double) microvoltspermicrosecond; - return new ElectricPotentialChangeRate(value, ElectricPotentialChangeRateUnit.MicrovoltPerMicrosecond); + return new ElectricPotentialChangeRate(microvoltspermicrosecond, ElectricPotentialChangeRateUnit.MicrovoltPerMicrosecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialChangeRate FromMicrovoltsPerMinute(QuantityValue microvoltsperminute) + public static ElectricPotentialChangeRate FromMicrovoltsPerMinute(double microvoltsperminute) { - double value = (double) microvoltsperminute; - return new ElectricPotentialChangeRate(value, ElectricPotentialChangeRateUnit.MicrovoltPerMinute); + return new ElectricPotentialChangeRate(microvoltsperminute, ElectricPotentialChangeRateUnit.MicrovoltPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialChangeRate FromMicrovoltsPerSecond(QuantityValue microvoltspersecond) + public static ElectricPotentialChangeRate FromMicrovoltsPerSecond(double microvoltspersecond) { - double value = (double) microvoltspersecond; - return new ElectricPotentialChangeRate(value, ElectricPotentialChangeRateUnit.MicrovoltPerSecond); + return new ElectricPotentialChangeRate(microvoltspersecond, ElectricPotentialChangeRateUnit.MicrovoltPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialChangeRate FromMillivoltsPerHour(QuantityValue millivoltsperhour) + public static ElectricPotentialChangeRate FromMillivoltsPerHour(double millivoltsperhour) { - double value = (double) millivoltsperhour; - return new ElectricPotentialChangeRate(value, ElectricPotentialChangeRateUnit.MillivoltPerHour); + return new ElectricPotentialChangeRate(millivoltsperhour, ElectricPotentialChangeRateUnit.MillivoltPerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialChangeRate FromMillivoltsPerMicrosecond(QuantityValue millivoltspermicrosecond) + public static ElectricPotentialChangeRate FromMillivoltsPerMicrosecond(double millivoltspermicrosecond) { - double value = (double) millivoltspermicrosecond; - return new ElectricPotentialChangeRate(value, ElectricPotentialChangeRateUnit.MillivoltPerMicrosecond); + return new ElectricPotentialChangeRate(millivoltspermicrosecond, ElectricPotentialChangeRateUnit.MillivoltPerMicrosecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialChangeRate FromMillivoltsPerMinute(QuantityValue millivoltsperminute) + public static ElectricPotentialChangeRate FromMillivoltsPerMinute(double millivoltsperminute) { - double value = (double) millivoltsperminute; - return new ElectricPotentialChangeRate(value, ElectricPotentialChangeRateUnit.MillivoltPerMinute); + return new ElectricPotentialChangeRate(millivoltsperminute, ElectricPotentialChangeRateUnit.MillivoltPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialChangeRate FromMillivoltsPerSecond(QuantityValue millivoltspersecond) + public static ElectricPotentialChangeRate FromMillivoltsPerSecond(double millivoltspersecond) { - double value = (double) millivoltspersecond; - return new ElectricPotentialChangeRate(value, ElectricPotentialChangeRateUnit.MillivoltPerSecond); + return new ElectricPotentialChangeRate(millivoltspersecond, ElectricPotentialChangeRateUnit.MillivoltPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialChangeRate FromVoltsPerHour(QuantityValue voltsperhour) + public static ElectricPotentialChangeRate FromVoltsPerHour(double voltsperhour) { - double value = (double) voltsperhour; - return new ElectricPotentialChangeRate(value, ElectricPotentialChangeRateUnit.VoltPerHour); + return new ElectricPotentialChangeRate(voltsperhour, ElectricPotentialChangeRateUnit.VoltPerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialChangeRate FromVoltsPerMicrosecond(QuantityValue voltspermicrosecond) + public static ElectricPotentialChangeRate FromVoltsPerMicrosecond(double voltspermicrosecond) { - double value = (double) voltspermicrosecond; - return new ElectricPotentialChangeRate(value, ElectricPotentialChangeRateUnit.VoltPerMicrosecond); + return new ElectricPotentialChangeRate(voltspermicrosecond, ElectricPotentialChangeRateUnit.VoltPerMicrosecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialChangeRate FromVoltsPerMinute(QuantityValue voltsperminute) + public static ElectricPotentialChangeRate FromVoltsPerMinute(double voltsperminute) { - double value = (double) voltsperminute; - return new ElectricPotentialChangeRate(value, ElectricPotentialChangeRateUnit.VoltPerMinute); + return new ElectricPotentialChangeRate(voltsperminute, ElectricPotentialChangeRateUnit.VoltPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialChangeRate FromVoltsPerSecond(QuantityValue voltspersecond) + public static ElectricPotentialChangeRate FromVoltsPerSecond(double voltspersecond) { - double value = (double) voltspersecond; - return new ElectricPotentialChangeRate(value, ElectricPotentialChangeRateUnit.VoltPerSecond); + return new ElectricPotentialChangeRate(voltspersecond, 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..63f8ddc2e6 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,50 +253,45 @@ 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 kilovoltsdc) { - double value = (double) kilovoltsdc; - return new ElectricPotentialDc(value, ElectricPotentialDcUnit.KilovoltDc); + return new ElectricPotentialDc(kilovoltsdc, ElectricPotentialDcUnit.KilovoltDc); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialDc FromMegavoltsDc(QuantityValue megavoltsdc) + public static ElectricPotentialDc FromMegavoltsDc(double megavoltsdc) { - double value = (double) megavoltsdc; - return new ElectricPotentialDc(value, ElectricPotentialDcUnit.MegavoltDc); + return new ElectricPotentialDc(megavoltsdc, ElectricPotentialDcUnit.MegavoltDc); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialDc FromMicrovoltsDc(QuantityValue microvoltsdc) + public static ElectricPotentialDc FromMicrovoltsDc(double microvoltsdc) { - double value = (double) microvoltsdc; - return new ElectricPotentialDc(value, ElectricPotentialDcUnit.MicrovoltDc); + return new ElectricPotentialDc(microvoltsdc, ElectricPotentialDcUnit.MicrovoltDc); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialDc FromMillivoltsDc(QuantityValue millivoltsdc) + public static ElectricPotentialDc FromMillivoltsDc(double millivoltsdc) { - double value = (double) millivoltsdc; - return new ElectricPotentialDc(value, ElectricPotentialDcUnit.MillivoltDc); + return new ElectricPotentialDc(millivoltsdc, ElectricPotentialDcUnit.MillivoltDc); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialDc FromVoltsDc(QuantityValue voltsdc) + public static ElectricPotentialDc FromVoltsDc(double voltsdc) { - double value = (double) voltsdc; - return new ElectricPotentialDc(value, ElectricPotentialDcUnit.VoltDc); + return new ElectricPotentialDc(voltsdc, 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..ea9498d3a8 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,70 +275,63 @@ 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 gigaohms) { - double value = (double) gigaohms; - return new ElectricResistance(value, ElectricResistanceUnit.Gigaohm); + return new ElectricResistance(gigaohms, ElectricResistanceUnit.Gigaohm); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricResistance FromKiloohms(QuantityValue kiloohms) + public static ElectricResistance FromKiloohms(double kiloohms) { - double value = (double) kiloohms; - return new ElectricResistance(value, ElectricResistanceUnit.Kiloohm); + return new ElectricResistance(kiloohms, ElectricResistanceUnit.Kiloohm); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricResistance FromMegaohms(QuantityValue megaohms) + public static ElectricResistance FromMegaohms(double megaohms) { - double value = (double) megaohms; - return new ElectricResistance(value, ElectricResistanceUnit.Megaohm); + return new ElectricResistance(megaohms, ElectricResistanceUnit.Megaohm); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricResistance FromMicroohms(QuantityValue microohms) + public static ElectricResistance FromMicroohms(double microohms) { - double value = (double) microohms; - return new ElectricResistance(value, ElectricResistanceUnit.Microohm); + return new ElectricResistance(microohms, ElectricResistanceUnit.Microohm); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricResistance FromMilliohms(QuantityValue milliohms) + public static ElectricResistance FromMilliohms(double milliohms) { - double value = (double) milliohms; - return new ElectricResistance(value, ElectricResistanceUnit.Milliohm); + return new ElectricResistance(milliohms, ElectricResistanceUnit.Milliohm); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricResistance FromOhms(QuantityValue ohms) + public static ElectricResistance FromOhms(double ohms) { - double value = (double) ohms; - return new ElectricResistance(value, ElectricResistanceUnit.Ohm); + return new ElectricResistance(ohms, ElectricResistanceUnit.Ohm); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricResistance FromTeraohms(QuantityValue teraohms) + public static ElectricResistance FromTeraohms(double teraohms) { - double value = (double) teraohms; - return new ElectricResistance(value, ElectricResistanceUnit.Teraohm); + return new ElectricResistance(teraohms, 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..8e569cbc49 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,140 +328,126 @@ 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 kiloohmscentimeter) { - double value = (double) kiloohmscentimeter; - return new ElectricResistivity(value, ElectricResistivityUnit.KiloohmCentimeter); + return new ElectricResistivity(kiloohmscentimeter, ElectricResistivityUnit.KiloohmCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricResistivity FromKiloohmMeters(QuantityValue kiloohmmeters) + public static ElectricResistivity FromKiloohmMeters(double kiloohmmeters) { - double value = (double) kiloohmmeters; - return new ElectricResistivity(value, ElectricResistivityUnit.KiloohmMeter); + return new ElectricResistivity(kiloohmmeters, ElectricResistivityUnit.KiloohmMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricResistivity FromMegaohmsCentimeter(QuantityValue megaohmscentimeter) + public static ElectricResistivity FromMegaohmsCentimeter(double megaohmscentimeter) { - double value = (double) megaohmscentimeter; - return new ElectricResistivity(value, ElectricResistivityUnit.MegaohmCentimeter); + return new ElectricResistivity(megaohmscentimeter, ElectricResistivityUnit.MegaohmCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricResistivity FromMegaohmMeters(QuantityValue megaohmmeters) + public static ElectricResistivity FromMegaohmMeters(double megaohmmeters) { - double value = (double) megaohmmeters; - return new ElectricResistivity(value, ElectricResistivityUnit.MegaohmMeter); + return new ElectricResistivity(megaohmmeters, ElectricResistivityUnit.MegaohmMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricResistivity FromMicroohmsCentimeter(QuantityValue microohmscentimeter) + public static ElectricResistivity FromMicroohmsCentimeter(double microohmscentimeter) { - double value = (double) microohmscentimeter; - return new ElectricResistivity(value, ElectricResistivityUnit.MicroohmCentimeter); + return new ElectricResistivity(microohmscentimeter, ElectricResistivityUnit.MicroohmCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricResistivity FromMicroohmMeters(QuantityValue microohmmeters) + public static ElectricResistivity FromMicroohmMeters(double microohmmeters) { - double value = (double) microohmmeters; - return new ElectricResistivity(value, ElectricResistivityUnit.MicroohmMeter); + return new ElectricResistivity(microohmmeters, ElectricResistivityUnit.MicroohmMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricResistivity FromMilliohmsCentimeter(QuantityValue milliohmscentimeter) + public static ElectricResistivity FromMilliohmsCentimeter(double milliohmscentimeter) { - double value = (double) milliohmscentimeter; - return new ElectricResistivity(value, ElectricResistivityUnit.MilliohmCentimeter); + return new ElectricResistivity(milliohmscentimeter, ElectricResistivityUnit.MilliohmCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricResistivity FromMilliohmMeters(QuantityValue milliohmmeters) + public static ElectricResistivity FromMilliohmMeters(double milliohmmeters) { - double value = (double) milliohmmeters; - return new ElectricResistivity(value, ElectricResistivityUnit.MilliohmMeter); + return new ElectricResistivity(milliohmmeters, ElectricResistivityUnit.MilliohmMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricResistivity FromNanoohmsCentimeter(QuantityValue nanoohmscentimeter) + public static ElectricResistivity FromNanoohmsCentimeter(double nanoohmscentimeter) { - double value = (double) nanoohmscentimeter; - return new ElectricResistivity(value, ElectricResistivityUnit.NanoohmCentimeter); + return new ElectricResistivity(nanoohmscentimeter, ElectricResistivityUnit.NanoohmCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricResistivity FromNanoohmMeters(QuantityValue nanoohmmeters) + public static ElectricResistivity FromNanoohmMeters(double nanoohmmeters) { - double value = (double) nanoohmmeters; - return new ElectricResistivity(value, ElectricResistivityUnit.NanoohmMeter); + return new ElectricResistivity(nanoohmmeters, ElectricResistivityUnit.NanoohmMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricResistivity FromOhmsCentimeter(QuantityValue ohmscentimeter) + public static ElectricResistivity FromOhmsCentimeter(double ohmscentimeter) { - double value = (double) ohmscentimeter; - return new ElectricResistivity(value, ElectricResistivityUnit.OhmCentimeter); + return new ElectricResistivity(ohmscentimeter, ElectricResistivityUnit.OhmCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricResistivity FromOhmMeters(QuantityValue ohmmeters) + public static ElectricResistivity FromOhmMeters(double ohmmeters) { - double value = (double) ohmmeters; - return new ElectricResistivity(value, ElectricResistivityUnit.OhmMeter); + return new ElectricResistivity(ohmmeters, ElectricResistivityUnit.OhmMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricResistivity FromPicoohmsCentimeter(QuantityValue picoohmscentimeter) + public static ElectricResistivity FromPicoohmsCentimeter(double picoohmscentimeter) { - double value = (double) picoohmscentimeter; - return new ElectricResistivity(value, ElectricResistivityUnit.PicoohmCentimeter); + return new ElectricResistivity(picoohmscentimeter, ElectricResistivityUnit.PicoohmCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricResistivity FromPicoohmMeters(QuantityValue picoohmmeters) + public static ElectricResistivity FromPicoohmMeters(double picoohmmeters) { - double value = (double) picoohmmeters; - return new ElectricResistivity(value, ElectricResistivityUnit.PicoohmMeter); + return new ElectricResistivity(picoohmmeters, 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..0100afc14f 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,30 +240,27 @@ 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 coulombspersquarecentimeter) { - double value = (double) coulombspersquarecentimeter; - return new ElectricSurfaceChargeDensity(value, ElectricSurfaceChargeDensityUnit.CoulombPerSquareCentimeter); + return new ElectricSurfaceChargeDensity(coulombspersquarecentimeter, ElectricSurfaceChargeDensityUnit.CoulombPerSquareCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricSurfaceChargeDensity FromCoulombsPerSquareInch(QuantityValue coulombspersquareinch) + public static ElectricSurfaceChargeDensity FromCoulombsPerSquareInch(double coulombspersquareinch) { - double value = (double) coulombspersquareinch; - return new ElectricSurfaceChargeDensity(value, ElectricSurfaceChargeDensityUnit.CoulombPerSquareInch); + return new ElectricSurfaceChargeDensity(coulombspersquareinch, ElectricSurfaceChargeDensityUnit.CoulombPerSquareInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricSurfaceChargeDensity FromCoulombsPerSquareMeter(QuantityValue coulombspersquaremeter) + public static ElectricSurfaceChargeDensity FromCoulombsPerSquareMeter(double coulombspersquaremeter) { - double value = (double) coulombspersquaremeter; - return new ElectricSurfaceChargeDensity(value, ElectricSurfaceChargeDensityUnit.CoulombPerSquareMeter); + return new ElectricSurfaceChargeDensity(coulombspersquaremeter, 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..b0dc36db32 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,400 +548,360 @@ 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 britishthermalunits) { - double value = (double) britishthermalunits; - return new Energy(value, EnergyUnit.BritishThermalUnit); + return new Energy(britishthermalunits, EnergyUnit.BritishThermalUnit); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromCalories(QuantityValue calories) + public static Energy FromCalories(double calories) { - double value = (double) calories; - return new Energy(value, EnergyUnit.Calorie); + return new Energy(calories, EnergyUnit.Calorie); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromDecathermsEc(QuantityValue decathermsec) + public static Energy FromDecathermsEc(double decathermsec) { - double value = (double) decathermsec; - return new Energy(value, EnergyUnit.DecathermEc); + return new Energy(decathermsec, EnergyUnit.DecathermEc); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromDecathermsImperial(QuantityValue decathermsimperial) + public static Energy FromDecathermsImperial(double decathermsimperial) { - double value = (double) decathermsimperial; - return new Energy(value, EnergyUnit.DecathermImperial); + return new Energy(decathermsimperial, EnergyUnit.DecathermImperial); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromDecathermsUs(QuantityValue decathermsus) + public static Energy FromDecathermsUs(double decathermsus) { - double value = (double) decathermsus; - return new Energy(value, EnergyUnit.DecathermUs); + return new Energy(decathermsus, EnergyUnit.DecathermUs); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromElectronVolts(QuantityValue electronvolts) + public static Energy FromElectronVolts(double electronvolts) { - double value = (double) electronvolts; - return new Energy(value, EnergyUnit.ElectronVolt); + return new Energy(electronvolts, EnergyUnit.ElectronVolt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromErgs(QuantityValue ergs) + public static Energy FromErgs(double ergs) { - double value = (double) ergs; - return new Energy(value, EnergyUnit.Erg); + return new Energy(ergs, EnergyUnit.Erg); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromFootPounds(QuantityValue footpounds) + public static Energy FromFootPounds(double footpounds) { - double value = (double) footpounds; - return new Energy(value, EnergyUnit.FootPound); + return new Energy(footpounds, EnergyUnit.FootPound); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromGigabritishThermalUnits(QuantityValue gigabritishthermalunits) + public static Energy FromGigabritishThermalUnits(double gigabritishthermalunits) { - double value = (double) gigabritishthermalunits; - return new Energy(value, EnergyUnit.GigabritishThermalUnit); + return new Energy(gigabritishthermalunits, EnergyUnit.GigabritishThermalUnit); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromGigaelectronVolts(QuantityValue gigaelectronvolts) + public static Energy FromGigaelectronVolts(double gigaelectronvolts) { - double value = (double) gigaelectronvolts; - return new Energy(value, EnergyUnit.GigaelectronVolt); + return new Energy(gigaelectronvolts, EnergyUnit.GigaelectronVolt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromGigajoules(QuantityValue gigajoules) + public static Energy FromGigajoules(double gigajoules) { - double value = (double) gigajoules; - return new Energy(value, EnergyUnit.Gigajoule); + return new Energy(gigajoules, EnergyUnit.Gigajoule); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromGigawattDays(QuantityValue gigawattdays) + public static Energy FromGigawattDays(double gigawattdays) { - double value = (double) gigawattdays; - return new Energy(value, EnergyUnit.GigawattDay); + return new Energy(gigawattdays, EnergyUnit.GigawattDay); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromGigawattHours(QuantityValue gigawatthours) + public static Energy FromGigawattHours(double gigawatthours) { - double value = (double) gigawatthours; - return new Energy(value, EnergyUnit.GigawattHour); + return new Energy(gigawatthours, EnergyUnit.GigawattHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromHorsepowerHours(QuantityValue horsepowerhours) + public static Energy FromHorsepowerHours(double horsepowerhours) { - double value = (double) horsepowerhours; - return new Energy(value, EnergyUnit.HorsepowerHour); + return new Energy(horsepowerhours, EnergyUnit.HorsepowerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromJoules(QuantityValue joules) + public static Energy FromJoules(double joules) { - double value = (double) joules; - return new Energy(value, EnergyUnit.Joule); + return new Energy(joules, EnergyUnit.Joule); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromKilobritishThermalUnits(QuantityValue kilobritishthermalunits) + public static Energy FromKilobritishThermalUnits(double kilobritishthermalunits) { - double value = (double) kilobritishthermalunits; - return new Energy(value, EnergyUnit.KilobritishThermalUnit); + return new Energy(kilobritishthermalunits, EnergyUnit.KilobritishThermalUnit); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromKilocalories(QuantityValue kilocalories) + public static Energy FromKilocalories(double kilocalories) { - double value = (double) kilocalories; - return new Energy(value, EnergyUnit.Kilocalorie); + return new Energy(kilocalories, EnergyUnit.Kilocalorie); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromKiloelectronVolts(QuantityValue kiloelectronvolts) + public static Energy FromKiloelectronVolts(double kiloelectronvolts) { - double value = (double) kiloelectronvolts; - return new Energy(value, EnergyUnit.KiloelectronVolt); + return new Energy(kiloelectronvolts, EnergyUnit.KiloelectronVolt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromKilojoules(QuantityValue kilojoules) + public static Energy FromKilojoules(double kilojoules) { - double value = (double) kilojoules; - return new Energy(value, EnergyUnit.Kilojoule); + return new Energy(kilojoules, EnergyUnit.Kilojoule); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromKilowattDays(QuantityValue kilowattdays) + public static Energy FromKilowattDays(double kilowattdays) { - double value = (double) kilowattdays; - return new Energy(value, EnergyUnit.KilowattDay); + return new Energy(kilowattdays, EnergyUnit.KilowattDay); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromKilowattHours(QuantityValue kilowatthours) + public static Energy FromKilowattHours(double kilowatthours) { - double value = (double) kilowatthours; - return new Energy(value, EnergyUnit.KilowattHour); + return new Energy(kilowatthours, EnergyUnit.KilowattHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromMegabritishThermalUnits(QuantityValue megabritishthermalunits) + public static Energy FromMegabritishThermalUnits(double megabritishthermalunits) { - double value = (double) megabritishthermalunits; - return new Energy(value, EnergyUnit.MegabritishThermalUnit); + return new Energy(megabritishthermalunits, EnergyUnit.MegabritishThermalUnit); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromMegacalories(QuantityValue megacalories) + public static Energy FromMegacalories(double megacalories) { - double value = (double) megacalories; - return new Energy(value, EnergyUnit.Megacalorie); + return new Energy(megacalories, EnergyUnit.Megacalorie); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromMegaelectronVolts(QuantityValue megaelectronvolts) + public static Energy FromMegaelectronVolts(double megaelectronvolts) { - double value = (double) megaelectronvolts; - return new Energy(value, EnergyUnit.MegaelectronVolt); + return new Energy(megaelectronvolts, EnergyUnit.MegaelectronVolt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromMegajoules(QuantityValue megajoules) + public static Energy FromMegajoules(double megajoules) { - double value = (double) megajoules; - return new Energy(value, EnergyUnit.Megajoule); + return new Energy(megajoules, EnergyUnit.Megajoule); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromMegawattDays(QuantityValue megawattdays) + public static Energy FromMegawattDays(double megawattdays) { - double value = (double) megawattdays; - return new Energy(value, EnergyUnit.MegawattDay); + return new Energy(megawattdays, EnergyUnit.MegawattDay); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromMegawattHours(QuantityValue megawatthours) + public static Energy FromMegawattHours(double megawatthours) { - double value = (double) megawatthours; - return new Energy(value, EnergyUnit.MegawattHour); + return new Energy(megawatthours, EnergyUnit.MegawattHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromMicrojoules(QuantityValue microjoules) + public static Energy FromMicrojoules(double microjoules) { - double value = (double) microjoules; - return new Energy(value, EnergyUnit.Microjoule); + return new Energy(microjoules, EnergyUnit.Microjoule); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromMillijoules(QuantityValue millijoules) + public static Energy FromMillijoules(double millijoules) { - double value = (double) millijoules; - return new Energy(value, EnergyUnit.Millijoule); + return new Energy(millijoules, EnergyUnit.Millijoule); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromNanojoules(QuantityValue nanojoules) + public static Energy FromNanojoules(double nanojoules) { - double value = (double) nanojoules; - return new Energy(value, EnergyUnit.Nanojoule); + return new Energy(nanojoules, EnergyUnit.Nanojoule); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromPetajoules(QuantityValue petajoules) + public static Energy FromPetajoules(double petajoules) { - double value = (double) petajoules; - return new Energy(value, EnergyUnit.Petajoule); + return new Energy(petajoules, EnergyUnit.Petajoule); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromTeraelectronVolts(QuantityValue teraelectronvolts) + public static Energy FromTeraelectronVolts(double teraelectronvolts) { - double value = (double) teraelectronvolts; - return new Energy(value, EnergyUnit.TeraelectronVolt); + return new Energy(teraelectronvolts, EnergyUnit.TeraelectronVolt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromTerajoules(QuantityValue terajoules) + public static Energy FromTerajoules(double terajoules) { - double value = (double) terajoules; - return new Energy(value, EnergyUnit.Terajoule); + return new Energy(terajoules, EnergyUnit.Terajoule); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromTerawattDays(QuantityValue terawattdays) + public static Energy FromTerawattDays(double terawattdays) { - double value = (double) terawattdays; - return new Energy(value, EnergyUnit.TerawattDay); + return new Energy(terawattdays, EnergyUnit.TerawattDay); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromTerawattHours(QuantityValue terawatthours) + public static Energy FromTerawattHours(double terawatthours) { - double value = (double) terawatthours; - return new Energy(value, EnergyUnit.TerawattHour); + return new Energy(terawatthours, EnergyUnit.TerawattHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromThermsEc(QuantityValue thermsec) + public static Energy FromThermsEc(double thermsec) { - double value = (double) thermsec; - return new Energy(value, EnergyUnit.ThermEc); + return new Energy(thermsec, EnergyUnit.ThermEc); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromThermsImperial(QuantityValue thermsimperial) + public static Energy FromThermsImperial(double thermsimperial) { - double value = (double) thermsimperial; - return new Energy(value, EnergyUnit.ThermImperial); + return new Energy(thermsimperial, EnergyUnit.ThermImperial); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromThermsUs(QuantityValue thermsus) + public static Energy FromThermsUs(double thermsus) { - double value = (double) thermsus; - return new Energy(value, EnergyUnit.ThermUs); + return new Energy(thermsus, EnergyUnit.ThermUs); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromWattDays(QuantityValue wattdays) + public static Energy FromWattDays(double wattdays) { - double value = (double) wattdays; - return new Energy(value, EnergyUnit.WattDay); + return new Energy(wattdays, EnergyUnit.WattDay); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromWattHours(QuantityValue watthours) + public static Energy FromWattHours(double watthours) { - double value = (double) watthours; - return new Energy(value, EnergyUnit.WattHour); + return new Energy(watthours, 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..da6aa0ead8 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,120 +315,108 @@ 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 gigajoulespercubicmeter) { - double value = (double) gigajoulespercubicmeter; - return new EnergyDensity(value, EnergyDensityUnit.GigajoulePerCubicMeter); + return new EnergyDensity(gigajoulespercubicmeter, EnergyDensityUnit.GigajoulePerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static EnergyDensity FromGigawattHoursPerCubicMeter(QuantityValue gigawatthourspercubicmeter) + public static EnergyDensity FromGigawattHoursPerCubicMeter(double gigawatthourspercubicmeter) { - double value = (double) gigawatthourspercubicmeter; - return new EnergyDensity(value, EnergyDensityUnit.GigawattHourPerCubicMeter); + return new EnergyDensity(gigawatthourspercubicmeter, EnergyDensityUnit.GigawattHourPerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static EnergyDensity FromJoulesPerCubicMeter(QuantityValue joulespercubicmeter) + public static EnergyDensity FromJoulesPerCubicMeter(double joulespercubicmeter) { - double value = (double) joulespercubicmeter; - return new EnergyDensity(value, EnergyDensityUnit.JoulePerCubicMeter); + return new EnergyDensity(joulespercubicmeter, EnergyDensityUnit.JoulePerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static EnergyDensity FromKilojoulesPerCubicMeter(QuantityValue kilojoulespercubicmeter) + public static EnergyDensity FromKilojoulesPerCubicMeter(double kilojoulespercubicmeter) { - double value = (double) kilojoulespercubicmeter; - return new EnergyDensity(value, EnergyDensityUnit.KilojoulePerCubicMeter); + return new EnergyDensity(kilojoulespercubicmeter, EnergyDensityUnit.KilojoulePerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static EnergyDensity FromKilowattHoursPerCubicMeter(QuantityValue kilowatthourspercubicmeter) + public static EnergyDensity FromKilowattHoursPerCubicMeter(double kilowatthourspercubicmeter) { - double value = (double) kilowatthourspercubicmeter; - return new EnergyDensity(value, EnergyDensityUnit.KilowattHourPerCubicMeter); + return new EnergyDensity(kilowatthourspercubicmeter, EnergyDensityUnit.KilowattHourPerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static EnergyDensity FromMegajoulesPerCubicMeter(QuantityValue megajoulespercubicmeter) + public static EnergyDensity FromMegajoulesPerCubicMeter(double megajoulespercubicmeter) { - double value = (double) megajoulespercubicmeter; - return new EnergyDensity(value, EnergyDensityUnit.MegajoulePerCubicMeter); + return new EnergyDensity(megajoulespercubicmeter, EnergyDensityUnit.MegajoulePerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static EnergyDensity FromMegawattHoursPerCubicMeter(QuantityValue megawatthourspercubicmeter) + public static EnergyDensity FromMegawattHoursPerCubicMeter(double megawatthourspercubicmeter) { - double value = (double) megawatthourspercubicmeter; - return new EnergyDensity(value, EnergyDensityUnit.MegawattHourPerCubicMeter); + return new EnergyDensity(megawatthourspercubicmeter, EnergyDensityUnit.MegawattHourPerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static EnergyDensity FromPetajoulesPerCubicMeter(QuantityValue petajoulespercubicmeter) + public static EnergyDensity FromPetajoulesPerCubicMeter(double petajoulespercubicmeter) { - double value = (double) petajoulespercubicmeter; - return new EnergyDensity(value, EnergyDensityUnit.PetajoulePerCubicMeter); + return new EnergyDensity(petajoulespercubicmeter, EnergyDensityUnit.PetajoulePerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static EnergyDensity FromPetawattHoursPerCubicMeter(QuantityValue petawatthourspercubicmeter) + public static EnergyDensity FromPetawattHoursPerCubicMeter(double petawatthourspercubicmeter) { - double value = (double) petawatthourspercubicmeter; - return new EnergyDensity(value, EnergyDensityUnit.PetawattHourPerCubicMeter); + return new EnergyDensity(petawatthourspercubicmeter, EnergyDensityUnit.PetawattHourPerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static EnergyDensity FromTerajoulesPerCubicMeter(QuantityValue terajoulespercubicmeter) + public static EnergyDensity FromTerajoulesPerCubicMeter(double terajoulespercubicmeter) { - double value = (double) terajoulespercubicmeter; - return new EnergyDensity(value, EnergyDensityUnit.TerajoulePerCubicMeter); + return new EnergyDensity(terajoulespercubicmeter, EnergyDensityUnit.TerajoulePerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static EnergyDensity FromTerawattHoursPerCubicMeter(QuantityValue terawatthourspercubicmeter) + public static EnergyDensity FromTerawattHoursPerCubicMeter(double terawatthourspercubicmeter) { - double value = (double) terawatthourspercubicmeter; - return new EnergyDensity(value, EnergyDensityUnit.TerawattHourPerCubicMeter); + return new EnergyDensity(terawatthourspercubicmeter, EnergyDensityUnit.TerawattHourPerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static EnergyDensity FromWattHoursPerCubicMeter(QuantityValue watthourspercubicmeter) + public static EnergyDensity FromWattHoursPerCubicMeter(double watthourspercubicmeter) { - double value = (double) watthourspercubicmeter; - return new EnergyDensity(value, EnergyDensityUnit.WattHourPerCubicMeter); + return new EnergyDensity(watthourspercubicmeter, 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..53677dec17 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,70 +276,63 @@ 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 caloriesperkelvin) { - double value = (double) caloriesperkelvin; - return new Entropy(value, EntropyUnit.CaloriePerKelvin); + return new Entropy(caloriesperkelvin, EntropyUnit.CaloriePerKelvin); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Entropy FromJoulesPerDegreeCelsius(QuantityValue joulesperdegreecelsius) + public static Entropy FromJoulesPerDegreeCelsius(double joulesperdegreecelsius) { - double value = (double) joulesperdegreecelsius; - return new Entropy(value, EntropyUnit.JoulePerDegreeCelsius); + return new Entropy(joulesperdegreecelsius, EntropyUnit.JoulePerDegreeCelsius); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Entropy FromJoulesPerKelvin(QuantityValue joulesperkelvin) + public static Entropy FromJoulesPerKelvin(double joulesperkelvin) { - double value = (double) joulesperkelvin; - return new Entropy(value, EntropyUnit.JoulePerKelvin); + return new Entropy(joulesperkelvin, EntropyUnit.JoulePerKelvin); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Entropy FromKilocaloriesPerKelvin(QuantityValue kilocaloriesperkelvin) + public static Entropy FromKilocaloriesPerKelvin(double kilocaloriesperkelvin) { - double value = (double) kilocaloriesperkelvin; - return new Entropy(value, EntropyUnit.KilocaloriePerKelvin); + return new Entropy(kilocaloriesperkelvin, EntropyUnit.KilocaloriePerKelvin); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Entropy FromKilojoulesPerDegreeCelsius(QuantityValue kilojoulesperdegreecelsius) + public static Entropy FromKilojoulesPerDegreeCelsius(double kilojoulesperdegreecelsius) { - double value = (double) kilojoulesperdegreecelsius; - return new Entropy(value, EntropyUnit.KilojoulePerDegreeCelsius); + return new Entropy(kilojoulesperdegreecelsius, EntropyUnit.KilojoulePerDegreeCelsius); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Entropy FromKilojoulesPerKelvin(QuantityValue kilojoulesperkelvin) + public static Entropy FromKilojoulesPerKelvin(double kilojoulesperkelvin) { - double value = (double) kilojoulesperkelvin; - return new Entropy(value, EntropyUnit.KilojoulePerKelvin); + return new Entropy(kilojoulesperkelvin, EntropyUnit.KilojoulePerKelvin); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Entropy FromMegajoulesPerKelvin(QuantityValue megajoulesperkelvin) + public static Entropy FromMegajoulesPerKelvin(double megajoulesperkelvin) { - double value = (double) megajoulesperkelvin; - return new Entropy(value, EntropyUnit.MegajoulePerKelvin); + return new Entropy(megajoulesperkelvin, 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..8e0d17e118 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,150 +348,135 @@ 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 decanewtons) { - double value = (double) decanewtons; - return new Force(value, ForceUnit.Decanewton); + return new Force(decanewtons, ForceUnit.Decanewton); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Force FromDyne(QuantityValue dyne) + public static Force FromDyne(double dyne) { - double value = (double) dyne; - return new Force(value, ForceUnit.Dyn); + return new Force(dyne, ForceUnit.Dyn); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Force FromKilogramsForce(QuantityValue kilogramsforce) + public static Force FromKilogramsForce(double kilogramsforce) { - double value = (double) kilogramsforce; - return new Force(value, ForceUnit.KilogramForce); + return new Force(kilogramsforce, ForceUnit.KilogramForce); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Force FromKilonewtons(QuantityValue kilonewtons) + public static Force FromKilonewtons(double kilonewtons) { - double value = (double) kilonewtons; - return new Force(value, ForceUnit.Kilonewton); + return new Force(kilonewtons, ForceUnit.Kilonewton); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Force FromKiloPonds(QuantityValue kiloponds) + public static Force FromKiloPonds(double kiloponds) { - double value = (double) kiloponds; - return new Force(value, ForceUnit.KiloPond); + return new Force(kiloponds, ForceUnit.KiloPond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Force FromKilopoundsForce(QuantityValue kilopoundsforce) + public static Force FromKilopoundsForce(double kilopoundsforce) { - double value = (double) kilopoundsforce; - return new Force(value, ForceUnit.KilopoundForce); + return new Force(kilopoundsforce, ForceUnit.KilopoundForce); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Force FromMeganewtons(QuantityValue meganewtons) + public static Force FromMeganewtons(double meganewtons) { - double value = (double) meganewtons; - return new Force(value, ForceUnit.Meganewton); + return new Force(meganewtons, ForceUnit.Meganewton); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Force FromMicronewtons(QuantityValue micronewtons) + public static Force FromMicronewtons(double micronewtons) { - double value = (double) micronewtons; - return new Force(value, ForceUnit.Micronewton); + return new Force(micronewtons, ForceUnit.Micronewton); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Force FromMillinewtons(QuantityValue millinewtons) + public static Force FromMillinewtons(double millinewtons) { - double value = (double) millinewtons; - return new Force(value, ForceUnit.Millinewton); + return new Force(millinewtons, ForceUnit.Millinewton); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Force FromNewtons(QuantityValue newtons) + public static Force FromNewtons(double newtons) { - double value = (double) newtons; - return new Force(value, ForceUnit.Newton); + return new Force(newtons, ForceUnit.Newton); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Force FromOunceForce(QuantityValue ounceforce) + public static Force FromOunceForce(double ounceforce) { - double value = (double) ounceforce; - return new Force(value, ForceUnit.OunceForce); + return new Force(ounceforce, ForceUnit.OunceForce); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Force FromPoundals(QuantityValue poundals) + public static Force FromPoundals(double poundals) { - double value = (double) poundals; - return new Force(value, ForceUnit.Poundal); + return new Force(poundals, ForceUnit.Poundal); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Force FromPoundsForce(QuantityValue poundsforce) + public static Force FromPoundsForce(double poundsforce) { - double value = (double) poundsforce; - return new Force(value, ForceUnit.PoundForce); + return new Force(poundsforce, ForceUnit.PoundForce); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Force FromShortTonsForce(QuantityValue shorttonsforce) + public static Force FromShortTonsForce(double shorttonsforce) { - double value = (double) shorttonsforce; - return new Force(value, ForceUnit.ShortTonForce); + return new Force(shorttonsforce, ForceUnit.ShortTonForce); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Force FromTonnesForce(QuantityValue tonnesforce) + public static Force FromTonnesForce(double tonnesforce) { - double value = (double) tonnesforce; - return new Force(value, ForceUnit.TonneForce); + return new Force(tonnesforce, 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..63b0c2a3cc 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,150 +340,135 @@ 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 centinewtonspersecond) { - double value = (double) centinewtonspersecond; - return new ForceChangeRate(value, ForceChangeRateUnit.CentinewtonPerSecond); + return new ForceChangeRate(centinewtonspersecond, ForceChangeRateUnit.CentinewtonPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForceChangeRate FromDecanewtonsPerMinute(QuantityValue decanewtonsperminute) + public static ForceChangeRate FromDecanewtonsPerMinute(double decanewtonsperminute) { - double value = (double) decanewtonsperminute; - return new ForceChangeRate(value, ForceChangeRateUnit.DecanewtonPerMinute); + return new ForceChangeRate(decanewtonsperminute, ForceChangeRateUnit.DecanewtonPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForceChangeRate FromDecanewtonsPerSecond(QuantityValue decanewtonspersecond) + public static ForceChangeRate FromDecanewtonsPerSecond(double decanewtonspersecond) { - double value = (double) decanewtonspersecond; - return new ForceChangeRate(value, ForceChangeRateUnit.DecanewtonPerSecond); + return new ForceChangeRate(decanewtonspersecond, ForceChangeRateUnit.DecanewtonPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForceChangeRate FromDecinewtonsPerSecond(QuantityValue decinewtonspersecond) + public static ForceChangeRate FromDecinewtonsPerSecond(double decinewtonspersecond) { - double value = (double) decinewtonspersecond; - return new ForceChangeRate(value, ForceChangeRateUnit.DecinewtonPerSecond); + return new ForceChangeRate(decinewtonspersecond, ForceChangeRateUnit.DecinewtonPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForceChangeRate FromKilonewtonsPerMinute(QuantityValue kilonewtonsperminute) + public static ForceChangeRate FromKilonewtonsPerMinute(double kilonewtonsperminute) { - double value = (double) kilonewtonsperminute; - return new ForceChangeRate(value, ForceChangeRateUnit.KilonewtonPerMinute); + return new ForceChangeRate(kilonewtonsperminute, ForceChangeRateUnit.KilonewtonPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForceChangeRate FromKilonewtonsPerSecond(QuantityValue kilonewtonspersecond) + public static ForceChangeRate FromKilonewtonsPerSecond(double kilonewtonspersecond) { - double value = (double) kilonewtonspersecond; - return new ForceChangeRate(value, ForceChangeRateUnit.KilonewtonPerSecond); + return new ForceChangeRate(kilonewtonspersecond, ForceChangeRateUnit.KilonewtonPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForceChangeRate FromKilopoundsForcePerMinute(QuantityValue kilopoundsforceperminute) + public static ForceChangeRate FromKilopoundsForcePerMinute(double kilopoundsforceperminute) { - double value = (double) kilopoundsforceperminute; - return new ForceChangeRate(value, ForceChangeRateUnit.KilopoundForcePerMinute); + return new ForceChangeRate(kilopoundsforceperminute, ForceChangeRateUnit.KilopoundForcePerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForceChangeRate FromKilopoundsForcePerSecond(QuantityValue kilopoundsforcepersecond) + public static ForceChangeRate FromKilopoundsForcePerSecond(double kilopoundsforcepersecond) { - double value = (double) kilopoundsforcepersecond; - return new ForceChangeRate(value, ForceChangeRateUnit.KilopoundForcePerSecond); + return new ForceChangeRate(kilopoundsforcepersecond, ForceChangeRateUnit.KilopoundForcePerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForceChangeRate FromMicronewtonsPerSecond(QuantityValue micronewtonspersecond) + public static ForceChangeRate FromMicronewtonsPerSecond(double micronewtonspersecond) { - double value = (double) micronewtonspersecond; - return new ForceChangeRate(value, ForceChangeRateUnit.MicronewtonPerSecond); + return new ForceChangeRate(micronewtonspersecond, ForceChangeRateUnit.MicronewtonPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForceChangeRate FromMillinewtonsPerSecond(QuantityValue millinewtonspersecond) + public static ForceChangeRate FromMillinewtonsPerSecond(double millinewtonspersecond) { - double value = (double) millinewtonspersecond; - return new ForceChangeRate(value, ForceChangeRateUnit.MillinewtonPerSecond); + return new ForceChangeRate(millinewtonspersecond, ForceChangeRateUnit.MillinewtonPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForceChangeRate FromNanonewtonsPerSecond(QuantityValue nanonewtonspersecond) + public static ForceChangeRate FromNanonewtonsPerSecond(double nanonewtonspersecond) { - double value = (double) nanonewtonspersecond; - return new ForceChangeRate(value, ForceChangeRateUnit.NanonewtonPerSecond); + return new ForceChangeRate(nanonewtonspersecond, ForceChangeRateUnit.NanonewtonPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForceChangeRate FromNewtonsPerMinute(QuantityValue newtonsperminute) + public static ForceChangeRate FromNewtonsPerMinute(double newtonsperminute) { - double value = (double) newtonsperminute; - return new ForceChangeRate(value, ForceChangeRateUnit.NewtonPerMinute); + return new ForceChangeRate(newtonsperminute, ForceChangeRateUnit.NewtonPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForceChangeRate FromNewtonsPerSecond(QuantityValue newtonspersecond) + public static ForceChangeRate FromNewtonsPerSecond(double newtonspersecond) { - double value = (double) newtonspersecond; - return new ForceChangeRate(value, ForceChangeRateUnit.NewtonPerSecond); + return new ForceChangeRate(newtonspersecond, ForceChangeRateUnit.NewtonPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForceChangeRate FromPoundsForcePerMinute(QuantityValue poundsforceperminute) + public static ForceChangeRate FromPoundsForcePerMinute(double poundsforceperminute) { - double value = (double) poundsforceperminute; - return new ForceChangeRate(value, ForceChangeRateUnit.PoundForcePerMinute); + return new ForceChangeRate(poundsforceperminute, ForceChangeRateUnit.PoundForcePerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForceChangeRate FromPoundsForcePerSecond(QuantityValue poundsforcepersecond) + public static ForceChangeRate FromPoundsForcePerSecond(double poundsforcepersecond) { - double value = (double) poundsforcepersecond; - return new ForceChangeRate(value, ForceChangeRateUnit.PoundForcePerSecond); + return new ForceChangeRate(poundsforcepersecond, 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..ccb2a8f698 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,380 +527,342 @@ 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 centinewtonspercentimeter) { - double value = (double) centinewtonspercentimeter; - return new ForcePerLength(value, ForcePerLengthUnit.CentinewtonPerCentimeter); + return new ForcePerLength(centinewtonspercentimeter, ForcePerLengthUnit.CentinewtonPerCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromCentinewtonsPerMeter(QuantityValue centinewtonspermeter) + public static ForcePerLength FromCentinewtonsPerMeter(double centinewtonspermeter) { - double value = (double) centinewtonspermeter; - return new ForcePerLength(value, ForcePerLengthUnit.CentinewtonPerMeter); + return new ForcePerLength(centinewtonspermeter, ForcePerLengthUnit.CentinewtonPerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromCentinewtonsPerMillimeter(QuantityValue centinewtonspermillimeter) + public static ForcePerLength FromCentinewtonsPerMillimeter(double centinewtonspermillimeter) { - double value = (double) centinewtonspermillimeter; - return new ForcePerLength(value, ForcePerLengthUnit.CentinewtonPerMillimeter); + return new ForcePerLength(centinewtonspermillimeter, ForcePerLengthUnit.CentinewtonPerMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromDecanewtonsPerCentimeter(QuantityValue decanewtonspercentimeter) + public static ForcePerLength FromDecanewtonsPerCentimeter(double decanewtonspercentimeter) { - double value = (double) decanewtonspercentimeter; - return new ForcePerLength(value, ForcePerLengthUnit.DecanewtonPerCentimeter); + return new ForcePerLength(decanewtonspercentimeter, ForcePerLengthUnit.DecanewtonPerCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromDecanewtonsPerMeter(QuantityValue decanewtonspermeter) + public static ForcePerLength FromDecanewtonsPerMeter(double decanewtonspermeter) { - double value = (double) decanewtonspermeter; - return new ForcePerLength(value, ForcePerLengthUnit.DecanewtonPerMeter); + return new ForcePerLength(decanewtonspermeter, ForcePerLengthUnit.DecanewtonPerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromDecanewtonsPerMillimeter(QuantityValue decanewtonspermillimeter) + public static ForcePerLength FromDecanewtonsPerMillimeter(double decanewtonspermillimeter) { - double value = (double) decanewtonspermillimeter; - return new ForcePerLength(value, ForcePerLengthUnit.DecanewtonPerMillimeter); + return new ForcePerLength(decanewtonspermillimeter, ForcePerLengthUnit.DecanewtonPerMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromDecinewtonsPerCentimeter(QuantityValue decinewtonspercentimeter) + public static ForcePerLength FromDecinewtonsPerCentimeter(double decinewtonspercentimeter) { - double value = (double) decinewtonspercentimeter; - return new ForcePerLength(value, ForcePerLengthUnit.DecinewtonPerCentimeter); + return new ForcePerLength(decinewtonspercentimeter, ForcePerLengthUnit.DecinewtonPerCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromDecinewtonsPerMeter(QuantityValue decinewtonspermeter) + public static ForcePerLength FromDecinewtonsPerMeter(double decinewtonspermeter) { - double value = (double) decinewtonspermeter; - return new ForcePerLength(value, ForcePerLengthUnit.DecinewtonPerMeter); + return new ForcePerLength(decinewtonspermeter, ForcePerLengthUnit.DecinewtonPerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromDecinewtonsPerMillimeter(QuantityValue decinewtonspermillimeter) + public static ForcePerLength FromDecinewtonsPerMillimeter(double decinewtonspermillimeter) { - double value = (double) decinewtonspermillimeter; - return new ForcePerLength(value, ForcePerLengthUnit.DecinewtonPerMillimeter); + return new ForcePerLength(decinewtonspermillimeter, ForcePerLengthUnit.DecinewtonPerMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromKilogramsForcePerCentimeter(QuantityValue kilogramsforcepercentimeter) + public static ForcePerLength FromKilogramsForcePerCentimeter(double kilogramsforcepercentimeter) { - double value = (double) kilogramsforcepercentimeter; - return new ForcePerLength(value, ForcePerLengthUnit.KilogramForcePerCentimeter); + return new ForcePerLength(kilogramsforcepercentimeter, ForcePerLengthUnit.KilogramForcePerCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromKilogramsForcePerMeter(QuantityValue kilogramsforcepermeter) + public static ForcePerLength FromKilogramsForcePerMeter(double kilogramsforcepermeter) { - double value = (double) kilogramsforcepermeter; - return new ForcePerLength(value, ForcePerLengthUnit.KilogramForcePerMeter); + return new ForcePerLength(kilogramsforcepermeter, ForcePerLengthUnit.KilogramForcePerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromKilogramsForcePerMillimeter(QuantityValue kilogramsforcepermillimeter) + public static ForcePerLength FromKilogramsForcePerMillimeter(double kilogramsforcepermillimeter) { - double value = (double) kilogramsforcepermillimeter; - return new ForcePerLength(value, ForcePerLengthUnit.KilogramForcePerMillimeter); + return new ForcePerLength(kilogramsforcepermillimeter, ForcePerLengthUnit.KilogramForcePerMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromKilonewtonsPerCentimeter(QuantityValue kilonewtonspercentimeter) + public static ForcePerLength FromKilonewtonsPerCentimeter(double kilonewtonspercentimeter) { - double value = (double) kilonewtonspercentimeter; - return new ForcePerLength(value, ForcePerLengthUnit.KilonewtonPerCentimeter); + return new ForcePerLength(kilonewtonspercentimeter, ForcePerLengthUnit.KilonewtonPerCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromKilonewtonsPerMeter(QuantityValue kilonewtonspermeter) + public static ForcePerLength FromKilonewtonsPerMeter(double kilonewtonspermeter) { - double value = (double) kilonewtonspermeter; - return new ForcePerLength(value, ForcePerLengthUnit.KilonewtonPerMeter); + return new ForcePerLength(kilonewtonspermeter, ForcePerLengthUnit.KilonewtonPerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromKilonewtonsPerMillimeter(QuantityValue kilonewtonspermillimeter) + public static ForcePerLength FromKilonewtonsPerMillimeter(double kilonewtonspermillimeter) { - double value = (double) kilonewtonspermillimeter; - return new ForcePerLength(value, ForcePerLengthUnit.KilonewtonPerMillimeter); + return new ForcePerLength(kilonewtonspermillimeter, ForcePerLengthUnit.KilonewtonPerMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromKilopoundsForcePerFoot(QuantityValue kilopoundsforceperfoot) + public static ForcePerLength FromKilopoundsForcePerFoot(double kilopoundsforceperfoot) { - double value = (double) kilopoundsforceperfoot; - return new ForcePerLength(value, ForcePerLengthUnit.KilopoundForcePerFoot); + return new ForcePerLength(kilopoundsforceperfoot, ForcePerLengthUnit.KilopoundForcePerFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromKilopoundsForcePerInch(QuantityValue kilopoundsforceperinch) + public static ForcePerLength FromKilopoundsForcePerInch(double kilopoundsforceperinch) { - double value = (double) kilopoundsforceperinch; - return new ForcePerLength(value, ForcePerLengthUnit.KilopoundForcePerInch); + return new ForcePerLength(kilopoundsforceperinch, ForcePerLengthUnit.KilopoundForcePerInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromMeganewtonsPerCentimeter(QuantityValue meganewtonspercentimeter) + public static ForcePerLength FromMeganewtonsPerCentimeter(double meganewtonspercentimeter) { - double value = (double) meganewtonspercentimeter; - return new ForcePerLength(value, ForcePerLengthUnit.MeganewtonPerCentimeter); + return new ForcePerLength(meganewtonspercentimeter, ForcePerLengthUnit.MeganewtonPerCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromMeganewtonsPerMeter(QuantityValue meganewtonspermeter) + public static ForcePerLength FromMeganewtonsPerMeter(double meganewtonspermeter) { - double value = (double) meganewtonspermeter; - return new ForcePerLength(value, ForcePerLengthUnit.MeganewtonPerMeter); + return new ForcePerLength(meganewtonspermeter, ForcePerLengthUnit.MeganewtonPerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromMeganewtonsPerMillimeter(QuantityValue meganewtonspermillimeter) + public static ForcePerLength FromMeganewtonsPerMillimeter(double meganewtonspermillimeter) { - double value = (double) meganewtonspermillimeter; - return new ForcePerLength(value, ForcePerLengthUnit.MeganewtonPerMillimeter); + return new ForcePerLength(meganewtonspermillimeter, ForcePerLengthUnit.MeganewtonPerMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromMicronewtonsPerCentimeter(QuantityValue micronewtonspercentimeter) + public static ForcePerLength FromMicronewtonsPerCentimeter(double micronewtonspercentimeter) { - double value = (double) micronewtonspercentimeter; - return new ForcePerLength(value, ForcePerLengthUnit.MicronewtonPerCentimeter); + return new ForcePerLength(micronewtonspercentimeter, ForcePerLengthUnit.MicronewtonPerCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromMicronewtonsPerMeter(QuantityValue micronewtonspermeter) + public static ForcePerLength FromMicronewtonsPerMeter(double micronewtonspermeter) { - double value = (double) micronewtonspermeter; - return new ForcePerLength(value, ForcePerLengthUnit.MicronewtonPerMeter); + return new ForcePerLength(micronewtonspermeter, ForcePerLengthUnit.MicronewtonPerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromMicronewtonsPerMillimeter(QuantityValue micronewtonspermillimeter) + public static ForcePerLength FromMicronewtonsPerMillimeter(double micronewtonspermillimeter) { - double value = (double) micronewtonspermillimeter; - return new ForcePerLength(value, ForcePerLengthUnit.MicronewtonPerMillimeter); + return new ForcePerLength(micronewtonspermillimeter, ForcePerLengthUnit.MicronewtonPerMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromMillinewtonsPerCentimeter(QuantityValue millinewtonspercentimeter) + public static ForcePerLength FromMillinewtonsPerCentimeter(double millinewtonspercentimeter) { - double value = (double) millinewtonspercentimeter; - return new ForcePerLength(value, ForcePerLengthUnit.MillinewtonPerCentimeter); + return new ForcePerLength(millinewtonspercentimeter, ForcePerLengthUnit.MillinewtonPerCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromMillinewtonsPerMeter(QuantityValue millinewtonspermeter) + public static ForcePerLength FromMillinewtonsPerMeter(double millinewtonspermeter) { - double value = (double) millinewtonspermeter; - return new ForcePerLength(value, ForcePerLengthUnit.MillinewtonPerMeter); + return new ForcePerLength(millinewtonspermeter, ForcePerLengthUnit.MillinewtonPerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromMillinewtonsPerMillimeter(QuantityValue millinewtonspermillimeter) + public static ForcePerLength FromMillinewtonsPerMillimeter(double millinewtonspermillimeter) { - double value = (double) millinewtonspermillimeter; - return new ForcePerLength(value, ForcePerLengthUnit.MillinewtonPerMillimeter); + return new ForcePerLength(millinewtonspermillimeter, ForcePerLengthUnit.MillinewtonPerMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromNanonewtonsPerCentimeter(QuantityValue nanonewtonspercentimeter) + public static ForcePerLength FromNanonewtonsPerCentimeter(double nanonewtonspercentimeter) { - double value = (double) nanonewtonspercentimeter; - return new ForcePerLength(value, ForcePerLengthUnit.NanonewtonPerCentimeter); + return new ForcePerLength(nanonewtonspercentimeter, ForcePerLengthUnit.NanonewtonPerCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromNanonewtonsPerMeter(QuantityValue nanonewtonspermeter) + public static ForcePerLength FromNanonewtonsPerMeter(double nanonewtonspermeter) { - double value = (double) nanonewtonspermeter; - return new ForcePerLength(value, ForcePerLengthUnit.NanonewtonPerMeter); + return new ForcePerLength(nanonewtonspermeter, ForcePerLengthUnit.NanonewtonPerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromNanonewtonsPerMillimeter(QuantityValue nanonewtonspermillimeter) + public static ForcePerLength FromNanonewtonsPerMillimeter(double nanonewtonspermillimeter) { - double value = (double) nanonewtonspermillimeter; - return new ForcePerLength(value, ForcePerLengthUnit.NanonewtonPerMillimeter); + return new ForcePerLength(nanonewtonspermillimeter, ForcePerLengthUnit.NanonewtonPerMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromNewtonsPerCentimeter(QuantityValue newtonspercentimeter) + public static ForcePerLength FromNewtonsPerCentimeter(double newtonspercentimeter) { - double value = (double) newtonspercentimeter; - return new ForcePerLength(value, ForcePerLengthUnit.NewtonPerCentimeter); + return new ForcePerLength(newtonspercentimeter, ForcePerLengthUnit.NewtonPerCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromNewtonsPerMeter(QuantityValue newtonspermeter) + public static ForcePerLength FromNewtonsPerMeter(double newtonspermeter) { - double value = (double) newtonspermeter; - return new ForcePerLength(value, ForcePerLengthUnit.NewtonPerMeter); + return new ForcePerLength(newtonspermeter, ForcePerLengthUnit.NewtonPerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromNewtonsPerMillimeter(QuantityValue newtonspermillimeter) + public static ForcePerLength FromNewtonsPerMillimeter(double newtonspermillimeter) { - double value = (double) newtonspermillimeter; - return new ForcePerLength(value, ForcePerLengthUnit.NewtonPerMillimeter); + return new ForcePerLength(newtonspermillimeter, ForcePerLengthUnit.NewtonPerMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromPoundsForcePerFoot(QuantityValue poundsforceperfoot) + public static ForcePerLength FromPoundsForcePerFoot(double poundsforceperfoot) { - double value = (double) poundsforceperfoot; - return new ForcePerLength(value, ForcePerLengthUnit.PoundForcePerFoot); + return new ForcePerLength(poundsforceperfoot, ForcePerLengthUnit.PoundForcePerFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromPoundsForcePerInch(QuantityValue poundsforceperinch) + public static ForcePerLength FromPoundsForcePerInch(double poundsforceperinch) { - double value = (double) poundsforceperinch; - return new ForcePerLength(value, ForcePerLengthUnit.PoundForcePerInch); + return new ForcePerLength(poundsforceperinch, ForcePerLengthUnit.PoundForcePerInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromPoundsForcePerYard(QuantityValue poundsforceperyard) + public static ForcePerLength FromPoundsForcePerYard(double poundsforceperyard) { - double value = (double) poundsforceperyard; - return new ForcePerLength(value, ForcePerLengthUnit.PoundForcePerYard); + return new ForcePerLength(poundsforceperyard, ForcePerLengthUnit.PoundForcePerYard); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromTonnesForcePerCentimeter(QuantityValue tonnesforcepercentimeter) + public static ForcePerLength FromTonnesForcePerCentimeter(double tonnesforcepercentimeter) { - double value = (double) tonnesforcepercentimeter; - return new ForcePerLength(value, ForcePerLengthUnit.TonneForcePerCentimeter); + return new ForcePerLength(tonnesforcepercentimeter, ForcePerLengthUnit.TonneForcePerCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromTonnesForcePerMeter(QuantityValue tonnesforcepermeter) + public static ForcePerLength FromTonnesForcePerMeter(double tonnesforcepermeter) { - double value = (double) tonnesforcepermeter; - return new ForcePerLength(value, ForcePerLengthUnit.TonneForcePerMeter); + return new ForcePerLength(tonnesforcepermeter, ForcePerLengthUnit.TonneForcePerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromTonnesForcePerMillimeter(QuantityValue tonnesforcepermillimeter) + public static ForcePerLength FromTonnesForcePerMillimeter(double tonnesforcepermillimeter) { - double value = (double) tonnesforcepermillimeter; - return new ForcePerLength(value, ForcePerLengthUnit.TonneForcePerMillimeter); + return new ForcePerLength(tonnesforcepermillimeter, 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..49aa24a00a 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,130 +323,117 @@ 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 beatsperminute) { - double value = (double) beatsperminute; - return new Frequency(value, FrequencyUnit.BeatPerMinute); + return new Frequency(beatsperminute, FrequencyUnit.BeatPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Frequency FromBUnits(QuantityValue bunits) + public static Frequency FromBUnits(double bunits) { - double value = (double) bunits; - return new Frequency(value, FrequencyUnit.BUnit); + return new Frequency(bunits, FrequencyUnit.BUnit); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Frequency FromCyclesPerHour(QuantityValue cyclesperhour) + public static Frequency FromCyclesPerHour(double cyclesperhour) { - double value = (double) cyclesperhour; - return new Frequency(value, FrequencyUnit.CyclePerHour); + return new Frequency(cyclesperhour, FrequencyUnit.CyclePerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Frequency FromCyclesPerMinute(QuantityValue cyclesperminute) + public static Frequency FromCyclesPerMinute(double cyclesperminute) { - double value = (double) cyclesperminute; - return new Frequency(value, FrequencyUnit.CyclePerMinute); + return new Frequency(cyclesperminute, FrequencyUnit.CyclePerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Frequency FromGigahertz(QuantityValue gigahertz) + public static Frequency FromGigahertz(double gigahertz) { - double value = (double) gigahertz; - return new Frequency(value, FrequencyUnit.Gigahertz); + return new Frequency(gigahertz, FrequencyUnit.Gigahertz); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Frequency FromHertz(QuantityValue hertz) + public static Frequency FromHertz(double hertz) { - double value = (double) hertz; - return new Frequency(value, FrequencyUnit.Hertz); + return new Frequency(hertz, FrequencyUnit.Hertz); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Frequency FromKilohertz(QuantityValue kilohertz) + public static Frequency FromKilohertz(double kilohertz) { - double value = (double) kilohertz; - return new Frequency(value, FrequencyUnit.Kilohertz); + return new Frequency(kilohertz, FrequencyUnit.Kilohertz); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Frequency FromMegahertz(QuantityValue megahertz) + public static Frequency FromMegahertz(double megahertz) { - double value = (double) megahertz; - return new Frequency(value, FrequencyUnit.Megahertz); + return new Frequency(megahertz, FrequencyUnit.Megahertz); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Frequency FromMicrohertz(QuantityValue microhertz) + public static Frequency FromMicrohertz(double microhertz) { - double value = (double) microhertz; - return new Frequency(value, FrequencyUnit.Microhertz); + return new Frequency(microhertz, FrequencyUnit.Microhertz); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Frequency FromMillihertz(QuantityValue millihertz) + public static Frequency FromMillihertz(double millihertz) { - double value = (double) millihertz; - return new Frequency(value, FrequencyUnit.Millihertz); + return new Frequency(millihertz, FrequencyUnit.Millihertz); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Frequency FromPerSecond(QuantityValue persecond) + public static Frequency FromPerSecond(double persecond) { - double value = (double) persecond; - return new Frequency(value, FrequencyUnit.PerSecond); + return new Frequency(persecond, FrequencyUnit.PerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Frequency FromRadiansPerSecond(QuantityValue radianspersecond) + public static Frequency FromRadiansPerSecond(double radianspersecond) { - double value = (double) radianspersecond; - return new Frequency(value, FrequencyUnit.RadianPerSecond); + return new Frequency(radianspersecond, FrequencyUnit.RadianPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Frequency FromTerahertz(QuantityValue terahertz) + public static Frequency FromTerahertz(double terahertz) { - double value = (double) terahertz; - return new Frequency(value, FrequencyUnit.Terahertz); + return new Frequency(terahertz, 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..cd57722a34 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,40 +248,36 @@ 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 kilometersperliter) { - double value = (double) kilometersperliter; - return new FuelEfficiency(value, FuelEfficiencyUnit.KilometerPerLiter); + return new FuelEfficiency(kilometersperliter, FuelEfficiencyUnit.KilometerPerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static FuelEfficiency FromLitersPer100Kilometers(QuantityValue litersper100kilometers) + public static FuelEfficiency FromLitersPer100Kilometers(double litersper100kilometers) { - double value = (double) litersper100kilometers; - return new FuelEfficiency(value, FuelEfficiencyUnit.LiterPer100Kilometers); + return new FuelEfficiency(litersper100kilometers, FuelEfficiencyUnit.LiterPer100Kilometers); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static FuelEfficiency FromMilesPerUkGallon(QuantityValue milesperukgallon) + public static FuelEfficiency FromMilesPerUkGallon(double milesperukgallon) { - double value = (double) milesperukgallon; - return new FuelEfficiency(value, FuelEfficiencyUnit.MilePerUkGallon); + return new FuelEfficiency(milesperukgallon, FuelEfficiencyUnit.MilePerUkGallon); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static FuelEfficiency FromMilesPerUsGallon(QuantityValue milesperusgallon) + public static FuelEfficiency FromMilesPerUsGallon(double milesperusgallon) { - double value = (double) milesperusgallon; - return new FuelEfficiency(value, FuelEfficiencyUnit.MilePerUsGallon); + return new FuelEfficiency(milesperusgallon, 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..577af9701d 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,180 +363,162 @@ 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 btusperhoursquarefoot) { - double value = (double) btusperhoursquarefoot; - return new HeatFlux(value, HeatFluxUnit.BtuPerHourSquareFoot); + return new HeatFlux(btusperhoursquarefoot, HeatFluxUnit.BtuPerHourSquareFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static HeatFlux FromBtusPerMinuteSquareFoot(QuantityValue btusperminutesquarefoot) + public static HeatFlux FromBtusPerMinuteSquareFoot(double btusperminutesquarefoot) { - double value = (double) btusperminutesquarefoot; - return new HeatFlux(value, HeatFluxUnit.BtuPerMinuteSquareFoot); + return new HeatFlux(btusperminutesquarefoot, HeatFluxUnit.BtuPerMinuteSquareFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static HeatFlux FromBtusPerSecondSquareFoot(QuantityValue btuspersecondsquarefoot) + public static HeatFlux FromBtusPerSecondSquareFoot(double btuspersecondsquarefoot) { - double value = (double) btuspersecondsquarefoot; - return new HeatFlux(value, HeatFluxUnit.BtuPerSecondSquareFoot); + return new HeatFlux(btuspersecondsquarefoot, HeatFluxUnit.BtuPerSecondSquareFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static HeatFlux FromBtusPerSecondSquareInch(QuantityValue btuspersecondsquareinch) + public static HeatFlux FromBtusPerSecondSquareInch(double btuspersecondsquareinch) { - double value = (double) btuspersecondsquareinch; - return new HeatFlux(value, HeatFluxUnit.BtuPerSecondSquareInch); + return new HeatFlux(btuspersecondsquareinch, HeatFluxUnit.BtuPerSecondSquareInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static HeatFlux FromCaloriesPerSecondSquareCentimeter(QuantityValue caloriespersecondsquarecentimeter) + public static HeatFlux FromCaloriesPerSecondSquareCentimeter(double caloriespersecondsquarecentimeter) { - double value = (double) caloriespersecondsquarecentimeter; - return new HeatFlux(value, HeatFluxUnit.CaloriePerSecondSquareCentimeter); + return new HeatFlux(caloriespersecondsquarecentimeter, HeatFluxUnit.CaloriePerSecondSquareCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static HeatFlux FromCentiwattsPerSquareMeter(QuantityValue centiwattspersquaremeter) + public static HeatFlux FromCentiwattsPerSquareMeter(double centiwattspersquaremeter) { - double value = (double) centiwattspersquaremeter; - return new HeatFlux(value, HeatFluxUnit.CentiwattPerSquareMeter); + return new HeatFlux(centiwattspersquaremeter, HeatFluxUnit.CentiwattPerSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static HeatFlux FromDeciwattsPerSquareMeter(QuantityValue deciwattspersquaremeter) + public static HeatFlux FromDeciwattsPerSquareMeter(double deciwattspersquaremeter) { - double value = (double) deciwattspersquaremeter; - return new HeatFlux(value, HeatFluxUnit.DeciwattPerSquareMeter); + return new HeatFlux(deciwattspersquaremeter, HeatFluxUnit.DeciwattPerSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static HeatFlux FromKilocaloriesPerHourSquareMeter(QuantityValue kilocaloriesperhoursquaremeter) + public static HeatFlux FromKilocaloriesPerHourSquareMeter(double kilocaloriesperhoursquaremeter) { - double value = (double) kilocaloriesperhoursquaremeter; - return new HeatFlux(value, HeatFluxUnit.KilocaloriePerHourSquareMeter); + return new HeatFlux(kilocaloriesperhoursquaremeter, HeatFluxUnit.KilocaloriePerHourSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static HeatFlux FromKilocaloriesPerSecondSquareCentimeter(QuantityValue kilocaloriespersecondsquarecentimeter) + public static HeatFlux FromKilocaloriesPerSecondSquareCentimeter(double kilocaloriespersecondsquarecentimeter) { - double value = (double) kilocaloriespersecondsquarecentimeter; - return new HeatFlux(value, HeatFluxUnit.KilocaloriePerSecondSquareCentimeter); + return new HeatFlux(kilocaloriespersecondsquarecentimeter, HeatFluxUnit.KilocaloriePerSecondSquareCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static HeatFlux FromKilowattsPerSquareMeter(QuantityValue kilowattspersquaremeter) + public static HeatFlux FromKilowattsPerSquareMeter(double kilowattspersquaremeter) { - double value = (double) kilowattspersquaremeter; - return new HeatFlux(value, HeatFluxUnit.KilowattPerSquareMeter); + return new HeatFlux(kilowattspersquaremeter, HeatFluxUnit.KilowattPerSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static HeatFlux FromMicrowattsPerSquareMeter(QuantityValue microwattspersquaremeter) + public static HeatFlux FromMicrowattsPerSquareMeter(double microwattspersquaremeter) { - double value = (double) microwattspersquaremeter; - return new HeatFlux(value, HeatFluxUnit.MicrowattPerSquareMeter); + return new HeatFlux(microwattspersquaremeter, HeatFluxUnit.MicrowattPerSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static HeatFlux FromMilliwattsPerSquareMeter(QuantityValue milliwattspersquaremeter) + public static HeatFlux FromMilliwattsPerSquareMeter(double milliwattspersquaremeter) { - double value = (double) milliwattspersquaremeter; - return new HeatFlux(value, HeatFluxUnit.MilliwattPerSquareMeter); + return new HeatFlux(milliwattspersquaremeter, HeatFluxUnit.MilliwattPerSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static HeatFlux FromNanowattsPerSquareMeter(QuantityValue nanowattspersquaremeter) + public static HeatFlux FromNanowattsPerSquareMeter(double nanowattspersquaremeter) { - double value = (double) nanowattspersquaremeter; - return new HeatFlux(value, HeatFluxUnit.NanowattPerSquareMeter); + return new HeatFlux(nanowattspersquaremeter, HeatFluxUnit.NanowattPerSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static HeatFlux FromPoundsForcePerFootSecond(QuantityValue poundsforceperfootsecond) + public static HeatFlux FromPoundsForcePerFootSecond(double poundsforceperfootsecond) { - double value = (double) poundsforceperfootsecond; - return new HeatFlux(value, HeatFluxUnit.PoundForcePerFootSecond); + return new HeatFlux(poundsforceperfootsecond, HeatFluxUnit.PoundForcePerFootSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static HeatFlux FromPoundsPerSecondCubed(QuantityValue poundspersecondcubed) + public static HeatFlux FromPoundsPerSecondCubed(double poundspersecondcubed) { - double value = (double) poundspersecondcubed; - return new HeatFlux(value, HeatFluxUnit.PoundPerSecondCubed); + return new HeatFlux(poundspersecondcubed, HeatFluxUnit.PoundPerSecondCubed); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static HeatFlux FromWattsPerSquareFoot(QuantityValue wattspersquarefoot) + public static HeatFlux FromWattsPerSquareFoot(double wattspersquarefoot) { - double value = (double) wattspersquarefoot; - return new HeatFlux(value, HeatFluxUnit.WattPerSquareFoot); + return new HeatFlux(wattspersquarefoot, HeatFluxUnit.WattPerSquareFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static HeatFlux FromWattsPerSquareInch(QuantityValue wattspersquareinch) + public static HeatFlux FromWattsPerSquareInch(double wattspersquareinch) { - double value = (double) wattspersquareinch; - return new HeatFlux(value, HeatFluxUnit.WattPerSquareInch); + return new HeatFlux(wattspersquareinch, HeatFluxUnit.WattPerSquareInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static HeatFlux FromWattsPerSquareMeter(QuantityValue wattspersquaremeter) + public static HeatFlux FromWattsPerSquareMeter(double wattspersquaremeter) { - double value = (double) wattspersquaremeter; - return new HeatFlux(value, HeatFluxUnit.WattPerSquareMeter); + return new HeatFlux(wattspersquaremeter, 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..1c8b3d95f0 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,10 +262,9 @@ 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 btusperhoursquarefootdegreefahrenheit) { - double value = (double) btusperhoursquarefootdegreefahrenheit; - return new HeatTransferCoefficient(value, HeatTransferCoefficientUnit.BtuPerHourSquareFootDegreeFahrenheit); + return new HeatTransferCoefficient(btusperhoursquarefootdegreefahrenheit, HeatTransferCoefficientUnit.BtuPerHourSquareFootDegreeFahrenheit); } /// @@ -273,50 +272,45 @@ 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 btuspersquarefootdegreefahrenheit) { - double value = (double) btuspersquarefootdegreefahrenheit; - return new HeatTransferCoefficient(value, HeatTransferCoefficientUnit.BtuPerSquareFootDegreeFahrenheit); + return new HeatTransferCoefficient(btuspersquarefootdegreefahrenheit, HeatTransferCoefficientUnit.BtuPerSquareFootDegreeFahrenheit); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static HeatTransferCoefficient FromCaloriesPerHourSquareMeterDegreeCelsius(QuantityValue caloriesperhoursquaremeterdegreecelsius) + public static HeatTransferCoefficient FromCaloriesPerHourSquareMeterDegreeCelsius(double caloriesperhoursquaremeterdegreecelsius) { - double value = (double) caloriesperhoursquaremeterdegreecelsius; - return new HeatTransferCoefficient(value, HeatTransferCoefficientUnit.CaloriePerHourSquareMeterDegreeCelsius); + return new HeatTransferCoefficient(caloriesperhoursquaremeterdegreecelsius, HeatTransferCoefficientUnit.CaloriePerHourSquareMeterDegreeCelsius); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static HeatTransferCoefficient FromKilocaloriesPerHourSquareMeterDegreeCelsius(QuantityValue kilocaloriesperhoursquaremeterdegreecelsius) + public static HeatTransferCoefficient FromKilocaloriesPerHourSquareMeterDegreeCelsius(double kilocaloriesperhoursquaremeterdegreecelsius) { - double value = (double) kilocaloriesperhoursquaremeterdegreecelsius; - return new HeatTransferCoefficient(value, HeatTransferCoefficientUnit.KilocaloriePerHourSquareMeterDegreeCelsius); + return new HeatTransferCoefficient(kilocaloriesperhoursquaremeterdegreecelsius, HeatTransferCoefficientUnit.KilocaloriePerHourSquareMeterDegreeCelsius); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static HeatTransferCoefficient FromWattsPerSquareMeterCelsius(QuantityValue wattspersquaremetercelsius) + public static HeatTransferCoefficient FromWattsPerSquareMeterCelsius(double wattspersquaremetercelsius) { - double value = (double) wattspersquaremetercelsius; - return new HeatTransferCoefficient(value, HeatTransferCoefficientUnit.WattPerSquareMeterCelsius); + return new HeatTransferCoefficient(wattspersquaremetercelsius, HeatTransferCoefficientUnit.WattPerSquareMeterCelsius); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static HeatTransferCoefficient FromWattsPerSquareMeterKelvin(QuantityValue wattspersquaremeterkelvin) + public static HeatTransferCoefficient FromWattsPerSquareMeterKelvin(double wattspersquaremeterkelvin) { - double value = (double) wattspersquaremeterkelvin; - return new HeatTransferCoefficient(value, HeatTransferCoefficientUnit.WattPerSquareMeterKelvin); + return new HeatTransferCoefficient(wattspersquaremeterkelvin, 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..c35b8a1fe1 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,40 +248,36 @@ 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 kilolux) { - double value = (double) kilolux; - return new Illuminance(value, IlluminanceUnit.Kilolux); + return new Illuminance(kilolux, IlluminanceUnit.Kilolux); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Illuminance FromLux(QuantityValue lux) + public static Illuminance FromLux(double lux) { - double value = (double) lux; - return new Illuminance(value, IlluminanceUnit.Lux); + return new Illuminance(lux, IlluminanceUnit.Lux); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Illuminance FromMegalux(QuantityValue megalux) + public static Illuminance FromMegalux(double megalux) { - double value = (double) megalux; - return new Illuminance(value, IlluminanceUnit.Megalux); + return new Illuminance(megalux, IlluminanceUnit.Megalux); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Illuminance FromMillilux(QuantityValue millilux) + public static Illuminance FromMillilux(double millilux) { - double value = (double) millilux; - return new Illuminance(value, IlluminanceUnit.Millilux); + return new Illuminance(millilux, 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..4981926abc 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,130 +317,117 @@ 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 centinewtonseconds) { - double value = (double) centinewtonseconds; - return new Impulse(value, ImpulseUnit.CentinewtonSecond); + return new Impulse(centinewtonseconds, ImpulseUnit.CentinewtonSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Impulse FromDecanewtonSeconds(QuantityValue decanewtonseconds) + public static Impulse FromDecanewtonSeconds(double decanewtonseconds) { - double value = (double) decanewtonseconds; - return new Impulse(value, ImpulseUnit.DecanewtonSecond); + return new Impulse(decanewtonseconds, ImpulseUnit.DecanewtonSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Impulse FromDecinewtonSeconds(QuantityValue decinewtonseconds) + public static Impulse FromDecinewtonSeconds(double decinewtonseconds) { - double value = (double) decinewtonseconds; - return new Impulse(value, ImpulseUnit.DecinewtonSecond); + return new Impulse(decinewtonseconds, ImpulseUnit.DecinewtonSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Impulse FromKilogramMetersPerSecond(QuantityValue kilogrammeterspersecond) + public static Impulse FromKilogramMetersPerSecond(double kilogrammeterspersecond) { - double value = (double) kilogrammeterspersecond; - return new Impulse(value, ImpulseUnit.KilogramMeterPerSecond); + return new Impulse(kilogrammeterspersecond, ImpulseUnit.KilogramMeterPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Impulse FromKilonewtonSeconds(QuantityValue kilonewtonseconds) + public static Impulse FromKilonewtonSeconds(double kilonewtonseconds) { - double value = (double) kilonewtonseconds; - return new Impulse(value, ImpulseUnit.KilonewtonSecond); + return new Impulse(kilonewtonseconds, ImpulseUnit.KilonewtonSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Impulse FromMeganewtonSeconds(QuantityValue meganewtonseconds) + public static Impulse FromMeganewtonSeconds(double meganewtonseconds) { - double value = (double) meganewtonseconds; - return new Impulse(value, ImpulseUnit.MeganewtonSecond); + return new Impulse(meganewtonseconds, ImpulseUnit.MeganewtonSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Impulse FromMicronewtonSeconds(QuantityValue micronewtonseconds) + public static Impulse FromMicronewtonSeconds(double micronewtonseconds) { - double value = (double) micronewtonseconds; - return new Impulse(value, ImpulseUnit.MicronewtonSecond); + return new Impulse(micronewtonseconds, ImpulseUnit.MicronewtonSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Impulse FromMillinewtonSeconds(QuantityValue millinewtonseconds) + public static Impulse FromMillinewtonSeconds(double millinewtonseconds) { - double value = (double) millinewtonseconds; - return new Impulse(value, ImpulseUnit.MillinewtonSecond); + return new Impulse(millinewtonseconds, ImpulseUnit.MillinewtonSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Impulse FromNanonewtonSeconds(QuantityValue nanonewtonseconds) + public static Impulse FromNanonewtonSeconds(double nanonewtonseconds) { - double value = (double) nanonewtonseconds; - return new Impulse(value, ImpulseUnit.NanonewtonSecond); + return new Impulse(nanonewtonseconds, ImpulseUnit.NanonewtonSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Impulse FromNewtonSeconds(QuantityValue newtonseconds) + public static Impulse FromNewtonSeconds(double newtonseconds) { - double value = (double) newtonseconds; - return new Impulse(value, ImpulseUnit.NewtonSecond); + return new Impulse(newtonseconds, ImpulseUnit.NewtonSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Impulse FromPoundFeetPerSecond(QuantityValue poundfeetpersecond) + public static Impulse FromPoundFeetPerSecond(double poundfeetpersecond) { - double value = (double) poundfeetpersecond; - return new Impulse(value, ImpulseUnit.PoundFootPerSecond); + return new Impulse(poundfeetpersecond, ImpulseUnit.PoundFootPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Impulse FromPoundForceSeconds(QuantityValue poundforceseconds) + public static Impulse FromPoundForceSeconds(double poundforceseconds) { - double value = (double) poundforceseconds; - return new Impulse(value, ImpulseUnit.PoundForceSecond); + return new Impulse(poundforceseconds, ImpulseUnit.PoundForceSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Impulse FromSlugFeetPerSecond(QuantityValue slugfeetpersecond) + public static Impulse FromSlugFeetPerSecond(double slugfeetpersecond) { - double value = (double) slugfeetpersecond; - return new Impulse(value, ImpulseUnit.SlugFootPerSecond); + return new Impulse(slugfeetpersecond, 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..892c978953 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,260 +421,234 @@ 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 bits) { - double value = (double) bits; - return new Information(value, InformationUnit.Bit); + return new Information(bits, InformationUnit.Bit); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Information FromBytes(QuantityValue bytes) + public static Information FromBytes(double bytes) { - double value = (double) bytes; - return new Information(value, InformationUnit.Byte); + return new Information(bytes, InformationUnit.Byte); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Information FromExabits(QuantityValue exabits) + public static Information FromExabits(double exabits) { - double value = (double) exabits; - return new Information(value, InformationUnit.Exabit); + return new Information(exabits, InformationUnit.Exabit); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Information FromExabytes(QuantityValue exabytes) + public static Information FromExabytes(double exabytes) { - double value = (double) exabytes; - return new Information(value, InformationUnit.Exabyte); + return new Information(exabytes, InformationUnit.Exabyte); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Information FromExbibits(QuantityValue exbibits) + public static Information FromExbibits(double exbibits) { - double value = (double) exbibits; - return new Information(value, InformationUnit.Exbibit); + return new Information(exbibits, InformationUnit.Exbibit); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Information FromExbibytes(QuantityValue exbibytes) + public static Information FromExbibytes(double exbibytes) { - double value = (double) exbibytes; - return new Information(value, InformationUnit.Exbibyte); + return new Information(exbibytes, InformationUnit.Exbibyte); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Information FromGibibits(QuantityValue gibibits) + public static Information FromGibibits(double gibibits) { - double value = (double) gibibits; - return new Information(value, InformationUnit.Gibibit); + return new Information(gibibits, InformationUnit.Gibibit); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Information FromGibibytes(QuantityValue gibibytes) + public static Information FromGibibytes(double gibibytes) { - double value = (double) gibibytes; - return new Information(value, InformationUnit.Gibibyte); + return new Information(gibibytes, InformationUnit.Gibibyte); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Information FromGigabits(QuantityValue gigabits) + public static Information FromGigabits(double gigabits) { - double value = (double) gigabits; - return new Information(value, InformationUnit.Gigabit); + return new Information(gigabits, InformationUnit.Gigabit); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Information FromGigabytes(QuantityValue gigabytes) + public static Information FromGigabytes(double gigabytes) { - double value = (double) gigabytes; - return new Information(value, InformationUnit.Gigabyte); + return new Information(gigabytes, InformationUnit.Gigabyte); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Information FromKibibits(QuantityValue kibibits) + public static Information FromKibibits(double kibibits) { - double value = (double) kibibits; - return new Information(value, InformationUnit.Kibibit); + return new Information(kibibits, InformationUnit.Kibibit); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Information FromKibibytes(QuantityValue kibibytes) + public static Information FromKibibytes(double kibibytes) { - double value = (double) kibibytes; - return new Information(value, InformationUnit.Kibibyte); + return new Information(kibibytes, InformationUnit.Kibibyte); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Information FromKilobits(QuantityValue kilobits) + public static Information FromKilobits(double kilobits) { - double value = (double) kilobits; - return new Information(value, InformationUnit.Kilobit); + return new Information(kilobits, InformationUnit.Kilobit); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Information FromKilobytes(QuantityValue kilobytes) + public static Information FromKilobytes(double kilobytes) { - double value = (double) kilobytes; - return new Information(value, InformationUnit.Kilobyte); + return new Information(kilobytes, InformationUnit.Kilobyte); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Information FromMebibits(QuantityValue mebibits) + public static Information FromMebibits(double mebibits) { - double value = (double) mebibits; - return new Information(value, InformationUnit.Mebibit); + return new Information(mebibits, InformationUnit.Mebibit); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Information FromMebibytes(QuantityValue mebibytes) + public static Information FromMebibytes(double mebibytes) { - double value = (double) mebibytes; - return new Information(value, InformationUnit.Mebibyte); + return new Information(mebibytes, InformationUnit.Mebibyte); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Information FromMegabits(QuantityValue megabits) + public static Information FromMegabits(double megabits) { - double value = (double) megabits; - return new Information(value, InformationUnit.Megabit); + return new Information(megabits, InformationUnit.Megabit); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Information FromMegabytes(QuantityValue megabytes) + public static Information FromMegabytes(double megabytes) { - double value = (double) megabytes; - return new Information(value, InformationUnit.Megabyte); + return new Information(megabytes, InformationUnit.Megabyte); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Information FromPebibits(QuantityValue pebibits) + public static Information FromPebibits(double pebibits) { - double value = (double) pebibits; - return new Information(value, InformationUnit.Pebibit); + return new Information(pebibits, InformationUnit.Pebibit); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Information FromPebibytes(QuantityValue pebibytes) + public static Information FromPebibytes(double pebibytes) { - double value = (double) pebibytes; - return new Information(value, InformationUnit.Pebibyte); + return new Information(pebibytes, InformationUnit.Pebibyte); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Information FromPetabits(QuantityValue petabits) + public static Information FromPetabits(double petabits) { - double value = (double) petabits; - return new Information(value, InformationUnit.Petabit); + return new Information(petabits, InformationUnit.Petabit); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Information FromPetabytes(QuantityValue petabytes) + public static Information FromPetabytes(double petabytes) { - double value = (double) petabytes; - return new Information(value, InformationUnit.Petabyte); + return new Information(petabytes, InformationUnit.Petabyte); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Information FromTebibits(QuantityValue tebibits) + public static Information FromTebibits(double tebibits) { - double value = (double) tebibits; - return new Information(value, InformationUnit.Tebibit); + return new Information(tebibits, InformationUnit.Tebibit); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Information FromTebibytes(QuantityValue tebibytes) + public static Information FromTebibytes(double tebibytes) { - double value = (double) tebibytes; - return new Information(value, InformationUnit.Tebibyte); + return new Information(tebibytes, InformationUnit.Tebibyte); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Information FromTerabits(QuantityValue terabits) + public static Information FromTerabits(double terabits) { - double value = (double) terabits; - return new Information(value, InformationUnit.Terabit); + return new Information(terabits, InformationUnit.Terabit); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Information FromTerabytes(QuantityValue terabytes) + public static Information FromTerabytes(double terabytes) { - double value = (double) terabytes; - return new Information(value, InformationUnit.Terabyte); + return new Information(terabytes, 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..fa1233967f 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,140 +325,126 @@ 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 kilowattspersquarecentimeter) { - double value = (double) kilowattspersquarecentimeter; - return new Irradiance(value, IrradianceUnit.KilowattPerSquareCentimeter); + return new Irradiance(kilowattspersquarecentimeter, IrradianceUnit.KilowattPerSquareCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Irradiance FromKilowattsPerSquareMeter(QuantityValue kilowattspersquaremeter) + public static Irradiance FromKilowattsPerSquareMeter(double kilowattspersquaremeter) { - double value = (double) kilowattspersquaremeter; - return new Irradiance(value, IrradianceUnit.KilowattPerSquareMeter); + return new Irradiance(kilowattspersquaremeter, IrradianceUnit.KilowattPerSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Irradiance FromMegawattsPerSquareCentimeter(QuantityValue megawattspersquarecentimeter) + public static Irradiance FromMegawattsPerSquareCentimeter(double megawattspersquarecentimeter) { - double value = (double) megawattspersquarecentimeter; - return new Irradiance(value, IrradianceUnit.MegawattPerSquareCentimeter); + return new Irradiance(megawattspersquarecentimeter, IrradianceUnit.MegawattPerSquareCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Irradiance FromMegawattsPerSquareMeter(QuantityValue megawattspersquaremeter) + public static Irradiance FromMegawattsPerSquareMeter(double megawattspersquaremeter) { - double value = (double) megawattspersquaremeter; - return new Irradiance(value, IrradianceUnit.MegawattPerSquareMeter); + return new Irradiance(megawattspersquaremeter, IrradianceUnit.MegawattPerSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Irradiance FromMicrowattsPerSquareCentimeter(QuantityValue microwattspersquarecentimeter) + public static Irradiance FromMicrowattsPerSquareCentimeter(double microwattspersquarecentimeter) { - double value = (double) microwattspersquarecentimeter; - return new Irradiance(value, IrradianceUnit.MicrowattPerSquareCentimeter); + return new Irradiance(microwattspersquarecentimeter, IrradianceUnit.MicrowattPerSquareCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Irradiance FromMicrowattsPerSquareMeter(QuantityValue microwattspersquaremeter) + public static Irradiance FromMicrowattsPerSquareMeter(double microwattspersquaremeter) { - double value = (double) microwattspersquaremeter; - return new Irradiance(value, IrradianceUnit.MicrowattPerSquareMeter); + return new Irradiance(microwattspersquaremeter, IrradianceUnit.MicrowattPerSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Irradiance FromMilliwattsPerSquareCentimeter(QuantityValue milliwattspersquarecentimeter) + public static Irradiance FromMilliwattsPerSquareCentimeter(double milliwattspersquarecentimeter) { - double value = (double) milliwattspersquarecentimeter; - return new Irradiance(value, IrradianceUnit.MilliwattPerSquareCentimeter); + return new Irradiance(milliwattspersquarecentimeter, IrradianceUnit.MilliwattPerSquareCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Irradiance FromMilliwattsPerSquareMeter(QuantityValue milliwattspersquaremeter) + public static Irradiance FromMilliwattsPerSquareMeter(double milliwattspersquaremeter) { - double value = (double) milliwattspersquaremeter; - return new Irradiance(value, IrradianceUnit.MilliwattPerSquareMeter); + return new Irradiance(milliwattspersquaremeter, IrradianceUnit.MilliwattPerSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Irradiance FromNanowattsPerSquareCentimeter(QuantityValue nanowattspersquarecentimeter) + public static Irradiance FromNanowattsPerSquareCentimeter(double nanowattspersquarecentimeter) { - double value = (double) nanowattspersquarecentimeter; - return new Irradiance(value, IrradianceUnit.NanowattPerSquareCentimeter); + return new Irradiance(nanowattspersquarecentimeter, IrradianceUnit.NanowattPerSquareCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Irradiance FromNanowattsPerSquareMeter(QuantityValue nanowattspersquaremeter) + public static Irradiance FromNanowattsPerSquareMeter(double nanowattspersquaremeter) { - double value = (double) nanowattspersquaremeter; - return new Irradiance(value, IrradianceUnit.NanowattPerSquareMeter); + return new Irradiance(nanowattspersquaremeter, IrradianceUnit.NanowattPerSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Irradiance FromPicowattsPerSquareCentimeter(QuantityValue picowattspersquarecentimeter) + public static Irradiance FromPicowattsPerSquareCentimeter(double picowattspersquarecentimeter) { - double value = (double) picowattspersquarecentimeter; - return new Irradiance(value, IrradianceUnit.PicowattPerSquareCentimeter); + return new Irradiance(picowattspersquarecentimeter, IrradianceUnit.PicowattPerSquareCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Irradiance FromPicowattsPerSquareMeter(QuantityValue picowattspersquaremeter) + public static Irradiance FromPicowattsPerSquareMeter(double picowattspersquaremeter) { - double value = (double) picowattspersquaremeter; - return new Irradiance(value, IrradianceUnit.PicowattPerSquareMeter); + return new Irradiance(picowattspersquaremeter, IrradianceUnit.PicowattPerSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Irradiance FromWattsPerSquareCentimeter(QuantityValue wattspersquarecentimeter) + public static Irradiance FromWattsPerSquareCentimeter(double wattspersquarecentimeter) { - double value = (double) wattspersquarecentimeter; - return new Irradiance(value, IrradianceUnit.WattPerSquareCentimeter); + return new Irradiance(wattspersquarecentimeter, IrradianceUnit.WattPerSquareCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Irradiance FromWattsPerSquareMeter(QuantityValue wattspersquaremeter) + public static Irradiance FromWattsPerSquareMeter(double wattspersquaremeter) { - double value = (double) wattspersquaremeter; - return new Irradiance(value, IrradianceUnit.WattPerSquareMeter); + return new Irradiance(wattspersquaremeter, 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..9d294e4e23 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,70 +272,63 @@ 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 joulespersquarecentimeter) { - double value = (double) joulespersquarecentimeter; - return new Irradiation(value, IrradiationUnit.JoulePerSquareCentimeter); + return new Irradiation(joulespersquarecentimeter, IrradiationUnit.JoulePerSquareCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Irradiation FromJoulesPerSquareMeter(QuantityValue joulespersquaremeter) + public static Irradiation FromJoulesPerSquareMeter(double joulespersquaremeter) { - double value = (double) joulespersquaremeter; - return new Irradiation(value, IrradiationUnit.JoulePerSquareMeter); + return new Irradiation(joulespersquaremeter, IrradiationUnit.JoulePerSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Irradiation FromJoulesPerSquareMillimeter(QuantityValue joulespersquaremillimeter) + public static Irradiation FromJoulesPerSquareMillimeter(double joulespersquaremillimeter) { - double value = (double) joulespersquaremillimeter; - return new Irradiation(value, IrradiationUnit.JoulePerSquareMillimeter); + return new Irradiation(joulespersquaremillimeter, IrradiationUnit.JoulePerSquareMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Irradiation FromKilojoulesPerSquareMeter(QuantityValue kilojoulespersquaremeter) + public static Irradiation FromKilojoulesPerSquareMeter(double kilojoulespersquaremeter) { - double value = (double) kilojoulespersquaremeter; - return new Irradiation(value, IrradiationUnit.KilojoulePerSquareMeter); + return new Irradiation(kilojoulespersquaremeter, IrradiationUnit.KilojoulePerSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Irradiation FromKilowattHoursPerSquareMeter(QuantityValue kilowatthourspersquaremeter) + public static Irradiation FromKilowattHoursPerSquareMeter(double kilowatthourspersquaremeter) { - double value = (double) kilowatthourspersquaremeter; - return new Irradiation(value, IrradiationUnit.KilowattHourPerSquareMeter); + return new Irradiation(kilowatthourspersquaremeter, IrradiationUnit.KilowattHourPerSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Irradiation FromMillijoulesPerSquareCentimeter(QuantityValue millijoulespersquarecentimeter) + public static Irradiation FromMillijoulesPerSquareCentimeter(double millijoulespersquarecentimeter) { - double value = (double) millijoulespersquarecentimeter; - return new Irradiation(value, IrradiationUnit.MillijoulePerSquareCentimeter); + return new Irradiation(millijoulespersquarecentimeter, IrradiationUnit.MillijoulePerSquareCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Irradiation FromWattHoursPerSquareMeter(QuantityValue watthourspersquaremeter) + public static Irradiation FromWattHoursPerSquareMeter(double watthourspersquaremeter) { - double value = (double) watthourspersquaremeter; - return new Irradiation(value, IrradiationUnit.WattHourPerSquareMeter); + return new Irradiation(watthourspersquaremeter, 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..473fb34652 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,110 +301,99 @@ 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 centimeterspersecondcubed) { - double value = (double) centimeterspersecondcubed; - return new Jerk(value, JerkUnit.CentimeterPerSecondCubed); + return new Jerk(centimeterspersecondcubed, JerkUnit.CentimeterPerSecondCubed); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Jerk FromDecimetersPerSecondCubed(QuantityValue decimeterspersecondcubed) + public static Jerk FromDecimetersPerSecondCubed(double decimeterspersecondcubed) { - double value = (double) decimeterspersecondcubed; - return new Jerk(value, JerkUnit.DecimeterPerSecondCubed); + return new Jerk(decimeterspersecondcubed, JerkUnit.DecimeterPerSecondCubed); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Jerk FromFeetPerSecondCubed(QuantityValue feetpersecondcubed) + public static Jerk FromFeetPerSecondCubed(double feetpersecondcubed) { - double value = (double) feetpersecondcubed; - return new Jerk(value, JerkUnit.FootPerSecondCubed); + return new Jerk(feetpersecondcubed, JerkUnit.FootPerSecondCubed); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Jerk FromInchesPerSecondCubed(QuantityValue inchespersecondcubed) + public static Jerk FromInchesPerSecondCubed(double inchespersecondcubed) { - double value = (double) inchespersecondcubed; - return new Jerk(value, JerkUnit.InchPerSecondCubed); + return new Jerk(inchespersecondcubed, JerkUnit.InchPerSecondCubed); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Jerk FromKilometersPerSecondCubed(QuantityValue kilometerspersecondcubed) + public static Jerk FromKilometersPerSecondCubed(double kilometerspersecondcubed) { - double value = (double) kilometerspersecondcubed; - return new Jerk(value, JerkUnit.KilometerPerSecondCubed); + return new Jerk(kilometerspersecondcubed, JerkUnit.KilometerPerSecondCubed); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Jerk FromMetersPerSecondCubed(QuantityValue meterspersecondcubed) + public static Jerk FromMetersPerSecondCubed(double meterspersecondcubed) { - double value = (double) meterspersecondcubed; - return new Jerk(value, JerkUnit.MeterPerSecondCubed); + return new Jerk(meterspersecondcubed, JerkUnit.MeterPerSecondCubed); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Jerk FromMicrometersPerSecondCubed(QuantityValue micrometerspersecondcubed) + public static Jerk FromMicrometersPerSecondCubed(double micrometerspersecondcubed) { - double value = (double) micrometerspersecondcubed; - return new Jerk(value, JerkUnit.MicrometerPerSecondCubed); + return new Jerk(micrometerspersecondcubed, JerkUnit.MicrometerPerSecondCubed); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Jerk FromMillimetersPerSecondCubed(QuantityValue millimeterspersecondcubed) + public static Jerk FromMillimetersPerSecondCubed(double millimeterspersecondcubed) { - double value = (double) millimeterspersecondcubed; - return new Jerk(value, JerkUnit.MillimeterPerSecondCubed); + return new Jerk(millimeterspersecondcubed, JerkUnit.MillimeterPerSecondCubed); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Jerk FromMillistandardGravitiesPerSecond(QuantityValue millistandardgravitiespersecond) + public static Jerk FromMillistandardGravitiesPerSecond(double millistandardgravitiespersecond) { - double value = (double) millistandardgravitiespersecond; - return new Jerk(value, JerkUnit.MillistandardGravitiesPerSecond); + return new Jerk(millistandardgravitiespersecond, JerkUnit.MillistandardGravitiesPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Jerk FromNanometersPerSecondCubed(QuantityValue nanometerspersecondcubed) + public static Jerk FromNanometersPerSecondCubed(double nanometerspersecondcubed) { - double value = (double) nanometerspersecondcubed; - return new Jerk(value, JerkUnit.NanometerPerSecondCubed); + return new Jerk(nanometerspersecondcubed, JerkUnit.NanometerPerSecondCubed); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Jerk FromStandardGravitiesPerSecond(QuantityValue standardgravitiespersecond) + public static Jerk FromStandardGravitiesPerSecond(double standardgravitiespersecond) { - double value = (double) standardgravitiespersecond; - return new Jerk(value, JerkUnit.StandardGravitiesPerSecond); + return new Jerk(standardgravitiespersecond, 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..0988035e9f 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,90 +297,81 @@ 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 centistokes) { - double value = (double) centistokes; - return new KinematicViscosity(value, KinematicViscosityUnit.Centistokes); + return new KinematicViscosity(centistokes, KinematicViscosityUnit.Centistokes); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static KinematicViscosity FromDecistokes(QuantityValue decistokes) + public static KinematicViscosity FromDecistokes(double decistokes) { - double value = (double) decistokes; - return new KinematicViscosity(value, KinematicViscosityUnit.Decistokes); + return new KinematicViscosity(decistokes, KinematicViscosityUnit.Decistokes); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static KinematicViscosity FromKilostokes(QuantityValue kilostokes) + public static KinematicViscosity FromKilostokes(double kilostokes) { - double value = (double) kilostokes; - return new KinematicViscosity(value, KinematicViscosityUnit.Kilostokes); + return new KinematicViscosity(kilostokes, KinematicViscosityUnit.Kilostokes); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static KinematicViscosity FromMicrostokes(QuantityValue microstokes) + public static KinematicViscosity FromMicrostokes(double microstokes) { - double value = (double) microstokes; - return new KinematicViscosity(value, KinematicViscosityUnit.Microstokes); + return new KinematicViscosity(microstokes, KinematicViscosityUnit.Microstokes); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static KinematicViscosity FromMillistokes(QuantityValue millistokes) + public static KinematicViscosity FromMillistokes(double millistokes) { - double value = (double) millistokes; - return new KinematicViscosity(value, KinematicViscosityUnit.Millistokes); + return new KinematicViscosity(millistokes, KinematicViscosityUnit.Millistokes); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static KinematicViscosity FromNanostokes(QuantityValue nanostokes) + public static KinematicViscosity FromNanostokes(double nanostokes) { - double value = (double) nanostokes; - return new KinematicViscosity(value, KinematicViscosityUnit.Nanostokes); + return new KinematicViscosity(nanostokes, KinematicViscosityUnit.Nanostokes); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static KinematicViscosity FromSquareFeetPerSecond(QuantityValue squarefeetpersecond) + public static KinematicViscosity FromSquareFeetPerSecond(double squarefeetpersecond) { - double value = (double) squarefeetpersecond; - return new KinematicViscosity(value, KinematicViscosityUnit.SquareFootPerSecond); + return new KinematicViscosity(squarefeetpersecond, KinematicViscosityUnit.SquareFootPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static KinematicViscosity FromSquareMetersPerSecond(QuantityValue squaremeterspersecond) + public static KinematicViscosity FromSquareMetersPerSecond(double squaremeterspersecond) { - double value = (double) squaremeterspersecond; - return new KinematicViscosity(value, KinematicViscosityUnit.SquareMeterPerSecond); + return new KinematicViscosity(squaremeterspersecond, KinematicViscosityUnit.SquareMeterPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static KinematicViscosity FromStokes(QuantityValue stokes) + public static KinematicViscosity FromStokes(double stokes) { - double value = (double) stokes; - return new KinematicViscosity(value, KinematicViscosityUnit.Stokes); + return new KinematicViscosity(stokes, 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..0c6ea0fdfe 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,30 +240,27 @@ 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 millibarliterspersecond) { - double value = (double) millibarliterspersecond; - return new LeakRate(value, LeakRateUnit.MillibarLiterPerSecond); + return new LeakRate(millibarliterspersecond, LeakRateUnit.MillibarLiterPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static LeakRate FromPascalCubicMetersPerSecond(QuantityValue pascalcubicmeterspersecond) + public static LeakRate FromPascalCubicMetersPerSecond(double pascalcubicmeterspersecond) { - double value = (double) pascalcubicmeterspersecond; - return new LeakRate(value, LeakRateUnit.PascalCubicMeterPerSecond); + return new LeakRate(pascalcubicmeterspersecond, LeakRateUnit.PascalCubicMeterPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static LeakRate FromTorrLitersPerSecond(QuantityValue torrliterspersecond) + public static LeakRate FromTorrLitersPerSecond(double torrliterspersecond) { - double value = (double) torrliterspersecond; - return new LeakRate(value, LeakRateUnit.TorrLiterPerSecond); + return new LeakRate(torrliterspersecond, 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..0a6d1841dd 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,420 +566,378 @@ 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 angstroms) { - double value = (double) angstroms; - return new Length(value, LengthUnit.Angstrom); + return new Length(angstroms, LengthUnit.Angstrom); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromAstronomicalUnits(QuantityValue astronomicalunits) + public static Length FromAstronomicalUnits(double astronomicalunits) { - double value = (double) astronomicalunits; - return new Length(value, LengthUnit.AstronomicalUnit); + return new Length(astronomicalunits, LengthUnit.AstronomicalUnit); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromCentimeters(QuantityValue centimeters) + public static Length FromCentimeters(double centimeters) { - double value = (double) centimeters; - return new Length(value, LengthUnit.Centimeter); + return new Length(centimeters, LengthUnit.Centimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromChains(QuantityValue chains) + public static Length FromChains(double chains) { - double value = (double) chains; - return new Length(value, LengthUnit.Chain); + return new Length(chains, LengthUnit.Chain); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromDataMiles(QuantityValue datamiles) + public static Length FromDataMiles(double datamiles) { - double value = (double) datamiles; - return new Length(value, LengthUnit.DataMile); + return new Length(datamiles, LengthUnit.DataMile); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromDecameters(QuantityValue decameters) + public static Length FromDecameters(double decameters) { - double value = (double) decameters; - return new Length(value, LengthUnit.Decameter); + return new Length(decameters, LengthUnit.Decameter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromDecimeters(QuantityValue decimeters) + public static Length FromDecimeters(double decimeters) { - double value = (double) decimeters; - return new Length(value, LengthUnit.Decimeter); + return new Length(decimeters, LengthUnit.Decimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromDtpPicas(QuantityValue dtppicas) + public static Length FromDtpPicas(double dtppicas) { - double value = (double) dtppicas; - return new Length(value, LengthUnit.DtpPica); + return new Length(dtppicas, LengthUnit.DtpPica); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromDtpPoints(QuantityValue dtppoints) + public static Length FromDtpPoints(double dtppoints) { - double value = (double) dtppoints; - return new Length(value, LengthUnit.DtpPoint); + return new Length(dtppoints, LengthUnit.DtpPoint); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromFathoms(QuantityValue fathoms) + public static Length FromFathoms(double fathoms) { - double value = (double) fathoms; - return new Length(value, LengthUnit.Fathom); + return new Length(fathoms, LengthUnit.Fathom); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromFemtometers(QuantityValue femtometers) + public static Length FromFemtometers(double femtometers) { - double value = (double) femtometers; - return new Length(value, LengthUnit.Femtometer); + return new Length(femtometers, LengthUnit.Femtometer); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromFeet(QuantityValue feet) + public static Length FromFeet(double feet) { - double value = (double) feet; - return new Length(value, LengthUnit.Foot); + return new Length(feet, LengthUnit.Foot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromGigameters(QuantityValue gigameters) + public static Length FromGigameters(double gigameters) { - double value = (double) gigameters; - return new Length(value, LengthUnit.Gigameter); + return new Length(gigameters, LengthUnit.Gigameter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromHands(QuantityValue hands) + public static Length FromHands(double hands) { - double value = (double) hands; - return new Length(value, LengthUnit.Hand); + return new Length(hands, LengthUnit.Hand); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromHectometers(QuantityValue hectometers) + public static Length FromHectometers(double hectometers) { - double value = (double) hectometers; - return new Length(value, LengthUnit.Hectometer); + return new Length(hectometers, LengthUnit.Hectometer); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromInches(QuantityValue inches) + public static Length FromInches(double inches) { - double value = (double) inches; - return new Length(value, LengthUnit.Inch); + return new Length(inches, LengthUnit.Inch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromKilofeet(QuantityValue kilofeet) + public static Length FromKilofeet(double kilofeet) { - double value = (double) kilofeet; - return new Length(value, LengthUnit.Kilofoot); + return new Length(kilofeet, LengthUnit.Kilofoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromKilolightYears(QuantityValue kilolightyears) + public static Length FromKilolightYears(double kilolightyears) { - double value = (double) kilolightyears; - return new Length(value, LengthUnit.KilolightYear); + return new Length(kilolightyears, LengthUnit.KilolightYear); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromKilometers(QuantityValue kilometers) + public static Length FromKilometers(double kilometers) { - double value = (double) kilometers; - return new Length(value, LengthUnit.Kilometer); + return new Length(kilometers, LengthUnit.Kilometer); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromKiloparsecs(QuantityValue kiloparsecs) + public static Length FromKiloparsecs(double kiloparsecs) { - double value = (double) kiloparsecs; - return new Length(value, LengthUnit.Kiloparsec); + return new Length(kiloparsecs, LengthUnit.Kiloparsec); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromKiloyards(QuantityValue kiloyards) + public static Length FromKiloyards(double kiloyards) { - double value = (double) kiloyards; - return new Length(value, LengthUnit.Kiloyard); + return new Length(kiloyards, LengthUnit.Kiloyard); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromLightYears(QuantityValue lightyears) + public static Length FromLightYears(double lightyears) { - double value = (double) lightyears; - return new Length(value, LengthUnit.LightYear); + return new Length(lightyears, LengthUnit.LightYear); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromMegalightYears(QuantityValue megalightyears) + public static Length FromMegalightYears(double megalightyears) { - double value = (double) megalightyears; - return new Length(value, LengthUnit.MegalightYear); + return new Length(megalightyears, LengthUnit.MegalightYear); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromMegameters(QuantityValue megameters) + public static Length FromMegameters(double megameters) { - double value = (double) megameters; - return new Length(value, LengthUnit.Megameter); + return new Length(megameters, LengthUnit.Megameter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromMegaparsecs(QuantityValue megaparsecs) + public static Length FromMegaparsecs(double megaparsecs) { - double value = (double) megaparsecs; - return new Length(value, LengthUnit.Megaparsec); + return new Length(megaparsecs, LengthUnit.Megaparsec); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromMeters(QuantityValue meters) + public static Length FromMeters(double meters) { - double value = (double) meters; - return new Length(value, LengthUnit.Meter); + return new Length(meters, LengthUnit.Meter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromMicroinches(QuantityValue microinches) + public static Length FromMicroinches(double microinches) { - double value = (double) microinches; - return new Length(value, LengthUnit.Microinch); + return new Length(microinches, LengthUnit.Microinch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromMicrometers(QuantityValue micrometers) + public static Length FromMicrometers(double micrometers) { - double value = (double) micrometers; - return new Length(value, LengthUnit.Micrometer); + return new Length(micrometers, LengthUnit.Micrometer); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromMils(QuantityValue mils) + public static Length FromMils(double mils) { - double value = (double) mils; - return new Length(value, LengthUnit.Mil); + return new Length(mils, LengthUnit.Mil); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromMiles(QuantityValue miles) + public static Length FromMiles(double miles) { - double value = (double) miles; - return new Length(value, LengthUnit.Mile); + return new Length(miles, LengthUnit.Mile); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromMillimeters(QuantityValue millimeters) + public static Length FromMillimeters(double millimeters) { - double value = (double) millimeters; - return new Length(value, LengthUnit.Millimeter); + return new Length(millimeters, LengthUnit.Millimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromNanometers(QuantityValue nanometers) + public static Length FromNanometers(double nanometers) { - double value = (double) nanometers; - return new Length(value, LengthUnit.Nanometer); + return new Length(nanometers, LengthUnit.Nanometer); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromNauticalMiles(QuantityValue nauticalmiles) + public static Length FromNauticalMiles(double nauticalmiles) { - double value = (double) nauticalmiles; - return new Length(value, LengthUnit.NauticalMile); + return new Length(nauticalmiles, LengthUnit.NauticalMile); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromParsecs(QuantityValue parsecs) + public static Length FromParsecs(double parsecs) { - double value = (double) parsecs; - return new Length(value, LengthUnit.Parsec); + return new Length(parsecs, LengthUnit.Parsec); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromPicometers(QuantityValue picometers) + public static Length FromPicometers(double picometers) { - double value = (double) picometers; - return new Length(value, LengthUnit.Picometer); + return new Length(picometers, LengthUnit.Picometer); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromPrinterPicas(QuantityValue printerpicas) + public static Length FromPrinterPicas(double printerpicas) { - double value = (double) printerpicas; - return new Length(value, LengthUnit.PrinterPica); + return new Length(printerpicas, LengthUnit.PrinterPica); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromPrinterPoints(QuantityValue printerpoints) + public static Length FromPrinterPoints(double printerpoints) { - double value = (double) printerpoints; - return new Length(value, LengthUnit.PrinterPoint); + return new Length(printerpoints, LengthUnit.PrinterPoint); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromShackles(QuantityValue shackles) + public static Length FromShackles(double shackles) { - double value = (double) shackles; - return new Length(value, LengthUnit.Shackle); + return new Length(shackles, LengthUnit.Shackle); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromSolarRadiuses(QuantityValue solarradiuses) + public static Length FromSolarRadiuses(double solarradiuses) { - double value = (double) solarradiuses; - return new Length(value, LengthUnit.SolarRadius); + return new Length(solarradiuses, LengthUnit.SolarRadius); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromTwips(QuantityValue twips) + public static Length FromTwips(double twips) { - double value = (double) twips; - return new Length(value, LengthUnit.Twip); + return new Length(twips, LengthUnit.Twip); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromUsSurveyFeet(QuantityValue ussurveyfeet) + public static Length FromUsSurveyFeet(double ussurveyfeet) { - double value = (double) ussurveyfeet; - return new Length(value, LengthUnit.UsSurveyFoot); + return new Length(ussurveyfeet, LengthUnit.UsSurveyFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromYards(QuantityValue yards) + public static Length FromYards(double yards) { - double value = (double) yards; - return new Length(value, LengthUnit.Yard); + return new Length(yards, 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..5343025e4f 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,20 +229,18 @@ 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 decibels) { - double value = (double) decibels; - return new Level(value, LevelUnit.Decibel); + return new Level(decibels, LevelUnit.Decibel); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Level FromNepers(QuantityValue nepers) + public static Level FromNepers(double nepers) { - double value = (double) nepers; - return new Level(value, LevelUnit.Neper); + return new Level(nepers, 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..d244dbf6d5 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,140 +336,126 @@ 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 gramspercentimeter) { - double value = (double) gramspercentimeter; - return new LinearDensity(value, LinearDensityUnit.GramPerCentimeter); + return new LinearDensity(gramspercentimeter, LinearDensityUnit.GramPerCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearDensity FromGramsPerMeter(QuantityValue gramspermeter) + public static LinearDensity FromGramsPerMeter(double gramspermeter) { - double value = (double) gramspermeter; - return new LinearDensity(value, LinearDensityUnit.GramPerMeter); + return new LinearDensity(gramspermeter, LinearDensityUnit.GramPerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearDensity FromGramsPerMillimeter(QuantityValue gramspermillimeter) + public static LinearDensity FromGramsPerMillimeter(double gramspermillimeter) { - double value = (double) gramspermillimeter; - return new LinearDensity(value, LinearDensityUnit.GramPerMillimeter); + return new LinearDensity(gramspermillimeter, LinearDensityUnit.GramPerMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearDensity FromKilogramsPerCentimeter(QuantityValue kilogramspercentimeter) + public static LinearDensity FromKilogramsPerCentimeter(double kilogramspercentimeter) { - double value = (double) kilogramspercentimeter; - return new LinearDensity(value, LinearDensityUnit.KilogramPerCentimeter); + return new LinearDensity(kilogramspercentimeter, LinearDensityUnit.KilogramPerCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearDensity FromKilogramsPerMeter(QuantityValue kilogramspermeter) + public static LinearDensity FromKilogramsPerMeter(double kilogramspermeter) { - double value = (double) kilogramspermeter; - return new LinearDensity(value, LinearDensityUnit.KilogramPerMeter); + return new LinearDensity(kilogramspermeter, LinearDensityUnit.KilogramPerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearDensity FromKilogramsPerMillimeter(QuantityValue kilogramspermillimeter) + public static LinearDensity FromKilogramsPerMillimeter(double kilogramspermillimeter) { - double value = (double) kilogramspermillimeter; - return new LinearDensity(value, LinearDensityUnit.KilogramPerMillimeter); + return new LinearDensity(kilogramspermillimeter, LinearDensityUnit.KilogramPerMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearDensity FromMicrogramsPerCentimeter(QuantityValue microgramspercentimeter) + public static LinearDensity FromMicrogramsPerCentimeter(double microgramspercentimeter) { - double value = (double) microgramspercentimeter; - return new LinearDensity(value, LinearDensityUnit.MicrogramPerCentimeter); + return new LinearDensity(microgramspercentimeter, LinearDensityUnit.MicrogramPerCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearDensity FromMicrogramsPerMeter(QuantityValue microgramspermeter) + public static LinearDensity FromMicrogramsPerMeter(double microgramspermeter) { - double value = (double) microgramspermeter; - return new LinearDensity(value, LinearDensityUnit.MicrogramPerMeter); + return new LinearDensity(microgramspermeter, LinearDensityUnit.MicrogramPerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearDensity FromMicrogramsPerMillimeter(QuantityValue microgramspermillimeter) + public static LinearDensity FromMicrogramsPerMillimeter(double microgramspermillimeter) { - double value = (double) microgramspermillimeter; - return new LinearDensity(value, LinearDensityUnit.MicrogramPerMillimeter); + return new LinearDensity(microgramspermillimeter, LinearDensityUnit.MicrogramPerMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearDensity FromMilligramsPerCentimeter(QuantityValue milligramspercentimeter) + public static LinearDensity FromMilligramsPerCentimeter(double milligramspercentimeter) { - double value = (double) milligramspercentimeter; - return new LinearDensity(value, LinearDensityUnit.MilligramPerCentimeter); + return new LinearDensity(milligramspercentimeter, LinearDensityUnit.MilligramPerCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearDensity FromMilligramsPerMeter(QuantityValue milligramspermeter) + public static LinearDensity FromMilligramsPerMeter(double milligramspermeter) { - double value = (double) milligramspermeter; - return new LinearDensity(value, LinearDensityUnit.MilligramPerMeter); + return new LinearDensity(milligramspermeter, LinearDensityUnit.MilligramPerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearDensity FromMilligramsPerMillimeter(QuantityValue milligramspermillimeter) + public static LinearDensity FromMilligramsPerMillimeter(double milligramspermillimeter) { - double value = (double) milligramspermillimeter; - return new LinearDensity(value, LinearDensityUnit.MilligramPerMillimeter); + return new LinearDensity(milligramspermillimeter, LinearDensityUnit.MilligramPerMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearDensity FromPoundsPerFoot(QuantityValue poundsperfoot) + public static LinearDensity FromPoundsPerFoot(double poundsperfoot) { - double value = (double) poundsperfoot; - return new LinearDensity(value, LinearDensityUnit.PoundPerFoot); + return new LinearDensity(poundsperfoot, LinearDensityUnit.PoundPerFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearDensity FromPoundsPerInch(QuantityValue poundsperinch) + public static LinearDensity FromPoundsPerInch(double poundsperinch) { - double value = (double) poundsperinch; - return new LinearDensity(value, LinearDensityUnit.PoundPerInch); + return new LinearDensity(poundsperinch, 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..900302a53e 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,250 +416,225 @@ 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 gigawattspercentimeter) { - double value = (double) gigawattspercentimeter; - return new LinearPowerDensity(value, LinearPowerDensityUnit.GigawattPerCentimeter); + return new LinearPowerDensity(gigawattspercentimeter, LinearPowerDensityUnit.GigawattPerCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearPowerDensity FromGigawattsPerFoot(QuantityValue gigawattsperfoot) + public static LinearPowerDensity FromGigawattsPerFoot(double gigawattsperfoot) { - double value = (double) gigawattsperfoot; - return new LinearPowerDensity(value, LinearPowerDensityUnit.GigawattPerFoot); + return new LinearPowerDensity(gigawattsperfoot, LinearPowerDensityUnit.GigawattPerFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearPowerDensity FromGigawattsPerInch(QuantityValue gigawattsperinch) + public static LinearPowerDensity FromGigawattsPerInch(double gigawattsperinch) { - double value = (double) gigawattsperinch; - return new LinearPowerDensity(value, LinearPowerDensityUnit.GigawattPerInch); + return new LinearPowerDensity(gigawattsperinch, LinearPowerDensityUnit.GigawattPerInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearPowerDensity FromGigawattsPerMeter(QuantityValue gigawattspermeter) + public static LinearPowerDensity FromGigawattsPerMeter(double gigawattspermeter) { - double value = (double) gigawattspermeter; - return new LinearPowerDensity(value, LinearPowerDensityUnit.GigawattPerMeter); + return new LinearPowerDensity(gigawattspermeter, LinearPowerDensityUnit.GigawattPerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearPowerDensity FromGigawattsPerMillimeter(QuantityValue gigawattspermillimeter) + public static LinearPowerDensity FromGigawattsPerMillimeter(double gigawattspermillimeter) { - double value = (double) gigawattspermillimeter; - return new LinearPowerDensity(value, LinearPowerDensityUnit.GigawattPerMillimeter); + return new LinearPowerDensity(gigawattspermillimeter, LinearPowerDensityUnit.GigawattPerMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearPowerDensity FromKilowattsPerCentimeter(QuantityValue kilowattspercentimeter) + public static LinearPowerDensity FromKilowattsPerCentimeter(double kilowattspercentimeter) { - double value = (double) kilowattspercentimeter; - return new LinearPowerDensity(value, LinearPowerDensityUnit.KilowattPerCentimeter); + return new LinearPowerDensity(kilowattspercentimeter, LinearPowerDensityUnit.KilowattPerCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearPowerDensity FromKilowattsPerFoot(QuantityValue kilowattsperfoot) + public static LinearPowerDensity FromKilowattsPerFoot(double kilowattsperfoot) { - double value = (double) kilowattsperfoot; - return new LinearPowerDensity(value, LinearPowerDensityUnit.KilowattPerFoot); + return new LinearPowerDensity(kilowattsperfoot, LinearPowerDensityUnit.KilowattPerFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearPowerDensity FromKilowattsPerInch(QuantityValue kilowattsperinch) + public static LinearPowerDensity FromKilowattsPerInch(double kilowattsperinch) { - double value = (double) kilowattsperinch; - return new LinearPowerDensity(value, LinearPowerDensityUnit.KilowattPerInch); + return new LinearPowerDensity(kilowattsperinch, LinearPowerDensityUnit.KilowattPerInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearPowerDensity FromKilowattsPerMeter(QuantityValue kilowattspermeter) + public static LinearPowerDensity FromKilowattsPerMeter(double kilowattspermeter) { - double value = (double) kilowattspermeter; - return new LinearPowerDensity(value, LinearPowerDensityUnit.KilowattPerMeter); + return new LinearPowerDensity(kilowattspermeter, LinearPowerDensityUnit.KilowattPerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearPowerDensity FromKilowattsPerMillimeter(QuantityValue kilowattspermillimeter) + public static LinearPowerDensity FromKilowattsPerMillimeter(double kilowattspermillimeter) { - double value = (double) kilowattspermillimeter; - return new LinearPowerDensity(value, LinearPowerDensityUnit.KilowattPerMillimeter); + return new LinearPowerDensity(kilowattspermillimeter, LinearPowerDensityUnit.KilowattPerMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearPowerDensity FromMegawattsPerCentimeter(QuantityValue megawattspercentimeter) + public static LinearPowerDensity FromMegawattsPerCentimeter(double megawattspercentimeter) { - double value = (double) megawattspercentimeter; - return new LinearPowerDensity(value, LinearPowerDensityUnit.MegawattPerCentimeter); + return new LinearPowerDensity(megawattspercentimeter, LinearPowerDensityUnit.MegawattPerCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearPowerDensity FromMegawattsPerFoot(QuantityValue megawattsperfoot) + public static LinearPowerDensity FromMegawattsPerFoot(double megawattsperfoot) { - double value = (double) megawattsperfoot; - return new LinearPowerDensity(value, LinearPowerDensityUnit.MegawattPerFoot); + return new LinearPowerDensity(megawattsperfoot, LinearPowerDensityUnit.MegawattPerFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearPowerDensity FromMegawattsPerInch(QuantityValue megawattsperinch) + public static LinearPowerDensity FromMegawattsPerInch(double megawattsperinch) { - double value = (double) megawattsperinch; - return new LinearPowerDensity(value, LinearPowerDensityUnit.MegawattPerInch); + return new LinearPowerDensity(megawattsperinch, LinearPowerDensityUnit.MegawattPerInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearPowerDensity FromMegawattsPerMeter(QuantityValue megawattspermeter) + public static LinearPowerDensity FromMegawattsPerMeter(double megawattspermeter) { - double value = (double) megawattspermeter; - return new LinearPowerDensity(value, LinearPowerDensityUnit.MegawattPerMeter); + return new LinearPowerDensity(megawattspermeter, LinearPowerDensityUnit.MegawattPerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearPowerDensity FromMegawattsPerMillimeter(QuantityValue megawattspermillimeter) + public static LinearPowerDensity FromMegawattsPerMillimeter(double megawattspermillimeter) { - double value = (double) megawattspermillimeter; - return new LinearPowerDensity(value, LinearPowerDensityUnit.MegawattPerMillimeter); + return new LinearPowerDensity(megawattspermillimeter, LinearPowerDensityUnit.MegawattPerMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearPowerDensity FromMilliwattsPerCentimeter(QuantityValue milliwattspercentimeter) + public static LinearPowerDensity FromMilliwattsPerCentimeter(double milliwattspercentimeter) { - double value = (double) milliwattspercentimeter; - return new LinearPowerDensity(value, LinearPowerDensityUnit.MilliwattPerCentimeter); + return new LinearPowerDensity(milliwattspercentimeter, LinearPowerDensityUnit.MilliwattPerCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearPowerDensity FromMilliwattsPerFoot(QuantityValue milliwattsperfoot) + public static LinearPowerDensity FromMilliwattsPerFoot(double milliwattsperfoot) { - double value = (double) milliwattsperfoot; - return new LinearPowerDensity(value, LinearPowerDensityUnit.MilliwattPerFoot); + return new LinearPowerDensity(milliwattsperfoot, LinearPowerDensityUnit.MilliwattPerFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearPowerDensity FromMilliwattsPerInch(QuantityValue milliwattsperinch) + public static LinearPowerDensity FromMilliwattsPerInch(double milliwattsperinch) { - double value = (double) milliwattsperinch; - return new LinearPowerDensity(value, LinearPowerDensityUnit.MilliwattPerInch); + return new LinearPowerDensity(milliwattsperinch, LinearPowerDensityUnit.MilliwattPerInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearPowerDensity FromMilliwattsPerMeter(QuantityValue milliwattspermeter) + public static LinearPowerDensity FromMilliwattsPerMeter(double milliwattspermeter) { - double value = (double) milliwattspermeter; - return new LinearPowerDensity(value, LinearPowerDensityUnit.MilliwattPerMeter); + return new LinearPowerDensity(milliwattspermeter, LinearPowerDensityUnit.MilliwattPerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearPowerDensity FromMilliwattsPerMillimeter(QuantityValue milliwattspermillimeter) + public static LinearPowerDensity FromMilliwattsPerMillimeter(double milliwattspermillimeter) { - double value = (double) milliwattspermillimeter; - return new LinearPowerDensity(value, LinearPowerDensityUnit.MilliwattPerMillimeter); + return new LinearPowerDensity(milliwattspermillimeter, LinearPowerDensityUnit.MilliwattPerMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearPowerDensity FromWattsPerCentimeter(QuantityValue wattspercentimeter) + public static LinearPowerDensity FromWattsPerCentimeter(double wattspercentimeter) { - double value = (double) wattspercentimeter; - return new LinearPowerDensity(value, LinearPowerDensityUnit.WattPerCentimeter); + return new LinearPowerDensity(wattspercentimeter, LinearPowerDensityUnit.WattPerCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearPowerDensity FromWattsPerFoot(QuantityValue wattsperfoot) + public static LinearPowerDensity FromWattsPerFoot(double wattsperfoot) { - double value = (double) wattsperfoot; - return new LinearPowerDensity(value, LinearPowerDensityUnit.WattPerFoot); + return new LinearPowerDensity(wattsperfoot, LinearPowerDensityUnit.WattPerFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearPowerDensity FromWattsPerInch(QuantityValue wattsperinch) + public static LinearPowerDensity FromWattsPerInch(double wattsperinch) { - double value = (double) wattsperinch; - return new LinearPowerDensity(value, LinearPowerDensityUnit.WattPerInch); + return new LinearPowerDensity(wattsperinch, LinearPowerDensityUnit.WattPerInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearPowerDensity FromWattsPerMeter(QuantityValue wattspermeter) + public static LinearPowerDensity FromWattsPerMeter(double wattspermeter) { - double value = (double) wattspermeter; - return new LinearPowerDensity(value, LinearPowerDensityUnit.WattPerMeter); + return new LinearPowerDensity(wattspermeter, LinearPowerDensityUnit.WattPerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearPowerDensity FromWattsPerMillimeter(QuantityValue wattspermillimeter) + public static LinearPowerDensity FromWattsPerMillimeter(double wattspermillimeter) { - double value = (double) wattspermillimeter; - return new LinearPowerDensity(value, LinearPowerDensityUnit.WattPerMillimeter); + return new LinearPowerDensity(wattspermillimeter, 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..c7f77fe15a 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,100 +302,90 @@ 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 candelaspersquarefoot) { - double value = (double) candelaspersquarefoot; - return new Luminance(value, LuminanceUnit.CandelaPerSquareFoot); + return new Luminance(candelaspersquarefoot, LuminanceUnit.CandelaPerSquareFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Luminance FromCandelasPerSquareInch(QuantityValue candelaspersquareinch) + public static Luminance FromCandelasPerSquareInch(double candelaspersquareinch) { - double value = (double) candelaspersquareinch; - return new Luminance(value, LuminanceUnit.CandelaPerSquareInch); + return new Luminance(candelaspersquareinch, LuminanceUnit.CandelaPerSquareInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Luminance FromCandelasPerSquareMeter(QuantityValue candelaspersquaremeter) + public static Luminance FromCandelasPerSquareMeter(double candelaspersquaremeter) { - double value = (double) candelaspersquaremeter; - return new Luminance(value, LuminanceUnit.CandelaPerSquareMeter); + return new Luminance(candelaspersquaremeter, LuminanceUnit.CandelaPerSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Luminance FromCenticandelasPerSquareMeter(QuantityValue centicandelaspersquaremeter) + public static Luminance FromCenticandelasPerSquareMeter(double centicandelaspersquaremeter) { - double value = (double) centicandelaspersquaremeter; - return new Luminance(value, LuminanceUnit.CenticandelaPerSquareMeter); + return new Luminance(centicandelaspersquaremeter, LuminanceUnit.CenticandelaPerSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Luminance FromDecicandelasPerSquareMeter(QuantityValue decicandelaspersquaremeter) + public static Luminance FromDecicandelasPerSquareMeter(double decicandelaspersquaremeter) { - double value = (double) decicandelaspersquaremeter; - return new Luminance(value, LuminanceUnit.DecicandelaPerSquareMeter); + return new Luminance(decicandelaspersquaremeter, LuminanceUnit.DecicandelaPerSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Luminance FromKilocandelasPerSquareMeter(QuantityValue kilocandelaspersquaremeter) + public static Luminance FromKilocandelasPerSquareMeter(double kilocandelaspersquaremeter) { - double value = (double) kilocandelaspersquaremeter; - return new Luminance(value, LuminanceUnit.KilocandelaPerSquareMeter); + return new Luminance(kilocandelaspersquaremeter, LuminanceUnit.KilocandelaPerSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Luminance FromMicrocandelasPerSquareMeter(QuantityValue microcandelaspersquaremeter) + public static Luminance FromMicrocandelasPerSquareMeter(double microcandelaspersquaremeter) { - double value = (double) microcandelaspersquaremeter; - return new Luminance(value, LuminanceUnit.MicrocandelaPerSquareMeter); + return new Luminance(microcandelaspersquaremeter, LuminanceUnit.MicrocandelaPerSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Luminance FromMillicandelasPerSquareMeter(QuantityValue millicandelaspersquaremeter) + public static Luminance FromMillicandelasPerSquareMeter(double millicandelaspersquaremeter) { - double value = (double) millicandelaspersquaremeter; - return new Luminance(value, LuminanceUnit.MillicandelaPerSquareMeter); + return new Luminance(millicandelaspersquaremeter, LuminanceUnit.MillicandelaPerSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Luminance FromNanocandelasPerSquareMeter(QuantityValue nanocandelaspersquaremeter) + public static Luminance FromNanocandelasPerSquareMeter(double nanocandelaspersquaremeter) { - double value = (double) nanocandelaspersquaremeter; - return new Luminance(value, LuminanceUnit.NanocandelaPerSquareMeter); + return new Luminance(nanocandelaspersquaremeter, LuminanceUnit.NanocandelaPerSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Luminance FromNits(QuantityValue nits) + public static Luminance FromNits(double nits) { - double value = (double) nits; - return new Luminance(value, LuminanceUnit.Nit); + return new Luminance(nits, 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..0df8fb7e24 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,140 +328,126 @@ 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 decawatts) { - double value = (double) decawatts; - return new Luminosity(value, LuminosityUnit.Decawatt); + return new Luminosity(decawatts, LuminosityUnit.Decawatt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Luminosity FromDeciwatts(QuantityValue deciwatts) + public static Luminosity FromDeciwatts(double deciwatts) { - double value = (double) deciwatts; - return new Luminosity(value, LuminosityUnit.Deciwatt); + return new Luminosity(deciwatts, LuminosityUnit.Deciwatt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Luminosity FromFemtowatts(QuantityValue femtowatts) + public static Luminosity FromFemtowatts(double femtowatts) { - double value = (double) femtowatts; - return new Luminosity(value, LuminosityUnit.Femtowatt); + return new Luminosity(femtowatts, LuminosityUnit.Femtowatt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Luminosity FromGigawatts(QuantityValue gigawatts) + public static Luminosity FromGigawatts(double gigawatts) { - double value = (double) gigawatts; - return new Luminosity(value, LuminosityUnit.Gigawatt); + return new Luminosity(gigawatts, LuminosityUnit.Gigawatt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Luminosity FromKilowatts(QuantityValue kilowatts) + public static Luminosity FromKilowatts(double kilowatts) { - double value = (double) kilowatts; - return new Luminosity(value, LuminosityUnit.Kilowatt); + return new Luminosity(kilowatts, LuminosityUnit.Kilowatt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Luminosity FromMegawatts(QuantityValue megawatts) + public static Luminosity FromMegawatts(double megawatts) { - double value = (double) megawatts; - return new Luminosity(value, LuminosityUnit.Megawatt); + return new Luminosity(megawatts, LuminosityUnit.Megawatt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Luminosity FromMicrowatts(QuantityValue microwatts) + public static Luminosity FromMicrowatts(double microwatts) { - double value = (double) microwatts; - return new Luminosity(value, LuminosityUnit.Microwatt); + return new Luminosity(microwatts, LuminosityUnit.Microwatt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Luminosity FromMilliwatts(QuantityValue milliwatts) + public static Luminosity FromMilliwatts(double milliwatts) { - double value = (double) milliwatts; - return new Luminosity(value, LuminosityUnit.Milliwatt); + return new Luminosity(milliwatts, LuminosityUnit.Milliwatt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Luminosity FromNanowatts(QuantityValue nanowatts) + public static Luminosity FromNanowatts(double nanowatts) { - double value = (double) nanowatts; - return new Luminosity(value, LuminosityUnit.Nanowatt); + return new Luminosity(nanowatts, LuminosityUnit.Nanowatt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Luminosity FromPetawatts(QuantityValue petawatts) + public static Luminosity FromPetawatts(double petawatts) { - double value = (double) petawatts; - return new Luminosity(value, LuminosityUnit.Petawatt); + return new Luminosity(petawatts, LuminosityUnit.Petawatt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Luminosity FromPicowatts(QuantityValue picowatts) + public static Luminosity FromPicowatts(double picowatts) { - double value = (double) picowatts; - return new Luminosity(value, LuminosityUnit.Picowatt); + return new Luminosity(picowatts, LuminosityUnit.Picowatt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Luminosity FromSolarLuminosities(QuantityValue solarluminosities) + public static Luminosity FromSolarLuminosities(double solarluminosities) { - double value = (double) solarluminosities; - return new Luminosity(value, LuminosityUnit.SolarLuminosity); + return new Luminosity(solarluminosities, LuminosityUnit.SolarLuminosity); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Luminosity FromTerawatts(QuantityValue terawatts) + public static Luminosity FromTerawatts(double terawatts) { - double value = (double) terawatts; - return new Luminosity(value, LuminosityUnit.Terawatt); + return new Luminosity(terawatts, LuminosityUnit.Terawatt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Luminosity FromWatts(QuantityValue watts) + public static Luminosity FromWatts(double watts) { - double value = (double) watts; - return new Luminosity(value, LuminosityUnit.Watt); + return new Luminosity(watts, 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..785e2c1a02 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,10 +224,9 @@ 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 lumens) { - double value = (double) lumens; - return new LuminousFlux(value, LuminousFluxUnit.Lumen); + return new LuminousFlux(lumens, 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..43d4a65664 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,10 +231,9 @@ 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 candela) { - double value = (double) candela; - return new LuminousIntensity(value, LuminousIntensityUnit.Candela); + return new LuminousIntensity(candela, 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..583f0dcbd5 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,60 +264,54 @@ 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 gausses) { - double value = (double) gausses; - return new MagneticField(value, MagneticFieldUnit.Gauss); + return new MagneticField(gausses, MagneticFieldUnit.Gauss); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MagneticField FromMicroteslas(QuantityValue microteslas) + public static MagneticField FromMicroteslas(double microteslas) { - double value = (double) microteslas; - return new MagneticField(value, MagneticFieldUnit.Microtesla); + return new MagneticField(microteslas, MagneticFieldUnit.Microtesla); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MagneticField FromMilligausses(QuantityValue milligausses) + public static MagneticField FromMilligausses(double milligausses) { - double value = (double) milligausses; - return new MagneticField(value, MagneticFieldUnit.Milligauss); + return new MagneticField(milligausses, MagneticFieldUnit.Milligauss); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MagneticField FromMilliteslas(QuantityValue milliteslas) + public static MagneticField FromMilliteslas(double milliteslas) { - double value = (double) milliteslas; - return new MagneticField(value, MagneticFieldUnit.Millitesla); + return new MagneticField(milliteslas, MagneticFieldUnit.Millitesla); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MagneticField FromNanoteslas(QuantityValue nanoteslas) + public static MagneticField FromNanoteslas(double nanoteslas) { - double value = (double) nanoteslas; - return new MagneticField(value, MagneticFieldUnit.Nanotesla); + return new MagneticField(nanoteslas, MagneticFieldUnit.Nanotesla); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MagneticField FromTeslas(QuantityValue teslas) + public static MagneticField FromTeslas(double teslas) { - double value = (double) teslas; - return new MagneticField(value, MagneticFieldUnit.Tesla); + return new MagneticField(teslas, 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..15465cb859 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,10 +224,9 @@ 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 webers) { - double value = (double) webers; - return new MagneticFlux(value, MagneticFluxUnit.Weber); + return new MagneticFlux(webers, 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..df422b1ca0 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,10 +224,9 @@ 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 amperespermeter) { - double value = (double) amperespermeter; - return new Magnetization(value, MagnetizationUnit.AmperePerMeter); + return new Magnetization(amperespermeter, 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..1d5da4b22d 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,270 +449,243 @@ 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 centigrams) { - double value = (double) centigrams; - return new Mass(value, MassUnit.Centigram); + return new Mass(centigrams, MassUnit.Centigram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromDecagrams(QuantityValue decagrams) + public static Mass FromDecagrams(double decagrams) { - double value = (double) decagrams; - return new Mass(value, MassUnit.Decagram); + return new Mass(decagrams, MassUnit.Decagram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromDecigrams(QuantityValue decigrams) + public static Mass FromDecigrams(double decigrams) { - double value = (double) decigrams; - return new Mass(value, MassUnit.Decigram); + return new Mass(decigrams, MassUnit.Decigram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromEarthMasses(QuantityValue earthmasses) + public static Mass FromEarthMasses(double earthmasses) { - double value = (double) earthmasses; - return new Mass(value, MassUnit.EarthMass); + return new Mass(earthmasses, MassUnit.EarthMass); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromFemtograms(QuantityValue femtograms) + public static Mass FromFemtograms(double femtograms) { - double value = (double) femtograms; - return new Mass(value, MassUnit.Femtogram); + return new Mass(femtograms, MassUnit.Femtogram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromGrains(QuantityValue grains) + public static Mass FromGrains(double grains) { - double value = (double) grains; - return new Mass(value, MassUnit.Grain); + return new Mass(grains, MassUnit.Grain); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromGrams(QuantityValue grams) + public static Mass FromGrams(double grams) { - double value = (double) grams; - return new Mass(value, MassUnit.Gram); + return new Mass(grams, MassUnit.Gram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromHectograms(QuantityValue hectograms) + public static Mass FromHectograms(double hectograms) { - double value = (double) hectograms; - return new Mass(value, MassUnit.Hectogram); + return new Mass(hectograms, MassUnit.Hectogram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromKilograms(QuantityValue kilograms) + public static Mass FromKilograms(double kilograms) { - double value = (double) kilograms; - return new Mass(value, MassUnit.Kilogram); + return new Mass(kilograms, MassUnit.Kilogram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromKilopounds(QuantityValue kilopounds) + public static Mass FromKilopounds(double kilopounds) { - double value = (double) kilopounds; - return new Mass(value, MassUnit.Kilopound); + return new Mass(kilopounds, MassUnit.Kilopound); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromKilotonnes(QuantityValue kilotonnes) + public static Mass FromKilotonnes(double kilotonnes) { - double value = (double) kilotonnes; - return new Mass(value, MassUnit.Kilotonne); + return new Mass(kilotonnes, MassUnit.Kilotonne); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromLongHundredweight(QuantityValue longhundredweight) + public static Mass FromLongHundredweight(double longhundredweight) { - double value = (double) longhundredweight; - return new Mass(value, MassUnit.LongHundredweight); + return new Mass(longhundredweight, MassUnit.LongHundredweight); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromLongTons(QuantityValue longtons) + public static Mass FromLongTons(double longtons) { - double value = (double) longtons; - return new Mass(value, MassUnit.LongTon); + return new Mass(longtons, MassUnit.LongTon); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromMegapounds(QuantityValue megapounds) + public static Mass FromMegapounds(double megapounds) { - double value = (double) megapounds; - return new Mass(value, MassUnit.Megapound); + return new Mass(megapounds, MassUnit.Megapound); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromMegatonnes(QuantityValue megatonnes) + public static Mass FromMegatonnes(double megatonnes) { - double value = (double) megatonnes; - return new Mass(value, MassUnit.Megatonne); + return new Mass(megatonnes, MassUnit.Megatonne); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromMicrograms(QuantityValue micrograms) + public static Mass FromMicrograms(double micrograms) { - double value = (double) micrograms; - return new Mass(value, MassUnit.Microgram); + return new Mass(micrograms, MassUnit.Microgram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromMilligrams(QuantityValue milligrams) + public static Mass FromMilligrams(double milligrams) { - double value = (double) milligrams; - return new Mass(value, MassUnit.Milligram); + return new Mass(milligrams, MassUnit.Milligram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromNanograms(QuantityValue nanograms) + public static Mass FromNanograms(double nanograms) { - double value = (double) nanograms; - return new Mass(value, MassUnit.Nanogram); + return new Mass(nanograms, MassUnit.Nanogram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromOunces(QuantityValue ounces) + public static Mass FromOunces(double ounces) { - double value = (double) ounces; - return new Mass(value, MassUnit.Ounce); + return new Mass(ounces, MassUnit.Ounce); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromPicograms(QuantityValue picograms) + public static Mass FromPicograms(double picograms) { - double value = (double) picograms; - return new Mass(value, MassUnit.Picogram); + return new Mass(picograms, MassUnit.Picogram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromPounds(QuantityValue pounds) + public static Mass FromPounds(double pounds) { - double value = (double) pounds; - return new Mass(value, MassUnit.Pound); + return new Mass(pounds, MassUnit.Pound); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromShortHundredweight(QuantityValue shorthundredweight) + public static Mass FromShortHundredweight(double shorthundredweight) { - double value = (double) shorthundredweight; - return new Mass(value, MassUnit.ShortHundredweight); + return new Mass(shorthundredweight, MassUnit.ShortHundredweight); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromShortTons(QuantityValue shorttons) + public static Mass FromShortTons(double shorttons) { - double value = (double) shorttons; - return new Mass(value, MassUnit.ShortTon); + return new Mass(shorttons, MassUnit.ShortTon); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromSlugs(QuantityValue slugs) + public static Mass FromSlugs(double slugs) { - double value = (double) slugs; - return new Mass(value, MassUnit.Slug); + return new Mass(slugs, MassUnit.Slug); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromSolarMasses(QuantityValue solarmasses) + public static Mass FromSolarMasses(double solarmasses) { - double value = (double) solarmasses; - return new Mass(value, MassUnit.SolarMass); + return new Mass(solarmasses, MassUnit.SolarMass); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromStone(QuantityValue stone) + public static Mass FromStone(double stone) { - double value = (double) stone; - return new Mass(value, MassUnit.Stone); + return new Mass(stone, MassUnit.Stone); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromTonnes(QuantityValue tonnes) + public static Mass FromTonnes(double tonnes) { - double value = (double) tonnes; - return new Mass(value, MassUnit.Tonne); + return new Mass(tonnes, 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..5c3625f8f9 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,490 +616,441 @@ 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 centigramsperdeciliter) { - double value = (double) centigramsperdeciliter; - return new MassConcentration(value, MassConcentrationUnit.CentigramPerDeciliter); + return new MassConcentration(centigramsperdeciliter, MassConcentrationUnit.CentigramPerDeciliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromCentigramsPerLiter(QuantityValue centigramsperliter) + public static MassConcentration FromCentigramsPerLiter(double centigramsperliter) { - double value = (double) centigramsperliter; - return new MassConcentration(value, MassConcentrationUnit.CentigramPerLiter); + return new MassConcentration(centigramsperliter, MassConcentrationUnit.CentigramPerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromCentigramsPerMicroliter(QuantityValue centigramspermicroliter) + public static MassConcentration FromCentigramsPerMicroliter(double centigramspermicroliter) { - double value = (double) centigramspermicroliter; - return new MassConcentration(value, MassConcentrationUnit.CentigramPerMicroliter); + return new MassConcentration(centigramspermicroliter, MassConcentrationUnit.CentigramPerMicroliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromCentigramsPerMilliliter(QuantityValue centigramspermilliliter) + public static MassConcentration FromCentigramsPerMilliliter(double centigramspermilliliter) { - double value = (double) centigramspermilliliter; - return new MassConcentration(value, MassConcentrationUnit.CentigramPerMilliliter); + return new MassConcentration(centigramspermilliliter, MassConcentrationUnit.CentigramPerMilliliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromDecigramsPerDeciliter(QuantityValue decigramsperdeciliter) + public static MassConcentration FromDecigramsPerDeciliter(double decigramsperdeciliter) { - double value = (double) decigramsperdeciliter; - return new MassConcentration(value, MassConcentrationUnit.DecigramPerDeciliter); + return new MassConcentration(decigramsperdeciliter, MassConcentrationUnit.DecigramPerDeciliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromDecigramsPerLiter(QuantityValue decigramsperliter) + public static MassConcentration FromDecigramsPerLiter(double decigramsperliter) { - double value = (double) decigramsperliter; - return new MassConcentration(value, MassConcentrationUnit.DecigramPerLiter); + return new MassConcentration(decigramsperliter, MassConcentrationUnit.DecigramPerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromDecigramsPerMicroliter(QuantityValue decigramspermicroliter) + public static MassConcentration FromDecigramsPerMicroliter(double decigramspermicroliter) { - double value = (double) decigramspermicroliter; - return new MassConcentration(value, MassConcentrationUnit.DecigramPerMicroliter); + return new MassConcentration(decigramspermicroliter, MassConcentrationUnit.DecigramPerMicroliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromDecigramsPerMilliliter(QuantityValue decigramspermilliliter) + public static MassConcentration FromDecigramsPerMilliliter(double decigramspermilliliter) { - double value = (double) decigramspermilliliter; - return new MassConcentration(value, MassConcentrationUnit.DecigramPerMilliliter); + return new MassConcentration(decigramspermilliliter, MassConcentrationUnit.DecigramPerMilliliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromGramsPerCubicCentimeter(QuantityValue gramspercubiccentimeter) + public static MassConcentration FromGramsPerCubicCentimeter(double gramspercubiccentimeter) { - double value = (double) gramspercubiccentimeter; - return new MassConcentration(value, MassConcentrationUnit.GramPerCubicCentimeter); + return new MassConcentration(gramspercubiccentimeter, MassConcentrationUnit.GramPerCubicCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromGramsPerCubicMeter(QuantityValue gramspercubicmeter) + public static MassConcentration FromGramsPerCubicMeter(double gramspercubicmeter) { - double value = (double) gramspercubicmeter; - return new MassConcentration(value, MassConcentrationUnit.GramPerCubicMeter); + return new MassConcentration(gramspercubicmeter, MassConcentrationUnit.GramPerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromGramsPerCubicMillimeter(QuantityValue gramspercubicmillimeter) + public static MassConcentration FromGramsPerCubicMillimeter(double gramspercubicmillimeter) { - double value = (double) gramspercubicmillimeter; - return new MassConcentration(value, MassConcentrationUnit.GramPerCubicMillimeter); + return new MassConcentration(gramspercubicmillimeter, MassConcentrationUnit.GramPerCubicMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromGramsPerDeciliter(QuantityValue gramsperdeciliter) + public static MassConcentration FromGramsPerDeciliter(double gramsperdeciliter) { - double value = (double) gramsperdeciliter; - return new MassConcentration(value, MassConcentrationUnit.GramPerDeciliter); + return new MassConcentration(gramsperdeciliter, MassConcentrationUnit.GramPerDeciliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromGramsPerLiter(QuantityValue gramsperliter) + public static MassConcentration FromGramsPerLiter(double gramsperliter) { - double value = (double) gramsperliter; - return new MassConcentration(value, MassConcentrationUnit.GramPerLiter); + return new MassConcentration(gramsperliter, MassConcentrationUnit.GramPerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromGramsPerMicroliter(QuantityValue gramspermicroliter) + public static MassConcentration FromGramsPerMicroliter(double gramspermicroliter) { - double value = (double) gramspermicroliter; - return new MassConcentration(value, MassConcentrationUnit.GramPerMicroliter); + return new MassConcentration(gramspermicroliter, MassConcentrationUnit.GramPerMicroliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromGramsPerMilliliter(QuantityValue gramspermilliliter) + public static MassConcentration FromGramsPerMilliliter(double gramspermilliliter) { - double value = (double) gramspermilliliter; - return new MassConcentration(value, MassConcentrationUnit.GramPerMilliliter); + return new MassConcentration(gramspermilliliter, MassConcentrationUnit.GramPerMilliliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromKilogramsPerCubicCentimeter(QuantityValue kilogramspercubiccentimeter) + public static MassConcentration FromKilogramsPerCubicCentimeter(double kilogramspercubiccentimeter) { - double value = (double) kilogramspercubiccentimeter; - return new MassConcentration(value, MassConcentrationUnit.KilogramPerCubicCentimeter); + return new MassConcentration(kilogramspercubiccentimeter, MassConcentrationUnit.KilogramPerCubicCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromKilogramsPerCubicMeter(QuantityValue kilogramspercubicmeter) + public static MassConcentration FromKilogramsPerCubicMeter(double kilogramspercubicmeter) { - double value = (double) kilogramspercubicmeter; - return new MassConcentration(value, MassConcentrationUnit.KilogramPerCubicMeter); + return new MassConcentration(kilogramspercubicmeter, MassConcentrationUnit.KilogramPerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromKilogramsPerCubicMillimeter(QuantityValue kilogramspercubicmillimeter) + public static MassConcentration FromKilogramsPerCubicMillimeter(double kilogramspercubicmillimeter) { - double value = (double) kilogramspercubicmillimeter; - return new MassConcentration(value, MassConcentrationUnit.KilogramPerCubicMillimeter); + return new MassConcentration(kilogramspercubicmillimeter, MassConcentrationUnit.KilogramPerCubicMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromKilogramsPerLiter(QuantityValue kilogramsperliter) + public static MassConcentration FromKilogramsPerLiter(double kilogramsperliter) { - double value = (double) kilogramsperliter; - return new MassConcentration(value, MassConcentrationUnit.KilogramPerLiter); + return new MassConcentration(kilogramsperliter, MassConcentrationUnit.KilogramPerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromKilopoundsPerCubicFoot(QuantityValue kilopoundspercubicfoot) + public static MassConcentration FromKilopoundsPerCubicFoot(double kilopoundspercubicfoot) { - double value = (double) kilopoundspercubicfoot; - return new MassConcentration(value, MassConcentrationUnit.KilopoundPerCubicFoot); + return new MassConcentration(kilopoundspercubicfoot, MassConcentrationUnit.KilopoundPerCubicFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromKilopoundsPerCubicInch(QuantityValue kilopoundspercubicinch) + public static MassConcentration FromKilopoundsPerCubicInch(double kilopoundspercubicinch) { - double value = (double) kilopoundspercubicinch; - return new MassConcentration(value, MassConcentrationUnit.KilopoundPerCubicInch); + return new MassConcentration(kilopoundspercubicinch, MassConcentrationUnit.KilopoundPerCubicInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromMicrogramsPerCubicMeter(QuantityValue microgramspercubicmeter) + public static MassConcentration FromMicrogramsPerCubicMeter(double microgramspercubicmeter) { - double value = (double) microgramspercubicmeter; - return new MassConcentration(value, MassConcentrationUnit.MicrogramPerCubicMeter); + return new MassConcentration(microgramspercubicmeter, MassConcentrationUnit.MicrogramPerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromMicrogramsPerDeciliter(QuantityValue microgramsperdeciliter) + public static MassConcentration FromMicrogramsPerDeciliter(double microgramsperdeciliter) { - double value = (double) microgramsperdeciliter; - return new MassConcentration(value, MassConcentrationUnit.MicrogramPerDeciliter); + return new MassConcentration(microgramsperdeciliter, MassConcentrationUnit.MicrogramPerDeciliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromMicrogramsPerLiter(QuantityValue microgramsperliter) + public static MassConcentration FromMicrogramsPerLiter(double microgramsperliter) { - double value = (double) microgramsperliter; - return new MassConcentration(value, MassConcentrationUnit.MicrogramPerLiter); + return new MassConcentration(microgramsperliter, MassConcentrationUnit.MicrogramPerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromMicrogramsPerMicroliter(QuantityValue microgramspermicroliter) + public static MassConcentration FromMicrogramsPerMicroliter(double microgramspermicroliter) { - double value = (double) microgramspermicroliter; - return new MassConcentration(value, MassConcentrationUnit.MicrogramPerMicroliter); + return new MassConcentration(microgramspermicroliter, MassConcentrationUnit.MicrogramPerMicroliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromMicrogramsPerMilliliter(QuantityValue microgramspermilliliter) + public static MassConcentration FromMicrogramsPerMilliliter(double microgramspermilliliter) { - double value = (double) microgramspermilliliter; - return new MassConcentration(value, MassConcentrationUnit.MicrogramPerMilliliter); + return new MassConcentration(microgramspermilliliter, MassConcentrationUnit.MicrogramPerMilliliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromMilligramsPerCubicMeter(QuantityValue milligramspercubicmeter) + public static MassConcentration FromMilligramsPerCubicMeter(double milligramspercubicmeter) { - double value = (double) milligramspercubicmeter; - return new MassConcentration(value, MassConcentrationUnit.MilligramPerCubicMeter); + return new MassConcentration(milligramspercubicmeter, MassConcentrationUnit.MilligramPerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromMilligramsPerDeciliter(QuantityValue milligramsperdeciliter) + public static MassConcentration FromMilligramsPerDeciliter(double milligramsperdeciliter) { - double value = (double) milligramsperdeciliter; - return new MassConcentration(value, MassConcentrationUnit.MilligramPerDeciliter); + return new MassConcentration(milligramsperdeciliter, MassConcentrationUnit.MilligramPerDeciliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromMilligramsPerLiter(QuantityValue milligramsperliter) + public static MassConcentration FromMilligramsPerLiter(double milligramsperliter) { - double value = (double) milligramsperliter; - return new MassConcentration(value, MassConcentrationUnit.MilligramPerLiter); + return new MassConcentration(milligramsperliter, MassConcentrationUnit.MilligramPerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromMilligramsPerMicroliter(QuantityValue milligramspermicroliter) + public static MassConcentration FromMilligramsPerMicroliter(double milligramspermicroliter) { - double value = (double) milligramspermicroliter; - return new MassConcentration(value, MassConcentrationUnit.MilligramPerMicroliter); + return new MassConcentration(milligramspermicroliter, MassConcentrationUnit.MilligramPerMicroliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromMilligramsPerMilliliter(QuantityValue milligramspermilliliter) + public static MassConcentration FromMilligramsPerMilliliter(double milligramspermilliliter) { - double value = (double) milligramspermilliliter; - return new MassConcentration(value, MassConcentrationUnit.MilligramPerMilliliter); + return new MassConcentration(milligramspermilliliter, MassConcentrationUnit.MilligramPerMilliliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromNanogramsPerDeciliter(QuantityValue nanogramsperdeciliter) + public static MassConcentration FromNanogramsPerDeciliter(double nanogramsperdeciliter) { - double value = (double) nanogramsperdeciliter; - return new MassConcentration(value, MassConcentrationUnit.NanogramPerDeciliter); + return new MassConcentration(nanogramsperdeciliter, MassConcentrationUnit.NanogramPerDeciliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromNanogramsPerLiter(QuantityValue nanogramsperliter) + public static MassConcentration FromNanogramsPerLiter(double nanogramsperliter) { - double value = (double) nanogramsperliter; - return new MassConcentration(value, MassConcentrationUnit.NanogramPerLiter); + return new MassConcentration(nanogramsperliter, MassConcentrationUnit.NanogramPerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromNanogramsPerMicroliter(QuantityValue nanogramspermicroliter) + public static MassConcentration FromNanogramsPerMicroliter(double nanogramspermicroliter) { - double value = (double) nanogramspermicroliter; - return new MassConcentration(value, MassConcentrationUnit.NanogramPerMicroliter); + return new MassConcentration(nanogramspermicroliter, MassConcentrationUnit.NanogramPerMicroliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromNanogramsPerMilliliter(QuantityValue nanogramspermilliliter) + public static MassConcentration FromNanogramsPerMilliliter(double nanogramspermilliliter) { - double value = (double) nanogramspermilliliter; - return new MassConcentration(value, MassConcentrationUnit.NanogramPerMilliliter); + return new MassConcentration(nanogramspermilliliter, MassConcentrationUnit.NanogramPerMilliliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromOuncesPerImperialGallon(QuantityValue ouncesperimperialgallon) + public static MassConcentration FromOuncesPerImperialGallon(double ouncesperimperialgallon) { - double value = (double) ouncesperimperialgallon; - return new MassConcentration(value, MassConcentrationUnit.OuncePerImperialGallon); + return new MassConcentration(ouncesperimperialgallon, MassConcentrationUnit.OuncePerImperialGallon); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromOuncesPerUSGallon(QuantityValue ouncesperusgallon) + public static MassConcentration FromOuncesPerUSGallon(double ouncesperusgallon) { - double value = (double) ouncesperusgallon; - return new MassConcentration(value, MassConcentrationUnit.OuncePerUSGallon); + return new MassConcentration(ouncesperusgallon, MassConcentrationUnit.OuncePerUSGallon); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromPicogramsPerDeciliter(QuantityValue picogramsperdeciliter) + public static MassConcentration FromPicogramsPerDeciliter(double picogramsperdeciliter) { - double value = (double) picogramsperdeciliter; - return new MassConcentration(value, MassConcentrationUnit.PicogramPerDeciliter); + return new MassConcentration(picogramsperdeciliter, MassConcentrationUnit.PicogramPerDeciliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromPicogramsPerLiter(QuantityValue picogramsperliter) + public static MassConcentration FromPicogramsPerLiter(double picogramsperliter) { - double value = (double) picogramsperliter; - return new MassConcentration(value, MassConcentrationUnit.PicogramPerLiter); + return new MassConcentration(picogramsperliter, MassConcentrationUnit.PicogramPerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromPicogramsPerMicroliter(QuantityValue picogramspermicroliter) + public static MassConcentration FromPicogramsPerMicroliter(double picogramspermicroliter) { - double value = (double) picogramspermicroliter; - return new MassConcentration(value, MassConcentrationUnit.PicogramPerMicroliter); + return new MassConcentration(picogramspermicroliter, MassConcentrationUnit.PicogramPerMicroliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromPicogramsPerMilliliter(QuantityValue picogramspermilliliter) + public static MassConcentration FromPicogramsPerMilliliter(double picogramspermilliliter) { - double value = (double) picogramspermilliliter; - return new MassConcentration(value, MassConcentrationUnit.PicogramPerMilliliter); + return new MassConcentration(picogramspermilliliter, MassConcentrationUnit.PicogramPerMilliliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromPoundsPerCubicFoot(QuantityValue poundspercubicfoot) + public static MassConcentration FromPoundsPerCubicFoot(double poundspercubicfoot) { - double value = (double) poundspercubicfoot; - return new MassConcentration(value, MassConcentrationUnit.PoundPerCubicFoot); + return new MassConcentration(poundspercubicfoot, MassConcentrationUnit.PoundPerCubicFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromPoundsPerCubicInch(QuantityValue poundspercubicinch) + public static MassConcentration FromPoundsPerCubicInch(double poundspercubicinch) { - double value = (double) poundspercubicinch; - return new MassConcentration(value, MassConcentrationUnit.PoundPerCubicInch); + return new MassConcentration(poundspercubicinch, MassConcentrationUnit.PoundPerCubicInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromPoundsPerImperialGallon(QuantityValue poundsperimperialgallon) + public static MassConcentration FromPoundsPerImperialGallon(double poundsperimperialgallon) { - double value = (double) poundsperimperialgallon; - return new MassConcentration(value, MassConcentrationUnit.PoundPerImperialGallon); + return new MassConcentration(poundsperimperialgallon, MassConcentrationUnit.PoundPerImperialGallon); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromPoundsPerUSGallon(QuantityValue poundsperusgallon) + public static MassConcentration FromPoundsPerUSGallon(double poundsperusgallon) { - double value = (double) poundsperusgallon; - return new MassConcentration(value, MassConcentrationUnit.PoundPerUSGallon); + return new MassConcentration(poundsperusgallon, MassConcentrationUnit.PoundPerUSGallon); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromSlugsPerCubicFoot(QuantityValue slugspercubicfoot) + public static MassConcentration FromSlugsPerCubicFoot(double slugspercubicfoot) { - double value = (double) slugspercubicfoot; - return new MassConcentration(value, MassConcentrationUnit.SlugPerCubicFoot); + return new MassConcentration(slugspercubicfoot, MassConcentrationUnit.SlugPerCubicFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromTonnesPerCubicCentimeter(QuantityValue tonnespercubiccentimeter) + public static MassConcentration FromTonnesPerCubicCentimeter(double tonnespercubiccentimeter) { - double value = (double) tonnespercubiccentimeter; - return new MassConcentration(value, MassConcentrationUnit.TonnePerCubicCentimeter); + return new MassConcentration(tonnespercubiccentimeter, MassConcentrationUnit.TonnePerCubicCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromTonnesPerCubicMeter(QuantityValue tonnespercubicmeter) + public static MassConcentration FromTonnesPerCubicMeter(double tonnespercubicmeter) { - double value = (double) tonnespercubicmeter; - return new MassConcentration(value, MassConcentrationUnit.TonnePerCubicMeter); + return new MassConcentration(tonnespercubicmeter, MassConcentrationUnit.TonnePerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromTonnesPerCubicMillimeter(QuantityValue tonnespercubicmillimeter) + public static MassConcentration FromTonnesPerCubicMillimeter(double tonnespercubicmillimeter) { - double value = (double) tonnespercubicmillimeter; - return new MassConcentration(value, MassConcentrationUnit.TonnePerCubicMillimeter); + return new MassConcentration(tonnespercubicmillimeter, 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..07ecac8e86 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,330 +491,297 @@ 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 centigramsperday) { - double value = (double) centigramsperday; - return new MassFlow(value, MassFlowUnit.CentigramPerDay); + return new MassFlow(centigramsperday, MassFlowUnit.CentigramPerDay); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromCentigramsPerSecond(QuantityValue centigramspersecond) + public static MassFlow FromCentigramsPerSecond(double centigramspersecond) { - double value = (double) centigramspersecond; - return new MassFlow(value, MassFlowUnit.CentigramPerSecond); + return new MassFlow(centigramspersecond, MassFlowUnit.CentigramPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromDecagramsPerDay(QuantityValue decagramsperday) + public static MassFlow FromDecagramsPerDay(double decagramsperday) { - double value = (double) decagramsperday; - return new MassFlow(value, MassFlowUnit.DecagramPerDay); + return new MassFlow(decagramsperday, MassFlowUnit.DecagramPerDay); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromDecagramsPerSecond(QuantityValue decagramspersecond) + public static MassFlow FromDecagramsPerSecond(double decagramspersecond) { - double value = (double) decagramspersecond; - return new MassFlow(value, MassFlowUnit.DecagramPerSecond); + return new MassFlow(decagramspersecond, MassFlowUnit.DecagramPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromDecigramsPerDay(QuantityValue decigramsperday) + public static MassFlow FromDecigramsPerDay(double decigramsperday) { - double value = (double) decigramsperday; - return new MassFlow(value, MassFlowUnit.DecigramPerDay); + return new MassFlow(decigramsperday, MassFlowUnit.DecigramPerDay); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromDecigramsPerSecond(QuantityValue decigramspersecond) + public static MassFlow FromDecigramsPerSecond(double decigramspersecond) { - double value = (double) decigramspersecond; - return new MassFlow(value, MassFlowUnit.DecigramPerSecond); + return new MassFlow(decigramspersecond, MassFlowUnit.DecigramPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromGramsPerDay(QuantityValue gramsperday) + public static MassFlow FromGramsPerDay(double gramsperday) { - double value = (double) gramsperday; - return new MassFlow(value, MassFlowUnit.GramPerDay); + return new MassFlow(gramsperday, MassFlowUnit.GramPerDay); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromGramsPerHour(QuantityValue gramsperhour) + public static MassFlow FromGramsPerHour(double gramsperhour) { - double value = (double) gramsperhour; - return new MassFlow(value, MassFlowUnit.GramPerHour); + return new MassFlow(gramsperhour, MassFlowUnit.GramPerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromGramsPerSecond(QuantityValue gramspersecond) + public static MassFlow FromGramsPerSecond(double gramspersecond) { - double value = (double) gramspersecond; - return new MassFlow(value, MassFlowUnit.GramPerSecond); + return new MassFlow(gramspersecond, MassFlowUnit.GramPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromHectogramsPerDay(QuantityValue hectogramsperday) + public static MassFlow FromHectogramsPerDay(double hectogramsperday) { - double value = (double) hectogramsperday; - return new MassFlow(value, MassFlowUnit.HectogramPerDay); + return new MassFlow(hectogramsperday, MassFlowUnit.HectogramPerDay); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromHectogramsPerSecond(QuantityValue hectogramspersecond) + public static MassFlow FromHectogramsPerSecond(double hectogramspersecond) { - double value = (double) hectogramspersecond; - return new MassFlow(value, MassFlowUnit.HectogramPerSecond); + return new MassFlow(hectogramspersecond, MassFlowUnit.HectogramPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromKilogramsPerDay(QuantityValue kilogramsperday) + public static MassFlow FromKilogramsPerDay(double kilogramsperday) { - double value = (double) kilogramsperday; - return new MassFlow(value, MassFlowUnit.KilogramPerDay); + return new MassFlow(kilogramsperday, MassFlowUnit.KilogramPerDay); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromKilogramsPerHour(QuantityValue kilogramsperhour) + public static MassFlow FromKilogramsPerHour(double kilogramsperhour) { - double value = (double) kilogramsperhour; - return new MassFlow(value, MassFlowUnit.KilogramPerHour); + return new MassFlow(kilogramsperhour, MassFlowUnit.KilogramPerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromKilogramsPerMinute(QuantityValue kilogramsperminute) + public static MassFlow FromKilogramsPerMinute(double kilogramsperminute) { - double value = (double) kilogramsperminute; - return new MassFlow(value, MassFlowUnit.KilogramPerMinute); + return new MassFlow(kilogramsperminute, MassFlowUnit.KilogramPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromKilogramsPerSecond(QuantityValue kilogramspersecond) + public static MassFlow FromKilogramsPerSecond(double kilogramspersecond) { - double value = (double) kilogramspersecond; - return new MassFlow(value, MassFlowUnit.KilogramPerSecond); + return new MassFlow(kilogramspersecond, MassFlowUnit.KilogramPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromMegagramsPerDay(QuantityValue megagramsperday) + public static MassFlow FromMegagramsPerDay(double megagramsperday) { - double value = (double) megagramsperday; - return new MassFlow(value, MassFlowUnit.MegagramPerDay); + return new MassFlow(megagramsperday, MassFlowUnit.MegagramPerDay); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromMegapoundsPerDay(QuantityValue megapoundsperday) + public static MassFlow FromMegapoundsPerDay(double megapoundsperday) { - double value = (double) megapoundsperday; - return new MassFlow(value, MassFlowUnit.MegapoundPerDay); + return new MassFlow(megapoundsperday, MassFlowUnit.MegapoundPerDay); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromMegapoundsPerHour(QuantityValue megapoundsperhour) + public static MassFlow FromMegapoundsPerHour(double megapoundsperhour) { - double value = (double) megapoundsperhour; - return new MassFlow(value, MassFlowUnit.MegapoundPerHour); + return new MassFlow(megapoundsperhour, MassFlowUnit.MegapoundPerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromMegapoundsPerMinute(QuantityValue megapoundsperminute) + public static MassFlow FromMegapoundsPerMinute(double megapoundsperminute) { - double value = (double) megapoundsperminute; - return new MassFlow(value, MassFlowUnit.MegapoundPerMinute); + return new MassFlow(megapoundsperminute, MassFlowUnit.MegapoundPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromMegapoundsPerSecond(QuantityValue megapoundspersecond) + public static MassFlow FromMegapoundsPerSecond(double megapoundspersecond) { - double value = (double) megapoundspersecond; - return new MassFlow(value, MassFlowUnit.MegapoundPerSecond); + return new MassFlow(megapoundspersecond, MassFlowUnit.MegapoundPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromMicrogramsPerDay(QuantityValue microgramsperday) + public static MassFlow FromMicrogramsPerDay(double microgramsperday) { - double value = (double) microgramsperday; - return new MassFlow(value, MassFlowUnit.MicrogramPerDay); + return new MassFlow(microgramsperday, MassFlowUnit.MicrogramPerDay); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromMicrogramsPerSecond(QuantityValue microgramspersecond) + public static MassFlow FromMicrogramsPerSecond(double microgramspersecond) { - double value = (double) microgramspersecond; - return new MassFlow(value, MassFlowUnit.MicrogramPerSecond); + return new MassFlow(microgramspersecond, MassFlowUnit.MicrogramPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromMilligramsPerDay(QuantityValue milligramsperday) + public static MassFlow FromMilligramsPerDay(double milligramsperday) { - double value = (double) milligramsperday; - return new MassFlow(value, MassFlowUnit.MilligramPerDay); + return new MassFlow(milligramsperday, MassFlowUnit.MilligramPerDay); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromMilligramsPerSecond(QuantityValue milligramspersecond) + public static MassFlow FromMilligramsPerSecond(double milligramspersecond) { - double value = (double) milligramspersecond; - return new MassFlow(value, MassFlowUnit.MilligramPerSecond); + return new MassFlow(milligramspersecond, MassFlowUnit.MilligramPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromNanogramsPerDay(QuantityValue nanogramsperday) + public static MassFlow FromNanogramsPerDay(double nanogramsperday) { - double value = (double) nanogramsperday; - return new MassFlow(value, MassFlowUnit.NanogramPerDay); + return new MassFlow(nanogramsperday, MassFlowUnit.NanogramPerDay); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromNanogramsPerSecond(QuantityValue nanogramspersecond) + public static MassFlow FromNanogramsPerSecond(double nanogramspersecond) { - double value = (double) nanogramspersecond; - return new MassFlow(value, MassFlowUnit.NanogramPerSecond); + return new MassFlow(nanogramspersecond, MassFlowUnit.NanogramPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromPoundsPerDay(QuantityValue poundsperday) + public static MassFlow FromPoundsPerDay(double poundsperday) { - double value = (double) poundsperday; - return new MassFlow(value, MassFlowUnit.PoundPerDay); + return new MassFlow(poundsperday, MassFlowUnit.PoundPerDay); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromPoundsPerHour(QuantityValue poundsperhour) + public static MassFlow FromPoundsPerHour(double poundsperhour) { - double value = (double) poundsperhour; - return new MassFlow(value, MassFlowUnit.PoundPerHour); + return new MassFlow(poundsperhour, MassFlowUnit.PoundPerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromPoundsPerMinute(QuantityValue poundsperminute) + public static MassFlow FromPoundsPerMinute(double poundsperminute) { - double value = (double) poundsperminute; - return new MassFlow(value, MassFlowUnit.PoundPerMinute); + return new MassFlow(poundsperminute, MassFlowUnit.PoundPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromPoundsPerSecond(QuantityValue poundspersecond) + public static MassFlow FromPoundsPerSecond(double poundspersecond) { - double value = (double) poundspersecond; - return new MassFlow(value, MassFlowUnit.PoundPerSecond); + return new MassFlow(poundspersecond, MassFlowUnit.PoundPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromShortTonsPerHour(QuantityValue shorttonsperhour) + public static MassFlow FromShortTonsPerHour(double shorttonsperhour) { - double value = (double) shorttonsperhour; - return new MassFlow(value, MassFlowUnit.ShortTonPerHour); + return new MassFlow(shorttonsperhour, MassFlowUnit.ShortTonPerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromTonnesPerDay(QuantityValue tonnesperday) + public static MassFlow FromTonnesPerDay(double tonnesperday) { - double value = (double) tonnesperday; - return new MassFlow(value, MassFlowUnit.TonnePerDay); + return new MassFlow(tonnesperday, MassFlowUnit.TonnePerDay); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromTonnesPerHour(QuantityValue tonnesperhour) + public static MassFlow FromTonnesPerHour(double tonnesperhour) { - double value = (double) tonnesperhour; - return new MassFlow(value, MassFlowUnit.TonnePerHour); + return new MassFlow(tonnesperhour, 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..5e65d320c1 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,120 +317,108 @@ 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 gramsperhourpersquarecentimeter) { - double value = (double) gramsperhourpersquarecentimeter; - return new MassFlux(value, MassFluxUnit.GramPerHourPerSquareCentimeter); + return new MassFlux(gramsperhourpersquarecentimeter, MassFluxUnit.GramPerHourPerSquareCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlux FromGramsPerHourPerSquareMeter(QuantityValue gramsperhourpersquaremeter) + public static MassFlux FromGramsPerHourPerSquareMeter(double gramsperhourpersquaremeter) { - double value = (double) gramsperhourpersquaremeter; - return new MassFlux(value, MassFluxUnit.GramPerHourPerSquareMeter); + return new MassFlux(gramsperhourpersquaremeter, MassFluxUnit.GramPerHourPerSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlux FromGramsPerHourPerSquareMillimeter(QuantityValue gramsperhourpersquaremillimeter) + public static MassFlux FromGramsPerHourPerSquareMillimeter(double gramsperhourpersquaremillimeter) { - double value = (double) gramsperhourpersquaremillimeter; - return new MassFlux(value, MassFluxUnit.GramPerHourPerSquareMillimeter); + return new MassFlux(gramsperhourpersquaremillimeter, MassFluxUnit.GramPerHourPerSquareMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlux FromGramsPerSecondPerSquareCentimeter(QuantityValue gramspersecondpersquarecentimeter) + public static MassFlux FromGramsPerSecondPerSquareCentimeter(double gramspersecondpersquarecentimeter) { - double value = (double) gramspersecondpersquarecentimeter; - return new MassFlux(value, MassFluxUnit.GramPerSecondPerSquareCentimeter); + return new MassFlux(gramspersecondpersquarecentimeter, MassFluxUnit.GramPerSecondPerSquareCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlux FromGramsPerSecondPerSquareMeter(QuantityValue gramspersecondpersquaremeter) + public static MassFlux FromGramsPerSecondPerSquareMeter(double gramspersecondpersquaremeter) { - double value = (double) gramspersecondpersquaremeter; - return new MassFlux(value, MassFluxUnit.GramPerSecondPerSquareMeter); + return new MassFlux(gramspersecondpersquaremeter, MassFluxUnit.GramPerSecondPerSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlux FromGramsPerSecondPerSquareMillimeter(QuantityValue gramspersecondpersquaremillimeter) + public static MassFlux FromGramsPerSecondPerSquareMillimeter(double gramspersecondpersquaremillimeter) { - double value = (double) gramspersecondpersquaremillimeter; - return new MassFlux(value, MassFluxUnit.GramPerSecondPerSquareMillimeter); + return new MassFlux(gramspersecondpersquaremillimeter, MassFluxUnit.GramPerSecondPerSquareMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlux FromKilogramsPerHourPerSquareCentimeter(QuantityValue kilogramsperhourpersquarecentimeter) + public static MassFlux FromKilogramsPerHourPerSquareCentimeter(double kilogramsperhourpersquarecentimeter) { - double value = (double) kilogramsperhourpersquarecentimeter; - return new MassFlux(value, MassFluxUnit.KilogramPerHourPerSquareCentimeter); + return new MassFlux(kilogramsperhourpersquarecentimeter, MassFluxUnit.KilogramPerHourPerSquareCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlux FromKilogramsPerHourPerSquareMeter(QuantityValue kilogramsperhourpersquaremeter) + public static MassFlux FromKilogramsPerHourPerSquareMeter(double kilogramsperhourpersquaremeter) { - double value = (double) kilogramsperhourpersquaremeter; - return new MassFlux(value, MassFluxUnit.KilogramPerHourPerSquareMeter); + return new MassFlux(kilogramsperhourpersquaremeter, MassFluxUnit.KilogramPerHourPerSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlux FromKilogramsPerHourPerSquareMillimeter(QuantityValue kilogramsperhourpersquaremillimeter) + public static MassFlux FromKilogramsPerHourPerSquareMillimeter(double kilogramsperhourpersquaremillimeter) { - double value = (double) kilogramsperhourpersquaremillimeter; - return new MassFlux(value, MassFluxUnit.KilogramPerHourPerSquareMillimeter); + return new MassFlux(kilogramsperhourpersquaremillimeter, MassFluxUnit.KilogramPerHourPerSquareMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlux FromKilogramsPerSecondPerSquareCentimeter(QuantityValue kilogramspersecondpersquarecentimeter) + public static MassFlux FromKilogramsPerSecondPerSquareCentimeter(double kilogramspersecondpersquarecentimeter) { - double value = (double) kilogramspersecondpersquarecentimeter; - return new MassFlux(value, MassFluxUnit.KilogramPerSecondPerSquareCentimeter); + return new MassFlux(kilogramspersecondpersquarecentimeter, MassFluxUnit.KilogramPerSecondPerSquareCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlux FromKilogramsPerSecondPerSquareMeter(QuantityValue kilogramspersecondpersquaremeter) + public static MassFlux FromKilogramsPerSecondPerSquareMeter(double kilogramspersecondpersquaremeter) { - double value = (double) kilogramspersecondpersquaremeter; - return new MassFlux(value, MassFluxUnit.KilogramPerSecondPerSquareMeter); + return new MassFlux(kilogramspersecondpersquaremeter, MassFluxUnit.KilogramPerSecondPerSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlux FromKilogramsPerSecondPerSquareMillimeter(QuantityValue kilogramspersecondpersquaremillimeter) + public static MassFlux FromKilogramsPerSecondPerSquareMillimeter(double kilogramspersecondpersquaremillimeter) { - double value = (double) kilogramspersecondpersquaremillimeter; - return new MassFlux(value, MassFluxUnit.KilogramPerSecondPerSquareMillimeter); + return new MassFlux(kilogramspersecondpersquaremillimeter, 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..391b74441d 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,240 +414,216 @@ 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 centigramspergram) { - double value = (double) centigramspergram; - return new MassFraction(value, MassFractionUnit.CentigramPerGram); + return new MassFraction(centigramspergram, MassFractionUnit.CentigramPerGram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFraction FromCentigramsPerKilogram(QuantityValue centigramsperkilogram) + public static MassFraction FromCentigramsPerKilogram(double centigramsperkilogram) { - double value = (double) centigramsperkilogram; - return new MassFraction(value, MassFractionUnit.CentigramPerKilogram); + return new MassFraction(centigramsperkilogram, MassFractionUnit.CentigramPerKilogram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFraction FromDecagramsPerGram(QuantityValue decagramspergram) + public static MassFraction FromDecagramsPerGram(double decagramspergram) { - double value = (double) decagramspergram; - return new MassFraction(value, MassFractionUnit.DecagramPerGram); + return new MassFraction(decagramspergram, MassFractionUnit.DecagramPerGram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFraction FromDecagramsPerKilogram(QuantityValue decagramsperkilogram) + public static MassFraction FromDecagramsPerKilogram(double decagramsperkilogram) { - double value = (double) decagramsperkilogram; - return new MassFraction(value, MassFractionUnit.DecagramPerKilogram); + return new MassFraction(decagramsperkilogram, MassFractionUnit.DecagramPerKilogram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFraction FromDecigramsPerGram(QuantityValue decigramspergram) + public static MassFraction FromDecigramsPerGram(double decigramspergram) { - double value = (double) decigramspergram; - return new MassFraction(value, MassFractionUnit.DecigramPerGram); + return new MassFraction(decigramspergram, MassFractionUnit.DecigramPerGram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFraction FromDecigramsPerKilogram(QuantityValue decigramsperkilogram) + public static MassFraction FromDecigramsPerKilogram(double decigramsperkilogram) { - double value = (double) decigramsperkilogram; - return new MassFraction(value, MassFractionUnit.DecigramPerKilogram); + return new MassFraction(decigramsperkilogram, MassFractionUnit.DecigramPerKilogram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFraction FromDecimalFractions(QuantityValue decimalfractions) + public static MassFraction FromDecimalFractions(double decimalfractions) { - double value = (double) decimalfractions; - return new MassFraction(value, MassFractionUnit.DecimalFraction); + return new MassFraction(decimalfractions, MassFractionUnit.DecimalFraction); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFraction FromGramsPerGram(QuantityValue gramspergram) + public static MassFraction FromGramsPerGram(double gramspergram) { - double value = (double) gramspergram; - return new MassFraction(value, MassFractionUnit.GramPerGram); + return new MassFraction(gramspergram, MassFractionUnit.GramPerGram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFraction FromGramsPerKilogram(QuantityValue gramsperkilogram) + public static MassFraction FromGramsPerKilogram(double gramsperkilogram) { - double value = (double) gramsperkilogram; - return new MassFraction(value, MassFractionUnit.GramPerKilogram); + return new MassFraction(gramsperkilogram, MassFractionUnit.GramPerKilogram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFraction FromHectogramsPerGram(QuantityValue hectogramspergram) + public static MassFraction FromHectogramsPerGram(double hectogramspergram) { - double value = (double) hectogramspergram; - return new MassFraction(value, MassFractionUnit.HectogramPerGram); + return new MassFraction(hectogramspergram, MassFractionUnit.HectogramPerGram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFraction FromHectogramsPerKilogram(QuantityValue hectogramsperkilogram) + public static MassFraction FromHectogramsPerKilogram(double hectogramsperkilogram) { - double value = (double) hectogramsperkilogram; - return new MassFraction(value, MassFractionUnit.HectogramPerKilogram); + return new MassFraction(hectogramsperkilogram, MassFractionUnit.HectogramPerKilogram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFraction FromKilogramsPerGram(QuantityValue kilogramspergram) + public static MassFraction FromKilogramsPerGram(double kilogramspergram) { - double value = (double) kilogramspergram; - return new MassFraction(value, MassFractionUnit.KilogramPerGram); + return new MassFraction(kilogramspergram, MassFractionUnit.KilogramPerGram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFraction FromKilogramsPerKilogram(QuantityValue kilogramsperkilogram) + public static MassFraction FromKilogramsPerKilogram(double kilogramsperkilogram) { - double value = (double) kilogramsperkilogram; - return new MassFraction(value, MassFractionUnit.KilogramPerKilogram); + return new MassFraction(kilogramsperkilogram, MassFractionUnit.KilogramPerKilogram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFraction FromMicrogramsPerGram(QuantityValue microgramspergram) + public static MassFraction FromMicrogramsPerGram(double microgramspergram) { - double value = (double) microgramspergram; - return new MassFraction(value, MassFractionUnit.MicrogramPerGram); + return new MassFraction(microgramspergram, MassFractionUnit.MicrogramPerGram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFraction FromMicrogramsPerKilogram(QuantityValue microgramsperkilogram) + public static MassFraction FromMicrogramsPerKilogram(double microgramsperkilogram) { - double value = (double) microgramsperkilogram; - return new MassFraction(value, MassFractionUnit.MicrogramPerKilogram); + return new MassFraction(microgramsperkilogram, MassFractionUnit.MicrogramPerKilogram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFraction FromMilligramsPerGram(QuantityValue milligramspergram) + public static MassFraction FromMilligramsPerGram(double milligramspergram) { - double value = (double) milligramspergram; - return new MassFraction(value, MassFractionUnit.MilligramPerGram); + return new MassFraction(milligramspergram, MassFractionUnit.MilligramPerGram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFraction FromMilligramsPerKilogram(QuantityValue milligramsperkilogram) + public static MassFraction FromMilligramsPerKilogram(double milligramsperkilogram) { - double value = (double) milligramsperkilogram; - return new MassFraction(value, MassFractionUnit.MilligramPerKilogram); + return new MassFraction(milligramsperkilogram, MassFractionUnit.MilligramPerKilogram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFraction FromNanogramsPerGram(QuantityValue nanogramspergram) + public static MassFraction FromNanogramsPerGram(double nanogramspergram) { - double value = (double) nanogramspergram; - return new MassFraction(value, MassFractionUnit.NanogramPerGram); + return new MassFraction(nanogramspergram, MassFractionUnit.NanogramPerGram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFraction FromNanogramsPerKilogram(QuantityValue nanogramsperkilogram) + public static MassFraction FromNanogramsPerKilogram(double nanogramsperkilogram) { - double value = (double) nanogramsperkilogram; - return new MassFraction(value, MassFractionUnit.NanogramPerKilogram); + return new MassFraction(nanogramsperkilogram, MassFractionUnit.NanogramPerKilogram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFraction FromPartsPerBillion(QuantityValue partsperbillion) + public static MassFraction FromPartsPerBillion(double partsperbillion) { - double value = (double) partsperbillion; - return new MassFraction(value, MassFractionUnit.PartPerBillion); + return new MassFraction(partsperbillion, MassFractionUnit.PartPerBillion); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFraction FromPartsPerMillion(QuantityValue partspermillion) + public static MassFraction FromPartsPerMillion(double partspermillion) { - double value = (double) partspermillion; - return new MassFraction(value, MassFractionUnit.PartPerMillion); + return new MassFraction(partspermillion, MassFractionUnit.PartPerMillion); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFraction FromPartsPerThousand(QuantityValue partsperthousand) + public static MassFraction FromPartsPerThousand(double partsperthousand) { - double value = (double) partsperthousand; - return new MassFraction(value, MassFractionUnit.PartPerThousand); + return new MassFraction(partsperthousand, MassFractionUnit.PartPerThousand); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFraction FromPartsPerTrillion(QuantityValue partspertrillion) + public static MassFraction FromPartsPerTrillion(double partspertrillion) { - double value = (double) partspertrillion; - return new MassFraction(value, MassFractionUnit.PartPerTrillion); + return new MassFraction(partspertrillion, MassFractionUnit.PartPerTrillion); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFraction FromPercent(QuantityValue percent) + public static MassFraction FromPercent(double percent) { - double value = (double) percent; - return new MassFraction(value, MassFractionUnit.Percent); + return new MassFraction(percent, 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..1c0c81e360 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,280 +437,252 @@ 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 gramsquarecentimeters) { - double value = (double) gramsquarecentimeters; - return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.GramSquareCentimeter); + return new MassMomentOfInertia(gramsquarecentimeters, MassMomentOfInertiaUnit.GramSquareCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromGramSquareDecimeters(QuantityValue gramsquaredecimeters) + public static MassMomentOfInertia FromGramSquareDecimeters(double gramsquaredecimeters) { - double value = (double) gramsquaredecimeters; - return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.GramSquareDecimeter); + return new MassMomentOfInertia(gramsquaredecimeters, MassMomentOfInertiaUnit.GramSquareDecimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromGramSquareMeters(QuantityValue gramsquaremeters) + public static MassMomentOfInertia FromGramSquareMeters(double gramsquaremeters) { - double value = (double) gramsquaremeters; - return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.GramSquareMeter); + return new MassMomentOfInertia(gramsquaremeters, MassMomentOfInertiaUnit.GramSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromGramSquareMillimeters(QuantityValue gramsquaremillimeters) + public static MassMomentOfInertia FromGramSquareMillimeters(double gramsquaremillimeters) { - double value = (double) gramsquaremillimeters; - return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.GramSquareMillimeter); + return new MassMomentOfInertia(gramsquaremillimeters, MassMomentOfInertiaUnit.GramSquareMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromKilogramSquareCentimeters(QuantityValue kilogramsquarecentimeters) + public static MassMomentOfInertia FromKilogramSquareCentimeters(double kilogramsquarecentimeters) { - double value = (double) kilogramsquarecentimeters; - return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.KilogramSquareCentimeter); + return new MassMomentOfInertia(kilogramsquarecentimeters, MassMomentOfInertiaUnit.KilogramSquareCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromKilogramSquareDecimeters(QuantityValue kilogramsquaredecimeters) + public static MassMomentOfInertia FromKilogramSquareDecimeters(double kilogramsquaredecimeters) { - double value = (double) kilogramsquaredecimeters; - return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.KilogramSquareDecimeter); + return new MassMomentOfInertia(kilogramsquaredecimeters, MassMomentOfInertiaUnit.KilogramSquareDecimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromKilogramSquareMeters(QuantityValue kilogramsquaremeters) + public static MassMomentOfInertia FromKilogramSquareMeters(double kilogramsquaremeters) { - double value = (double) kilogramsquaremeters; - return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.KilogramSquareMeter); + return new MassMomentOfInertia(kilogramsquaremeters, MassMomentOfInertiaUnit.KilogramSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromKilogramSquareMillimeters(QuantityValue kilogramsquaremillimeters) + public static MassMomentOfInertia FromKilogramSquareMillimeters(double kilogramsquaremillimeters) { - double value = (double) kilogramsquaremillimeters; - return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.KilogramSquareMillimeter); + return new MassMomentOfInertia(kilogramsquaremillimeters, MassMomentOfInertiaUnit.KilogramSquareMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromKilotonneSquareCentimeters(QuantityValue kilotonnesquarecentimeters) + public static MassMomentOfInertia FromKilotonneSquareCentimeters(double kilotonnesquarecentimeters) { - double value = (double) kilotonnesquarecentimeters; - return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.KilotonneSquareCentimeter); + return new MassMomentOfInertia(kilotonnesquarecentimeters, MassMomentOfInertiaUnit.KilotonneSquareCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromKilotonneSquareDecimeters(QuantityValue kilotonnesquaredecimeters) + public static MassMomentOfInertia FromKilotonneSquareDecimeters(double kilotonnesquaredecimeters) { - double value = (double) kilotonnesquaredecimeters; - return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.KilotonneSquareDecimeter); + return new MassMomentOfInertia(kilotonnesquaredecimeters, MassMomentOfInertiaUnit.KilotonneSquareDecimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromKilotonneSquareMeters(QuantityValue kilotonnesquaremeters) + public static MassMomentOfInertia FromKilotonneSquareMeters(double kilotonnesquaremeters) { - double value = (double) kilotonnesquaremeters; - return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.KilotonneSquareMeter); + return new MassMomentOfInertia(kilotonnesquaremeters, MassMomentOfInertiaUnit.KilotonneSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromKilotonneSquareMilimeters(QuantityValue kilotonnesquaremilimeters) + public static MassMomentOfInertia FromKilotonneSquareMilimeters(double kilotonnesquaremilimeters) { - double value = (double) kilotonnesquaremilimeters; - return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.KilotonneSquareMilimeter); + return new MassMomentOfInertia(kilotonnesquaremilimeters, MassMomentOfInertiaUnit.KilotonneSquareMilimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromMegatonneSquareCentimeters(QuantityValue megatonnesquarecentimeters) + public static MassMomentOfInertia FromMegatonneSquareCentimeters(double megatonnesquarecentimeters) { - double value = (double) megatonnesquarecentimeters; - return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.MegatonneSquareCentimeter); + return new MassMomentOfInertia(megatonnesquarecentimeters, MassMomentOfInertiaUnit.MegatonneSquareCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromMegatonneSquareDecimeters(QuantityValue megatonnesquaredecimeters) + public static MassMomentOfInertia FromMegatonneSquareDecimeters(double megatonnesquaredecimeters) { - double value = (double) megatonnesquaredecimeters; - return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.MegatonneSquareDecimeter); + return new MassMomentOfInertia(megatonnesquaredecimeters, MassMomentOfInertiaUnit.MegatonneSquareDecimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromMegatonneSquareMeters(QuantityValue megatonnesquaremeters) + public static MassMomentOfInertia FromMegatonneSquareMeters(double megatonnesquaremeters) { - double value = (double) megatonnesquaremeters; - return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.MegatonneSquareMeter); + return new MassMomentOfInertia(megatonnesquaremeters, MassMomentOfInertiaUnit.MegatonneSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromMegatonneSquareMilimeters(QuantityValue megatonnesquaremilimeters) + public static MassMomentOfInertia FromMegatonneSquareMilimeters(double megatonnesquaremilimeters) { - double value = (double) megatonnesquaremilimeters; - return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.MegatonneSquareMilimeter); + return new MassMomentOfInertia(megatonnesquaremilimeters, MassMomentOfInertiaUnit.MegatonneSquareMilimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromMilligramSquareCentimeters(QuantityValue milligramsquarecentimeters) + public static MassMomentOfInertia FromMilligramSquareCentimeters(double milligramsquarecentimeters) { - double value = (double) milligramsquarecentimeters; - return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.MilligramSquareCentimeter); + return new MassMomentOfInertia(milligramsquarecentimeters, MassMomentOfInertiaUnit.MilligramSquareCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromMilligramSquareDecimeters(QuantityValue milligramsquaredecimeters) + public static MassMomentOfInertia FromMilligramSquareDecimeters(double milligramsquaredecimeters) { - double value = (double) milligramsquaredecimeters; - return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.MilligramSquareDecimeter); + return new MassMomentOfInertia(milligramsquaredecimeters, MassMomentOfInertiaUnit.MilligramSquareDecimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromMilligramSquareMeters(QuantityValue milligramsquaremeters) + public static MassMomentOfInertia FromMilligramSquareMeters(double milligramsquaremeters) { - double value = (double) milligramsquaremeters; - return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.MilligramSquareMeter); + return new MassMomentOfInertia(milligramsquaremeters, MassMomentOfInertiaUnit.MilligramSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromMilligramSquareMillimeters(QuantityValue milligramsquaremillimeters) + public static MassMomentOfInertia FromMilligramSquareMillimeters(double milligramsquaremillimeters) { - double value = (double) milligramsquaremillimeters; - return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.MilligramSquareMillimeter); + return new MassMomentOfInertia(milligramsquaremillimeters, MassMomentOfInertiaUnit.MilligramSquareMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromPoundSquareFeet(QuantityValue poundsquarefeet) + public static MassMomentOfInertia FromPoundSquareFeet(double poundsquarefeet) { - double value = (double) poundsquarefeet; - return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.PoundSquareFoot); + return new MassMomentOfInertia(poundsquarefeet, MassMomentOfInertiaUnit.PoundSquareFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromPoundSquareInches(QuantityValue poundsquareinches) + public static MassMomentOfInertia FromPoundSquareInches(double poundsquareinches) { - double value = (double) poundsquareinches; - return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.PoundSquareInch); + return new MassMomentOfInertia(poundsquareinches, MassMomentOfInertiaUnit.PoundSquareInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromSlugSquareFeet(QuantityValue slugsquarefeet) + public static MassMomentOfInertia FromSlugSquareFeet(double slugsquarefeet) { - double value = (double) slugsquarefeet; - return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.SlugSquareFoot); + return new MassMomentOfInertia(slugsquarefeet, MassMomentOfInertiaUnit.SlugSquareFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromSlugSquareInches(QuantityValue slugsquareinches) + public static MassMomentOfInertia FromSlugSquareInches(double slugsquareinches) { - double value = (double) slugsquareinches; - return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.SlugSquareInch); + return new MassMomentOfInertia(slugsquareinches, MassMomentOfInertiaUnit.SlugSquareInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromTonneSquareCentimeters(QuantityValue tonnesquarecentimeters) + public static MassMomentOfInertia FromTonneSquareCentimeters(double tonnesquarecentimeters) { - double value = (double) tonnesquarecentimeters; - return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.TonneSquareCentimeter); + return new MassMomentOfInertia(tonnesquarecentimeters, MassMomentOfInertiaUnit.TonneSquareCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromTonneSquareDecimeters(QuantityValue tonnesquaredecimeters) + public static MassMomentOfInertia FromTonneSquareDecimeters(double tonnesquaredecimeters) { - double value = (double) tonnesquaredecimeters; - return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.TonneSquareDecimeter); + return new MassMomentOfInertia(tonnesquaredecimeters, MassMomentOfInertiaUnit.TonneSquareDecimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromTonneSquareMeters(QuantityValue tonnesquaremeters) + public static MassMomentOfInertia FromTonneSquareMeters(double tonnesquaremeters) { - double value = (double) tonnesquaremeters; - return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.TonneSquareMeter); + return new MassMomentOfInertia(tonnesquaremeters, MassMomentOfInertiaUnit.TonneSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromTonneSquareMilimeters(QuantityValue tonnesquaremilimeters) + public static MassMomentOfInertia FromTonneSquareMilimeters(double tonnesquaremilimeters) { - double value = (double) tonnesquaremilimeters; - return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.TonneSquareMilimeter); + return new MassMomentOfInertia(tonnesquaremilimeters, 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..da1b9a2d1b 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,20 +232,18 @@ 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 molespergram) { - double value = (double) molespergram; - return new Molality(value, MolalityUnit.MolePerGram); + return new Molality(molespergram, MolalityUnit.MolePerGram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Molality FromMolesPerKilogram(QuantityValue molesperkilogram) + public static Molality FromMolesPerKilogram(double molesperkilogram) { - double value = (double) molesperkilogram; - return new Molality(value, MolalityUnit.MolePerKilogram); + return new Molality(molesperkilogram, 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..bfba26db00 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,30 +237,27 @@ 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 joulespermole) { - double value = (double) joulespermole; - return new MolarEnergy(value, MolarEnergyUnit.JoulePerMole); + return new MolarEnergy(joulespermole, MolarEnergyUnit.JoulePerMole); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarEnergy FromKilojoulesPerMole(QuantityValue kilojoulespermole) + public static MolarEnergy FromKilojoulesPerMole(double kilojoulespermole) { - double value = (double) kilojoulespermole; - return new MolarEnergy(value, MolarEnergyUnit.KilojoulePerMole); + return new MolarEnergy(kilojoulespermole, MolarEnergyUnit.KilojoulePerMole); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarEnergy FromMegajoulesPerMole(QuantityValue megajoulespermole) + public static MolarEnergy FromMegajoulesPerMole(double megajoulespermole) { - double value = (double) megajoulespermole; - return new MolarEnergy(value, MolarEnergyUnit.MegajoulePerMole); + return new MolarEnergy(megajoulespermole, 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..b03a52aa8b 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,30 +237,27 @@ 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 joulespermolekelvin) { - double value = (double) joulespermolekelvin; - return new MolarEntropy(value, MolarEntropyUnit.JoulePerMoleKelvin); + return new MolarEntropy(joulespermolekelvin, MolarEntropyUnit.JoulePerMoleKelvin); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarEntropy FromKilojoulesPerMoleKelvin(QuantityValue kilojoulespermolekelvin) + public static MolarEntropy FromKilojoulesPerMoleKelvin(double kilojoulespermolekelvin) { - double value = (double) kilojoulespermolekelvin; - return new MolarEntropy(value, MolarEntropyUnit.KilojoulePerMoleKelvin); + return new MolarEntropy(kilojoulespermolekelvin, MolarEntropyUnit.KilojoulePerMoleKelvin); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarEntropy FromMegajoulesPerMoleKelvin(QuantityValue megajoulespermolekelvin) + public static MolarEntropy FromMegajoulesPerMoleKelvin(double megajoulespermolekelvin) { - double value = (double) megajoulespermolekelvin; - return new MolarEntropy(value, MolarEntropyUnit.MegajoulePerMoleKelvin); + return new MolarEntropy(megajoulespermolekelvin, 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..0dd64967c2 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,90 +294,81 @@ 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 kilomolesperhour) { - double value = (double) kilomolesperhour; - return new MolarFlow(value, MolarFlowUnit.KilomolePerHour); + return new MolarFlow(kilomolesperhour, MolarFlowUnit.KilomolePerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarFlow FromKilomolesPerMinute(QuantityValue kilomolesperminute) + public static MolarFlow FromKilomolesPerMinute(double kilomolesperminute) { - double value = (double) kilomolesperminute; - return new MolarFlow(value, MolarFlowUnit.KilomolePerMinute); + return new MolarFlow(kilomolesperminute, MolarFlowUnit.KilomolePerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarFlow FromKilomolesPerSecond(QuantityValue kilomolespersecond) + public static MolarFlow FromKilomolesPerSecond(double kilomolespersecond) { - double value = (double) kilomolespersecond; - return new MolarFlow(value, MolarFlowUnit.KilomolePerSecond); + return new MolarFlow(kilomolespersecond, MolarFlowUnit.KilomolePerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarFlow FromMolesPerHour(QuantityValue molesperhour) + public static MolarFlow FromMolesPerHour(double molesperhour) { - double value = (double) molesperhour; - return new MolarFlow(value, MolarFlowUnit.MolePerHour); + return new MolarFlow(molesperhour, MolarFlowUnit.MolePerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarFlow FromMolesPerMinute(QuantityValue molesperminute) + public static MolarFlow FromMolesPerMinute(double molesperminute) { - double value = (double) molesperminute; - return new MolarFlow(value, MolarFlowUnit.MolePerMinute); + return new MolarFlow(molesperminute, MolarFlowUnit.MolePerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarFlow FromMolesPerSecond(QuantityValue molespersecond) + public static MolarFlow FromMolesPerSecond(double molespersecond) { - double value = (double) molespersecond; - return new MolarFlow(value, MolarFlowUnit.MolePerSecond); + return new MolarFlow(molespersecond, MolarFlowUnit.MolePerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarFlow FromPoundMolesPerHour(QuantityValue poundmolesperhour) + public static MolarFlow FromPoundMolesPerHour(double poundmolesperhour) { - double value = (double) poundmolesperhour; - return new MolarFlow(value, MolarFlowUnit.PoundMolePerHour); + return new MolarFlow(poundmolesperhour, MolarFlowUnit.PoundMolePerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarFlow FromPoundMolesPerMinute(QuantityValue poundmolesperminute) + public static MolarFlow FromPoundMolesPerMinute(double poundmolesperminute) { - double value = (double) poundmolesperminute; - return new MolarFlow(value, MolarFlowUnit.PoundMolePerMinute); + return new MolarFlow(poundmolesperminute, MolarFlowUnit.PoundMolePerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarFlow FromPoundMolesPerSecond(QuantityValue poundmolespersecond) + public static MolarFlow FromPoundMolesPerSecond(double poundmolespersecond) { - double value = (double) poundmolespersecond; - return new MolarFlow(value, MolarFlowUnit.PoundMolePerSecond); + return new MolarFlow(poundmolespersecond, 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..3bfbb57fd7 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,130 +325,117 @@ 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 centigramspermole) { - double value = (double) centigramspermole; - return new MolarMass(value, MolarMassUnit.CentigramPerMole); + return new MolarMass(centigramspermole, MolarMassUnit.CentigramPerMole); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarMass FromDecagramsPerMole(QuantityValue decagramspermole) + public static MolarMass FromDecagramsPerMole(double decagramspermole) { - double value = (double) decagramspermole; - return new MolarMass(value, MolarMassUnit.DecagramPerMole); + return new MolarMass(decagramspermole, MolarMassUnit.DecagramPerMole); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarMass FromDecigramsPerMole(QuantityValue decigramspermole) + public static MolarMass FromDecigramsPerMole(double decigramspermole) { - double value = (double) decigramspermole; - return new MolarMass(value, MolarMassUnit.DecigramPerMole); + return new MolarMass(decigramspermole, MolarMassUnit.DecigramPerMole); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarMass FromGramsPerMole(QuantityValue gramspermole) + public static MolarMass FromGramsPerMole(double gramspermole) { - double value = (double) gramspermole; - return new MolarMass(value, MolarMassUnit.GramPerMole); + return new MolarMass(gramspermole, MolarMassUnit.GramPerMole); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarMass FromHectogramsPerMole(QuantityValue hectogramspermole) + public static MolarMass FromHectogramsPerMole(double hectogramspermole) { - double value = (double) hectogramspermole; - return new MolarMass(value, MolarMassUnit.HectogramPerMole); + return new MolarMass(hectogramspermole, MolarMassUnit.HectogramPerMole); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarMass FromKilogramsPerKilomole(QuantityValue kilogramsperkilomole) + public static MolarMass FromKilogramsPerKilomole(double kilogramsperkilomole) { - double value = (double) kilogramsperkilomole; - return new MolarMass(value, MolarMassUnit.KilogramPerKilomole); + return new MolarMass(kilogramsperkilomole, MolarMassUnit.KilogramPerKilomole); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarMass FromKilogramsPerMole(QuantityValue kilogramspermole) + public static MolarMass FromKilogramsPerMole(double kilogramspermole) { - double value = (double) kilogramspermole; - return new MolarMass(value, MolarMassUnit.KilogramPerMole); + return new MolarMass(kilogramspermole, MolarMassUnit.KilogramPerMole); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarMass FromKilopoundsPerMole(QuantityValue kilopoundspermole) + public static MolarMass FromKilopoundsPerMole(double kilopoundspermole) { - double value = (double) kilopoundspermole; - return new MolarMass(value, MolarMassUnit.KilopoundPerMole); + return new MolarMass(kilopoundspermole, MolarMassUnit.KilopoundPerMole); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarMass FromMegapoundsPerMole(QuantityValue megapoundspermole) + public static MolarMass FromMegapoundsPerMole(double megapoundspermole) { - double value = (double) megapoundspermole; - return new MolarMass(value, MolarMassUnit.MegapoundPerMole); + return new MolarMass(megapoundspermole, MolarMassUnit.MegapoundPerMole); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarMass FromMicrogramsPerMole(QuantityValue microgramspermole) + public static MolarMass FromMicrogramsPerMole(double microgramspermole) { - double value = (double) microgramspermole; - return new MolarMass(value, MolarMassUnit.MicrogramPerMole); + return new MolarMass(microgramspermole, MolarMassUnit.MicrogramPerMole); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarMass FromMilligramsPerMole(QuantityValue milligramspermole) + public static MolarMass FromMilligramsPerMole(double milligramspermole) { - double value = (double) milligramspermole; - return new MolarMass(value, MolarMassUnit.MilligramPerMole); + return new MolarMass(milligramspermole, MolarMassUnit.MilligramPerMole); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarMass FromNanogramsPerMole(QuantityValue nanogramspermole) + public static MolarMass FromNanogramsPerMole(double nanogramspermole) { - double value = (double) nanogramspermole; - return new MolarMass(value, MolarMassUnit.NanogramPerMole); + return new MolarMass(nanogramspermole, MolarMassUnit.NanogramPerMole); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarMass FromPoundsPerMole(QuantityValue poundspermole) + public static MolarMass FromPoundsPerMole(double poundspermole) { - double value = (double) poundspermole; - return new MolarMass(value, MolarMassUnit.PoundPerMole); + return new MolarMass(poundspermole, 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..65c56868a3 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,110 +311,99 @@ 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 centimolesperliter) { - double value = (double) centimolesperliter; - return new Molarity(value, MolarityUnit.CentimolePerLiter); + return new Molarity(centimolesperliter, MolarityUnit.CentimolePerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Molarity FromDecimolesPerLiter(QuantityValue decimolesperliter) + public static Molarity FromDecimolesPerLiter(double decimolesperliter) { - double value = (double) decimolesperliter; - return new Molarity(value, MolarityUnit.DecimolePerLiter); + return new Molarity(decimolesperliter, MolarityUnit.DecimolePerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Molarity FromFemtomolesPerLiter(QuantityValue femtomolesperliter) + public static Molarity FromFemtomolesPerLiter(double femtomolesperliter) { - double value = (double) femtomolesperliter; - return new Molarity(value, MolarityUnit.FemtomolePerLiter); + return new Molarity(femtomolesperliter, MolarityUnit.FemtomolePerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Molarity FromKilomolesPerCubicMeter(QuantityValue kilomolespercubicmeter) + public static Molarity FromKilomolesPerCubicMeter(double kilomolespercubicmeter) { - double value = (double) kilomolespercubicmeter; - return new Molarity(value, MolarityUnit.KilomolePerCubicMeter); + return new Molarity(kilomolespercubicmeter, MolarityUnit.KilomolePerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Molarity FromMicromolesPerLiter(QuantityValue micromolesperliter) + public static Molarity FromMicromolesPerLiter(double micromolesperliter) { - double value = (double) micromolesperliter; - return new Molarity(value, MolarityUnit.MicromolePerLiter); + return new Molarity(micromolesperliter, MolarityUnit.MicromolePerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Molarity FromMillimolesPerLiter(QuantityValue millimolesperliter) + public static Molarity FromMillimolesPerLiter(double millimolesperliter) { - double value = (double) millimolesperliter; - return new Molarity(value, MolarityUnit.MillimolePerLiter); + return new Molarity(millimolesperliter, MolarityUnit.MillimolePerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Molarity FromMolesPerCubicMeter(QuantityValue molespercubicmeter) + public static Molarity FromMolesPerCubicMeter(double molespercubicmeter) { - double value = (double) molespercubicmeter; - return new Molarity(value, MolarityUnit.MolePerCubicMeter); + return new Molarity(molespercubicmeter, MolarityUnit.MolePerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Molarity FromMolesPerLiter(QuantityValue molesperliter) + public static Molarity FromMolesPerLiter(double molesperliter) { - double value = (double) molesperliter; - return new Molarity(value, MolarityUnit.MolePerLiter); + return new Molarity(molesperliter, MolarityUnit.MolePerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Molarity FromNanomolesPerLiter(QuantityValue nanomolesperliter) + public static Molarity FromNanomolesPerLiter(double nanomolesperliter) { - double value = (double) nanomolesperliter; - return new Molarity(value, MolarityUnit.NanomolePerLiter); + return new Molarity(nanomolesperliter, MolarityUnit.NanomolePerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Molarity FromPicomolesPerLiter(QuantityValue picomolesperliter) + public static Molarity FromPicomolesPerLiter(double picomolesperliter) { - double value = (double) picomolesperliter; - return new Molarity(value, MolarityUnit.PicomolePerLiter); + return new Molarity(picomolesperliter, MolarityUnit.PicomolePerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Molarity FromPoundMolesPerCubicFoot(QuantityValue poundmolespercubicfoot) + public static Molarity FromPoundMolesPerCubicFoot(double poundmolespercubicfoot) { - double value = (double) poundmolespercubicfoot; - return new Molarity(value, MolarityUnit.PoundMolePerCubicFoot); + return new Molarity(poundmolespercubicfoot, 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..127dee07c2 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,10 +224,9 @@ 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 henriespermeter) { - double value = (double) henriespermeter; - return new Permeability(value, PermeabilityUnit.HenryPerMeter); + return new Permeability(henriespermeter, 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..0695207fde 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,10 +224,9 @@ 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 faradspermeter) { - double value = (double) faradspermeter; - return new Permittivity(value, PermittivityUnit.FaradPerMeter); + return new Permittivity(faradspermeter, 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..797b6278c8 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,50 +256,45 @@ 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 darcys) { - double value = (double) darcys; - return new PorousMediumPermeability(value, PorousMediumPermeabilityUnit.Darcy); + return new PorousMediumPermeability(darcys, PorousMediumPermeabilityUnit.Darcy); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PorousMediumPermeability FromMicrodarcys(QuantityValue microdarcys) + public static PorousMediumPermeability FromMicrodarcys(double microdarcys) { - double value = (double) microdarcys; - return new PorousMediumPermeability(value, PorousMediumPermeabilityUnit.Microdarcy); + return new PorousMediumPermeability(microdarcys, PorousMediumPermeabilityUnit.Microdarcy); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PorousMediumPermeability FromMillidarcys(QuantityValue millidarcys) + public static PorousMediumPermeability FromMillidarcys(double millidarcys) { - double value = (double) millidarcys; - return new PorousMediumPermeability(value, PorousMediumPermeabilityUnit.Millidarcy); + return new PorousMediumPermeability(millidarcys, PorousMediumPermeabilityUnit.Millidarcy); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PorousMediumPermeability FromSquareCentimeters(QuantityValue squarecentimeters) + public static PorousMediumPermeability FromSquareCentimeters(double squarecentimeters) { - double value = (double) squarecentimeters; - return new PorousMediumPermeability(value, PorousMediumPermeabilityUnit.SquareCentimeter); + return new PorousMediumPermeability(squarecentimeters, PorousMediumPermeabilityUnit.SquareCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PorousMediumPermeability FromSquareMeters(QuantityValue squaremeters) + public static PorousMediumPermeability FromSquareMeters(double squaremeters) { - double value = (double) squaremeters; - return new PorousMediumPermeability(value, PorousMediumPermeabilityUnit.SquareMeter); + return new PorousMediumPermeability(squaremeters, 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..aea66bf0d1 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,260 +438,234 @@ 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 boilerhorsepower) { - double value = (double) boilerhorsepower; - return new Power(value, PowerUnit.BoilerHorsepower); + return new Power(boilerhorsepower, PowerUnit.BoilerHorsepower); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Power FromBritishThermalUnitsPerHour(QuantityValue britishthermalunitsperhour) + public static Power FromBritishThermalUnitsPerHour(double britishthermalunitsperhour) { - double value = (double) britishthermalunitsperhour; - return new Power(value, PowerUnit.BritishThermalUnitPerHour); + return new Power(britishthermalunitsperhour, PowerUnit.BritishThermalUnitPerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Power FromDecawatts(QuantityValue decawatts) + public static Power FromDecawatts(double decawatts) { - double value = (double) decawatts; - return new Power(value, PowerUnit.Decawatt); + return new Power(decawatts, PowerUnit.Decawatt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Power FromDeciwatts(QuantityValue deciwatts) + public static Power FromDeciwatts(double deciwatts) { - double value = (double) deciwatts; - return new Power(value, PowerUnit.Deciwatt); + return new Power(deciwatts, PowerUnit.Deciwatt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Power FromElectricalHorsepower(QuantityValue electricalhorsepower) + public static Power FromElectricalHorsepower(double electricalhorsepower) { - double value = (double) electricalhorsepower; - return new Power(value, PowerUnit.ElectricalHorsepower); + return new Power(electricalhorsepower, PowerUnit.ElectricalHorsepower); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Power FromFemtowatts(QuantityValue femtowatts) + public static Power FromFemtowatts(double femtowatts) { - double value = (double) femtowatts; - return new Power(value, PowerUnit.Femtowatt); + return new Power(femtowatts, PowerUnit.Femtowatt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Power FromGigajoulesPerHour(QuantityValue gigajoulesperhour) + public static Power FromGigajoulesPerHour(double gigajoulesperhour) { - double value = (double) gigajoulesperhour; - return new Power(value, PowerUnit.GigajoulePerHour); + return new Power(gigajoulesperhour, PowerUnit.GigajoulePerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Power FromGigawatts(QuantityValue gigawatts) + public static Power FromGigawatts(double gigawatts) { - double value = (double) gigawatts; - return new Power(value, PowerUnit.Gigawatt); + return new Power(gigawatts, PowerUnit.Gigawatt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Power FromHydraulicHorsepower(QuantityValue hydraulichorsepower) + public static Power FromHydraulicHorsepower(double hydraulichorsepower) { - double value = (double) hydraulichorsepower; - return new Power(value, PowerUnit.HydraulicHorsepower); + return new Power(hydraulichorsepower, PowerUnit.HydraulicHorsepower); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Power FromJoulesPerHour(QuantityValue joulesperhour) + public static Power FromJoulesPerHour(double joulesperhour) { - double value = (double) joulesperhour; - return new Power(value, PowerUnit.JoulePerHour); + return new Power(joulesperhour, PowerUnit.JoulePerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Power FromKilobritishThermalUnitsPerHour(QuantityValue kilobritishthermalunitsperhour) + public static Power FromKilobritishThermalUnitsPerHour(double kilobritishthermalunitsperhour) { - double value = (double) kilobritishthermalunitsperhour; - return new Power(value, PowerUnit.KilobritishThermalUnitPerHour); + return new Power(kilobritishthermalunitsperhour, PowerUnit.KilobritishThermalUnitPerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Power FromKilojoulesPerHour(QuantityValue kilojoulesperhour) + public static Power FromKilojoulesPerHour(double kilojoulesperhour) { - double value = (double) kilojoulesperhour; - return new Power(value, PowerUnit.KilojoulePerHour); + return new Power(kilojoulesperhour, PowerUnit.KilojoulePerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Power FromKilowatts(QuantityValue kilowatts) + public static Power FromKilowatts(double kilowatts) { - double value = (double) kilowatts; - return new Power(value, PowerUnit.Kilowatt); + return new Power(kilowatts, PowerUnit.Kilowatt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Power FromMechanicalHorsepower(QuantityValue mechanicalhorsepower) + public static Power FromMechanicalHorsepower(double mechanicalhorsepower) { - double value = (double) mechanicalhorsepower; - return new Power(value, PowerUnit.MechanicalHorsepower); + return new Power(mechanicalhorsepower, PowerUnit.MechanicalHorsepower); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Power FromMegabritishThermalUnitsPerHour(QuantityValue megabritishthermalunitsperhour) + public static Power FromMegabritishThermalUnitsPerHour(double megabritishthermalunitsperhour) { - double value = (double) megabritishthermalunitsperhour; - return new Power(value, PowerUnit.MegabritishThermalUnitPerHour); + return new Power(megabritishthermalunitsperhour, PowerUnit.MegabritishThermalUnitPerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Power FromMegajoulesPerHour(QuantityValue megajoulesperhour) + public static Power FromMegajoulesPerHour(double megajoulesperhour) { - double value = (double) megajoulesperhour; - return new Power(value, PowerUnit.MegajoulePerHour); + return new Power(megajoulesperhour, PowerUnit.MegajoulePerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Power FromMegawatts(QuantityValue megawatts) + public static Power FromMegawatts(double megawatts) { - double value = (double) megawatts; - return new Power(value, PowerUnit.Megawatt); + return new Power(megawatts, PowerUnit.Megawatt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Power FromMetricHorsepower(QuantityValue metrichorsepower) + public static Power FromMetricHorsepower(double metrichorsepower) { - double value = (double) metrichorsepower; - return new Power(value, PowerUnit.MetricHorsepower); + return new Power(metrichorsepower, PowerUnit.MetricHorsepower); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Power FromMicrowatts(QuantityValue microwatts) + public static Power FromMicrowatts(double microwatts) { - double value = (double) microwatts; - return new Power(value, PowerUnit.Microwatt); + return new Power(microwatts, PowerUnit.Microwatt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Power FromMillijoulesPerHour(QuantityValue millijoulesperhour) + public static Power FromMillijoulesPerHour(double millijoulesperhour) { - double value = (double) millijoulesperhour; - return new Power(value, PowerUnit.MillijoulePerHour); + return new Power(millijoulesperhour, PowerUnit.MillijoulePerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Power FromMilliwatts(QuantityValue milliwatts) + public static Power FromMilliwatts(double milliwatts) { - double value = (double) milliwatts; - return new Power(value, PowerUnit.Milliwatt); + return new Power(milliwatts, PowerUnit.Milliwatt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Power FromNanowatts(QuantityValue nanowatts) + public static Power FromNanowatts(double nanowatts) { - double value = (double) nanowatts; - return new Power(value, PowerUnit.Nanowatt); + return new Power(nanowatts, PowerUnit.Nanowatt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Power FromPetawatts(QuantityValue petawatts) + public static Power FromPetawatts(double petawatts) { - double value = (double) petawatts; - return new Power(value, PowerUnit.Petawatt); + return new Power(petawatts, PowerUnit.Petawatt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Power FromPicowatts(QuantityValue picowatts) + public static Power FromPicowatts(double picowatts) { - double value = (double) picowatts; - return new Power(value, PowerUnit.Picowatt); + return new Power(picowatts, PowerUnit.Picowatt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Power FromTerawatts(QuantityValue terawatts) + public static Power FromTerawatts(double terawatts) { - double value = (double) terawatts; - return new Power(value, PowerUnit.Terawatt); + return new Power(terawatts, PowerUnit.Terawatt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Power FromWatts(QuantityValue watts) + public static Power FromWatts(double watts) { - double value = (double) watts; - return new Power(value, PowerUnit.Watt); + return new Power(watts, 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..22731dc022 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,440 +565,396 @@ 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 decawattspercubicfoot) { - double value = (double) decawattspercubicfoot; - return new PowerDensity(value, PowerDensityUnit.DecawattPerCubicFoot); + return new PowerDensity(decawattspercubicfoot, PowerDensityUnit.DecawattPerCubicFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromDecawattsPerCubicInch(QuantityValue decawattspercubicinch) + public static PowerDensity FromDecawattsPerCubicInch(double decawattspercubicinch) { - double value = (double) decawattspercubicinch; - return new PowerDensity(value, PowerDensityUnit.DecawattPerCubicInch); + return new PowerDensity(decawattspercubicinch, PowerDensityUnit.DecawattPerCubicInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromDecawattsPerCubicMeter(QuantityValue decawattspercubicmeter) + public static PowerDensity FromDecawattsPerCubicMeter(double decawattspercubicmeter) { - double value = (double) decawattspercubicmeter; - return new PowerDensity(value, PowerDensityUnit.DecawattPerCubicMeter); + return new PowerDensity(decawattspercubicmeter, PowerDensityUnit.DecawattPerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromDecawattsPerLiter(QuantityValue decawattsperliter) + public static PowerDensity FromDecawattsPerLiter(double decawattsperliter) { - double value = (double) decawattsperliter; - return new PowerDensity(value, PowerDensityUnit.DecawattPerLiter); + return new PowerDensity(decawattsperliter, PowerDensityUnit.DecawattPerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromDeciwattsPerCubicFoot(QuantityValue deciwattspercubicfoot) + public static PowerDensity FromDeciwattsPerCubicFoot(double deciwattspercubicfoot) { - double value = (double) deciwattspercubicfoot; - return new PowerDensity(value, PowerDensityUnit.DeciwattPerCubicFoot); + return new PowerDensity(deciwattspercubicfoot, PowerDensityUnit.DeciwattPerCubicFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromDeciwattsPerCubicInch(QuantityValue deciwattspercubicinch) + public static PowerDensity FromDeciwattsPerCubicInch(double deciwattspercubicinch) { - double value = (double) deciwattspercubicinch; - return new PowerDensity(value, PowerDensityUnit.DeciwattPerCubicInch); + return new PowerDensity(deciwattspercubicinch, PowerDensityUnit.DeciwattPerCubicInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromDeciwattsPerCubicMeter(QuantityValue deciwattspercubicmeter) + public static PowerDensity FromDeciwattsPerCubicMeter(double deciwattspercubicmeter) { - double value = (double) deciwattspercubicmeter; - return new PowerDensity(value, PowerDensityUnit.DeciwattPerCubicMeter); + return new PowerDensity(deciwattspercubicmeter, PowerDensityUnit.DeciwattPerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromDeciwattsPerLiter(QuantityValue deciwattsperliter) + public static PowerDensity FromDeciwattsPerLiter(double deciwattsperliter) { - double value = (double) deciwattsperliter; - return new PowerDensity(value, PowerDensityUnit.DeciwattPerLiter); + return new PowerDensity(deciwattsperliter, PowerDensityUnit.DeciwattPerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromGigawattsPerCubicFoot(QuantityValue gigawattspercubicfoot) + public static PowerDensity FromGigawattsPerCubicFoot(double gigawattspercubicfoot) { - double value = (double) gigawattspercubicfoot; - return new PowerDensity(value, PowerDensityUnit.GigawattPerCubicFoot); + return new PowerDensity(gigawattspercubicfoot, PowerDensityUnit.GigawattPerCubicFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromGigawattsPerCubicInch(QuantityValue gigawattspercubicinch) + public static PowerDensity FromGigawattsPerCubicInch(double gigawattspercubicinch) { - double value = (double) gigawattspercubicinch; - return new PowerDensity(value, PowerDensityUnit.GigawattPerCubicInch); + return new PowerDensity(gigawattspercubicinch, PowerDensityUnit.GigawattPerCubicInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromGigawattsPerCubicMeter(QuantityValue gigawattspercubicmeter) + public static PowerDensity FromGigawattsPerCubicMeter(double gigawattspercubicmeter) { - double value = (double) gigawattspercubicmeter; - return new PowerDensity(value, PowerDensityUnit.GigawattPerCubicMeter); + return new PowerDensity(gigawattspercubicmeter, PowerDensityUnit.GigawattPerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromGigawattsPerLiter(QuantityValue gigawattsperliter) + public static PowerDensity FromGigawattsPerLiter(double gigawattsperliter) { - double value = (double) gigawattsperliter; - return new PowerDensity(value, PowerDensityUnit.GigawattPerLiter); + return new PowerDensity(gigawattsperliter, PowerDensityUnit.GigawattPerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromKilowattsPerCubicFoot(QuantityValue kilowattspercubicfoot) + public static PowerDensity FromKilowattsPerCubicFoot(double kilowattspercubicfoot) { - double value = (double) kilowattspercubicfoot; - return new PowerDensity(value, PowerDensityUnit.KilowattPerCubicFoot); + return new PowerDensity(kilowattspercubicfoot, PowerDensityUnit.KilowattPerCubicFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromKilowattsPerCubicInch(QuantityValue kilowattspercubicinch) + public static PowerDensity FromKilowattsPerCubicInch(double kilowattspercubicinch) { - double value = (double) kilowattspercubicinch; - return new PowerDensity(value, PowerDensityUnit.KilowattPerCubicInch); + return new PowerDensity(kilowattspercubicinch, PowerDensityUnit.KilowattPerCubicInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromKilowattsPerCubicMeter(QuantityValue kilowattspercubicmeter) + public static PowerDensity FromKilowattsPerCubicMeter(double kilowattspercubicmeter) { - double value = (double) kilowattspercubicmeter; - return new PowerDensity(value, PowerDensityUnit.KilowattPerCubicMeter); + return new PowerDensity(kilowattspercubicmeter, PowerDensityUnit.KilowattPerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromKilowattsPerLiter(QuantityValue kilowattsperliter) + public static PowerDensity FromKilowattsPerLiter(double kilowattsperliter) { - double value = (double) kilowattsperliter; - return new PowerDensity(value, PowerDensityUnit.KilowattPerLiter); + return new PowerDensity(kilowattsperliter, PowerDensityUnit.KilowattPerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromMegawattsPerCubicFoot(QuantityValue megawattspercubicfoot) + public static PowerDensity FromMegawattsPerCubicFoot(double megawattspercubicfoot) { - double value = (double) megawattspercubicfoot; - return new PowerDensity(value, PowerDensityUnit.MegawattPerCubicFoot); + return new PowerDensity(megawattspercubicfoot, PowerDensityUnit.MegawattPerCubicFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromMegawattsPerCubicInch(QuantityValue megawattspercubicinch) + public static PowerDensity FromMegawattsPerCubicInch(double megawattspercubicinch) { - double value = (double) megawattspercubicinch; - return new PowerDensity(value, PowerDensityUnit.MegawattPerCubicInch); + return new PowerDensity(megawattspercubicinch, PowerDensityUnit.MegawattPerCubicInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromMegawattsPerCubicMeter(QuantityValue megawattspercubicmeter) + public static PowerDensity FromMegawattsPerCubicMeter(double megawattspercubicmeter) { - double value = (double) megawattspercubicmeter; - return new PowerDensity(value, PowerDensityUnit.MegawattPerCubicMeter); + return new PowerDensity(megawattspercubicmeter, PowerDensityUnit.MegawattPerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromMegawattsPerLiter(QuantityValue megawattsperliter) + public static PowerDensity FromMegawattsPerLiter(double megawattsperliter) { - double value = (double) megawattsperliter; - return new PowerDensity(value, PowerDensityUnit.MegawattPerLiter); + return new PowerDensity(megawattsperliter, PowerDensityUnit.MegawattPerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromMicrowattsPerCubicFoot(QuantityValue microwattspercubicfoot) + public static PowerDensity FromMicrowattsPerCubicFoot(double microwattspercubicfoot) { - double value = (double) microwattspercubicfoot; - return new PowerDensity(value, PowerDensityUnit.MicrowattPerCubicFoot); + return new PowerDensity(microwattspercubicfoot, PowerDensityUnit.MicrowattPerCubicFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromMicrowattsPerCubicInch(QuantityValue microwattspercubicinch) + public static PowerDensity FromMicrowattsPerCubicInch(double microwattspercubicinch) { - double value = (double) microwattspercubicinch; - return new PowerDensity(value, PowerDensityUnit.MicrowattPerCubicInch); + return new PowerDensity(microwattspercubicinch, PowerDensityUnit.MicrowattPerCubicInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromMicrowattsPerCubicMeter(QuantityValue microwattspercubicmeter) + public static PowerDensity FromMicrowattsPerCubicMeter(double microwattspercubicmeter) { - double value = (double) microwattspercubicmeter; - return new PowerDensity(value, PowerDensityUnit.MicrowattPerCubicMeter); + return new PowerDensity(microwattspercubicmeter, PowerDensityUnit.MicrowattPerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromMicrowattsPerLiter(QuantityValue microwattsperliter) + public static PowerDensity FromMicrowattsPerLiter(double microwattsperliter) { - double value = (double) microwattsperliter; - return new PowerDensity(value, PowerDensityUnit.MicrowattPerLiter); + return new PowerDensity(microwattsperliter, PowerDensityUnit.MicrowattPerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromMilliwattsPerCubicFoot(QuantityValue milliwattspercubicfoot) + public static PowerDensity FromMilliwattsPerCubicFoot(double milliwattspercubicfoot) { - double value = (double) milliwattspercubicfoot; - return new PowerDensity(value, PowerDensityUnit.MilliwattPerCubicFoot); + return new PowerDensity(milliwattspercubicfoot, PowerDensityUnit.MilliwattPerCubicFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromMilliwattsPerCubicInch(QuantityValue milliwattspercubicinch) + public static PowerDensity FromMilliwattsPerCubicInch(double milliwattspercubicinch) { - double value = (double) milliwattspercubicinch; - return new PowerDensity(value, PowerDensityUnit.MilliwattPerCubicInch); + return new PowerDensity(milliwattspercubicinch, PowerDensityUnit.MilliwattPerCubicInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromMilliwattsPerCubicMeter(QuantityValue milliwattspercubicmeter) + public static PowerDensity FromMilliwattsPerCubicMeter(double milliwattspercubicmeter) { - double value = (double) milliwattspercubicmeter; - return new PowerDensity(value, PowerDensityUnit.MilliwattPerCubicMeter); + return new PowerDensity(milliwattspercubicmeter, PowerDensityUnit.MilliwattPerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromMilliwattsPerLiter(QuantityValue milliwattsperliter) + public static PowerDensity FromMilliwattsPerLiter(double milliwattsperliter) { - double value = (double) milliwattsperliter; - return new PowerDensity(value, PowerDensityUnit.MilliwattPerLiter); + return new PowerDensity(milliwattsperliter, PowerDensityUnit.MilliwattPerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromNanowattsPerCubicFoot(QuantityValue nanowattspercubicfoot) + public static PowerDensity FromNanowattsPerCubicFoot(double nanowattspercubicfoot) { - double value = (double) nanowattspercubicfoot; - return new PowerDensity(value, PowerDensityUnit.NanowattPerCubicFoot); + return new PowerDensity(nanowattspercubicfoot, PowerDensityUnit.NanowattPerCubicFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromNanowattsPerCubicInch(QuantityValue nanowattspercubicinch) + public static PowerDensity FromNanowattsPerCubicInch(double nanowattspercubicinch) { - double value = (double) nanowattspercubicinch; - return new PowerDensity(value, PowerDensityUnit.NanowattPerCubicInch); + return new PowerDensity(nanowattspercubicinch, PowerDensityUnit.NanowattPerCubicInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromNanowattsPerCubicMeter(QuantityValue nanowattspercubicmeter) + public static PowerDensity FromNanowattsPerCubicMeter(double nanowattspercubicmeter) { - double value = (double) nanowattspercubicmeter; - return new PowerDensity(value, PowerDensityUnit.NanowattPerCubicMeter); + return new PowerDensity(nanowattspercubicmeter, PowerDensityUnit.NanowattPerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromNanowattsPerLiter(QuantityValue nanowattsperliter) + public static PowerDensity FromNanowattsPerLiter(double nanowattsperliter) { - double value = (double) nanowattsperliter; - return new PowerDensity(value, PowerDensityUnit.NanowattPerLiter); + return new PowerDensity(nanowattsperliter, PowerDensityUnit.NanowattPerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromPicowattsPerCubicFoot(QuantityValue picowattspercubicfoot) + public static PowerDensity FromPicowattsPerCubicFoot(double picowattspercubicfoot) { - double value = (double) picowattspercubicfoot; - return new PowerDensity(value, PowerDensityUnit.PicowattPerCubicFoot); + return new PowerDensity(picowattspercubicfoot, PowerDensityUnit.PicowattPerCubicFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromPicowattsPerCubicInch(QuantityValue picowattspercubicinch) + public static PowerDensity FromPicowattsPerCubicInch(double picowattspercubicinch) { - double value = (double) picowattspercubicinch; - return new PowerDensity(value, PowerDensityUnit.PicowattPerCubicInch); + return new PowerDensity(picowattspercubicinch, PowerDensityUnit.PicowattPerCubicInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromPicowattsPerCubicMeter(QuantityValue picowattspercubicmeter) + public static PowerDensity FromPicowattsPerCubicMeter(double picowattspercubicmeter) { - double value = (double) picowattspercubicmeter; - return new PowerDensity(value, PowerDensityUnit.PicowattPerCubicMeter); + return new PowerDensity(picowattspercubicmeter, PowerDensityUnit.PicowattPerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromPicowattsPerLiter(QuantityValue picowattsperliter) + public static PowerDensity FromPicowattsPerLiter(double picowattsperliter) { - double value = (double) picowattsperliter; - return new PowerDensity(value, PowerDensityUnit.PicowattPerLiter); + return new PowerDensity(picowattsperliter, PowerDensityUnit.PicowattPerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromTerawattsPerCubicFoot(QuantityValue terawattspercubicfoot) + public static PowerDensity FromTerawattsPerCubicFoot(double terawattspercubicfoot) { - double value = (double) terawattspercubicfoot; - return new PowerDensity(value, PowerDensityUnit.TerawattPerCubicFoot); + return new PowerDensity(terawattspercubicfoot, PowerDensityUnit.TerawattPerCubicFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromTerawattsPerCubicInch(QuantityValue terawattspercubicinch) + public static PowerDensity FromTerawattsPerCubicInch(double terawattspercubicinch) { - double value = (double) terawattspercubicinch; - return new PowerDensity(value, PowerDensityUnit.TerawattPerCubicInch); + return new PowerDensity(terawattspercubicinch, PowerDensityUnit.TerawattPerCubicInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromTerawattsPerCubicMeter(QuantityValue terawattspercubicmeter) + public static PowerDensity FromTerawattsPerCubicMeter(double terawattspercubicmeter) { - double value = (double) terawattspercubicmeter; - return new PowerDensity(value, PowerDensityUnit.TerawattPerCubicMeter); + return new PowerDensity(terawattspercubicmeter, PowerDensityUnit.TerawattPerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromTerawattsPerLiter(QuantityValue terawattsperliter) + public static PowerDensity FromTerawattsPerLiter(double terawattsperliter) { - double value = (double) terawattsperliter; - return new PowerDensity(value, PowerDensityUnit.TerawattPerLiter); + return new PowerDensity(terawattsperliter, PowerDensityUnit.TerawattPerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromWattsPerCubicFoot(QuantityValue wattspercubicfoot) + public static PowerDensity FromWattsPerCubicFoot(double wattspercubicfoot) { - double value = (double) wattspercubicfoot; - return new PowerDensity(value, PowerDensityUnit.WattPerCubicFoot); + return new PowerDensity(wattspercubicfoot, PowerDensityUnit.WattPerCubicFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromWattsPerCubicInch(QuantityValue wattspercubicinch) + public static PowerDensity FromWattsPerCubicInch(double wattspercubicinch) { - double value = (double) wattspercubicinch; - return new PowerDensity(value, PowerDensityUnit.WattPerCubicInch); + return new PowerDensity(wattspercubicinch, PowerDensityUnit.WattPerCubicInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromWattsPerCubicMeter(QuantityValue wattspercubicmeter) + public static PowerDensity FromWattsPerCubicMeter(double wattspercubicmeter) { - double value = (double) wattspercubicmeter; - return new PowerDensity(value, PowerDensityUnit.WattPerCubicMeter); + return new PowerDensity(wattspercubicmeter, PowerDensityUnit.WattPerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromWattsPerLiter(QuantityValue wattsperliter) + public static PowerDensity FromWattsPerLiter(double wattsperliter) { - double value = (double) wattsperliter; - return new PowerDensity(value, PowerDensityUnit.WattPerLiter); + return new PowerDensity(wattsperliter, 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..32d914c432 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,20 +229,18 @@ 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 decibelmilliwatts) { - double value = (double) decibelmilliwatts; - return new PowerRatio(value, PowerRatioUnit.DecibelMilliwatt); + return new PowerRatio(decibelmilliwatts, PowerRatioUnit.DecibelMilliwatt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerRatio FromDecibelWatts(QuantityValue decibelwatts) + public static PowerRatio FromDecibelWatts(double decibelwatts) { - double value = (double) decibelwatts; - return new PowerRatio(value, PowerRatioUnit.DecibelWatt); + return new PowerRatio(decibelwatts, 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..a0c06f2a49 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,490 +617,441 @@ 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 atmospheres) { - double value = (double) atmospheres; - return new Pressure(value, PressureUnit.Atmosphere); + return new Pressure(atmospheres, PressureUnit.Atmosphere); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromBars(QuantityValue bars) + public static Pressure FromBars(double bars) { - double value = (double) bars; - return new Pressure(value, PressureUnit.Bar); + return new Pressure(bars, PressureUnit.Bar); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromCentibars(QuantityValue centibars) + public static Pressure FromCentibars(double centibars) { - double value = (double) centibars; - return new Pressure(value, PressureUnit.Centibar); + return new Pressure(centibars, PressureUnit.Centibar); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromCentimetersOfWaterColumn(QuantityValue centimetersofwatercolumn) + public static Pressure FromCentimetersOfWaterColumn(double centimetersofwatercolumn) { - double value = (double) centimetersofwatercolumn; - return new Pressure(value, PressureUnit.CentimeterOfWaterColumn); + return new Pressure(centimetersofwatercolumn, PressureUnit.CentimeterOfWaterColumn); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromDecapascals(QuantityValue decapascals) + public static Pressure FromDecapascals(double decapascals) { - double value = (double) decapascals; - return new Pressure(value, PressureUnit.Decapascal); + return new Pressure(decapascals, PressureUnit.Decapascal); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromDecibars(QuantityValue decibars) + public static Pressure FromDecibars(double decibars) { - double value = (double) decibars; - return new Pressure(value, PressureUnit.Decibar); + return new Pressure(decibars, PressureUnit.Decibar); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromDynesPerSquareCentimeter(QuantityValue dynespersquarecentimeter) + public static Pressure FromDynesPerSquareCentimeter(double dynespersquarecentimeter) { - double value = (double) dynespersquarecentimeter; - return new Pressure(value, PressureUnit.DynePerSquareCentimeter); + return new Pressure(dynespersquarecentimeter, PressureUnit.DynePerSquareCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromFeetOfElevation(QuantityValue feetofelevation) + public static Pressure FromFeetOfElevation(double feetofelevation) { - double value = (double) feetofelevation; - return new Pressure(value, PressureUnit.FootOfElevation); + return new Pressure(feetofelevation, PressureUnit.FootOfElevation); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromFeetOfHead(QuantityValue feetofhead) + public static Pressure FromFeetOfHead(double feetofhead) { - double value = (double) feetofhead; - return new Pressure(value, PressureUnit.FootOfHead); + return new Pressure(feetofhead, PressureUnit.FootOfHead); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromGigapascals(QuantityValue gigapascals) + public static Pressure FromGigapascals(double gigapascals) { - double value = (double) gigapascals; - return new Pressure(value, PressureUnit.Gigapascal); + return new Pressure(gigapascals, PressureUnit.Gigapascal); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromHectopascals(QuantityValue hectopascals) + public static Pressure FromHectopascals(double hectopascals) { - double value = (double) hectopascals; - return new Pressure(value, PressureUnit.Hectopascal); + return new Pressure(hectopascals, PressureUnit.Hectopascal); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromInchesOfMercury(QuantityValue inchesofmercury) + public static Pressure FromInchesOfMercury(double inchesofmercury) { - double value = (double) inchesofmercury; - return new Pressure(value, PressureUnit.InchOfMercury); + return new Pressure(inchesofmercury, PressureUnit.InchOfMercury); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromInchesOfWaterColumn(QuantityValue inchesofwatercolumn) + public static Pressure FromInchesOfWaterColumn(double inchesofwatercolumn) { - double value = (double) inchesofwatercolumn; - return new Pressure(value, PressureUnit.InchOfWaterColumn); + return new Pressure(inchesofwatercolumn, PressureUnit.InchOfWaterColumn); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromKilobars(QuantityValue kilobars) + public static Pressure FromKilobars(double kilobars) { - double value = (double) kilobars; - return new Pressure(value, PressureUnit.Kilobar); + return new Pressure(kilobars, PressureUnit.Kilobar); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromKilogramsForcePerSquareCentimeter(QuantityValue kilogramsforcepersquarecentimeter) + public static Pressure FromKilogramsForcePerSquareCentimeter(double kilogramsforcepersquarecentimeter) { - double value = (double) kilogramsforcepersquarecentimeter; - return new Pressure(value, PressureUnit.KilogramForcePerSquareCentimeter); + return new Pressure(kilogramsforcepersquarecentimeter, PressureUnit.KilogramForcePerSquareCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromKilogramsForcePerSquareMeter(QuantityValue kilogramsforcepersquaremeter) + public static Pressure FromKilogramsForcePerSquareMeter(double kilogramsforcepersquaremeter) { - double value = (double) kilogramsforcepersquaremeter; - return new Pressure(value, PressureUnit.KilogramForcePerSquareMeter); + return new Pressure(kilogramsforcepersquaremeter, PressureUnit.KilogramForcePerSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromKilogramsForcePerSquareMillimeter(QuantityValue kilogramsforcepersquaremillimeter) + public static Pressure FromKilogramsForcePerSquareMillimeter(double kilogramsforcepersquaremillimeter) { - double value = (double) kilogramsforcepersquaremillimeter; - return new Pressure(value, PressureUnit.KilogramForcePerSquareMillimeter); + return new Pressure(kilogramsforcepersquaremillimeter, PressureUnit.KilogramForcePerSquareMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromKilonewtonsPerSquareCentimeter(QuantityValue kilonewtonspersquarecentimeter) + public static Pressure FromKilonewtonsPerSquareCentimeter(double kilonewtonspersquarecentimeter) { - double value = (double) kilonewtonspersquarecentimeter; - return new Pressure(value, PressureUnit.KilonewtonPerSquareCentimeter); + return new Pressure(kilonewtonspersquarecentimeter, PressureUnit.KilonewtonPerSquareCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromKilonewtonsPerSquareMeter(QuantityValue kilonewtonspersquaremeter) + public static Pressure FromKilonewtonsPerSquareMeter(double kilonewtonspersquaremeter) { - double value = (double) kilonewtonspersquaremeter; - return new Pressure(value, PressureUnit.KilonewtonPerSquareMeter); + return new Pressure(kilonewtonspersquaremeter, PressureUnit.KilonewtonPerSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromKilonewtonsPerSquareMillimeter(QuantityValue kilonewtonspersquaremillimeter) + public static Pressure FromKilonewtonsPerSquareMillimeter(double kilonewtonspersquaremillimeter) { - double value = (double) kilonewtonspersquaremillimeter; - return new Pressure(value, PressureUnit.KilonewtonPerSquareMillimeter); + return new Pressure(kilonewtonspersquaremillimeter, PressureUnit.KilonewtonPerSquareMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromKilopascals(QuantityValue kilopascals) + public static Pressure FromKilopascals(double kilopascals) { - double value = (double) kilopascals; - return new Pressure(value, PressureUnit.Kilopascal); + return new Pressure(kilopascals, PressureUnit.Kilopascal); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromKilopoundsForcePerSquareFoot(QuantityValue kilopoundsforcepersquarefoot) + public static Pressure FromKilopoundsForcePerSquareFoot(double kilopoundsforcepersquarefoot) { - double value = (double) kilopoundsforcepersquarefoot; - return new Pressure(value, PressureUnit.KilopoundForcePerSquareFoot); + return new Pressure(kilopoundsforcepersquarefoot, PressureUnit.KilopoundForcePerSquareFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromKilopoundsForcePerSquareInch(QuantityValue kilopoundsforcepersquareinch) + public static Pressure FromKilopoundsForcePerSquareInch(double kilopoundsforcepersquareinch) { - double value = (double) kilopoundsforcepersquareinch; - return new Pressure(value, PressureUnit.KilopoundForcePerSquareInch); + return new Pressure(kilopoundsforcepersquareinch, PressureUnit.KilopoundForcePerSquareInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromKilopoundsForcePerSquareMil(QuantityValue kilopoundsforcepersquaremil) + public static Pressure FromKilopoundsForcePerSquareMil(double kilopoundsforcepersquaremil) { - double value = (double) kilopoundsforcepersquaremil; - return new Pressure(value, PressureUnit.KilopoundForcePerSquareMil); + return new Pressure(kilopoundsforcepersquaremil, PressureUnit.KilopoundForcePerSquareMil); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromMegabars(QuantityValue megabars) + public static Pressure FromMegabars(double megabars) { - double value = (double) megabars; - return new Pressure(value, PressureUnit.Megabar); + return new Pressure(megabars, PressureUnit.Megabar); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromMeganewtonsPerSquareMeter(QuantityValue meganewtonspersquaremeter) + public static Pressure FromMeganewtonsPerSquareMeter(double meganewtonspersquaremeter) { - double value = (double) meganewtonspersquaremeter; - return new Pressure(value, PressureUnit.MeganewtonPerSquareMeter); + return new Pressure(meganewtonspersquaremeter, PressureUnit.MeganewtonPerSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromMegapascals(QuantityValue megapascals) + public static Pressure FromMegapascals(double megapascals) { - double value = (double) megapascals; - return new Pressure(value, PressureUnit.Megapascal); + return new Pressure(megapascals, PressureUnit.Megapascal); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromMetersOfElevation(QuantityValue metersofelevation) + public static Pressure FromMetersOfElevation(double metersofelevation) { - double value = (double) metersofelevation; - return new Pressure(value, PressureUnit.MeterOfElevation); + return new Pressure(metersofelevation, PressureUnit.MeterOfElevation); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromMetersOfHead(QuantityValue metersofhead) + public static Pressure FromMetersOfHead(double metersofhead) { - double value = (double) metersofhead; - return new Pressure(value, PressureUnit.MeterOfHead); + return new Pressure(metersofhead, PressureUnit.MeterOfHead); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromMetersOfWaterColumn(QuantityValue metersofwatercolumn) + public static Pressure FromMetersOfWaterColumn(double metersofwatercolumn) { - double value = (double) metersofwatercolumn; - return new Pressure(value, PressureUnit.MeterOfWaterColumn); + return new Pressure(metersofwatercolumn, PressureUnit.MeterOfWaterColumn); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromMicrobars(QuantityValue microbars) + public static Pressure FromMicrobars(double microbars) { - double value = (double) microbars; - return new Pressure(value, PressureUnit.Microbar); + return new Pressure(microbars, PressureUnit.Microbar); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromMicropascals(QuantityValue micropascals) + public static Pressure FromMicropascals(double micropascals) { - double value = (double) micropascals; - return new Pressure(value, PressureUnit.Micropascal); + return new Pressure(micropascals, PressureUnit.Micropascal); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromMillibars(QuantityValue millibars) + public static Pressure FromMillibars(double millibars) { - double value = (double) millibars; - return new Pressure(value, PressureUnit.Millibar); + return new Pressure(millibars, PressureUnit.Millibar); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromMillimetersOfMercury(QuantityValue millimetersofmercury) + public static Pressure FromMillimetersOfMercury(double millimetersofmercury) { - double value = (double) millimetersofmercury; - return new Pressure(value, PressureUnit.MillimeterOfMercury); + return new Pressure(millimetersofmercury, PressureUnit.MillimeterOfMercury); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromMillimetersOfWaterColumn(QuantityValue millimetersofwatercolumn) + public static Pressure FromMillimetersOfWaterColumn(double millimetersofwatercolumn) { - double value = (double) millimetersofwatercolumn; - return new Pressure(value, PressureUnit.MillimeterOfWaterColumn); + return new Pressure(millimetersofwatercolumn, PressureUnit.MillimeterOfWaterColumn); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromMillipascals(QuantityValue millipascals) + public static Pressure FromMillipascals(double millipascals) { - double value = (double) millipascals; - return new Pressure(value, PressureUnit.Millipascal); + return new Pressure(millipascals, PressureUnit.Millipascal); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromNewtonsPerSquareCentimeter(QuantityValue newtonspersquarecentimeter) + public static Pressure FromNewtonsPerSquareCentimeter(double newtonspersquarecentimeter) { - double value = (double) newtonspersquarecentimeter; - return new Pressure(value, PressureUnit.NewtonPerSquareCentimeter); + return new Pressure(newtonspersquarecentimeter, PressureUnit.NewtonPerSquareCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromNewtonsPerSquareMeter(QuantityValue newtonspersquaremeter) + public static Pressure FromNewtonsPerSquareMeter(double newtonspersquaremeter) { - double value = (double) newtonspersquaremeter; - return new Pressure(value, PressureUnit.NewtonPerSquareMeter); + return new Pressure(newtonspersquaremeter, PressureUnit.NewtonPerSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromNewtonsPerSquareMillimeter(QuantityValue newtonspersquaremillimeter) + public static Pressure FromNewtonsPerSquareMillimeter(double newtonspersquaremillimeter) { - double value = (double) newtonspersquaremillimeter; - return new Pressure(value, PressureUnit.NewtonPerSquareMillimeter); + return new Pressure(newtonspersquaremillimeter, PressureUnit.NewtonPerSquareMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromPascals(QuantityValue pascals) + public static Pressure FromPascals(double pascals) { - double value = (double) pascals; - return new Pressure(value, PressureUnit.Pascal); + return new Pressure(pascals, PressureUnit.Pascal); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromPoundsForcePerSquareFoot(QuantityValue poundsforcepersquarefoot) + public static Pressure FromPoundsForcePerSquareFoot(double poundsforcepersquarefoot) { - double value = (double) poundsforcepersquarefoot; - return new Pressure(value, PressureUnit.PoundForcePerSquareFoot); + return new Pressure(poundsforcepersquarefoot, PressureUnit.PoundForcePerSquareFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromPoundsForcePerSquareInch(QuantityValue poundsforcepersquareinch) + public static Pressure FromPoundsForcePerSquareInch(double poundsforcepersquareinch) { - double value = (double) poundsforcepersquareinch; - return new Pressure(value, PressureUnit.PoundForcePerSquareInch); + return new Pressure(poundsforcepersquareinch, PressureUnit.PoundForcePerSquareInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromPoundsForcePerSquareMil(QuantityValue poundsforcepersquaremil) + public static Pressure FromPoundsForcePerSquareMil(double poundsforcepersquaremil) { - double value = (double) poundsforcepersquaremil; - return new Pressure(value, PressureUnit.PoundForcePerSquareMil); + return new Pressure(poundsforcepersquaremil, PressureUnit.PoundForcePerSquareMil); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromPoundsPerInchSecondSquared(QuantityValue poundsperinchsecondsquared) + public static Pressure FromPoundsPerInchSecondSquared(double poundsperinchsecondsquared) { - double value = (double) poundsperinchsecondsquared; - return new Pressure(value, PressureUnit.PoundPerInchSecondSquared); + return new Pressure(poundsperinchsecondsquared, PressureUnit.PoundPerInchSecondSquared); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromTechnicalAtmospheres(QuantityValue technicalatmospheres) + public static Pressure FromTechnicalAtmospheres(double technicalatmospheres) { - double value = (double) technicalatmospheres; - return new Pressure(value, PressureUnit.TechnicalAtmosphere); + return new Pressure(technicalatmospheres, PressureUnit.TechnicalAtmosphere); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromTonnesForcePerSquareCentimeter(QuantityValue tonnesforcepersquarecentimeter) + public static Pressure FromTonnesForcePerSquareCentimeter(double tonnesforcepersquarecentimeter) { - double value = (double) tonnesforcepersquarecentimeter; - return new Pressure(value, PressureUnit.TonneForcePerSquareCentimeter); + return new Pressure(tonnesforcepersquarecentimeter, PressureUnit.TonneForcePerSquareCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromTonnesForcePerSquareMeter(QuantityValue tonnesforcepersquaremeter) + public static Pressure FromTonnesForcePerSquareMeter(double tonnesforcepersquaremeter) { - double value = (double) tonnesforcepersquaremeter; - return new Pressure(value, PressureUnit.TonneForcePerSquareMeter); + return new Pressure(tonnesforcepersquaremeter, PressureUnit.TonneForcePerSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromTonnesForcePerSquareMillimeter(QuantityValue tonnesforcepersquaremillimeter) + public static Pressure FromTonnesForcePerSquareMillimeter(double tonnesforcepersquaremillimeter) { - double value = (double) tonnesforcepersquaremillimeter; - return new Pressure(value, PressureUnit.TonneForcePerSquareMillimeter); + return new Pressure(tonnesforcepersquaremillimeter, PressureUnit.TonneForcePerSquareMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromTorrs(QuantityValue torrs) + public static Pressure FromTorrs(double torrs) { - double value = (double) torrs; - return new Pressure(value, PressureUnit.Torr); + return new Pressure(torrs, 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..e7db9ac5b0 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,180 +364,162 @@ 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 atmospherespersecond) { - double value = (double) atmospherespersecond; - return new PressureChangeRate(value, PressureChangeRateUnit.AtmospherePerSecond); + return new PressureChangeRate(atmospherespersecond, PressureChangeRateUnit.AtmospherePerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PressureChangeRate FromBarsPerMinute(QuantityValue barsperminute) + public static PressureChangeRate FromBarsPerMinute(double barsperminute) { - double value = (double) barsperminute; - return new PressureChangeRate(value, PressureChangeRateUnit.BarPerMinute); + return new PressureChangeRate(barsperminute, PressureChangeRateUnit.BarPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PressureChangeRate FromBarsPerSecond(QuantityValue barspersecond) + public static PressureChangeRate FromBarsPerSecond(double barspersecond) { - double value = (double) barspersecond; - return new PressureChangeRate(value, PressureChangeRateUnit.BarPerSecond); + return new PressureChangeRate(barspersecond, PressureChangeRateUnit.BarPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PressureChangeRate FromKilopascalsPerMinute(QuantityValue kilopascalsperminute) + public static PressureChangeRate FromKilopascalsPerMinute(double kilopascalsperminute) { - double value = (double) kilopascalsperminute; - return new PressureChangeRate(value, PressureChangeRateUnit.KilopascalPerMinute); + return new PressureChangeRate(kilopascalsperminute, PressureChangeRateUnit.KilopascalPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PressureChangeRate FromKilopascalsPerSecond(QuantityValue kilopascalspersecond) + public static PressureChangeRate FromKilopascalsPerSecond(double kilopascalspersecond) { - double value = (double) kilopascalspersecond; - return new PressureChangeRate(value, PressureChangeRateUnit.KilopascalPerSecond); + return new PressureChangeRate(kilopascalspersecond, PressureChangeRateUnit.KilopascalPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PressureChangeRate FromKilopoundsForcePerSquareInchPerMinute(QuantityValue kilopoundsforcepersquareinchperminute) + public static PressureChangeRate FromKilopoundsForcePerSquareInchPerMinute(double kilopoundsforcepersquareinchperminute) { - double value = (double) kilopoundsforcepersquareinchperminute; - return new PressureChangeRate(value, PressureChangeRateUnit.KilopoundForcePerSquareInchPerMinute); + return new PressureChangeRate(kilopoundsforcepersquareinchperminute, PressureChangeRateUnit.KilopoundForcePerSquareInchPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PressureChangeRate FromKilopoundsForcePerSquareInchPerSecond(QuantityValue kilopoundsforcepersquareinchpersecond) + public static PressureChangeRate FromKilopoundsForcePerSquareInchPerSecond(double kilopoundsforcepersquareinchpersecond) { - double value = (double) kilopoundsforcepersquareinchpersecond; - return new PressureChangeRate(value, PressureChangeRateUnit.KilopoundForcePerSquareInchPerSecond); + return new PressureChangeRate(kilopoundsforcepersquareinchpersecond, PressureChangeRateUnit.KilopoundForcePerSquareInchPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PressureChangeRate FromMegapascalsPerMinute(QuantityValue megapascalsperminute) + public static PressureChangeRate FromMegapascalsPerMinute(double megapascalsperminute) { - double value = (double) megapascalsperminute; - return new PressureChangeRate(value, PressureChangeRateUnit.MegapascalPerMinute); + return new PressureChangeRate(megapascalsperminute, PressureChangeRateUnit.MegapascalPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PressureChangeRate FromMegapascalsPerSecond(QuantityValue megapascalspersecond) + public static PressureChangeRate FromMegapascalsPerSecond(double megapascalspersecond) { - double value = (double) megapascalspersecond; - return new PressureChangeRate(value, PressureChangeRateUnit.MegapascalPerSecond); + return new PressureChangeRate(megapascalspersecond, PressureChangeRateUnit.MegapascalPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PressureChangeRate FromMegapoundsForcePerSquareInchPerMinute(QuantityValue megapoundsforcepersquareinchperminute) + public static PressureChangeRate FromMegapoundsForcePerSquareInchPerMinute(double megapoundsforcepersquareinchperminute) { - double value = (double) megapoundsforcepersquareinchperminute; - return new PressureChangeRate(value, PressureChangeRateUnit.MegapoundForcePerSquareInchPerMinute); + return new PressureChangeRate(megapoundsforcepersquareinchperminute, PressureChangeRateUnit.MegapoundForcePerSquareInchPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PressureChangeRate FromMegapoundsForcePerSquareInchPerSecond(QuantityValue megapoundsforcepersquareinchpersecond) + public static PressureChangeRate FromMegapoundsForcePerSquareInchPerSecond(double megapoundsforcepersquareinchpersecond) { - double value = (double) megapoundsforcepersquareinchpersecond; - return new PressureChangeRate(value, PressureChangeRateUnit.MegapoundForcePerSquareInchPerSecond); + return new PressureChangeRate(megapoundsforcepersquareinchpersecond, PressureChangeRateUnit.MegapoundForcePerSquareInchPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PressureChangeRate FromMillibarsPerMinute(QuantityValue millibarsperminute) + public static PressureChangeRate FromMillibarsPerMinute(double millibarsperminute) { - double value = (double) millibarsperminute; - return new PressureChangeRate(value, PressureChangeRateUnit.MillibarPerMinute); + return new PressureChangeRate(millibarsperminute, PressureChangeRateUnit.MillibarPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PressureChangeRate FromMillibarsPerSecond(QuantityValue millibarspersecond) + public static PressureChangeRate FromMillibarsPerSecond(double millibarspersecond) { - double value = (double) millibarspersecond; - return new PressureChangeRate(value, PressureChangeRateUnit.MillibarPerSecond); + return new PressureChangeRate(millibarspersecond, PressureChangeRateUnit.MillibarPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PressureChangeRate FromMillimetersOfMercuryPerSecond(QuantityValue millimetersofmercurypersecond) + public static PressureChangeRate FromMillimetersOfMercuryPerSecond(double millimetersofmercurypersecond) { - double value = (double) millimetersofmercurypersecond; - return new PressureChangeRate(value, PressureChangeRateUnit.MillimeterOfMercuryPerSecond); + return new PressureChangeRate(millimetersofmercurypersecond, PressureChangeRateUnit.MillimeterOfMercuryPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PressureChangeRate FromPascalsPerMinute(QuantityValue pascalsperminute) + public static PressureChangeRate FromPascalsPerMinute(double pascalsperminute) { - double value = (double) pascalsperminute; - return new PressureChangeRate(value, PressureChangeRateUnit.PascalPerMinute); + return new PressureChangeRate(pascalsperminute, PressureChangeRateUnit.PascalPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PressureChangeRate FromPascalsPerSecond(QuantityValue pascalspersecond) + public static PressureChangeRate FromPascalsPerSecond(double pascalspersecond) { - double value = (double) pascalspersecond; - return new PressureChangeRate(value, PressureChangeRateUnit.PascalPerSecond); + return new PressureChangeRate(pascalspersecond, PressureChangeRateUnit.PascalPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PressureChangeRate FromPoundsForcePerSquareInchPerMinute(QuantityValue poundsforcepersquareinchperminute) + public static PressureChangeRate FromPoundsForcePerSquareInchPerMinute(double poundsforcepersquareinchperminute) { - double value = (double) poundsforcepersquareinchperminute; - return new PressureChangeRate(value, PressureChangeRateUnit.PoundForcePerSquareInchPerMinute); + return new PressureChangeRate(poundsforcepersquareinchperminute, PressureChangeRateUnit.PoundForcePerSquareInchPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PressureChangeRate FromPoundsForcePerSquareInchPerSecond(QuantityValue poundsforcepersquareinchpersecond) + public static PressureChangeRate FromPoundsForcePerSquareInchPerSecond(double poundsforcepersquareinchpersecond) { - double value = (double) poundsforcepersquareinchpersecond; - return new PressureChangeRate(value, PressureChangeRateUnit.PoundForcePerSquareInchPerSecond); + return new PressureChangeRate(poundsforcepersquareinchpersecond, 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..f611c99e5e 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,80 +277,72 @@ 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 coulombsperkilogram) { - double value = (double) coulombsperkilogram; - return new RadiationExposure(value, RadiationExposureUnit.CoulombPerKilogram); + return new RadiationExposure(coulombsperkilogram, RadiationExposureUnit.CoulombPerKilogram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RadiationExposure FromMicrocoulombsPerKilogram(QuantityValue microcoulombsperkilogram) + public static RadiationExposure FromMicrocoulombsPerKilogram(double microcoulombsperkilogram) { - double value = (double) microcoulombsperkilogram; - return new RadiationExposure(value, RadiationExposureUnit.MicrocoulombPerKilogram); + return new RadiationExposure(microcoulombsperkilogram, RadiationExposureUnit.MicrocoulombPerKilogram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RadiationExposure FromMicroroentgens(QuantityValue microroentgens) + public static RadiationExposure FromMicroroentgens(double microroentgens) { - double value = (double) microroentgens; - return new RadiationExposure(value, RadiationExposureUnit.Microroentgen); + return new RadiationExposure(microroentgens, RadiationExposureUnit.Microroentgen); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RadiationExposure FromMillicoulombsPerKilogram(QuantityValue millicoulombsperkilogram) + public static RadiationExposure FromMillicoulombsPerKilogram(double millicoulombsperkilogram) { - double value = (double) millicoulombsperkilogram; - return new RadiationExposure(value, RadiationExposureUnit.MillicoulombPerKilogram); + return new RadiationExposure(millicoulombsperkilogram, RadiationExposureUnit.MillicoulombPerKilogram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RadiationExposure FromMilliroentgens(QuantityValue milliroentgens) + public static RadiationExposure FromMilliroentgens(double milliroentgens) { - double value = (double) milliroentgens; - return new RadiationExposure(value, RadiationExposureUnit.Milliroentgen); + return new RadiationExposure(milliroentgens, RadiationExposureUnit.Milliroentgen); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RadiationExposure FromNanocoulombsPerKilogram(QuantityValue nanocoulombsperkilogram) + public static RadiationExposure FromNanocoulombsPerKilogram(double nanocoulombsperkilogram) { - double value = (double) nanocoulombsperkilogram; - return new RadiationExposure(value, RadiationExposureUnit.NanocoulombPerKilogram); + return new RadiationExposure(nanocoulombsperkilogram, RadiationExposureUnit.NanocoulombPerKilogram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RadiationExposure FromPicocoulombsPerKilogram(QuantityValue picocoulombsperkilogram) + public static RadiationExposure FromPicocoulombsPerKilogram(double picocoulombsperkilogram) { - double value = (double) picocoulombsperkilogram; - return new RadiationExposure(value, RadiationExposureUnit.PicocoulombPerKilogram); + return new RadiationExposure(picocoulombsperkilogram, RadiationExposureUnit.PicocoulombPerKilogram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RadiationExposure FromRoentgens(QuantityValue roentgens) + public static RadiationExposure FromRoentgens(double roentgens) { - double value = (double) roentgens; - return new RadiationExposure(value, RadiationExposureUnit.Roentgen); + return new RadiationExposure(roentgens, 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..d44b97dd77 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,290 +445,261 @@ 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 becquerels) { - double value = (double) becquerels; - return new Radioactivity(value, RadioactivityUnit.Becquerel); + return new Radioactivity(becquerels, RadioactivityUnit.Becquerel); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromCuries(QuantityValue curies) + public static Radioactivity FromCuries(double curies) { - double value = (double) curies; - return new Radioactivity(value, RadioactivityUnit.Curie); + return new Radioactivity(curies, RadioactivityUnit.Curie); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromExabecquerels(QuantityValue exabecquerels) + public static Radioactivity FromExabecquerels(double exabecquerels) { - double value = (double) exabecquerels; - return new Radioactivity(value, RadioactivityUnit.Exabecquerel); + return new Radioactivity(exabecquerels, RadioactivityUnit.Exabecquerel); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromGigabecquerels(QuantityValue gigabecquerels) + public static Radioactivity FromGigabecquerels(double gigabecquerels) { - double value = (double) gigabecquerels; - return new Radioactivity(value, RadioactivityUnit.Gigabecquerel); + return new Radioactivity(gigabecquerels, RadioactivityUnit.Gigabecquerel); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromGigacuries(QuantityValue gigacuries) + public static Radioactivity FromGigacuries(double gigacuries) { - double value = (double) gigacuries; - return new Radioactivity(value, RadioactivityUnit.Gigacurie); + return new Radioactivity(gigacuries, RadioactivityUnit.Gigacurie); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromGigarutherfords(QuantityValue gigarutherfords) + public static Radioactivity FromGigarutherfords(double gigarutherfords) { - double value = (double) gigarutherfords; - return new Radioactivity(value, RadioactivityUnit.Gigarutherford); + return new Radioactivity(gigarutherfords, RadioactivityUnit.Gigarutherford); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromKilobecquerels(QuantityValue kilobecquerels) + public static Radioactivity FromKilobecquerels(double kilobecquerels) { - double value = (double) kilobecquerels; - return new Radioactivity(value, RadioactivityUnit.Kilobecquerel); + return new Radioactivity(kilobecquerels, RadioactivityUnit.Kilobecquerel); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromKilocuries(QuantityValue kilocuries) + public static Radioactivity FromKilocuries(double kilocuries) { - double value = (double) kilocuries; - return new Radioactivity(value, RadioactivityUnit.Kilocurie); + return new Radioactivity(kilocuries, RadioactivityUnit.Kilocurie); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromKilorutherfords(QuantityValue kilorutherfords) + public static Radioactivity FromKilorutherfords(double kilorutherfords) { - double value = (double) kilorutherfords; - return new Radioactivity(value, RadioactivityUnit.Kilorutherford); + return new Radioactivity(kilorutherfords, RadioactivityUnit.Kilorutherford); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromMegabecquerels(QuantityValue megabecquerels) + public static Radioactivity FromMegabecquerels(double megabecquerels) { - double value = (double) megabecquerels; - return new Radioactivity(value, RadioactivityUnit.Megabecquerel); + return new Radioactivity(megabecquerels, RadioactivityUnit.Megabecquerel); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromMegacuries(QuantityValue megacuries) + public static Radioactivity FromMegacuries(double megacuries) { - double value = (double) megacuries; - return new Radioactivity(value, RadioactivityUnit.Megacurie); + return new Radioactivity(megacuries, RadioactivityUnit.Megacurie); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromMegarutherfords(QuantityValue megarutherfords) + public static Radioactivity FromMegarutherfords(double megarutherfords) { - double value = (double) megarutherfords; - return new Radioactivity(value, RadioactivityUnit.Megarutherford); + return new Radioactivity(megarutherfords, RadioactivityUnit.Megarutherford); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromMicrobecquerels(QuantityValue microbecquerels) + public static Radioactivity FromMicrobecquerels(double microbecquerels) { - double value = (double) microbecquerels; - return new Radioactivity(value, RadioactivityUnit.Microbecquerel); + return new Radioactivity(microbecquerels, RadioactivityUnit.Microbecquerel); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromMicrocuries(QuantityValue microcuries) + public static Radioactivity FromMicrocuries(double microcuries) { - double value = (double) microcuries; - return new Radioactivity(value, RadioactivityUnit.Microcurie); + return new Radioactivity(microcuries, RadioactivityUnit.Microcurie); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromMicrorutherfords(QuantityValue microrutherfords) + public static Radioactivity FromMicrorutherfords(double microrutherfords) { - double value = (double) microrutherfords; - return new Radioactivity(value, RadioactivityUnit.Microrutherford); + return new Radioactivity(microrutherfords, RadioactivityUnit.Microrutherford); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromMillibecquerels(QuantityValue millibecquerels) + public static Radioactivity FromMillibecquerels(double millibecquerels) { - double value = (double) millibecquerels; - return new Radioactivity(value, RadioactivityUnit.Millibecquerel); + return new Radioactivity(millibecquerels, RadioactivityUnit.Millibecquerel); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromMillicuries(QuantityValue millicuries) + public static Radioactivity FromMillicuries(double millicuries) { - double value = (double) millicuries; - return new Radioactivity(value, RadioactivityUnit.Millicurie); + return new Radioactivity(millicuries, RadioactivityUnit.Millicurie); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromMillirutherfords(QuantityValue millirutherfords) + public static Radioactivity FromMillirutherfords(double millirutherfords) { - double value = (double) millirutherfords; - return new Radioactivity(value, RadioactivityUnit.Millirutherford); + return new Radioactivity(millirutherfords, RadioactivityUnit.Millirutherford); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromNanobecquerels(QuantityValue nanobecquerels) + public static Radioactivity FromNanobecquerels(double nanobecquerels) { - double value = (double) nanobecquerels; - return new Radioactivity(value, RadioactivityUnit.Nanobecquerel); + return new Radioactivity(nanobecquerels, RadioactivityUnit.Nanobecquerel); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromNanocuries(QuantityValue nanocuries) + public static Radioactivity FromNanocuries(double nanocuries) { - double value = (double) nanocuries; - return new Radioactivity(value, RadioactivityUnit.Nanocurie); + return new Radioactivity(nanocuries, RadioactivityUnit.Nanocurie); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromNanorutherfords(QuantityValue nanorutherfords) + public static Radioactivity FromNanorutherfords(double nanorutherfords) { - double value = (double) nanorutherfords; - return new Radioactivity(value, RadioactivityUnit.Nanorutherford); + return new Radioactivity(nanorutherfords, RadioactivityUnit.Nanorutherford); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromPetabecquerels(QuantityValue petabecquerels) + public static Radioactivity FromPetabecquerels(double petabecquerels) { - double value = (double) petabecquerels; - return new Radioactivity(value, RadioactivityUnit.Petabecquerel); + return new Radioactivity(petabecquerels, RadioactivityUnit.Petabecquerel); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromPicobecquerels(QuantityValue picobecquerels) + public static Radioactivity FromPicobecquerels(double picobecquerels) { - double value = (double) picobecquerels; - return new Radioactivity(value, RadioactivityUnit.Picobecquerel); + return new Radioactivity(picobecquerels, RadioactivityUnit.Picobecquerel); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromPicocuries(QuantityValue picocuries) + public static Radioactivity FromPicocuries(double picocuries) { - double value = (double) picocuries; - return new Radioactivity(value, RadioactivityUnit.Picocurie); + return new Radioactivity(picocuries, RadioactivityUnit.Picocurie); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromPicorutherfords(QuantityValue picorutherfords) + public static Radioactivity FromPicorutherfords(double picorutherfords) { - double value = (double) picorutherfords; - return new Radioactivity(value, RadioactivityUnit.Picorutherford); + return new Radioactivity(picorutherfords, RadioactivityUnit.Picorutherford); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromRutherfords(QuantityValue rutherfords) + public static Radioactivity FromRutherfords(double rutherfords) { - double value = (double) rutherfords; - return new Radioactivity(value, RadioactivityUnit.Rutherford); + return new Radioactivity(rutherfords, RadioactivityUnit.Rutherford); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromTerabecquerels(QuantityValue terabecquerels) + public static Radioactivity FromTerabecquerels(double terabecquerels) { - double value = (double) terabecquerels; - return new Radioactivity(value, RadioactivityUnit.Terabecquerel); + return new Radioactivity(terabecquerels, RadioactivityUnit.Terabecquerel); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromTeracuries(QuantityValue teracuries) + public static Radioactivity FromTeracuries(double teracuries) { - double value = (double) teracuries; - return new Radioactivity(value, RadioactivityUnit.Teracurie); + return new Radioactivity(teracuries, RadioactivityUnit.Teracurie); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromTerarutherfords(QuantityValue terarutherfords) + public static Radioactivity FromTerarutherfords(double terarutherfords) { - double value = (double) terarutherfords; - return new Radioactivity(value, RadioactivityUnit.Terarutherford); + return new Radioactivity(terarutherfords, 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..9ddb15bc47 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,60 +261,54 @@ 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 decimalfractions) { - double value = (double) decimalfractions; - return new Ratio(value, RatioUnit.DecimalFraction); + return new Ratio(decimalfractions, RatioUnit.DecimalFraction); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Ratio FromPartsPerBillion(QuantityValue partsperbillion) + public static Ratio FromPartsPerBillion(double partsperbillion) { - double value = (double) partsperbillion; - return new Ratio(value, RatioUnit.PartPerBillion); + return new Ratio(partsperbillion, RatioUnit.PartPerBillion); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Ratio FromPartsPerMillion(QuantityValue partspermillion) + public static Ratio FromPartsPerMillion(double partspermillion) { - double value = (double) partspermillion; - return new Ratio(value, RatioUnit.PartPerMillion); + return new Ratio(partspermillion, RatioUnit.PartPerMillion); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Ratio FromPartsPerThousand(QuantityValue partsperthousand) + public static Ratio FromPartsPerThousand(double partsperthousand) { - double value = (double) partsperthousand; - return new Ratio(value, RatioUnit.PartPerThousand); + return new Ratio(partsperthousand, RatioUnit.PartPerThousand); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Ratio FromPartsPerTrillion(QuantityValue partspertrillion) + public static Ratio FromPartsPerTrillion(double partspertrillion) { - double value = (double) partspertrillion; - return new Ratio(value, RatioUnit.PartPerTrillion); + return new Ratio(partspertrillion, RatioUnit.PartPerTrillion); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Ratio FromPercent(QuantityValue percent) + public static Ratio FromPercent(double percent) { - double value = (double) percent; - return new Ratio(value, RatioUnit.Percent); + return new Ratio(percent, 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..913a13decd 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,20 +229,18 @@ 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 decimalfractionspersecond) { - double value = (double) decimalfractionspersecond; - return new RatioChangeRate(value, RatioChangeRateUnit.DecimalFractionPerSecond); + return new RatioChangeRate(decimalfractionspersecond, RatioChangeRateUnit.DecimalFractionPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RatioChangeRate FromPercentsPerSecond(QuantityValue percentspersecond) + public static RatioChangeRate FromPercentsPerSecond(double percentspersecond) { - double value = (double) percentspersecond; - return new RatioChangeRate(value, RatioChangeRateUnit.PercentPerSecond); + return new RatioChangeRate(percentspersecond, 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..4da15c9eb7 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,30 +237,27 @@ 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 kilovoltamperereactivehours) { - double value = (double) kilovoltamperereactivehours; - return new ReactiveEnergy(value, ReactiveEnergyUnit.KilovoltampereReactiveHour); + return new ReactiveEnergy(kilovoltamperereactivehours, ReactiveEnergyUnit.KilovoltampereReactiveHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ReactiveEnergy FromMegavoltampereReactiveHours(QuantityValue megavoltamperereactivehours) + public static ReactiveEnergy FromMegavoltampereReactiveHours(double megavoltamperereactivehours) { - double value = (double) megavoltamperereactivehours; - return new ReactiveEnergy(value, ReactiveEnergyUnit.MegavoltampereReactiveHour); + return new ReactiveEnergy(megavoltamperereactivehours, ReactiveEnergyUnit.MegavoltampereReactiveHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ReactiveEnergy FromVoltampereReactiveHours(QuantityValue voltamperereactivehours) + public static ReactiveEnergy FromVoltampereReactiveHours(double voltamperereactivehours) { - double value = (double) voltamperereactivehours; - return new ReactiveEnergy(value, ReactiveEnergyUnit.VoltampereReactiveHour); + return new ReactiveEnergy(voltamperereactivehours, 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..f25c534690 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,40 +245,36 @@ 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 gigavoltamperesreactive) { - double value = (double) gigavoltamperesreactive; - return new ReactivePower(value, ReactivePowerUnit.GigavoltampereReactive); + return new ReactivePower(gigavoltamperesreactive, ReactivePowerUnit.GigavoltampereReactive); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ReactivePower FromKilovoltamperesReactive(QuantityValue kilovoltamperesreactive) + public static ReactivePower FromKilovoltamperesReactive(double kilovoltamperesreactive) { - double value = (double) kilovoltamperesreactive; - return new ReactivePower(value, ReactivePowerUnit.KilovoltampereReactive); + return new ReactivePower(kilovoltamperesreactive, ReactivePowerUnit.KilovoltampereReactive); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ReactivePower FromMegavoltamperesReactive(QuantityValue megavoltamperesreactive) + public static ReactivePower FromMegavoltamperesReactive(double megavoltamperesreactive) { - double value = (double) megavoltamperesreactive; - return new ReactivePower(value, ReactivePowerUnit.MegavoltampereReactive); + return new ReactivePower(megavoltamperesreactive, ReactivePowerUnit.MegavoltampereReactive); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ReactivePower FromVoltamperesReactive(QuantityValue voltamperesreactive) + public static ReactivePower FromVoltamperesReactive(double voltamperesreactive) { - double value = (double) voltamperesreactive; - return new ReactivePower(value, ReactivePowerUnit.VoltampereReactive); + return new ReactivePower(voltamperesreactive, 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..4ffad89940 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,110 +312,99 @@ 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 inversesquarecentimeters) { - double value = (double) inversesquarecentimeters; - return new ReciprocalArea(value, ReciprocalAreaUnit.InverseSquareCentimeter); + return new ReciprocalArea(inversesquarecentimeters, ReciprocalAreaUnit.InverseSquareCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ReciprocalArea FromInverseSquareDecimeters(QuantityValue inversesquaredecimeters) + public static ReciprocalArea FromInverseSquareDecimeters(double inversesquaredecimeters) { - double value = (double) inversesquaredecimeters; - return new ReciprocalArea(value, ReciprocalAreaUnit.InverseSquareDecimeter); + return new ReciprocalArea(inversesquaredecimeters, ReciprocalAreaUnit.InverseSquareDecimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ReciprocalArea FromInverseSquareFeet(QuantityValue inversesquarefeet) + public static ReciprocalArea FromInverseSquareFeet(double inversesquarefeet) { - double value = (double) inversesquarefeet; - return new ReciprocalArea(value, ReciprocalAreaUnit.InverseSquareFoot); + return new ReciprocalArea(inversesquarefeet, ReciprocalAreaUnit.InverseSquareFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ReciprocalArea FromInverseSquareInches(QuantityValue inversesquareinches) + public static ReciprocalArea FromInverseSquareInches(double inversesquareinches) { - double value = (double) inversesquareinches; - return new ReciprocalArea(value, ReciprocalAreaUnit.InverseSquareInch); + return new ReciprocalArea(inversesquareinches, ReciprocalAreaUnit.InverseSquareInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ReciprocalArea FromInverseSquareKilometers(QuantityValue inversesquarekilometers) + public static ReciprocalArea FromInverseSquareKilometers(double inversesquarekilometers) { - double value = (double) inversesquarekilometers; - return new ReciprocalArea(value, ReciprocalAreaUnit.InverseSquareKilometer); + return new ReciprocalArea(inversesquarekilometers, ReciprocalAreaUnit.InverseSquareKilometer); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ReciprocalArea FromInverseSquareMeters(QuantityValue inversesquaremeters) + public static ReciprocalArea FromInverseSquareMeters(double inversesquaremeters) { - double value = (double) inversesquaremeters; - return new ReciprocalArea(value, ReciprocalAreaUnit.InverseSquareMeter); + return new ReciprocalArea(inversesquaremeters, ReciprocalAreaUnit.InverseSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ReciprocalArea FromInverseSquareMicrometers(QuantityValue inversesquaremicrometers) + public static ReciprocalArea FromInverseSquareMicrometers(double inversesquaremicrometers) { - double value = (double) inversesquaremicrometers; - return new ReciprocalArea(value, ReciprocalAreaUnit.InverseSquareMicrometer); + return new ReciprocalArea(inversesquaremicrometers, ReciprocalAreaUnit.InverseSquareMicrometer); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ReciprocalArea FromInverseSquareMiles(QuantityValue inversesquaremiles) + public static ReciprocalArea FromInverseSquareMiles(double inversesquaremiles) { - double value = (double) inversesquaremiles; - return new ReciprocalArea(value, ReciprocalAreaUnit.InverseSquareMile); + return new ReciprocalArea(inversesquaremiles, ReciprocalAreaUnit.InverseSquareMile); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ReciprocalArea FromInverseSquareMillimeters(QuantityValue inversesquaremillimeters) + public static ReciprocalArea FromInverseSquareMillimeters(double inversesquaremillimeters) { - double value = (double) inversesquaremillimeters; - return new ReciprocalArea(value, ReciprocalAreaUnit.InverseSquareMillimeter); + return new ReciprocalArea(inversesquaremillimeters, ReciprocalAreaUnit.InverseSquareMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ReciprocalArea FromInverseSquareYards(QuantityValue inversesquareyards) + public static ReciprocalArea FromInverseSquareYards(double inversesquareyards) { - double value = (double) inversesquareyards; - return new ReciprocalArea(value, ReciprocalAreaUnit.InverseSquareYard); + return new ReciprocalArea(inversesquareyards, ReciprocalAreaUnit.InverseSquareYard); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ReciprocalArea FromInverseUsSurveySquareFeet(QuantityValue inverseussurveysquarefeet) + public static ReciprocalArea FromInverseUsSurveySquareFeet(double inverseussurveysquarefeet) { - double value = (double) inverseussurveysquarefeet; - return new ReciprocalArea(value, ReciprocalAreaUnit.InverseUsSurveySquareFoot); + return new ReciprocalArea(inverseussurveysquarefeet, 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..e980cebee2 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,100 +305,90 @@ 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 inversecentimeters) { - double value = (double) inversecentimeters; - return new ReciprocalLength(value, ReciprocalLengthUnit.InverseCentimeter); + return new ReciprocalLength(inversecentimeters, ReciprocalLengthUnit.InverseCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ReciprocalLength FromInverseFeet(QuantityValue inversefeet) + public static ReciprocalLength FromInverseFeet(double inversefeet) { - double value = (double) inversefeet; - return new ReciprocalLength(value, ReciprocalLengthUnit.InverseFoot); + return new ReciprocalLength(inversefeet, ReciprocalLengthUnit.InverseFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ReciprocalLength FromInverseInches(QuantityValue inverseinches) + public static ReciprocalLength FromInverseInches(double inverseinches) { - double value = (double) inverseinches; - return new ReciprocalLength(value, ReciprocalLengthUnit.InverseInch); + return new ReciprocalLength(inverseinches, ReciprocalLengthUnit.InverseInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ReciprocalLength FromInverseMeters(QuantityValue inversemeters) + public static ReciprocalLength FromInverseMeters(double inversemeters) { - double value = (double) inversemeters; - return new ReciprocalLength(value, ReciprocalLengthUnit.InverseMeter); + return new ReciprocalLength(inversemeters, ReciprocalLengthUnit.InverseMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ReciprocalLength FromInverseMicroinches(QuantityValue inversemicroinches) + public static ReciprocalLength FromInverseMicroinches(double inversemicroinches) { - double value = (double) inversemicroinches; - return new ReciprocalLength(value, ReciprocalLengthUnit.InverseMicroinch); + return new ReciprocalLength(inversemicroinches, ReciprocalLengthUnit.InverseMicroinch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ReciprocalLength FromInverseMils(QuantityValue inversemils) + public static ReciprocalLength FromInverseMils(double inversemils) { - double value = (double) inversemils; - return new ReciprocalLength(value, ReciprocalLengthUnit.InverseMil); + return new ReciprocalLength(inversemils, ReciprocalLengthUnit.InverseMil); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ReciprocalLength FromInverseMiles(QuantityValue inversemiles) + public static ReciprocalLength FromInverseMiles(double inversemiles) { - double value = (double) inversemiles; - return new ReciprocalLength(value, ReciprocalLengthUnit.InverseMile); + return new ReciprocalLength(inversemiles, ReciprocalLengthUnit.InverseMile); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ReciprocalLength FromInverseMillimeters(QuantityValue inversemillimeters) + public static ReciprocalLength FromInverseMillimeters(double inversemillimeters) { - double value = (double) inversemillimeters; - return new ReciprocalLength(value, ReciprocalLengthUnit.InverseMillimeter); + return new ReciprocalLength(inversemillimeters, ReciprocalLengthUnit.InverseMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ReciprocalLength FromInverseUsSurveyFeet(QuantityValue inverseussurveyfeet) + public static ReciprocalLength FromInverseUsSurveyFeet(double inverseussurveyfeet) { - double value = (double) inverseussurveyfeet; - return new ReciprocalLength(value, ReciprocalLengthUnit.InverseUsSurveyFoot); + return new ReciprocalLength(inverseussurveyfeet, ReciprocalLengthUnit.InverseUsSurveyFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ReciprocalLength FromInverseYards(QuantityValue inverseyards) + public static ReciprocalLength FromInverseYards(double inverseyards) { - double value = (double) inverseyards; - return new ReciprocalLength(value, ReciprocalLengthUnit.InverseYard); + return new ReciprocalLength(inverseyards, 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..c66c66a8ea 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,10 +221,9 @@ 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 percent) { - double value = (double) percent; - return new RelativeHumidity(value, RelativeHumidityUnit.Percent); + return new RelativeHumidity(percent, 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..2131f06cbd 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,40 +245,36 @@ 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 degreespersecondsquared) { - double value = (double) degreespersecondsquared; - return new RotationalAcceleration(value, RotationalAccelerationUnit.DegreePerSecondSquared); + return new RotationalAcceleration(degreespersecondsquared, RotationalAccelerationUnit.DegreePerSecondSquared); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalAcceleration FromRadiansPerSecondSquared(QuantityValue radianspersecondsquared) + public static RotationalAcceleration FromRadiansPerSecondSquared(double radianspersecondsquared) { - double value = (double) radianspersecondsquared; - return new RotationalAcceleration(value, RotationalAccelerationUnit.RadianPerSecondSquared); + return new RotationalAcceleration(radianspersecondsquared, RotationalAccelerationUnit.RadianPerSecondSquared); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalAcceleration FromRevolutionsPerMinutePerSecond(QuantityValue revolutionsperminutepersecond) + public static RotationalAcceleration FromRevolutionsPerMinutePerSecond(double revolutionsperminutepersecond) { - double value = (double) revolutionsperminutepersecond; - return new RotationalAcceleration(value, RotationalAccelerationUnit.RevolutionPerMinutePerSecond); + return new RotationalAcceleration(revolutionsperminutepersecond, RotationalAccelerationUnit.RevolutionPerMinutePerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalAcceleration FromRevolutionsPerSecondSquared(QuantityValue revolutionspersecondsquared) + public static RotationalAcceleration FromRevolutionsPerSecondSquared(double revolutionspersecondsquared) { - double value = (double) revolutionspersecondsquared; - return new RotationalAcceleration(value, RotationalAccelerationUnit.RevolutionPerSecondSquared); + return new RotationalAcceleration(revolutionspersecondsquared, 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..3a0bb6bc99 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,130 +324,117 @@ 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 centiradianspersecond) { - double value = (double) centiradianspersecond; - return new RotationalSpeed(value, RotationalSpeedUnit.CentiradianPerSecond); + return new RotationalSpeed(centiradianspersecond, RotationalSpeedUnit.CentiradianPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalSpeed FromDeciradiansPerSecond(QuantityValue deciradianspersecond) + public static RotationalSpeed FromDeciradiansPerSecond(double deciradianspersecond) { - double value = (double) deciradianspersecond; - return new RotationalSpeed(value, RotationalSpeedUnit.DeciradianPerSecond); + return new RotationalSpeed(deciradianspersecond, RotationalSpeedUnit.DeciradianPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalSpeed FromDegreesPerMinute(QuantityValue degreesperminute) + public static RotationalSpeed FromDegreesPerMinute(double degreesperminute) { - double value = (double) degreesperminute; - return new RotationalSpeed(value, RotationalSpeedUnit.DegreePerMinute); + return new RotationalSpeed(degreesperminute, RotationalSpeedUnit.DegreePerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalSpeed FromDegreesPerSecond(QuantityValue degreespersecond) + public static RotationalSpeed FromDegreesPerSecond(double degreespersecond) { - double value = (double) degreespersecond; - return new RotationalSpeed(value, RotationalSpeedUnit.DegreePerSecond); + return new RotationalSpeed(degreespersecond, RotationalSpeedUnit.DegreePerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalSpeed FromMicrodegreesPerSecond(QuantityValue microdegreespersecond) + public static RotationalSpeed FromMicrodegreesPerSecond(double microdegreespersecond) { - double value = (double) microdegreespersecond; - return new RotationalSpeed(value, RotationalSpeedUnit.MicrodegreePerSecond); + return new RotationalSpeed(microdegreespersecond, RotationalSpeedUnit.MicrodegreePerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalSpeed FromMicroradiansPerSecond(QuantityValue microradianspersecond) + public static RotationalSpeed FromMicroradiansPerSecond(double microradianspersecond) { - double value = (double) microradianspersecond; - return new RotationalSpeed(value, RotationalSpeedUnit.MicroradianPerSecond); + return new RotationalSpeed(microradianspersecond, RotationalSpeedUnit.MicroradianPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalSpeed FromMillidegreesPerSecond(QuantityValue millidegreespersecond) + public static RotationalSpeed FromMillidegreesPerSecond(double millidegreespersecond) { - double value = (double) millidegreespersecond; - return new RotationalSpeed(value, RotationalSpeedUnit.MillidegreePerSecond); + return new RotationalSpeed(millidegreespersecond, RotationalSpeedUnit.MillidegreePerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalSpeed FromMilliradiansPerSecond(QuantityValue milliradianspersecond) + public static RotationalSpeed FromMilliradiansPerSecond(double milliradianspersecond) { - double value = (double) milliradianspersecond; - return new RotationalSpeed(value, RotationalSpeedUnit.MilliradianPerSecond); + return new RotationalSpeed(milliradianspersecond, RotationalSpeedUnit.MilliradianPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalSpeed FromNanodegreesPerSecond(QuantityValue nanodegreespersecond) + public static RotationalSpeed FromNanodegreesPerSecond(double nanodegreespersecond) { - double value = (double) nanodegreespersecond; - return new RotationalSpeed(value, RotationalSpeedUnit.NanodegreePerSecond); + return new RotationalSpeed(nanodegreespersecond, RotationalSpeedUnit.NanodegreePerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalSpeed FromNanoradiansPerSecond(QuantityValue nanoradianspersecond) + public static RotationalSpeed FromNanoradiansPerSecond(double nanoradianspersecond) { - double value = (double) nanoradianspersecond; - return new RotationalSpeed(value, RotationalSpeedUnit.NanoradianPerSecond); + return new RotationalSpeed(nanoradianspersecond, RotationalSpeedUnit.NanoradianPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalSpeed FromRadiansPerSecond(QuantityValue radianspersecond) + public static RotationalSpeed FromRadiansPerSecond(double radianspersecond) { - double value = (double) radianspersecond; - return new RotationalSpeed(value, RotationalSpeedUnit.RadianPerSecond); + return new RotationalSpeed(radianspersecond, RotationalSpeedUnit.RadianPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalSpeed FromRevolutionsPerMinute(QuantityValue revolutionsperminute) + public static RotationalSpeed FromRevolutionsPerMinute(double revolutionsperminute) { - double value = (double) revolutionsperminute; - return new RotationalSpeed(value, RotationalSpeedUnit.RevolutionPerMinute); + return new RotationalSpeed(revolutionsperminute, RotationalSpeedUnit.RevolutionPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalSpeed FromRevolutionsPerSecond(QuantityValue revolutionspersecond) + public static RotationalSpeed FromRevolutionsPerSecond(double revolutionspersecond) { - double value = (double) revolutionspersecond; - return new RotationalSpeed(value, RotationalSpeedUnit.RevolutionPerSecond); + return new RotationalSpeed(revolutionspersecond, 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..e6ed3b465c 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,330 +485,297 @@ 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 centinewtonmetersperdegree) { - double value = (double) centinewtonmetersperdegree; - return new RotationalStiffness(value, RotationalStiffnessUnit.CentinewtonMeterPerDegree); + return new RotationalStiffness(centinewtonmetersperdegree, RotationalStiffnessUnit.CentinewtonMeterPerDegree); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromCentinewtonMillimetersPerDegree(QuantityValue centinewtonmillimetersperdegree) + public static RotationalStiffness FromCentinewtonMillimetersPerDegree(double centinewtonmillimetersperdegree) { - double value = (double) centinewtonmillimetersperdegree; - return new RotationalStiffness(value, RotationalStiffnessUnit.CentinewtonMillimeterPerDegree); + return new RotationalStiffness(centinewtonmillimetersperdegree, RotationalStiffnessUnit.CentinewtonMillimeterPerDegree); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromCentinewtonMillimetersPerRadian(QuantityValue centinewtonmillimetersperradian) + public static RotationalStiffness FromCentinewtonMillimetersPerRadian(double centinewtonmillimetersperradian) { - double value = (double) centinewtonmillimetersperradian; - return new RotationalStiffness(value, RotationalStiffnessUnit.CentinewtonMillimeterPerRadian); + return new RotationalStiffness(centinewtonmillimetersperradian, RotationalStiffnessUnit.CentinewtonMillimeterPerRadian); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromDecanewtonMetersPerDegree(QuantityValue decanewtonmetersperdegree) + public static RotationalStiffness FromDecanewtonMetersPerDegree(double decanewtonmetersperdegree) { - double value = (double) decanewtonmetersperdegree; - return new RotationalStiffness(value, RotationalStiffnessUnit.DecanewtonMeterPerDegree); + return new RotationalStiffness(decanewtonmetersperdegree, RotationalStiffnessUnit.DecanewtonMeterPerDegree); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromDecanewtonMillimetersPerDegree(QuantityValue decanewtonmillimetersperdegree) + public static RotationalStiffness FromDecanewtonMillimetersPerDegree(double decanewtonmillimetersperdegree) { - double value = (double) decanewtonmillimetersperdegree; - return new RotationalStiffness(value, RotationalStiffnessUnit.DecanewtonMillimeterPerDegree); + return new RotationalStiffness(decanewtonmillimetersperdegree, RotationalStiffnessUnit.DecanewtonMillimeterPerDegree); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromDecanewtonMillimetersPerRadian(QuantityValue decanewtonmillimetersperradian) + public static RotationalStiffness FromDecanewtonMillimetersPerRadian(double decanewtonmillimetersperradian) { - double value = (double) decanewtonmillimetersperradian; - return new RotationalStiffness(value, RotationalStiffnessUnit.DecanewtonMillimeterPerRadian); + return new RotationalStiffness(decanewtonmillimetersperradian, RotationalStiffnessUnit.DecanewtonMillimeterPerRadian); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromDecinewtonMetersPerDegree(QuantityValue decinewtonmetersperdegree) + public static RotationalStiffness FromDecinewtonMetersPerDegree(double decinewtonmetersperdegree) { - double value = (double) decinewtonmetersperdegree; - return new RotationalStiffness(value, RotationalStiffnessUnit.DecinewtonMeterPerDegree); + return new RotationalStiffness(decinewtonmetersperdegree, RotationalStiffnessUnit.DecinewtonMeterPerDegree); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromDecinewtonMillimetersPerDegree(QuantityValue decinewtonmillimetersperdegree) + public static RotationalStiffness FromDecinewtonMillimetersPerDegree(double decinewtonmillimetersperdegree) { - double value = (double) decinewtonmillimetersperdegree; - return new RotationalStiffness(value, RotationalStiffnessUnit.DecinewtonMillimeterPerDegree); + return new RotationalStiffness(decinewtonmillimetersperdegree, RotationalStiffnessUnit.DecinewtonMillimeterPerDegree); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromDecinewtonMillimetersPerRadian(QuantityValue decinewtonmillimetersperradian) + public static RotationalStiffness FromDecinewtonMillimetersPerRadian(double decinewtonmillimetersperradian) { - double value = (double) decinewtonmillimetersperradian; - return new RotationalStiffness(value, RotationalStiffnessUnit.DecinewtonMillimeterPerRadian); + return new RotationalStiffness(decinewtonmillimetersperradian, RotationalStiffnessUnit.DecinewtonMillimeterPerRadian); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromKilonewtonMetersPerDegree(QuantityValue kilonewtonmetersperdegree) + public static RotationalStiffness FromKilonewtonMetersPerDegree(double kilonewtonmetersperdegree) { - double value = (double) kilonewtonmetersperdegree; - return new RotationalStiffness(value, RotationalStiffnessUnit.KilonewtonMeterPerDegree); + return new RotationalStiffness(kilonewtonmetersperdegree, RotationalStiffnessUnit.KilonewtonMeterPerDegree); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromKilonewtonMetersPerRadian(QuantityValue kilonewtonmetersperradian) + public static RotationalStiffness FromKilonewtonMetersPerRadian(double kilonewtonmetersperradian) { - double value = (double) kilonewtonmetersperradian; - return new RotationalStiffness(value, RotationalStiffnessUnit.KilonewtonMeterPerRadian); + return new RotationalStiffness(kilonewtonmetersperradian, RotationalStiffnessUnit.KilonewtonMeterPerRadian); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromKilonewtonMillimetersPerDegree(QuantityValue kilonewtonmillimetersperdegree) + public static RotationalStiffness FromKilonewtonMillimetersPerDegree(double kilonewtonmillimetersperdegree) { - double value = (double) kilonewtonmillimetersperdegree; - return new RotationalStiffness(value, RotationalStiffnessUnit.KilonewtonMillimeterPerDegree); + return new RotationalStiffness(kilonewtonmillimetersperdegree, RotationalStiffnessUnit.KilonewtonMillimeterPerDegree); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromKilonewtonMillimetersPerRadian(QuantityValue kilonewtonmillimetersperradian) + public static RotationalStiffness FromKilonewtonMillimetersPerRadian(double kilonewtonmillimetersperradian) { - double value = (double) kilonewtonmillimetersperradian; - return new RotationalStiffness(value, RotationalStiffnessUnit.KilonewtonMillimeterPerRadian); + return new RotationalStiffness(kilonewtonmillimetersperradian, RotationalStiffnessUnit.KilonewtonMillimeterPerRadian); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromKilopoundForceFeetPerDegrees(QuantityValue kilopoundforcefeetperdegrees) + public static RotationalStiffness FromKilopoundForceFeetPerDegrees(double kilopoundforcefeetperdegrees) { - double value = (double) kilopoundforcefeetperdegrees; - return new RotationalStiffness(value, RotationalStiffnessUnit.KilopoundForceFootPerDegrees); + return new RotationalStiffness(kilopoundforcefeetperdegrees, RotationalStiffnessUnit.KilopoundForceFootPerDegrees); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromMeganewtonMetersPerDegree(QuantityValue meganewtonmetersperdegree) + public static RotationalStiffness FromMeganewtonMetersPerDegree(double meganewtonmetersperdegree) { - double value = (double) meganewtonmetersperdegree; - return new RotationalStiffness(value, RotationalStiffnessUnit.MeganewtonMeterPerDegree); + return new RotationalStiffness(meganewtonmetersperdegree, RotationalStiffnessUnit.MeganewtonMeterPerDegree); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromMeganewtonMetersPerRadian(QuantityValue meganewtonmetersperradian) + public static RotationalStiffness FromMeganewtonMetersPerRadian(double meganewtonmetersperradian) { - double value = (double) meganewtonmetersperradian; - return new RotationalStiffness(value, RotationalStiffnessUnit.MeganewtonMeterPerRadian); + return new RotationalStiffness(meganewtonmetersperradian, RotationalStiffnessUnit.MeganewtonMeterPerRadian); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromMeganewtonMillimetersPerDegree(QuantityValue meganewtonmillimetersperdegree) + public static RotationalStiffness FromMeganewtonMillimetersPerDegree(double meganewtonmillimetersperdegree) { - double value = (double) meganewtonmillimetersperdegree; - return new RotationalStiffness(value, RotationalStiffnessUnit.MeganewtonMillimeterPerDegree); + return new RotationalStiffness(meganewtonmillimetersperdegree, RotationalStiffnessUnit.MeganewtonMillimeterPerDegree); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromMeganewtonMillimetersPerRadian(QuantityValue meganewtonmillimetersperradian) + public static RotationalStiffness FromMeganewtonMillimetersPerRadian(double meganewtonmillimetersperradian) { - double value = (double) meganewtonmillimetersperradian; - return new RotationalStiffness(value, RotationalStiffnessUnit.MeganewtonMillimeterPerRadian); + return new RotationalStiffness(meganewtonmillimetersperradian, RotationalStiffnessUnit.MeganewtonMillimeterPerRadian); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromMicronewtonMetersPerDegree(QuantityValue micronewtonmetersperdegree) + public static RotationalStiffness FromMicronewtonMetersPerDegree(double micronewtonmetersperdegree) { - double value = (double) micronewtonmetersperdegree; - return new RotationalStiffness(value, RotationalStiffnessUnit.MicronewtonMeterPerDegree); + return new RotationalStiffness(micronewtonmetersperdegree, RotationalStiffnessUnit.MicronewtonMeterPerDegree); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromMicronewtonMillimetersPerDegree(QuantityValue micronewtonmillimetersperdegree) + public static RotationalStiffness FromMicronewtonMillimetersPerDegree(double micronewtonmillimetersperdegree) { - double value = (double) micronewtonmillimetersperdegree; - return new RotationalStiffness(value, RotationalStiffnessUnit.MicronewtonMillimeterPerDegree); + return new RotationalStiffness(micronewtonmillimetersperdegree, RotationalStiffnessUnit.MicronewtonMillimeterPerDegree); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromMicronewtonMillimetersPerRadian(QuantityValue micronewtonmillimetersperradian) + public static RotationalStiffness FromMicronewtonMillimetersPerRadian(double micronewtonmillimetersperradian) { - double value = (double) micronewtonmillimetersperradian; - return new RotationalStiffness(value, RotationalStiffnessUnit.MicronewtonMillimeterPerRadian); + return new RotationalStiffness(micronewtonmillimetersperradian, RotationalStiffnessUnit.MicronewtonMillimeterPerRadian); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromMillinewtonMetersPerDegree(QuantityValue millinewtonmetersperdegree) + public static RotationalStiffness FromMillinewtonMetersPerDegree(double millinewtonmetersperdegree) { - double value = (double) millinewtonmetersperdegree; - return new RotationalStiffness(value, RotationalStiffnessUnit.MillinewtonMeterPerDegree); + return new RotationalStiffness(millinewtonmetersperdegree, RotationalStiffnessUnit.MillinewtonMeterPerDegree); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromMillinewtonMillimetersPerDegree(QuantityValue millinewtonmillimetersperdegree) + public static RotationalStiffness FromMillinewtonMillimetersPerDegree(double millinewtonmillimetersperdegree) { - double value = (double) millinewtonmillimetersperdegree; - return new RotationalStiffness(value, RotationalStiffnessUnit.MillinewtonMillimeterPerDegree); + return new RotationalStiffness(millinewtonmillimetersperdegree, RotationalStiffnessUnit.MillinewtonMillimeterPerDegree); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromMillinewtonMillimetersPerRadian(QuantityValue millinewtonmillimetersperradian) + public static RotationalStiffness FromMillinewtonMillimetersPerRadian(double millinewtonmillimetersperradian) { - double value = (double) millinewtonmillimetersperradian; - return new RotationalStiffness(value, RotationalStiffnessUnit.MillinewtonMillimeterPerRadian); + return new RotationalStiffness(millinewtonmillimetersperradian, RotationalStiffnessUnit.MillinewtonMillimeterPerRadian); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromNanonewtonMetersPerDegree(QuantityValue nanonewtonmetersperdegree) + public static RotationalStiffness FromNanonewtonMetersPerDegree(double nanonewtonmetersperdegree) { - double value = (double) nanonewtonmetersperdegree; - return new RotationalStiffness(value, RotationalStiffnessUnit.NanonewtonMeterPerDegree); + return new RotationalStiffness(nanonewtonmetersperdegree, RotationalStiffnessUnit.NanonewtonMeterPerDegree); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromNanonewtonMillimetersPerDegree(QuantityValue nanonewtonmillimetersperdegree) + public static RotationalStiffness FromNanonewtonMillimetersPerDegree(double nanonewtonmillimetersperdegree) { - double value = (double) nanonewtonmillimetersperdegree; - return new RotationalStiffness(value, RotationalStiffnessUnit.NanonewtonMillimeterPerDegree); + return new RotationalStiffness(nanonewtonmillimetersperdegree, RotationalStiffnessUnit.NanonewtonMillimeterPerDegree); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromNanonewtonMillimetersPerRadian(QuantityValue nanonewtonmillimetersperradian) + public static RotationalStiffness FromNanonewtonMillimetersPerRadian(double nanonewtonmillimetersperradian) { - double value = (double) nanonewtonmillimetersperradian; - return new RotationalStiffness(value, RotationalStiffnessUnit.NanonewtonMillimeterPerRadian); + return new RotationalStiffness(nanonewtonmillimetersperradian, RotationalStiffnessUnit.NanonewtonMillimeterPerRadian); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromNewtonMetersPerDegree(QuantityValue newtonmetersperdegree) + public static RotationalStiffness FromNewtonMetersPerDegree(double newtonmetersperdegree) { - double value = (double) newtonmetersperdegree; - return new RotationalStiffness(value, RotationalStiffnessUnit.NewtonMeterPerDegree); + return new RotationalStiffness(newtonmetersperdegree, RotationalStiffnessUnit.NewtonMeterPerDegree); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromNewtonMetersPerRadian(QuantityValue newtonmetersperradian) + public static RotationalStiffness FromNewtonMetersPerRadian(double newtonmetersperradian) { - double value = (double) newtonmetersperradian; - return new RotationalStiffness(value, RotationalStiffnessUnit.NewtonMeterPerRadian); + return new RotationalStiffness(newtonmetersperradian, RotationalStiffnessUnit.NewtonMeterPerRadian); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromNewtonMillimetersPerDegree(QuantityValue newtonmillimetersperdegree) + public static RotationalStiffness FromNewtonMillimetersPerDegree(double newtonmillimetersperdegree) { - double value = (double) newtonmillimetersperdegree; - return new RotationalStiffness(value, RotationalStiffnessUnit.NewtonMillimeterPerDegree); + return new RotationalStiffness(newtonmillimetersperdegree, RotationalStiffnessUnit.NewtonMillimeterPerDegree); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromNewtonMillimetersPerRadian(QuantityValue newtonmillimetersperradian) + public static RotationalStiffness FromNewtonMillimetersPerRadian(double newtonmillimetersperradian) { - double value = (double) newtonmillimetersperradian; - return new RotationalStiffness(value, RotationalStiffnessUnit.NewtonMillimeterPerRadian); + return new RotationalStiffness(newtonmillimetersperradian, RotationalStiffnessUnit.NewtonMillimeterPerRadian); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromPoundForceFeetPerRadian(QuantityValue poundforcefeetperradian) + public static RotationalStiffness FromPoundForceFeetPerRadian(double poundforcefeetperradian) { - double value = (double) poundforcefeetperradian; - return new RotationalStiffness(value, RotationalStiffnessUnit.PoundForceFeetPerRadian); + return new RotationalStiffness(poundforcefeetperradian, RotationalStiffnessUnit.PoundForceFeetPerRadian); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromPoundForceFeetPerDegrees(QuantityValue poundforcefeetperdegrees) + public static RotationalStiffness FromPoundForceFeetPerDegrees(double poundforcefeetperdegrees) { - double value = (double) poundforcefeetperdegrees; - return new RotationalStiffness(value, RotationalStiffnessUnit.PoundForceFootPerDegrees); + return new RotationalStiffness(poundforcefeetperdegrees, 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..0610388521 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,50 +259,45 @@ 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 kilonewtonmetersperradianpermeter) { - double value = (double) kilonewtonmetersperradianpermeter; - return new RotationalStiffnessPerLength(value, RotationalStiffnessPerLengthUnit.KilonewtonMeterPerRadianPerMeter); + return new RotationalStiffnessPerLength(kilonewtonmetersperradianpermeter, RotationalStiffnessPerLengthUnit.KilonewtonMeterPerRadianPerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffnessPerLength FromKilopoundForceFeetPerDegreesPerFeet(QuantityValue kilopoundforcefeetperdegreesperfeet) + public static RotationalStiffnessPerLength FromKilopoundForceFeetPerDegreesPerFeet(double kilopoundforcefeetperdegreesperfeet) { - double value = (double) kilopoundforcefeetperdegreesperfeet; - return new RotationalStiffnessPerLength(value, RotationalStiffnessPerLengthUnit.KilopoundForceFootPerDegreesPerFoot); + return new RotationalStiffnessPerLength(kilopoundforcefeetperdegreesperfeet, RotationalStiffnessPerLengthUnit.KilopoundForceFootPerDegreesPerFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffnessPerLength FromMeganewtonMetersPerRadianPerMeter(QuantityValue meganewtonmetersperradianpermeter) + public static RotationalStiffnessPerLength FromMeganewtonMetersPerRadianPerMeter(double meganewtonmetersperradianpermeter) { - double value = (double) meganewtonmetersperradianpermeter; - return new RotationalStiffnessPerLength(value, RotationalStiffnessPerLengthUnit.MeganewtonMeterPerRadianPerMeter); + return new RotationalStiffnessPerLength(meganewtonmetersperradianpermeter, RotationalStiffnessPerLengthUnit.MeganewtonMeterPerRadianPerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffnessPerLength FromNewtonMetersPerRadianPerMeter(QuantityValue newtonmetersperradianpermeter) + public static RotationalStiffnessPerLength FromNewtonMetersPerRadianPerMeter(double newtonmetersperradianpermeter) { - double value = (double) newtonmetersperradianpermeter; - return new RotationalStiffnessPerLength(value, RotationalStiffnessPerLengthUnit.NewtonMeterPerRadianPerMeter); + return new RotationalStiffnessPerLength(newtonmetersperradianpermeter, RotationalStiffnessPerLengthUnit.NewtonMeterPerRadianPerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffnessPerLength FromPoundForceFeetPerDegreesPerFeet(QuantityValue poundforcefeetperdegreesperfeet) + public static RotationalStiffnessPerLength FromPoundForceFeetPerDegreesPerFeet(double poundforcefeetperdegreesperfeet) { - double value = (double) poundforcefeetperdegreesperfeet; - return new RotationalStiffnessPerLength(value, RotationalStiffnessPerLengthUnit.PoundForceFootPerDegreesPerFoot); + return new RotationalStiffnessPerLength(poundforcefeetperdegreesperfeet, 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..0851f5db17 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,10 +221,9 @@ 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 amount) { - double value = (double) amount; - return new Scalar(value, ScalarUnit.Amount); + return new Scalar(amount, 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..d53fbdc6b3 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,10 +224,9 @@ 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 steradians) { - double value = (double) steradians; - return new SolidAngle(value, SolidAngleUnit.Steradian); + return new SolidAngle(steradians, 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..2ef4ebbb14 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,300 +465,270 @@ 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 btuperpound) { - double value = (double) btuperpound; - return new SpecificEnergy(value, SpecificEnergyUnit.BtuPerPound); + return new SpecificEnergy(btuperpound, SpecificEnergyUnit.BtuPerPound); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromCaloriesPerGram(QuantityValue caloriespergram) + public static SpecificEnergy FromCaloriesPerGram(double caloriespergram) { - double value = (double) caloriespergram; - return new SpecificEnergy(value, SpecificEnergyUnit.CaloriePerGram); + return new SpecificEnergy(caloriespergram, SpecificEnergyUnit.CaloriePerGram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromGigawattDaysPerKilogram(QuantityValue gigawattdaysperkilogram) + public static SpecificEnergy FromGigawattDaysPerKilogram(double gigawattdaysperkilogram) { - double value = (double) gigawattdaysperkilogram; - return new SpecificEnergy(value, SpecificEnergyUnit.GigawattDayPerKilogram); + return new SpecificEnergy(gigawattdaysperkilogram, SpecificEnergyUnit.GigawattDayPerKilogram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromGigawattDaysPerShortTon(QuantityValue gigawattdayspershortton) + public static SpecificEnergy FromGigawattDaysPerShortTon(double gigawattdayspershortton) { - double value = (double) gigawattdayspershortton; - return new SpecificEnergy(value, SpecificEnergyUnit.GigawattDayPerShortTon); + return new SpecificEnergy(gigawattdayspershortton, SpecificEnergyUnit.GigawattDayPerShortTon); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromGigawattDaysPerTonne(QuantityValue gigawattdayspertonne) + public static SpecificEnergy FromGigawattDaysPerTonne(double gigawattdayspertonne) { - double value = (double) gigawattdayspertonne; - return new SpecificEnergy(value, SpecificEnergyUnit.GigawattDayPerTonne); + return new SpecificEnergy(gigawattdayspertonne, SpecificEnergyUnit.GigawattDayPerTonne); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromGigawattHoursPerKilogram(QuantityValue gigawatthoursperkilogram) + public static SpecificEnergy FromGigawattHoursPerKilogram(double gigawatthoursperkilogram) { - double value = (double) gigawatthoursperkilogram; - return new SpecificEnergy(value, SpecificEnergyUnit.GigawattHourPerKilogram); + return new SpecificEnergy(gigawatthoursperkilogram, SpecificEnergyUnit.GigawattHourPerKilogram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromGigawattHoursPerPound(QuantityValue gigawatthoursperpound) + public static SpecificEnergy FromGigawattHoursPerPound(double gigawatthoursperpound) { - double value = (double) gigawatthoursperpound; - return new SpecificEnergy(value, SpecificEnergyUnit.GigawattHourPerPound); + return new SpecificEnergy(gigawatthoursperpound, SpecificEnergyUnit.GigawattHourPerPound); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromJoulesPerKilogram(QuantityValue joulesperkilogram) + public static SpecificEnergy FromJoulesPerKilogram(double joulesperkilogram) { - double value = (double) joulesperkilogram; - return new SpecificEnergy(value, SpecificEnergyUnit.JoulePerKilogram); + return new SpecificEnergy(joulesperkilogram, SpecificEnergyUnit.JoulePerKilogram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromKilocaloriesPerGram(QuantityValue kilocaloriespergram) + public static SpecificEnergy FromKilocaloriesPerGram(double kilocaloriespergram) { - double value = (double) kilocaloriespergram; - return new SpecificEnergy(value, SpecificEnergyUnit.KilocaloriePerGram); + return new SpecificEnergy(kilocaloriespergram, SpecificEnergyUnit.KilocaloriePerGram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromKilojoulesPerKilogram(QuantityValue kilojoulesperkilogram) + public static SpecificEnergy FromKilojoulesPerKilogram(double kilojoulesperkilogram) { - double value = (double) kilojoulesperkilogram; - return new SpecificEnergy(value, SpecificEnergyUnit.KilojoulePerKilogram); + return new SpecificEnergy(kilojoulesperkilogram, SpecificEnergyUnit.KilojoulePerKilogram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromKilowattDaysPerKilogram(QuantityValue kilowattdaysperkilogram) + public static SpecificEnergy FromKilowattDaysPerKilogram(double kilowattdaysperkilogram) { - double value = (double) kilowattdaysperkilogram; - return new SpecificEnergy(value, SpecificEnergyUnit.KilowattDayPerKilogram); + return new SpecificEnergy(kilowattdaysperkilogram, SpecificEnergyUnit.KilowattDayPerKilogram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromKilowattDaysPerShortTon(QuantityValue kilowattdayspershortton) + public static SpecificEnergy FromKilowattDaysPerShortTon(double kilowattdayspershortton) { - double value = (double) kilowattdayspershortton; - return new SpecificEnergy(value, SpecificEnergyUnit.KilowattDayPerShortTon); + return new SpecificEnergy(kilowattdayspershortton, SpecificEnergyUnit.KilowattDayPerShortTon); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromKilowattDaysPerTonne(QuantityValue kilowattdayspertonne) + public static SpecificEnergy FromKilowattDaysPerTonne(double kilowattdayspertonne) { - double value = (double) kilowattdayspertonne; - return new SpecificEnergy(value, SpecificEnergyUnit.KilowattDayPerTonne); + return new SpecificEnergy(kilowattdayspertonne, SpecificEnergyUnit.KilowattDayPerTonne); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromKilowattHoursPerKilogram(QuantityValue kilowatthoursperkilogram) + public static SpecificEnergy FromKilowattHoursPerKilogram(double kilowatthoursperkilogram) { - double value = (double) kilowatthoursperkilogram; - return new SpecificEnergy(value, SpecificEnergyUnit.KilowattHourPerKilogram); + return new SpecificEnergy(kilowatthoursperkilogram, SpecificEnergyUnit.KilowattHourPerKilogram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromKilowattHoursPerPound(QuantityValue kilowatthoursperpound) + public static SpecificEnergy FromKilowattHoursPerPound(double kilowatthoursperpound) { - double value = (double) kilowatthoursperpound; - return new SpecificEnergy(value, SpecificEnergyUnit.KilowattHourPerPound); + return new SpecificEnergy(kilowatthoursperpound, SpecificEnergyUnit.KilowattHourPerPound); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromMegajoulesPerKilogram(QuantityValue megajoulesperkilogram) + public static SpecificEnergy FromMegajoulesPerKilogram(double megajoulesperkilogram) { - double value = (double) megajoulesperkilogram; - return new SpecificEnergy(value, SpecificEnergyUnit.MegajoulePerKilogram); + return new SpecificEnergy(megajoulesperkilogram, SpecificEnergyUnit.MegajoulePerKilogram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromMegaJoulesPerTonne(QuantityValue megajoulespertonne) + public static SpecificEnergy FromMegaJoulesPerTonne(double megajoulespertonne) { - double value = (double) megajoulespertonne; - return new SpecificEnergy(value, SpecificEnergyUnit.MegaJoulePerTonne); + return new SpecificEnergy(megajoulespertonne, SpecificEnergyUnit.MegaJoulePerTonne); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromMegawattDaysPerKilogram(QuantityValue megawattdaysperkilogram) + public static SpecificEnergy FromMegawattDaysPerKilogram(double megawattdaysperkilogram) { - double value = (double) megawattdaysperkilogram; - return new SpecificEnergy(value, SpecificEnergyUnit.MegawattDayPerKilogram); + return new SpecificEnergy(megawattdaysperkilogram, SpecificEnergyUnit.MegawattDayPerKilogram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromMegawattDaysPerShortTon(QuantityValue megawattdayspershortton) + public static SpecificEnergy FromMegawattDaysPerShortTon(double megawattdayspershortton) { - double value = (double) megawattdayspershortton; - return new SpecificEnergy(value, SpecificEnergyUnit.MegawattDayPerShortTon); + return new SpecificEnergy(megawattdayspershortton, SpecificEnergyUnit.MegawattDayPerShortTon); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromMegawattDaysPerTonne(QuantityValue megawattdayspertonne) + public static SpecificEnergy FromMegawattDaysPerTonne(double megawattdayspertonne) { - double value = (double) megawattdayspertonne; - return new SpecificEnergy(value, SpecificEnergyUnit.MegawattDayPerTonne); + return new SpecificEnergy(megawattdayspertonne, SpecificEnergyUnit.MegawattDayPerTonne); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromMegawattHoursPerKilogram(QuantityValue megawatthoursperkilogram) + public static SpecificEnergy FromMegawattHoursPerKilogram(double megawatthoursperkilogram) { - double value = (double) megawatthoursperkilogram; - return new SpecificEnergy(value, SpecificEnergyUnit.MegawattHourPerKilogram); + return new SpecificEnergy(megawatthoursperkilogram, SpecificEnergyUnit.MegawattHourPerKilogram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromMegawattHoursPerPound(QuantityValue megawatthoursperpound) + public static SpecificEnergy FromMegawattHoursPerPound(double megawatthoursperpound) { - double value = (double) megawatthoursperpound; - return new SpecificEnergy(value, SpecificEnergyUnit.MegawattHourPerPound); + return new SpecificEnergy(megawatthoursperpound, SpecificEnergyUnit.MegawattHourPerPound); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromTerawattDaysPerKilogram(QuantityValue terawattdaysperkilogram) + public static SpecificEnergy FromTerawattDaysPerKilogram(double terawattdaysperkilogram) { - double value = (double) terawattdaysperkilogram; - return new SpecificEnergy(value, SpecificEnergyUnit.TerawattDayPerKilogram); + return new SpecificEnergy(terawattdaysperkilogram, SpecificEnergyUnit.TerawattDayPerKilogram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromTerawattDaysPerShortTon(QuantityValue terawattdayspershortton) + public static SpecificEnergy FromTerawattDaysPerShortTon(double terawattdayspershortton) { - double value = (double) terawattdayspershortton; - return new SpecificEnergy(value, SpecificEnergyUnit.TerawattDayPerShortTon); + return new SpecificEnergy(terawattdayspershortton, SpecificEnergyUnit.TerawattDayPerShortTon); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromTerawattDaysPerTonne(QuantityValue terawattdayspertonne) + public static SpecificEnergy FromTerawattDaysPerTonne(double terawattdayspertonne) { - double value = (double) terawattdayspertonne; - return new SpecificEnergy(value, SpecificEnergyUnit.TerawattDayPerTonne); + return new SpecificEnergy(terawattdayspertonne, SpecificEnergyUnit.TerawattDayPerTonne); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromWattDaysPerKilogram(QuantityValue wattdaysperkilogram) + public static SpecificEnergy FromWattDaysPerKilogram(double wattdaysperkilogram) { - double value = (double) wattdaysperkilogram; - return new SpecificEnergy(value, SpecificEnergyUnit.WattDayPerKilogram); + return new SpecificEnergy(wattdaysperkilogram, SpecificEnergyUnit.WattDayPerKilogram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromWattDaysPerShortTon(QuantityValue wattdayspershortton) + public static SpecificEnergy FromWattDaysPerShortTon(double wattdayspershortton) { - double value = (double) wattdayspershortton; - return new SpecificEnergy(value, SpecificEnergyUnit.WattDayPerShortTon); + return new SpecificEnergy(wattdayspershortton, SpecificEnergyUnit.WattDayPerShortTon); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromWattDaysPerTonne(QuantityValue wattdayspertonne) + public static SpecificEnergy FromWattDaysPerTonne(double wattdayspertonne) { - double value = (double) wattdayspertonne; - return new SpecificEnergy(value, SpecificEnergyUnit.WattDayPerTonne); + return new SpecificEnergy(wattdayspertonne, SpecificEnergyUnit.WattDayPerTonne); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromWattHoursPerKilogram(QuantityValue watthoursperkilogram) + public static SpecificEnergy FromWattHoursPerKilogram(double watthoursperkilogram) { - double value = (double) watthoursperkilogram; - return new SpecificEnergy(value, SpecificEnergyUnit.WattHourPerKilogram); + return new SpecificEnergy(watthoursperkilogram, SpecificEnergyUnit.WattHourPerKilogram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromWattHoursPerPound(QuantityValue watthoursperpound) + public static SpecificEnergy FromWattHoursPerPound(double watthoursperpound) { - double value = (double) watthoursperpound; - return new SpecificEnergy(value, SpecificEnergyUnit.WattHourPerPound); + return new SpecificEnergy(watthoursperpound, 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..7111f179f8 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,90 +292,81 @@ 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 btusperpoundfahrenheit) { - double value = (double) btusperpoundfahrenheit; - return new SpecificEntropy(value, SpecificEntropyUnit.BtuPerPoundFahrenheit); + return new SpecificEntropy(btusperpoundfahrenheit, SpecificEntropyUnit.BtuPerPoundFahrenheit); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEntropy FromCaloriesPerGramKelvin(QuantityValue caloriespergramkelvin) + public static SpecificEntropy FromCaloriesPerGramKelvin(double caloriespergramkelvin) { - double value = (double) caloriespergramkelvin; - return new SpecificEntropy(value, SpecificEntropyUnit.CaloriePerGramKelvin); + return new SpecificEntropy(caloriespergramkelvin, SpecificEntropyUnit.CaloriePerGramKelvin); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEntropy FromJoulesPerKilogramDegreeCelsius(QuantityValue joulesperkilogramdegreecelsius) + public static SpecificEntropy FromJoulesPerKilogramDegreeCelsius(double joulesperkilogramdegreecelsius) { - double value = (double) joulesperkilogramdegreecelsius; - return new SpecificEntropy(value, SpecificEntropyUnit.JoulePerKilogramDegreeCelsius); + return new SpecificEntropy(joulesperkilogramdegreecelsius, SpecificEntropyUnit.JoulePerKilogramDegreeCelsius); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEntropy FromJoulesPerKilogramKelvin(QuantityValue joulesperkilogramkelvin) + public static SpecificEntropy FromJoulesPerKilogramKelvin(double joulesperkilogramkelvin) { - double value = (double) joulesperkilogramkelvin; - return new SpecificEntropy(value, SpecificEntropyUnit.JoulePerKilogramKelvin); + return new SpecificEntropy(joulesperkilogramkelvin, SpecificEntropyUnit.JoulePerKilogramKelvin); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEntropy FromKilocaloriesPerGramKelvin(QuantityValue kilocaloriespergramkelvin) + public static SpecificEntropy FromKilocaloriesPerGramKelvin(double kilocaloriespergramkelvin) { - double value = (double) kilocaloriespergramkelvin; - return new SpecificEntropy(value, SpecificEntropyUnit.KilocaloriePerGramKelvin); + return new SpecificEntropy(kilocaloriespergramkelvin, SpecificEntropyUnit.KilocaloriePerGramKelvin); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEntropy FromKilojoulesPerKilogramDegreeCelsius(QuantityValue kilojoulesperkilogramdegreecelsius) + public static SpecificEntropy FromKilojoulesPerKilogramDegreeCelsius(double kilojoulesperkilogramdegreecelsius) { - double value = (double) kilojoulesperkilogramdegreecelsius; - return new SpecificEntropy(value, SpecificEntropyUnit.KilojoulePerKilogramDegreeCelsius); + return new SpecificEntropy(kilojoulesperkilogramdegreecelsius, SpecificEntropyUnit.KilojoulePerKilogramDegreeCelsius); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEntropy FromKilojoulesPerKilogramKelvin(QuantityValue kilojoulesperkilogramkelvin) + public static SpecificEntropy FromKilojoulesPerKilogramKelvin(double kilojoulesperkilogramkelvin) { - double value = (double) kilojoulesperkilogramkelvin; - return new SpecificEntropy(value, SpecificEntropyUnit.KilojoulePerKilogramKelvin); + return new SpecificEntropy(kilojoulesperkilogramkelvin, SpecificEntropyUnit.KilojoulePerKilogramKelvin); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEntropy FromMegajoulesPerKilogramDegreeCelsius(QuantityValue megajoulesperkilogramdegreecelsius) + public static SpecificEntropy FromMegajoulesPerKilogramDegreeCelsius(double megajoulesperkilogramdegreecelsius) { - double value = (double) megajoulesperkilogramdegreecelsius; - return new SpecificEntropy(value, SpecificEntropyUnit.MegajoulePerKilogramDegreeCelsius); + return new SpecificEntropy(megajoulesperkilogramdegreecelsius, SpecificEntropyUnit.MegajoulePerKilogramDegreeCelsius); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEntropy FromMegajoulesPerKilogramKelvin(QuantityValue megajoulesperkilogramkelvin) + public static SpecificEntropy FromMegajoulesPerKilogramKelvin(double megajoulesperkilogramkelvin) { - double value = (double) megajoulesperkilogramkelvin; - return new SpecificEntropy(value, SpecificEntropyUnit.MegajoulePerKilogramKelvin); + return new SpecificEntropy(megajoulesperkilogramkelvin, 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..f98426d202 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,40 +248,36 @@ 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 gramsperkilonewtonsecond) { - double value = (double) gramsperkilonewtonsecond; - return new SpecificFuelConsumption(value, SpecificFuelConsumptionUnit.GramPerKiloNewtonSecond); + return new SpecificFuelConsumption(gramsperkilonewtonsecond, SpecificFuelConsumptionUnit.GramPerKiloNewtonSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificFuelConsumption FromKilogramsPerKilogramForceHour(QuantityValue kilogramsperkilogramforcehour) + public static SpecificFuelConsumption FromKilogramsPerKilogramForceHour(double kilogramsperkilogramforcehour) { - double value = (double) kilogramsperkilogramforcehour; - return new SpecificFuelConsumption(value, SpecificFuelConsumptionUnit.KilogramPerKilogramForceHour); + return new SpecificFuelConsumption(kilogramsperkilogramforcehour, SpecificFuelConsumptionUnit.KilogramPerKilogramForceHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificFuelConsumption FromKilogramsPerKiloNewtonSecond(QuantityValue kilogramsperkilonewtonsecond) + public static SpecificFuelConsumption FromKilogramsPerKiloNewtonSecond(double kilogramsperkilonewtonsecond) { - double value = (double) kilogramsperkilonewtonsecond; - return new SpecificFuelConsumption(value, SpecificFuelConsumptionUnit.KilogramPerKiloNewtonSecond); + return new SpecificFuelConsumption(kilogramsperkilonewtonsecond, SpecificFuelConsumptionUnit.KilogramPerKiloNewtonSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificFuelConsumption FromPoundsMassPerPoundForceHour(QuantityValue poundsmassperpoundforcehour) + public static SpecificFuelConsumption FromPoundsMassPerPoundForceHour(double poundsmassperpoundforcehour) { - double value = (double) poundsmassperpoundforcehour; - return new SpecificFuelConsumption(value, SpecificFuelConsumptionUnit.PoundMassPerPoundForceHour); + return new SpecificFuelConsumption(poundsmassperpoundforcehour, 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..ec08b56d95 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,30 +243,27 @@ 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 cubicfeetperpound) { - double value = (double) cubicfeetperpound; - return new SpecificVolume(value, SpecificVolumeUnit.CubicFootPerPound); + return new SpecificVolume(cubicfeetperpound, SpecificVolumeUnit.CubicFootPerPound); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificVolume FromCubicMetersPerKilogram(QuantityValue cubicmetersperkilogram) + public static SpecificVolume FromCubicMetersPerKilogram(double cubicmetersperkilogram) { - double value = (double) cubicmetersperkilogram; - return new SpecificVolume(value, SpecificVolumeUnit.CubicMeterPerKilogram); + return new SpecificVolume(cubicmetersperkilogram, SpecificVolumeUnit.CubicMeterPerKilogram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificVolume FromMillicubicMetersPerKilogram(QuantityValue millicubicmetersperkilogram) + public static SpecificVolume FromMillicubicMetersPerKilogram(double millicubicmetersperkilogram) { - double value = (double) millicubicmetersperkilogram; - return new SpecificVolume(value, SpecificVolumeUnit.MillicubicMeterPerKilogram); + return new SpecificVolume(millicubicmetersperkilogram, 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..1c863125ad 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,170 +361,153 @@ 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 kilogramsforcepercubiccentimeter) { - double value = (double) kilogramsforcepercubiccentimeter; - return new SpecificWeight(value, SpecificWeightUnit.KilogramForcePerCubicCentimeter); + return new SpecificWeight(kilogramsforcepercubiccentimeter, SpecificWeightUnit.KilogramForcePerCubicCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificWeight FromKilogramsForcePerCubicMeter(QuantityValue kilogramsforcepercubicmeter) + public static SpecificWeight FromKilogramsForcePerCubicMeter(double kilogramsforcepercubicmeter) { - double value = (double) kilogramsforcepercubicmeter; - return new SpecificWeight(value, SpecificWeightUnit.KilogramForcePerCubicMeter); + return new SpecificWeight(kilogramsforcepercubicmeter, SpecificWeightUnit.KilogramForcePerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificWeight FromKilogramsForcePerCubicMillimeter(QuantityValue kilogramsforcepercubicmillimeter) + public static SpecificWeight FromKilogramsForcePerCubicMillimeter(double kilogramsforcepercubicmillimeter) { - double value = (double) kilogramsforcepercubicmillimeter; - return new SpecificWeight(value, SpecificWeightUnit.KilogramForcePerCubicMillimeter); + return new SpecificWeight(kilogramsforcepercubicmillimeter, SpecificWeightUnit.KilogramForcePerCubicMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificWeight FromKilonewtonsPerCubicCentimeter(QuantityValue kilonewtonspercubiccentimeter) + public static SpecificWeight FromKilonewtonsPerCubicCentimeter(double kilonewtonspercubiccentimeter) { - double value = (double) kilonewtonspercubiccentimeter; - return new SpecificWeight(value, SpecificWeightUnit.KilonewtonPerCubicCentimeter); + return new SpecificWeight(kilonewtonspercubiccentimeter, SpecificWeightUnit.KilonewtonPerCubicCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificWeight FromKilonewtonsPerCubicMeter(QuantityValue kilonewtonspercubicmeter) + public static SpecificWeight FromKilonewtonsPerCubicMeter(double kilonewtonspercubicmeter) { - double value = (double) kilonewtonspercubicmeter; - return new SpecificWeight(value, SpecificWeightUnit.KilonewtonPerCubicMeter); + return new SpecificWeight(kilonewtonspercubicmeter, SpecificWeightUnit.KilonewtonPerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificWeight FromKilonewtonsPerCubicMillimeter(QuantityValue kilonewtonspercubicmillimeter) + public static SpecificWeight FromKilonewtonsPerCubicMillimeter(double kilonewtonspercubicmillimeter) { - double value = (double) kilonewtonspercubicmillimeter; - return new SpecificWeight(value, SpecificWeightUnit.KilonewtonPerCubicMillimeter); + return new SpecificWeight(kilonewtonspercubicmillimeter, SpecificWeightUnit.KilonewtonPerCubicMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificWeight FromKilopoundsForcePerCubicFoot(QuantityValue kilopoundsforcepercubicfoot) + public static SpecificWeight FromKilopoundsForcePerCubicFoot(double kilopoundsforcepercubicfoot) { - double value = (double) kilopoundsforcepercubicfoot; - return new SpecificWeight(value, SpecificWeightUnit.KilopoundForcePerCubicFoot); + return new SpecificWeight(kilopoundsforcepercubicfoot, SpecificWeightUnit.KilopoundForcePerCubicFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificWeight FromKilopoundsForcePerCubicInch(QuantityValue kilopoundsforcepercubicinch) + public static SpecificWeight FromKilopoundsForcePerCubicInch(double kilopoundsforcepercubicinch) { - double value = (double) kilopoundsforcepercubicinch; - return new SpecificWeight(value, SpecificWeightUnit.KilopoundForcePerCubicInch); + return new SpecificWeight(kilopoundsforcepercubicinch, SpecificWeightUnit.KilopoundForcePerCubicInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificWeight FromMeganewtonsPerCubicMeter(QuantityValue meganewtonspercubicmeter) + public static SpecificWeight FromMeganewtonsPerCubicMeter(double meganewtonspercubicmeter) { - double value = (double) meganewtonspercubicmeter; - return new SpecificWeight(value, SpecificWeightUnit.MeganewtonPerCubicMeter); + return new SpecificWeight(meganewtonspercubicmeter, SpecificWeightUnit.MeganewtonPerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificWeight FromNewtonsPerCubicCentimeter(QuantityValue newtonspercubiccentimeter) + public static SpecificWeight FromNewtonsPerCubicCentimeter(double newtonspercubiccentimeter) { - double value = (double) newtonspercubiccentimeter; - return new SpecificWeight(value, SpecificWeightUnit.NewtonPerCubicCentimeter); + return new SpecificWeight(newtonspercubiccentimeter, SpecificWeightUnit.NewtonPerCubicCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificWeight FromNewtonsPerCubicMeter(QuantityValue newtonspercubicmeter) + public static SpecificWeight FromNewtonsPerCubicMeter(double newtonspercubicmeter) { - double value = (double) newtonspercubicmeter; - return new SpecificWeight(value, SpecificWeightUnit.NewtonPerCubicMeter); + return new SpecificWeight(newtonspercubicmeter, SpecificWeightUnit.NewtonPerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificWeight FromNewtonsPerCubicMillimeter(QuantityValue newtonspercubicmillimeter) + public static SpecificWeight FromNewtonsPerCubicMillimeter(double newtonspercubicmillimeter) { - double value = (double) newtonspercubicmillimeter; - return new SpecificWeight(value, SpecificWeightUnit.NewtonPerCubicMillimeter); + return new SpecificWeight(newtonspercubicmillimeter, SpecificWeightUnit.NewtonPerCubicMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificWeight FromPoundsForcePerCubicFoot(QuantityValue poundsforcepercubicfoot) + public static SpecificWeight FromPoundsForcePerCubicFoot(double poundsforcepercubicfoot) { - double value = (double) poundsforcepercubicfoot; - return new SpecificWeight(value, SpecificWeightUnit.PoundForcePerCubicFoot); + return new SpecificWeight(poundsforcepercubicfoot, SpecificWeightUnit.PoundForcePerCubicFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificWeight FromPoundsForcePerCubicInch(QuantityValue poundsforcepercubicinch) + public static SpecificWeight FromPoundsForcePerCubicInch(double poundsforcepercubicinch) { - double value = (double) poundsforcepercubicinch; - return new SpecificWeight(value, SpecificWeightUnit.PoundForcePerCubicInch); + return new SpecificWeight(poundsforcepercubicinch, SpecificWeightUnit.PoundForcePerCubicInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificWeight FromTonnesForcePerCubicCentimeter(QuantityValue tonnesforcepercubiccentimeter) + public static SpecificWeight FromTonnesForcePerCubicCentimeter(double tonnesforcepercubiccentimeter) { - double value = (double) tonnesforcepercubiccentimeter; - return new SpecificWeight(value, SpecificWeightUnit.TonneForcePerCubicCentimeter); + return new SpecificWeight(tonnesforcepercubiccentimeter, SpecificWeightUnit.TonneForcePerCubicCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificWeight FromTonnesForcePerCubicMeter(QuantityValue tonnesforcepercubicmeter) + public static SpecificWeight FromTonnesForcePerCubicMeter(double tonnesforcepercubicmeter) { - double value = (double) tonnesforcepercubicmeter; - return new SpecificWeight(value, SpecificWeightUnit.TonneForcePerCubicMeter); + return new SpecificWeight(tonnesforcepercubicmeter, SpecificWeightUnit.TonneForcePerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificWeight FromTonnesForcePerCubicMillimeter(QuantityValue tonnesforcepercubicmillimeter) + public static SpecificWeight FromTonnesForcePerCubicMillimeter(double tonnesforcepercubicmillimeter) { - double value = (double) tonnesforcepercubicmillimeter; - return new SpecificWeight(value, SpecificWeightUnit.TonneForcePerCubicMillimeter); + return new SpecificWeight(tonnesforcepercubicmillimeter, 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..8bf4d96a66 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,330 +492,297 @@ 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 centimetersperhour) { - double value = (double) centimetersperhour; - return new Speed(value, SpeedUnit.CentimeterPerHour); + return new Speed(centimetersperhour, SpeedUnit.CentimeterPerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromCentimetersPerMinute(QuantityValue centimetersperminute) + public static Speed FromCentimetersPerMinute(double centimetersperminute) { - double value = (double) centimetersperminute; - return new Speed(value, SpeedUnit.CentimeterPerMinute); + return new Speed(centimetersperminute, SpeedUnit.CentimeterPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromCentimetersPerSecond(QuantityValue centimeterspersecond) + public static Speed FromCentimetersPerSecond(double centimeterspersecond) { - double value = (double) centimeterspersecond; - return new Speed(value, SpeedUnit.CentimeterPerSecond); + return new Speed(centimeterspersecond, SpeedUnit.CentimeterPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromDecimetersPerMinute(QuantityValue decimetersperminute) + public static Speed FromDecimetersPerMinute(double decimetersperminute) { - double value = (double) decimetersperminute; - return new Speed(value, SpeedUnit.DecimeterPerMinute); + return new Speed(decimetersperminute, SpeedUnit.DecimeterPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromDecimetersPerSecond(QuantityValue decimeterspersecond) + public static Speed FromDecimetersPerSecond(double decimeterspersecond) { - double value = (double) decimeterspersecond; - return new Speed(value, SpeedUnit.DecimeterPerSecond); + return new Speed(decimeterspersecond, SpeedUnit.DecimeterPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromFeetPerHour(QuantityValue feetperhour) + public static Speed FromFeetPerHour(double feetperhour) { - double value = (double) feetperhour; - return new Speed(value, SpeedUnit.FootPerHour); + return new Speed(feetperhour, SpeedUnit.FootPerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromFeetPerMinute(QuantityValue feetperminute) + public static Speed FromFeetPerMinute(double feetperminute) { - double value = (double) feetperminute; - return new Speed(value, SpeedUnit.FootPerMinute); + return new Speed(feetperminute, SpeedUnit.FootPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromFeetPerSecond(QuantityValue feetpersecond) + public static Speed FromFeetPerSecond(double feetpersecond) { - double value = (double) feetpersecond; - return new Speed(value, SpeedUnit.FootPerSecond); + return new Speed(feetpersecond, SpeedUnit.FootPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromInchesPerHour(QuantityValue inchesperhour) + public static Speed FromInchesPerHour(double inchesperhour) { - double value = (double) inchesperhour; - return new Speed(value, SpeedUnit.InchPerHour); + return new Speed(inchesperhour, SpeedUnit.InchPerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromInchesPerMinute(QuantityValue inchesperminute) + public static Speed FromInchesPerMinute(double inchesperminute) { - double value = (double) inchesperminute; - return new Speed(value, SpeedUnit.InchPerMinute); + return new Speed(inchesperminute, SpeedUnit.InchPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromInchesPerSecond(QuantityValue inchespersecond) + public static Speed FromInchesPerSecond(double inchespersecond) { - double value = (double) inchespersecond; - return new Speed(value, SpeedUnit.InchPerSecond); + return new Speed(inchespersecond, SpeedUnit.InchPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromKilometersPerHour(QuantityValue kilometersperhour) + public static Speed FromKilometersPerHour(double kilometersperhour) { - double value = (double) kilometersperhour; - return new Speed(value, SpeedUnit.KilometerPerHour); + return new Speed(kilometersperhour, SpeedUnit.KilometerPerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromKilometersPerMinute(QuantityValue kilometersperminute) + public static Speed FromKilometersPerMinute(double kilometersperminute) { - double value = (double) kilometersperminute; - return new Speed(value, SpeedUnit.KilometerPerMinute); + return new Speed(kilometersperminute, SpeedUnit.KilometerPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromKilometersPerSecond(QuantityValue kilometerspersecond) + public static Speed FromKilometersPerSecond(double kilometerspersecond) { - double value = (double) kilometerspersecond; - return new Speed(value, SpeedUnit.KilometerPerSecond); + return new Speed(kilometerspersecond, SpeedUnit.KilometerPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromKnots(QuantityValue knots) + public static Speed FromKnots(double knots) { - double value = (double) knots; - return new Speed(value, SpeedUnit.Knot); + return new Speed(knots, SpeedUnit.Knot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromMach(QuantityValue mach) + public static Speed FromMach(double mach) { - double value = (double) mach; - return new Speed(value, SpeedUnit.Mach); + return new Speed(mach, SpeedUnit.Mach); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromMetersPerHour(QuantityValue metersperhour) + public static Speed FromMetersPerHour(double metersperhour) { - double value = (double) metersperhour; - return new Speed(value, SpeedUnit.MeterPerHour); + return new Speed(metersperhour, SpeedUnit.MeterPerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromMetersPerMinute(QuantityValue metersperminute) + public static Speed FromMetersPerMinute(double metersperminute) { - double value = (double) metersperminute; - return new Speed(value, SpeedUnit.MeterPerMinute); + return new Speed(metersperminute, SpeedUnit.MeterPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromMetersPerSecond(QuantityValue meterspersecond) + public static Speed FromMetersPerSecond(double meterspersecond) { - double value = (double) meterspersecond; - return new Speed(value, SpeedUnit.MeterPerSecond); + return new Speed(meterspersecond, SpeedUnit.MeterPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromMicrometersPerMinute(QuantityValue micrometersperminute) + public static Speed FromMicrometersPerMinute(double micrometersperminute) { - double value = (double) micrometersperminute; - return new Speed(value, SpeedUnit.MicrometerPerMinute); + return new Speed(micrometersperminute, SpeedUnit.MicrometerPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromMicrometersPerSecond(QuantityValue micrometerspersecond) + public static Speed FromMicrometersPerSecond(double micrometerspersecond) { - double value = (double) micrometerspersecond; - return new Speed(value, SpeedUnit.MicrometerPerSecond); + return new Speed(micrometerspersecond, SpeedUnit.MicrometerPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromMilesPerHour(QuantityValue milesperhour) + public static Speed FromMilesPerHour(double milesperhour) { - double value = (double) milesperhour; - return new Speed(value, SpeedUnit.MilePerHour); + return new Speed(milesperhour, SpeedUnit.MilePerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromMillimetersPerHour(QuantityValue millimetersperhour) + public static Speed FromMillimetersPerHour(double millimetersperhour) { - double value = (double) millimetersperhour; - return new Speed(value, SpeedUnit.MillimeterPerHour); + return new Speed(millimetersperhour, SpeedUnit.MillimeterPerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromMillimetersPerMinute(QuantityValue millimetersperminute) + public static Speed FromMillimetersPerMinute(double millimetersperminute) { - double value = (double) millimetersperminute; - return new Speed(value, SpeedUnit.MillimeterPerMinute); + return new Speed(millimetersperminute, SpeedUnit.MillimeterPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromMillimetersPerSecond(QuantityValue millimeterspersecond) + public static Speed FromMillimetersPerSecond(double millimeterspersecond) { - double value = (double) millimeterspersecond; - return new Speed(value, SpeedUnit.MillimeterPerSecond); + return new Speed(millimeterspersecond, SpeedUnit.MillimeterPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromNanometersPerMinute(QuantityValue nanometersperminute) + public static Speed FromNanometersPerMinute(double nanometersperminute) { - double value = (double) nanometersperminute; - return new Speed(value, SpeedUnit.NanometerPerMinute); + return new Speed(nanometersperminute, SpeedUnit.NanometerPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromNanometersPerSecond(QuantityValue nanometerspersecond) + public static Speed FromNanometersPerSecond(double nanometerspersecond) { - double value = (double) nanometerspersecond; - return new Speed(value, SpeedUnit.NanometerPerSecond); + return new Speed(nanometerspersecond, SpeedUnit.NanometerPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromUsSurveyFeetPerHour(QuantityValue ussurveyfeetperhour) + public static Speed FromUsSurveyFeetPerHour(double ussurveyfeetperhour) { - double value = (double) ussurveyfeetperhour; - return new Speed(value, SpeedUnit.UsSurveyFootPerHour); + return new Speed(ussurveyfeetperhour, SpeedUnit.UsSurveyFootPerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromUsSurveyFeetPerMinute(QuantityValue ussurveyfeetperminute) + public static Speed FromUsSurveyFeetPerMinute(double ussurveyfeetperminute) { - double value = (double) ussurveyfeetperminute; - return new Speed(value, SpeedUnit.UsSurveyFootPerMinute); + return new Speed(ussurveyfeetperminute, SpeedUnit.UsSurveyFootPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromUsSurveyFeetPerSecond(QuantityValue ussurveyfeetpersecond) + public static Speed FromUsSurveyFeetPerSecond(double ussurveyfeetpersecond) { - double value = (double) ussurveyfeetpersecond; - return new Speed(value, SpeedUnit.UsSurveyFootPerSecond); + return new Speed(ussurveyfeetpersecond, SpeedUnit.UsSurveyFootPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromYardsPerHour(QuantityValue yardsperhour) + public static Speed FromYardsPerHour(double yardsperhour) { - double value = (double) yardsperhour; - return new Speed(value, SpeedUnit.YardPerHour); + return new Speed(yardsperhour, SpeedUnit.YardPerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromYardsPerMinute(QuantityValue yardsperminute) + public static Speed FromYardsPerMinute(double yardsperminute) { - double value = (double) yardsperminute; - return new Speed(value, SpeedUnit.YardPerMinute); + return new Speed(yardsperminute, SpeedUnit.YardPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromYardsPerSecond(QuantityValue yardspersecond) + public static Speed FromYardsPerSecond(double yardspersecond) { - double value = (double) yardspersecond; - return new Speed(value, SpeedUnit.YardPerSecond); + return new Speed(yardspersecond, 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..b5667ffc11 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,90 +285,81 @@ 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 standardcubiccentimetersperminute) { - double value = (double) standardcubiccentimetersperminute; - return new StandardVolumeFlow(value, StandardVolumeFlowUnit.StandardCubicCentimeterPerMinute); + return new StandardVolumeFlow(standardcubiccentimetersperminute, StandardVolumeFlowUnit.StandardCubicCentimeterPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static StandardVolumeFlow FromStandardCubicFeetPerHour(QuantityValue standardcubicfeetperhour) + public static StandardVolumeFlow FromStandardCubicFeetPerHour(double standardcubicfeetperhour) { - double value = (double) standardcubicfeetperhour; - return new StandardVolumeFlow(value, StandardVolumeFlowUnit.StandardCubicFootPerHour); + return new StandardVolumeFlow(standardcubicfeetperhour, StandardVolumeFlowUnit.StandardCubicFootPerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static StandardVolumeFlow FromStandardCubicFeetPerMinute(QuantityValue standardcubicfeetperminute) + public static StandardVolumeFlow FromStandardCubicFeetPerMinute(double standardcubicfeetperminute) { - double value = (double) standardcubicfeetperminute; - return new StandardVolumeFlow(value, StandardVolumeFlowUnit.StandardCubicFootPerMinute); + return new StandardVolumeFlow(standardcubicfeetperminute, StandardVolumeFlowUnit.StandardCubicFootPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static StandardVolumeFlow FromStandardCubicFeetPerSecond(QuantityValue standardcubicfeetpersecond) + public static StandardVolumeFlow FromStandardCubicFeetPerSecond(double standardcubicfeetpersecond) { - double value = (double) standardcubicfeetpersecond; - return new StandardVolumeFlow(value, StandardVolumeFlowUnit.StandardCubicFootPerSecond); + return new StandardVolumeFlow(standardcubicfeetpersecond, StandardVolumeFlowUnit.StandardCubicFootPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static StandardVolumeFlow FromStandardCubicMetersPerDay(QuantityValue standardcubicmetersperday) + public static StandardVolumeFlow FromStandardCubicMetersPerDay(double standardcubicmetersperday) { - double value = (double) standardcubicmetersperday; - return new StandardVolumeFlow(value, StandardVolumeFlowUnit.StandardCubicMeterPerDay); + return new StandardVolumeFlow(standardcubicmetersperday, StandardVolumeFlowUnit.StandardCubicMeterPerDay); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static StandardVolumeFlow FromStandardCubicMetersPerHour(QuantityValue standardcubicmetersperhour) + public static StandardVolumeFlow FromStandardCubicMetersPerHour(double standardcubicmetersperhour) { - double value = (double) standardcubicmetersperhour; - return new StandardVolumeFlow(value, StandardVolumeFlowUnit.StandardCubicMeterPerHour); + return new StandardVolumeFlow(standardcubicmetersperhour, StandardVolumeFlowUnit.StandardCubicMeterPerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static StandardVolumeFlow FromStandardCubicMetersPerMinute(QuantityValue standardcubicmetersperminute) + public static StandardVolumeFlow FromStandardCubicMetersPerMinute(double standardcubicmetersperminute) { - double value = (double) standardcubicmetersperminute; - return new StandardVolumeFlow(value, StandardVolumeFlowUnit.StandardCubicMeterPerMinute); + return new StandardVolumeFlow(standardcubicmetersperminute, StandardVolumeFlowUnit.StandardCubicMeterPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static StandardVolumeFlow FromStandardCubicMetersPerSecond(QuantityValue standardcubicmeterspersecond) + public static StandardVolumeFlow FromStandardCubicMetersPerSecond(double standardcubicmeterspersecond) { - double value = (double) standardcubicmeterspersecond; - return new StandardVolumeFlow(value, StandardVolumeFlowUnit.StandardCubicMeterPerSecond); + return new StandardVolumeFlow(standardcubicmeterspersecond, StandardVolumeFlowUnit.StandardCubicMeterPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static StandardVolumeFlow FromStandardLitersPerMinute(QuantityValue standardlitersperminute) + public static StandardVolumeFlow FromStandardLitersPerMinute(double standardlitersperminute) { - double value = (double) standardlitersperminute; - return new StandardVolumeFlow(value, StandardVolumeFlowUnit.StandardLiterPerMinute); + return new StandardVolumeFlow(standardlitersperminute, 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..c3d224ce77 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,100 +290,90 @@ 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 degreescelsius) { - double value = (double) degreescelsius; - return new Temperature(value, TemperatureUnit.DegreeCelsius); + return new Temperature(degreescelsius, TemperatureUnit.DegreeCelsius); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Temperature FromDegreesDelisle(QuantityValue degreesdelisle) + public static Temperature FromDegreesDelisle(double degreesdelisle) { - double value = (double) degreesdelisle; - return new Temperature(value, TemperatureUnit.DegreeDelisle); + return new Temperature(degreesdelisle, TemperatureUnit.DegreeDelisle); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Temperature FromDegreesFahrenheit(QuantityValue degreesfahrenheit) + public static Temperature FromDegreesFahrenheit(double degreesfahrenheit) { - double value = (double) degreesfahrenheit; - return new Temperature(value, TemperatureUnit.DegreeFahrenheit); + return new Temperature(degreesfahrenheit, TemperatureUnit.DegreeFahrenheit); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Temperature FromDegreesNewton(QuantityValue degreesnewton) + public static Temperature FromDegreesNewton(double degreesnewton) { - double value = (double) degreesnewton; - return new Temperature(value, TemperatureUnit.DegreeNewton); + return new Temperature(degreesnewton, TemperatureUnit.DegreeNewton); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Temperature FromDegreesRankine(QuantityValue degreesrankine) + public static Temperature FromDegreesRankine(double degreesrankine) { - double value = (double) degreesrankine; - return new Temperature(value, TemperatureUnit.DegreeRankine); + return new Temperature(degreesrankine, TemperatureUnit.DegreeRankine); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Temperature FromDegreesReaumur(QuantityValue degreesreaumur) + public static Temperature FromDegreesReaumur(double degreesreaumur) { - double value = (double) degreesreaumur; - return new Temperature(value, TemperatureUnit.DegreeReaumur); + return new Temperature(degreesreaumur, TemperatureUnit.DegreeReaumur); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Temperature FromDegreesRoemer(QuantityValue degreesroemer) + public static Temperature FromDegreesRoemer(double degreesroemer) { - double value = (double) degreesroemer; - return new Temperature(value, TemperatureUnit.DegreeRoemer); + return new Temperature(degreesroemer, TemperatureUnit.DegreeRoemer); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Temperature FromKelvins(QuantityValue kelvins) + public static Temperature FromKelvins(double kelvins) { - double value = (double) kelvins; - return new Temperature(value, TemperatureUnit.Kelvin); + return new Temperature(kelvins, TemperatureUnit.Kelvin); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Temperature FromMillidegreesCelsius(QuantityValue millidegreescelsius) + public static Temperature FromMillidegreesCelsius(double millidegreescelsius) { - double value = (double) millidegreescelsius; - return new Temperature(value, TemperatureUnit.MillidegreeCelsius); + return new Temperature(millidegreescelsius, TemperatureUnit.MillidegreeCelsius); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Temperature FromSolarTemperatures(QuantityValue solartemperatures) + public static Temperature FromSolarTemperatures(double solartemperatures) { - double value = (double) solartemperatures; - return new Temperature(value, TemperatureUnit.SolarTemperature); + return new Temperature(solartemperatures, 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..e50c577e4d 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,100 +300,90 @@ 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 centidegreescelsiuspersecond) { - double value = (double) centidegreescelsiuspersecond; - return new TemperatureChangeRate(value, TemperatureChangeRateUnit.CentidegreeCelsiusPerSecond); + return new TemperatureChangeRate(centidegreescelsiuspersecond, TemperatureChangeRateUnit.CentidegreeCelsiusPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TemperatureChangeRate FromDecadegreesCelsiusPerSecond(QuantityValue decadegreescelsiuspersecond) + public static TemperatureChangeRate FromDecadegreesCelsiusPerSecond(double decadegreescelsiuspersecond) { - double value = (double) decadegreescelsiuspersecond; - return new TemperatureChangeRate(value, TemperatureChangeRateUnit.DecadegreeCelsiusPerSecond); + return new TemperatureChangeRate(decadegreescelsiuspersecond, TemperatureChangeRateUnit.DecadegreeCelsiusPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TemperatureChangeRate FromDecidegreesCelsiusPerSecond(QuantityValue decidegreescelsiuspersecond) + public static TemperatureChangeRate FromDecidegreesCelsiusPerSecond(double decidegreescelsiuspersecond) { - double value = (double) decidegreescelsiuspersecond; - return new TemperatureChangeRate(value, TemperatureChangeRateUnit.DecidegreeCelsiusPerSecond); + return new TemperatureChangeRate(decidegreescelsiuspersecond, TemperatureChangeRateUnit.DecidegreeCelsiusPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TemperatureChangeRate FromDegreesCelsiusPerMinute(QuantityValue degreescelsiusperminute) + public static TemperatureChangeRate FromDegreesCelsiusPerMinute(double degreescelsiusperminute) { - double value = (double) degreescelsiusperminute; - return new TemperatureChangeRate(value, TemperatureChangeRateUnit.DegreeCelsiusPerMinute); + return new TemperatureChangeRate(degreescelsiusperminute, TemperatureChangeRateUnit.DegreeCelsiusPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TemperatureChangeRate FromDegreesCelsiusPerSecond(QuantityValue degreescelsiuspersecond) + public static TemperatureChangeRate FromDegreesCelsiusPerSecond(double degreescelsiuspersecond) { - double value = (double) degreescelsiuspersecond; - return new TemperatureChangeRate(value, TemperatureChangeRateUnit.DegreeCelsiusPerSecond); + return new TemperatureChangeRate(degreescelsiuspersecond, TemperatureChangeRateUnit.DegreeCelsiusPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TemperatureChangeRate FromHectodegreesCelsiusPerSecond(QuantityValue hectodegreescelsiuspersecond) + public static TemperatureChangeRate FromHectodegreesCelsiusPerSecond(double hectodegreescelsiuspersecond) { - double value = (double) hectodegreescelsiuspersecond; - return new TemperatureChangeRate(value, TemperatureChangeRateUnit.HectodegreeCelsiusPerSecond); + return new TemperatureChangeRate(hectodegreescelsiuspersecond, TemperatureChangeRateUnit.HectodegreeCelsiusPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TemperatureChangeRate FromKilodegreesCelsiusPerSecond(QuantityValue kilodegreescelsiuspersecond) + public static TemperatureChangeRate FromKilodegreesCelsiusPerSecond(double kilodegreescelsiuspersecond) { - double value = (double) kilodegreescelsiuspersecond; - return new TemperatureChangeRate(value, TemperatureChangeRateUnit.KilodegreeCelsiusPerSecond); + return new TemperatureChangeRate(kilodegreescelsiuspersecond, TemperatureChangeRateUnit.KilodegreeCelsiusPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TemperatureChangeRate FromMicrodegreesCelsiusPerSecond(QuantityValue microdegreescelsiuspersecond) + public static TemperatureChangeRate FromMicrodegreesCelsiusPerSecond(double microdegreescelsiuspersecond) { - double value = (double) microdegreescelsiuspersecond; - return new TemperatureChangeRate(value, TemperatureChangeRateUnit.MicrodegreeCelsiusPerSecond); + return new TemperatureChangeRate(microdegreescelsiuspersecond, TemperatureChangeRateUnit.MicrodegreeCelsiusPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TemperatureChangeRate FromMillidegreesCelsiusPerSecond(QuantityValue millidegreescelsiuspersecond) + public static TemperatureChangeRate FromMillidegreesCelsiusPerSecond(double millidegreescelsiuspersecond) { - double value = (double) millidegreescelsiuspersecond; - return new TemperatureChangeRate(value, TemperatureChangeRateUnit.MillidegreeCelsiusPerSecond); + return new TemperatureChangeRate(millidegreescelsiuspersecond, TemperatureChangeRateUnit.MillidegreeCelsiusPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TemperatureChangeRate FromNanodegreesCelsiusPerSecond(QuantityValue nanodegreescelsiuspersecond) + public static TemperatureChangeRate FromNanodegreesCelsiusPerSecond(double nanodegreescelsiuspersecond) { - double value = (double) nanodegreescelsiuspersecond; - return new TemperatureChangeRate(value, TemperatureChangeRateUnit.NanodegreeCelsiusPerSecond); + return new TemperatureChangeRate(nanodegreescelsiuspersecond, 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..ea0728ccc2 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,90 +295,81 @@ 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 degreescelsius) { - double value = (double) degreescelsius; - return new TemperatureDelta(value, TemperatureDeltaUnit.DegreeCelsius); + return new TemperatureDelta(degreescelsius, TemperatureDeltaUnit.DegreeCelsius); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TemperatureDelta FromDegreesDelisle(QuantityValue degreesdelisle) + public static TemperatureDelta FromDegreesDelisle(double degreesdelisle) { - double value = (double) degreesdelisle; - return new TemperatureDelta(value, TemperatureDeltaUnit.DegreeDelisle); + return new TemperatureDelta(degreesdelisle, TemperatureDeltaUnit.DegreeDelisle); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TemperatureDelta FromDegreesFahrenheit(QuantityValue degreesfahrenheit) + public static TemperatureDelta FromDegreesFahrenheit(double degreesfahrenheit) { - double value = (double) degreesfahrenheit; - return new TemperatureDelta(value, TemperatureDeltaUnit.DegreeFahrenheit); + return new TemperatureDelta(degreesfahrenheit, TemperatureDeltaUnit.DegreeFahrenheit); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TemperatureDelta FromDegreesNewton(QuantityValue degreesnewton) + public static TemperatureDelta FromDegreesNewton(double degreesnewton) { - double value = (double) degreesnewton; - return new TemperatureDelta(value, TemperatureDeltaUnit.DegreeNewton); + return new TemperatureDelta(degreesnewton, TemperatureDeltaUnit.DegreeNewton); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TemperatureDelta FromDegreesRankine(QuantityValue degreesrankine) + public static TemperatureDelta FromDegreesRankine(double degreesrankine) { - double value = (double) degreesrankine; - return new TemperatureDelta(value, TemperatureDeltaUnit.DegreeRankine); + return new TemperatureDelta(degreesrankine, TemperatureDeltaUnit.DegreeRankine); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TemperatureDelta FromDegreesReaumur(QuantityValue degreesreaumur) + public static TemperatureDelta FromDegreesReaumur(double degreesreaumur) { - double value = (double) degreesreaumur; - return new TemperatureDelta(value, TemperatureDeltaUnit.DegreeReaumur); + return new TemperatureDelta(degreesreaumur, TemperatureDeltaUnit.DegreeReaumur); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TemperatureDelta FromDegreesRoemer(QuantityValue degreesroemer) + public static TemperatureDelta FromDegreesRoemer(double degreesroemer) { - double value = (double) degreesroemer; - return new TemperatureDelta(value, TemperatureDeltaUnit.DegreeRoemer); + return new TemperatureDelta(degreesroemer, TemperatureDeltaUnit.DegreeRoemer); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TemperatureDelta FromKelvins(QuantityValue kelvins) + public static TemperatureDelta FromKelvins(double kelvins) { - double value = (double) kelvins; - return new TemperatureDelta(value, TemperatureDeltaUnit.Kelvin); + return new TemperatureDelta(kelvins, TemperatureDeltaUnit.Kelvin); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TemperatureDelta FromMillidegreesCelsius(QuantityValue millidegreescelsius) + public static TemperatureDelta FromMillidegreesCelsius(double millidegreescelsius) { - double value = (double) millidegreescelsius; - return new TemperatureDelta(value, TemperatureDeltaUnit.MillidegreeCelsius); + return new TemperatureDelta(millidegreescelsius, 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..bd3d6405be 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,40 +251,36 @@ 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 degreescelsiusperkilometer) { - double value = (double) degreescelsiusperkilometer; - return new TemperatureGradient(value, TemperatureGradientUnit.DegreeCelsiusPerKilometer); + return new TemperatureGradient(degreescelsiusperkilometer, TemperatureGradientUnit.DegreeCelsiusPerKilometer); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TemperatureGradient FromDegreesCelsiusPerMeter(QuantityValue degreescelsiuspermeter) + public static TemperatureGradient FromDegreesCelsiusPerMeter(double degreescelsiuspermeter) { - double value = (double) degreescelsiuspermeter; - return new TemperatureGradient(value, TemperatureGradientUnit.DegreeCelsiusPerMeter); + return new TemperatureGradient(degreescelsiuspermeter, TemperatureGradientUnit.DegreeCelsiusPerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TemperatureGradient FromDegreesFahrenheitPerFoot(QuantityValue degreesfahrenheitperfoot) + public static TemperatureGradient FromDegreesFahrenheitPerFoot(double degreesfahrenheitperfoot) { - double value = (double) degreesfahrenheitperfoot; - return new TemperatureGradient(value, TemperatureGradientUnit.DegreeFahrenheitPerFoot); + return new TemperatureGradient(degreesfahrenheitperfoot, TemperatureGradientUnit.DegreeFahrenheitPerFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TemperatureGradient FromKelvinsPerMeter(QuantityValue kelvinspermeter) + public static TemperatureGradient FromKelvinsPerMeter(double kelvinspermeter) { - double value = (double) kelvinspermeter; - return new TemperatureGradient(value, TemperatureGradientUnit.KelvinPerMeter); + return new TemperatureGradient(kelvinspermeter, 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..7d523f9769 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,20 +232,18 @@ 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 btusperhourfootfahrenheit) { - double value = (double) btusperhourfootfahrenheit; - return new ThermalConductivity(value, ThermalConductivityUnit.BtuPerHourFootFahrenheit); + return new ThermalConductivity(btusperhourfootfahrenheit, ThermalConductivityUnit.BtuPerHourFootFahrenheit); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ThermalConductivity FromWattsPerMeterKelvin(QuantityValue wattspermeterkelvin) + public static ThermalConductivity FromWattsPerMeterKelvin(double wattspermeterkelvin) { - double value = (double) wattspermeterkelvin; - return new ThermalConductivity(value, ThermalConductivityUnit.WattPerMeterKelvin); + return new ThermalConductivity(wattspermeterkelvin, 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..d22876e53d 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,60 +261,54 @@ 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 hoursquarefeetdegreesfahrenheitperbtu) { - double value = (double) hoursquarefeetdegreesfahrenheitperbtu; - return new ThermalResistance(value, ThermalResistanceUnit.HourSquareFeetDegreeFahrenheitPerBtu); + return new ThermalResistance(hoursquarefeetdegreesfahrenheitperbtu, ThermalResistanceUnit.HourSquareFeetDegreeFahrenheitPerBtu); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ThermalResistance FromSquareCentimeterHourDegreesCelsiusPerKilocalorie(QuantityValue squarecentimeterhourdegreescelsiusperkilocalorie) + public static ThermalResistance FromSquareCentimeterHourDegreesCelsiusPerKilocalorie(double squarecentimeterhourdegreescelsiusperkilocalorie) { - double value = (double) squarecentimeterhourdegreescelsiusperkilocalorie; - return new ThermalResistance(value, ThermalResistanceUnit.SquareCentimeterHourDegreeCelsiusPerKilocalorie); + return new ThermalResistance(squarecentimeterhourdegreescelsiusperkilocalorie, ThermalResistanceUnit.SquareCentimeterHourDegreeCelsiusPerKilocalorie); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ThermalResistance FromSquareCentimeterKelvinsPerWatt(QuantityValue squarecentimeterkelvinsperwatt) + public static ThermalResistance FromSquareCentimeterKelvinsPerWatt(double squarecentimeterkelvinsperwatt) { - double value = (double) squarecentimeterkelvinsperwatt; - return new ThermalResistance(value, ThermalResistanceUnit.SquareCentimeterKelvinPerWatt); + return new ThermalResistance(squarecentimeterkelvinsperwatt, ThermalResistanceUnit.SquareCentimeterKelvinPerWatt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ThermalResistance FromSquareMeterDegreesCelsiusPerWatt(QuantityValue squaremeterdegreescelsiusperwatt) + public static ThermalResistance FromSquareMeterDegreesCelsiusPerWatt(double squaremeterdegreescelsiusperwatt) { - double value = (double) squaremeterdegreescelsiusperwatt; - return new ThermalResistance(value, ThermalResistanceUnit.SquareMeterDegreeCelsiusPerWatt); + return new ThermalResistance(squaremeterdegreescelsiusperwatt, ThermalResistanceUnit.SquareMeterDegreeCelsiusPerWatt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ThermalResistance FromSquareMeterKelvinsPerKilowatt(QuantityValue squaremeterkelvinsperkilowatt) + public static ThermalResistance FromSquareMeterKelvinsPerKilowatt(double squaremeterkelvinsperkilowatt) { - double value = (double) squaremeterkelvinsperkilowatt; - return new ThermalResistance(value, ThermalResistanceUnit.SquareMeterKelvinPerKilowatt); + return new ThermalResistance(squaremeterkelvinsperkilowatt, ThermalResistanceUnit.SquareMeterKelvinPerKilowatt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ThermalResistance FromSquareMeterKelvinsPerWatt(QuantityValue squaremeterkelvinsperwatt) + public static ThermalResistance FromSquareMeterKelvinsPerWatt(double squaremeterkelvinsperwatt) { - double value = (double) squaremeterkelvinsperwatt; - return new ThermalResistance(value, ThermalResistanceUnit.SquareMeterKelvinPerWatt); + return new ThermalResistance(squaremeterkelvinsperwatt, 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..1541850784 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,250 +422,225 @@ 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 gramforcecentimeters) { - double value = (double) gramforcecentimeters; - return new Torque(value, TorqueUnit.GramForceCentimeter); + return new Torque(gramforcecentimeters, TorqueUnit.GramForceCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Torque FromGramForceMeters(QuantityValue gramforcemeters) + public static Torque FromGramForceMeters(double gramforcemeters) { - double value = (double) gramforcemeters; - return new Torque(value, TorqueUnit.GramForceMeter); + return new Torque(gramforcemeters, TorqueUnit.GramForceMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Torque FromGramForceMillimeters(QuantityValue gramforcemillimeters) + public static Torque FromGramForceMillimeters(double gramforcemillimeters) { - double value = (double) gramforcemillimeters; - return new Torque(value, TorqueUnit.GramForceMillimeter); + return new Torque(gramforcemillimeters, TorqueUnit.GramForceMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Torque FromKilogramForceCentimeters(QuantityValue kilogramforcecentimeters) + public static Torque FromKilogramForceCentimeters(double kilogramforcecentimeters) { - double value = (double) kilogramforcecentimeters; - return new Torque(value, TorqueUnit.KilogramForceCentimeter); + return new Torque(kilogramforcecentimeters, TorqueUnit.KilogramForceCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Torque FromKilogramForceMeters(QuantityValue kilogramforcemeters) + public static Torque FromKilogramForceMeters(double kilogramforcemeters) { - double value = (double) kilogramforcemeters; - return new Torque(value, TorqueUnit.KilogramForceMeter); + return new Torque(kilogramforcemeters, TorqueUnit.KilogramForceMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Torque FromKilogramForceMillimeters(QuantityValue kilogramforcemillimeters) + public static Torque FromKilogramForceMillimeters(double kilogramforcemillimeters) { - double value = (double) kilogramforcemillimeters; - return new Torque(value, TorqueUnit.KilogramForceMillimeter); + return new Torque(kilogramforcemillimeters, TorqueUnit.KilogramForceMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Torque FromKilonewtonCentimeters(QuantityValue kilonewtoncentimeters) + public static Torque FromKilonewtonCentimeters(double kilonewtoncentimeters) { - double value = (double) kilonewtoncentimeters; - return new Torque(value, TorqueUnit.KilonewtonCentimeter); + return new Torque(kilonewtoncentimeters, TorqueUnit.KilonewtonCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Torque FromKilonewtonMeters(QuantityValue kilonewtonmeters) + public static Torque FromKilonewtonMeters(double kilonewtonmeters) { - double value = (double) kilonewtonmeters; - return new Torque(value, TorqueUnit.KilonewtonMeter); + return new Torque(kilonewtonmeters, TorqueUnit.KilonewtonMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Torque FromKilonewtonMillimeters(QuantityValue kilonewtonmillimeters) + public static Torque FromKilonewtonMillimeters(double kilonewtonmillimeters) { - double value = (double) kilonewtonmillimeters; - return new Torque(value, TorqueUnit.KilonewtonMillimeter); + return new Torque(kilonewtonmillimeters, TorqueUnit.KilonewtonMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Torque FromKilopoundForceFeet(QuantityValue kilopoundforcefeet) + public static Torque FromKilopoundForceFeet(double kilopoundforcefeet) { - double value = (double) kilopoundforcefeet; - return new Torque(value, TorqueUnit.KilopoundForceFoot); + return new Torque(kilopoundforcefeet, TorqueUnit.KilopoundForceFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Torque FromKilopoundForceInches(QuantityValue kilopoundforceinches) + public static Torque FromKilopoundForceInches(double kilopoundforceinches) { - double value = (double) kilopoundforceinches; - return new Torque(value, TorqueUnit.KilopoundForceInch); + return new Torque(kilopoundforceinches, TorqueUnit.KilopoundForceInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Torque FromMeganewtonCentimeters(QuantityValue meganewtoncentimeters) + public static Torque FromMeganewtonCentimeters(double meganewtoncentimeters) { - double value = (double) meganewtoncentimeters; - return new Torque(value, TorqueUnit.MeganewtonCentimeter); + return new Torque(meganewtoncentimeters, TorqueUnit.MeganewtonCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Torque FromMeganewtonMeters(QuantityValue meganewtonmeters) + public static Torque FromMeganewtonMeters(double meganewtonmeters) { - double value = (double) meganewtonmeters; - return new Torque(value, TorqueUnit.MeganewtonMeter); + return new Torque(meganewtonmeters, TorqueUnit.MeganewtonMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Torque FromMeganewtonMillimeters(QuantityValue meganewtonmillimeters) + public static Torque FromMeganewtonMillimeters(double meganewtonmillimeters) { - double value = (double) meganewtonmillimeters; - return new Torque(value, TorqueUnit.MeganewtonMillimeter); + return new Torque(meganewtonmillimeters, TorqueUnit.MeganewtonMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Torque FromMegapoundForceFeet(QuantityValue megapoundforcefeet) + public static Torque FromMegapoundForceFeet(double megapoundforcefeet) { - double value = (double) megapoundforcefeet; - return new Torque(value, TorqueUnit.MegapoundForceFoot); + return new Torque(megapoundforcefeet, TorqueUnit.MegapoundForceFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Torque FromMegapoundForceInches(QuantityValue megapoundforceinches) + public static Torque FromMegapoundForceInches(double megapoundforceinches) { - double value = (double) megapoundforceinches; - return new Torque(value, TorqueUnit.MegapoundForceInch); + return new Torque(megapoundforceinches, TorqueUnit.MegapoundForceInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Torque FromNewtonCentimeters(QuantityValue newtoncentimeters) + public static Torque FromNewtonCentimeters(double newtoncentimeters) { - double value = (double) newtoncentimeters; - return new Torque(value, TorqueUnit.NewtonCentimeter); + return new Torque(newtoncentimeters, TorqueUnit.NewtonCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Torque FromNewtonMeters(QuantityValue newtonmeters) + public static Torque FromNewtonMeters(double newtonmeters) { - double value = (double) newtonmeters; - return new Torque(value, TorqueUnit.NewtonMeter); + return new Torque(newtonmeters, TorqueUnit.NewtonMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Torque FromNewtonMillimeters(QuantityValue newtonmillimeters) + public static Torque FromNewtonMillimeters(double newtonmillimeters) { - double value = (double) newtonmillimeters; - return new Torque(value, TorqueUnit.NewtonMillimeter); + return new Torque(newtonmillimeters, TorqueUnit.NewtonMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Torque FromPoundalFeet(QuantityValue poundalfeet) + public static Torque FromPoundalFeet(double poundalfeet) { - double value = (double) poundalfeet; - return new Torque(value, TorqueUnit.PoundalFoot); + return new Torque(poundalfeet, TorqueUnit.PoundalFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Torque FromPoundForceFeet(QuantityValue poundforcefeet) + public static Torque FromPoundForceFeet(double poundforcefeet) { - double value = (double) poundforcefeet; - return new Torque(value, TorqueUnit.PoundForceFoot); + return new Torque(poundforcefeet, TorqueUnit.PoundForceFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Torque FromPoundForceInches(QuantityValue poundforceinches) + public static Torque FromPoundForceInches(double poundforceinches) { - double value = (double) poundforceinches; - return new Torque(value, TorqueUnit.PoundForceInch); + return new Torque(poundforceinches, TorqueUnit.PoundForceInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Torque FromTonneForceCentimeters(QuantityValue tonneforcecentimeters) + public static Torque FromTonneForceCentimeters(double tonneforcecentimeters) { - double value = (double) tonneforcecentimeters; - return new Torque(value, TorqueUnit.TonneForceCentimeter); + return new Torque(tonneforcecentimeters, TorqueUnit.TonneForceCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Torque FromTonneForceMeters(QuantityValue tonneforcemeters) + public static Torque FromTonneForceMeters(double tonneforcemeters) { - double value = (double) tonneforcemeters; - return new Torque(value, TorqueUnit.TonneForceMeter); + return new Torque(tonneforcemeters, TorqueUnit.TonneForceMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Torque FromTonneForceMillimeters(QuantityValue tonneforcemillimeters) + public static Torque FromTonneForceMillimeters(double tonneforcemillimeters) { - double value = (double) tonneforcemillimeters; - return new Torque(value, TorqueUnit.TonneForceMillimeter); + return new Torque(tonneforcemillimeters, 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..3324414983 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,210 +381,189 @@ 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 kilogramforcecentimeterspermeter) { - double value = (double) kilogramforcecentimeterspermeter; - return new TorquePerLength(value, TorquePerLengthUnit.KilogramForceCentimeterPerMeter); + return new TorquePerLength(kilogramforcecentimeterspermeter, TorquePerLengthUnit.KilogramForceCentimeterPerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TorquePerLength FromKilogramForceMetersPerMeter(QuantityValue kilogramforcemeterspermeter) + public static TorquePerLength FromKilogramForceMetersPerMeter(double kilogramforcemeterspermeter) { - double value = (double) kilogramforcemeterspermeter; - return new TorquePerLength(value, TorquePerLengthUnit.KilogramForceMeterPerMeter); + return new TorquePerLength(kilogramforcemeterspermeter, TorquePerLengthUnit.KilogramForceMeterPerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TorquePerLength FromKilogramForceMillimetersPerMeter(QuantityValue kilogramforcemillimeterspermeter) + public static TorquePerLength FromKilogramForceMillimetersPerMeter(double kilogramforcemillimeterspermeter) { - double value = (double) kilogramforcemillimeterspermeter; - return new TorquePerLength(value, TorquePerLengthUnit.KilogramForceMillimeterPerMeter); + return new TorquePerLength(kilogramforcemillimeterspermeter, TorquePerLengthUnit.KilogramForceMillimeterPerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TorquePerLength FromKilonewtonCentimetersPerMeter(QuantityValue kilonewtoncentimeterspermeter) + public static TorquePerLength FromKilonewtonCentimetersPerMeter(double kilonewtoncentimeterspermeter) { - double value = (double) kilonewtoncentimeterspermeter; - return new TorquePerLength(value, TorquePerLengthUnit.KilonewtonCentimeterPerMeter); + return new TorquePerLength(kilonewtoncentimeterspermeter, TorquePerLengthUnit.KilonewtonCentimeterPerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TorquePerLength FromKilonewtonMetersPerMeter(QuantityValue kilonewtonmeterspermeter) + public static TorquePerLength FromKilonewtonMetersPerMeter(double kilonewtonmeterspermeter) { - double value = (double) kilonewtonmeterspermeter; - return new TorquePerLength(value, TorquePerLengthUnit.KilonewtonMeterPerMeter); + return new TorquePerLength(kilonewtonmeterspermeter, TorquePerLengthUnit.KilonewtonMeterPerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TorquePerLength FromKilonewtonMillimetersPerMeter(QuantityValue kilonewtonmillimeterspermeter) + public static TorquePerLength FromKilonewtonMillimetersPerMeter(double kilonewtonmillimeterspermeter) { - double value = (double) kilonewtonmillimeterspermeter; - return new TorquePerLength(value, TorquePerLengthUnit.KilonewtonMillimeterPerMeter); + return new TorquePerLength(kilonewtonmillimeterspermeter, TorquePerLengthUnit.KilonewtonMillimeterPerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TorquePerLength FromKilopoundForceFeetPerFoot(QuantityValue kilopoundforcefeetperfoot) + public static TorquePerLength FromKilopoundForceFeetPerFoot(double kilopoundforcefeetperfoot) { - double value = (double) kilopoundforcefeetperfoot; - return new TorquePerLength(value, TorquePerLengthUnit.KilopoundForceFootPerFoot); + return new TorquePerLength(kilopoundforcefeetperfoot, TorquePerLengthUnit.KilopoundForceFootPerFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TorquePerLength FromKilopoundForceInchesPerFoot(QuantityValue kilopoundforceinchesperfoot) + public static TorquePerLength FromKilopoundForceInchesPerFoot(double kilopoundforceinchesperfoot) { - double value = (double) kilopoundforceinchesperfoot; - return new TorquePerLength(value, TorquePerLengthUnit.KilopoundForceInchPerFoot); + return new TorquePerLength(kilopoundforceinchesperfoot, TorquePerLengthUnit.KilopoundForceInchPerFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TorquePerLength FromMeganewtonCentimetersPerMeter(QuantityValue meganewtoncentimeterspermeter) + public static TorquePerLength FromMeganewtonCentimetersPerMeter(double meganewtoncentimeterspermeter) { - double value = (double) meganewtoncentimeterspermeter; - return new TorquePerLength(value, TorquePerLengthUnit.MeganewtonCentimeterPerMeter); + return new TorquePerLength(meganewtoncentimeterspermeter, TorquePerLengthUnit.MeganewtonCentimeterPerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TorquePerLength FromMeganewtonMetersPerMeter(QuantityValue meganewtonmeterspermeter) + public static TorquePerLength FromMeganewtonMetersPerMeter(double meganewtonmeterspermeter) { - double value = (double) meganewtonmeterspermeter; - return new TorquePerLength(value, TorquePerLengthUnit.MeganewtonMeterPerMeter); + return new TorquePerLength(meganewtonmeterspermeter, TorquePerLengthUnit.MeganewtonMeterPerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TorquePerLength FromMeganewtonMillimetersPerMeter(QuantityValue meganewtonmillimeterspermeter) + public static TorquePerLength FromMeganewtonMillimetersPerMeter(double meganewtonmillimeterspermeter) { - double value = (double) meganewtonmillimeterspermeter; - return new TorquePerLength(value, TorquePerLengthUnit.MeganewtonMillimeterPerMeter); + return new TorquePerLength(meganewtonmillimeterspermeter, TorquePerLengthUnit.MeganewtonMillimeterPerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TorquePerLength FromMegapoundForceFeetPerFoot(QuantityValue megapoundforcefeetperfoot) + public static TorquePerLength FromMegapoundForceFeetPerFoot(double megapoundforcefeetperfoot) { - double value = (double) megapoundforcefeetperfoot; - return new TorquePerLength(value, TorquePerLengthUnit.MegapoundForceFootPerFoot); + return new TorquePerLength(megapoundforcefeetperfoot, TorquePerLengthUnit.MegapoundForceFootPerFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TorquePerLength FromMegapoundForceInchesPerFoot(QuantityValue megapoundforceinchesperfoot) + public static TorquePerLength FromMegapoundForceInchesPerFoot(double megapoundforceinchesperfoot) { - double value = (double) megapoundforceinchesperfoot; - return new TorquePerLength(value, TorquePerLengthUnit.MegapoundForceInchPerFoot); + return new TorquePerLength(megapoundforceinchesperfoot, TorquePerLengthUnit.MegapoundForceInchPerFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TorquePerLength FromNewtonCentimetersPerMeter(QuantityValue newtoncentimeterspermeter) + public static TorquePerLength FromNewtonCentimetersPerMeter(double newtoncentimeterspermeter) { - double value = (double) newtoncentimeterspermeter; - return new TorquePerLength(value, TorquePerLengthUnit.NewtonCentimeterPerMeter); + return new TorquePerLength(newtoncentimeterspermeter, TorquePerLengthUnit.NewtonCentimeterPerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TorquePerLength FromNewtonMetersPerMeter(QuantityValue newtonmeterspermeter) + public static TorquePerLength FromNewtonMetersPerMeter(double newtonmeterspermeter) { - double value = (double) newtonmeterspermeter; - return new TorquePerLength(value, TorquePerLengthUnit.NewtonMeterPerMeter); + return new TorquePerLength(newtonmeterspermeter, TorquePerLengthUnit.NewtonMeterPerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TorquePerLength FromNewtonMillimetersPerMeter(QuantityValue newtonmillimeterspermeter) + public static TorquePerLength FromNewtonMillimetersPerMeter(double newtonmillimeterspermeter) { - double value = (double) newtonmillimeterspermeter; - return new TorquePerLength(value, TorquePerLengthUnit.NewtonMillimeterPerMeter); + return new TorquePerLength(newtonmillimeterspermeter, TorquePerLengthUnit.NewtonMillimeterPerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TorquePerLength FromPoundForceFeetPerFoot(QuantityValue poundforcefeetperfoot) + public static TorquePerLength FromPoundForceFeetPerFoot(double poundforcefeetperfoot) { - double value = (double) poundforcefeetperfoot; - return new TorquePerLength(value, TorquePerLengthUnit.PoundForceFootPerFoot); + return new TorquePerLength(poundforcefeetperfoot, TorquePerLengthUnit.PoundForceFootPerFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TorquePerLength FromPoundForceInchesPerFoot(QuantityValue poundforceinchesperfoot) + public static TorquePerLength FromPoundForceInchesPerFoot(double poundforceinchesperfoot) { - double value = (double) poundforceinchesperfoot; - return new TorquePerLength(value, TorquePerLengthUnit.PoundForceInchPerFoot); + return new TorquePerLength(poundforceinchesperfoot, TorquePerLengthUnit.PoundForceInchPerFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TorquePerLength FromTonneForceCentimetersPerMeter(QuantityValue tonneforcecentimeterspermeter) + public static TorquePerLength FromTonneForceCentimetersPerMeter(double tonneforcecentimeterspermeter) { - double value = (double) tonneforcecentimeterspermeter; - return new TorquePerLength(value, TorquePerLengthUnit.TonneForceCentimeterPerMeter); + return new TorquePerLength(tonneforcecentimeterspermeter, TorquePerLengthUnit.TonneForceCentimeterPerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TorquePerLength FromTonneForceMetersPerMeter(QuantityValue tonneforcemeterspermeter) + public static TorquePerLength FromTonneForceMetersPerMeter(double tonneforcemeterspermeter) { - double value = (double) tonneforcemeterspermeter; - return new TorquePerLength(value, TorquePerLengthUnit.TonneForceMeterPerMeter); + return new TorquePerLength(tonneforcemeterspermeter, TorquePerLengthUnit.TonneForceMeterPerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TorquePerLength FromTonneForceMillimetersPerMeter(QuantityValue tonneforcemillimeterspermeter) + public static TorquePerLength FromTonneForceMillimetersPerMeter(double tonneforcemillimeterspermeter) { - double value = (double) tonneforcemillimeterspermeter; - return new TorquePerLength(value, TorquePerLengthUnit.TonneForceMillimeterPerMeter); + return new TorquePerLength(tonneforcemillimeterspermeter, 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..ab02056d19 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,10 +224,9 @@ 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 ntu) { - double value = (double) ntu; - return new Turbidity(value, TurbidityUnit.NTU); + return new Turbidity(ntu, 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..dbfacd2822 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,10 +221,9 @@ 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 internationalunits) { - double value = (double) internationalunits; - return new VitaminA(value, VitaminAUnit.InternationalUnit); + return new VitaminA(internationalunits, 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..130cbc626b 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,540 +657,486 @@ 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 acrefeet) { - double value = (double) acrefeet; - return new Volume(value, VolumeUnit.AcreFoot); + return new Volume(acrefeet, VolumeUnit.AcreFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromAuTablespoons(QuantityValue autablespoons) + public static Volume FromAuTablespoons(double autablespoons) { - double value = (double) autablespoons; - return new Volume(value, VolumeUnit.AuTablespoon); + return new Volume(autablespoons, VolumeUnit.AuTablespoon); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromBoardFeet(QuantityValue boardfeet) + public static Volume FromBoardFeet(double boardfeet) { - double value = (double) boardfeet; - return new Volume(value, VolumeUnit.BoardFoot); + return new Volume(boardfeet, VolumeUnit.BoardFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromCentiliters(QuantityValue centiliters) + public static Volume FromCentiliters(double centiliters) { - double value = (double) centiliters; - return new Volume(value, VolumeUnit.Centiliter); + return new Volume(centiliters, VolumeUnit.Centiliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromCubicCentimeters(QuantityValue cubiccentimeters) + public static Volume FromCubicCentimeters(double cubiccentimeters) { - double value = (double) cubiccentimeters; - return new Volume(value, VolumeUnit.CubicCentimeter); + return new Volume(cubiccentimeters, VolumeUnit.CubicCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromCubicDecimeters(QuantityValue cubicdecimeters) + public static Volume FromCubicDecimeters(double cubicdecimeters) { - double value = (double) cubicdecimeters; - return new Volume(value, VolumeUnit.CubicDecimeter); + return new Volume(cubicdecimeters, VolumeUnit.CubicDecimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromCubicFeet(QuantityValue cubicfeet) + public static Volume FromCubicFeet(double cubicfeet) { - double value = (double) cubicfeet; - return new Volume(value, VolumeUnit.CubicFoot); + return new Volume(cubicfeet, VolumeUnit.CubicFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromCubicHectometers(QuantityValue cubichectometers) + public static Volume FromCubicHectometers(double cubichectometers) { - double value = (double) cubichectometers; - return new Volume(value, VolumeUnit.CubicHectometer); + return new Volume(cubichectometers, VolumeUnit.CubicHectometer); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromCubicInches(QuantityValue cubicinches) + public static Volume FromCubicInches(double cubicinches) { - double value = (double) cubicinches; - return new Volume(value, VolumeUnit.CubicInch); + return new Volume(cubicinches, VolumeUnit.CubicInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromCubicKilometers(QuantityValue cubickilometers) + public static Volume FromCubicKilometers(double cubickilometers) { - double value = (double) cubickilometers; - return new Volume(value, VolumeUnit.CubicKilometer); + return new Volume(cubickilometers, VolumeUnit.CubicKilometer); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromCubicMeters(QuantityValue cubicmeters) + public static Volume FromCubicMeters(double cubicmeters) { - double value = (double) cubicmeters; - return new Volume(value, VolumeUnit.CubicMeter); + return new Volume(cubicmeters, VolumeUnit.CubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromCubicMicrometers(QuantityValue cubicmicrometers) + public static Volume FromCubicMicrometers(double cubicmicrometers) { - double value = (double) cubicmicrometers; - return new Volume(value, VolumeUnit.CubicMicrometer); + return new Volume(cubicmicrometers, VolumeUnit.CubicMicrometer); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromCubicMiles(QuantityValue cubicmiles) + public static Volume FromCubicMiles(double cubicmiles) { - double value = (double) cubicmiles; - return new Volume(value, VolumeUnit.CubicMile); + return new Volume(cubicmiles, VolumeUnit.CubicMile); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromCubicMillimeters(QuantityValue cubicmillimeters) + public static Volume FromCubicMillimeters(double cubicmillimeters) { - double value = (double) cubicmillimeters; - return new Volume(value, VolumeUnit.CubicMillimeter); + return new Volume(cubicmillimeters, VolumeUnit.CubicMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromCubicYards(QuantityValue cubicyards) + public static Volume FromCubicYards(double cubicyards) { - double value = (double) cubicyards; - return new Volume(value, VolumeUnit.CubicYard); + return new Volume(cubicyards, VolumeUnit.CubicYard); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromDecaliters(QuantityValue decaliters) + public static Volume FromDecaliters(double decaliters) { - double value = (double) decaliters; - return new Volume(value, VolumeUnit.Decaliter); + return new Volume(decaliters, VolumeUnit.Decaliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromDecausGallons(QuantityValue decausgallons) + public static Volume FromDecausGallons(double decausgallons) { - double value = (double) decausgallons; - return new Volume(value, VolumeUnit.DecausGallon); + return new Volume(decausgallons, VolumeUnit.DecausGallon); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromDeciliters(QuantityValue deciliters) + public static Volume FromDeciliters(double deciliters) { - double value = (double) deciliters; - return new Volume(value, VolumeUnit.Deciliter); + return new Volume(deciliters, VolumeUnit.Deciliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromDeciusGallons(QuantityValue deciusgallons) + public static Volume FromDeciusGallons(double deciusgallons) { - double value = (double) deciusgallons; - return new Volume(value, VolumeUnit.DeciusGallon); + return new Volume(deciusgallons, VolumeUnit.DeciusGallon); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromHectocubicFeet(QuantityValue hectocubicfeet) + public static Volume FromHectocubicFeet(double hectocubicfeet) { - double value = (double) hectocubicfeet; - return new Volume(value, VolumeUnit.HectocubicFoot); + return new Volume(hectocubicfeet, VolumeUnit.HectocubicFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromHectocubicMeters(QuantityValue hectocubicmeters) + public static Volume FromHectocubicMeters(double hectocubicmeters) { - double value = (double) hectocubicmeters; - return new Volume(value, VolumeUnit.HectocubicMeter); + return new Volume(hectocubicmeters, VolumeUnit.HectocubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromHectoliters(QuantityValue hectoliters) + public static Volume FromHectoliters(double hectoliters) { - double value = (double) hectoliters; - return new Volume(value, VolumeUnit.Hectoliter); + return new Volume(hectoliters, VolumeUnit.Hectoliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromHectousGallons(QuantityValue hectousgallons) + public static Volume FromHectousGallons(double hectousgallons) { - double value = (double) hectousgallons; - return new Volume(value, VolumeUnit.HectousGallon); + return new Volume(hectousgallons, VolumeUnit.HectousGallon); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromImperialBeerBarrels(QuantityValue imperialbeerbarrels) + public static Volume FromImperialBeerBarrels(double imperialbeerbarrels) { - double value = (double) imperialbeerbarrels; - return new Volume(value, VolumeUnit.ImperialBeerBarrel); + return new Volume(imperialbeerbarrels, VolumeUnit.ImperialBeerBarrel); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromImperialGallons(QuantityValue imperialgallons) + public static Volume FromImperialGallons(double imperialgallons) { - double value = (double) imperialgallons; - return new Volume(value, VolumeUnit.ImperialGallon); + return new Volume(imperialgallons, VolumeUnit.ImperialGallon); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromImperialOunces(QuantityValue imperialounces) + public static Volume FromImperialOunces(double imperialounces) { - double value = (double) imperialounces; - return new Volume(value, VolumeUnit.ImperialOunce); + return new Volume(imperialounces, VolumeUnit.ImperialOunce); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromImperialPints(QuantityValue imperialpints) + public static Volume FromImperialPints(double imperialpints) { - double value = (double) imperialpints; - return new Volume(value, VolumeUnit.ImperialPint); + return new Volume(imperialpints, VolumeUnit.ImperialPint); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromImperialQuarts(QuantityValue imperialquarts) + public static Volume FromImperialQuarts(double imperialquarts) { - double value = (double) imperialquarts; - return new Volume(value, VolumeUnit.ImperialQuart); + return new Volume(imperialquarts, VolumeUnit.ImperialQuart); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromKilocubicFeet(QuantityValue kilocubicfeet) + public static Volume FromKilocubicFeet(double kilocubicfeet) { - double value = (double) kilocubicfeet; - return new Volume(value, VolumeUnit.KilocubicFoot); + return new Volume(kilocubicfeet, VolumeUnit.KilocubicFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromKilocubicMeters(QuantityValue kilocubicmeters) + public static Volume FromKilocubicMeters(double kilocubicmeters) { - double value = (double) kilocubicmeters; - return new Volume(value, VolumeUnit.KilocubicMeter); + return new Volume(kilocubicmeters, VolumeUnit.KilocubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromKiloimperialGallons(QuantityValue kiloimperialgallons) + public static Volume FromKiloimperialGallons(double kiloimperialgallons) { - double value = (double) kiloimperialgallons; - return new Volume(value, VolumeUnit.KiloimperialGallon); + return new Volume(kiloimperialgallons, VolumeUnit.KiloimperialGallon); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromKiloliters(QuantityValue kiloliters) + public static Volume FromKiloliters(double kiloliters) { - double value = (double) kiloliters; - return new Volume(value, VolumeUnit.Kiloliter); + return new Volume(kiloliters, VolumeUnit.Kiloliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromKilousGallons(QuantityValue kilousgallons) + public static Volume FromKilousGallons(double kilousgallons) { - double value = (double) kilousgallons; - return new Volume(value, VolumeUnit.KilousGallon); + return new Volume(kilousgallons, VolumeUnit.KilousGallon); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromLiters(QuantityValue liters) + public static Volume FromLiters(double liters) { - double value = (double) liters; - return new Volume(value, VolumeUnit.Liter); + return new Volume(liters, VolumeUnit.Liter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromMegacubicFeet(QuantityValue megacubicfeet) + public static Volume FromMegacubicFeet(double megacubicfeet) { - double value = (double) megacubicfeet; - return new Volume(value, VolumeUnit.MegacubicFoot); + return new Volume(megacubicfeet, VolumeUnit.MegacubicFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromMegaimperialGallons(QuantityValue megaimperialgallons) + public static Volume FromMegaimperialGallons(double megaimperialgallons) { - double value = (double) megaimperialgallons; - return new Volume(value, VolumeUnit.MegaimperialGallon); + return new Volume(megaimperialgallons, VolumeUnit.MegaimperialGallon); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromMegaliters(QuantityValue megaliters) + public static Volume FromMegaliters(double megaliters) { - double value = (double) megaliters; - return new Volume(value, VolumeUnit.Megaliter); + return new Volume(megaliters, VolumeUnit.Megaliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromMegausGallons(QuantityValue megausgallons) + public static Volume FromMegausGallons(double megausgallons) { - double value = (double) megausgallons; - return new Volume(value, VolumeUnit.MegausGallon); + return new Volume(megausgallons, VolumeUnit.MegausGallon); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromMetricCups(QuantityValue metriccups) + public static Volume FromMetricCups(double metriccups) { - double value = (double) metriccups; - return new Volume(value, VolumeUnit.MetricCup); + return new Volume(metriccups, VolumeUnit.MetricCup); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromMetricTeaspoons(QuantityValue metricteaspoons) + public static Volume FromMetricTeaspoons(double metricteaspoons) { - double value = (double) metricteaspoons; - return new Volume(value, VolumeUnit.MetricTeaspoon); + return new Volume(metricteaspoons, VolumeUnit.MetricTeaspoon); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromMicroliters(QuantityValue microliters) + public static Volume FromMicroliters(double microliters) { - double value = (double) microliters; - return new Volume(value, VolumeUnit.Microliter); + return new Volume(microliters, VolumeUnit.Microliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromMilliliters(QuantityValue milliliters) + public static Volume FromMilliliters(double milliliters) { - double value = (double) milliliters; - return new Volume(value, VolumeUnit.Milliliter); + return new Volume(milliliters, VolumeUnit.Milliliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromNanoliters(QuantityValue nanoliters) + public static Volume FromNanoliters(double nanoliters) { - double value = (double) nanoliters; - return new Volume(value, VolumeUnit.Nanoliter); + return new Volume(nanoliters, VolumeUnit.Nanoliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromOilBarrels(QuantityValue oilbarrels) + public static Volume FromOilBarrels(double oilbarrels) { - double value = (double) oilbarrels; - return new Volume(value, VolumeUnit.OilBarrel); + return new Volume(oilbarrels, VolumeUnit.OilBarrel); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromUkTablespoons(QuantityValue uktablespoons) + public static Volume FromUkTablespoons(double uktablespoons) { - double value = (double) uktablespoons; - return new Volume(value, VolumeUnit.UkTablespoon); + return new Volume(uktablespoons, VolumeUnit.UkTablespoon); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromUsBeerBarrels(QuantityValue usbeerbarrels) + public static Volume FromUsBeerBarrels(double usbeerbarrels) { - double value = (double) usbeerbarrels; - return new Volume(value, VolumeUnit.UsBeerBarrel); + return new Volume(usbeerbarrels, VolumeUnit.UsBeerBarrel); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromUsCustomaryCups(QuantityValue uscustomarycups) + public static Volume FromUsCustomaryCups(double uscustomarycups) { - double value = (double) uscustomarycups; - return new Volume(value, VolumeUnit.UsCustomaryCup); + return new Volume(uscustomarycups, VolumeUnit.UsCustomaryCup); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromUsGallons(QuantityValue usgallons) + public static Volume FromUsGallons(double usgallons) { - double value = (double) usgallons; - return new Volume(value, VolumeUnit.UsGallon); + return new Volume(usgallons, VolumeUnit.UsGallon); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromUsLegalCups(QuantityValue uslegalcups) + public static Volume FromUsLegalCups(double uslegalcups) { - double value = (double) uslegalcups; - return new Volume(value, VolumeUnit.UsLegalCup); + return new Volume(uslegalcups, VolumeUnit.UsLegalCup); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromUsOunces(QuantityValue usounces) + public static Volume FromUsOunces(double usounces) { - double value = (double) usounces; - return new Volume(value, VolumeUnit.UsOunce); + return new Volume(usounces, VolumeUnit.UsOunce); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromUsPints(QuantityValue uspints) + public static Volume FromUsPints(double uspints) { - double value = (double) uspints; - return new Volume(value, VolumeUnit.UsPint); + return new Volume(uspints, VolumeUnit.UsPint); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromUsQuarts(QuantityValue usquarts) + public static Volume FromUsQuarts(double usquarts) { - double value = (double) usquarts; - return new Volume(value, VolumeUnit.UsQuart); + return new Volume(usquarts, VolumeUnit.UsQuart); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromUsTablespoons(QuantityValue ustablespoons) + public static Volume FromUsTablespoons(double ustablespoons) { - double value = (double) ustablespoons; - return new Volume(value, VolumeUnit.UsTablespoon); + return new Volume(ustablespoons, VolumeUnit.UsTablespoon); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromUsTeaspoons(QuantityValue usteaspoons) + public static Volume FromUsTeaspoons(double usteaspoons) { - double value = (double) usteaspoons; - return new Volume(value, VolumeUnit.UsTeaspoon); + return new Volume(usteaspoons, 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..af7057eac6 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,200 +383,180 @@ 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 centilitersperliter) { - double value = (double) centilitersperliter; - return new VolumeConcentration(value, VolumeConcentrationUnit.CentilitersPerLiter); + return new VolumeConcentration(centilitersperliter, VolumeConcentrationUnit.CentilitersPerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeConcentration FromCentilitersPerMililiter(QuantityValue centiliterspermililiter) + public static VolumeConcentration FromCentilitersPerMililiter(double centiliterspermililiter) { - double value = (double) centiliterspermililiter; - return new VolumeConcentration(value, VolumeConcentrationUnit.CentilitersPerMililiter); + return new VolumeConcentration(centiliterspermililiter, VolumeConcentrationUnit.CentilitersPerMililiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeConcentration FromDecilitersPerLiter(QuantityValue decilitersperliter) + public static VolumeConcentration FromDecilitersPerLiter(double decilitersperliter) { - double value = (double) decilitersperliter; - return new VolumeConcentration(value, VolumeConcentrationUnit.DecilitersPerLiter); + return new VolumeConcentration(decilitersperliter, VolumeConcentrationUnit.DecilitersPerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeConcentration FromDecilitersPerMililiter(QuantityValue deciliterspermililiter) + public static VolumeConcentration FromDecilitersPerMililiter(double deciliterspermililiter) { - double value = (double) deciliterspermililiter; - return new VolumeConcentration(value, VolumeConcentrationUnit.DecilitersPerMililiter); + return new VolumeConcentration(deciliterspermililiter, VolumeConcentrationUnit.DecilitersPerMililiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeConcentration FromDecimalFractions(QuantityValue decimalfractions) + public static VolumeConcentration FromDecimalFractions(double decimalfractions) { - double value = (double) decimalfractions; - return new VolumeConcentration(value, VolumeConcentrationUnit.DecimalFraction); + return new VolumeConcentration(decimalfractions, VolumeConcentrationUnit.DecimalFraction); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeConcentration FromLitersPerLiter(QuantityValue litersperliter) + public static VolumeConcentration FromLitersPerLiter(double litersperliter) { - double value = (double) litersperliter; - return new VolumeConcentration(value, VolumeConcentrationUnit.LitersPerLiter); + return new VolumeConcentration(litersperliter, VolumeConcentrationUnit.LitersPerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeConcentration FromLitersPerMililiter(QuantityValue literspermililiter) + public static VolumeConcentration FromLitersPerMililiter(double literspermililiter) { - double value = (double) literspermililiter; - return new VolumeConcentration(value, VolumeConcentrationUnit.LitersPerMililiter); + return new VolumeConcentration(literspermililiter, VolumeConcentrationUnit.LitersPerMililiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeConcentration FromMicrolitersPerLiter(QuantityValue microlitersperliter) + public static VolumeConcentration FromMicrolitersPerLiter(double microlitersperliter) { - double value = (double) microlitersperliter; - return new VolumeConcentration(value, VolumeConcentrationUnit.MicrolitersPerLiter); + return new VolumeConcentration(microlitersperliter, VolumeConcentrationUnit.MicrolitersPerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeConcentration FromMicrolitersPerMililiter(QuantityValue microliterspermililiter) + public static VolumeConcentration FromMicrolitersPerMililiter(double microliterspermililiter) { - double value = (double) microliterspermililiter; - return new VolumeConcentration(value, VolumeConcentrationUnit.MicrolitersPerMililiter); + return new VolumeConcentration(microliterspermililiter, VolumeConcentrationUnit.MicrolitersPerMililiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeConcentration FromMillilitersPerLiter(QuantityValue millilitersperliter) + public static VolumeConcentration FromMillilitersPerLiter(double millilitersperliter) { - double value = (double) millilitersperliter; - return new VolumeConcentration(value, VolumeConcentrationUnit.MillilitersPerLiter); + return new VolumeConcentration(millilitersperliter, VolumeConcentrationUnit.MillilitersPerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeConcentration FromMillilitersPerMililiter(QuantityValue milliliterspermililiter) + public static VolumeConcentration FromMillilitersPerMililiter(double milliliterspermililiter) { - double value = (double) milliliterspermililiter; - return new VolumeConcentration(value, VolumeConcentrationUnit.MillilitersPerMililiter); + return new VolumeConcentration(milliliterspermililiter, VolumeConcentrationUnit.MillilitersPerMililiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeConcentration FromNanolitersPerLiter(QuantityValue nanolitersperliter) + public static VolumeConcentration FromNanolitersPerLiter(double nanolitersperliter) { - double value = (double) nanolitersperliter; - return new VolumeConcentration(value, VolumeConcentrationUnit.NanolitersPerLiter); + return new VolumeConcentration(nanolitersperliter, VolumeConcentrationUnit.NanolitersPerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeConcentration FromNanolitersPerMililiter(QuantityValue nanoliterspermililiter) + public static VolumeConcentration FromNanolitersPerMililiter(double nanoliterspermililiter) { - double value = (double) nanoliterspermililiter; - return new VolumeConcentration(value, VolumeConcentrationUnit.NanolitersPerMililiter); + return new VolumeConcentration(nanoliterspermililiter, VolumeConcentrationUnit.NanolitersPerMililiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeConcentration FromPartsPerBillion(QuantityValue partsperbillion) + public static VolumeConcentration FromPartsPerBillion(double partsperbillion) { - double value = (double) partsperbillion; - return new VolumeConcentration(value, VolumeConcentrationUnit.PartPerBillion); + return new VolumeConcentration(partsperbillion, VolumeConcentrationUnit.PartPerBillion); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeConcentration FromPartsPerMillion(QuantityValue partspermillion) + public static VolumeConcentration FromPartsPerMillion(double partspermillion) { - double value = (double) partspermillion; - return new VolumeConcentration(value, VolumeConcentrationUnit.PartPerMillion); + return new VolumeConcentration(partspermillion, VolumeConcentrationUnit.PartPerMillion); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeConcentration FromPartsPerThousand(QuantityValue partsperthousand) + public static VolumeConcentration FromPartsPerThousand(double partsperthousand) { - double value = (double) partsperthousand; - return new VolumeConcentration(value, VolumeConcentrationUnit.PartPerThousand); + return new VolumeConcentration(partsperthousand, VolumeConcentrationUnit.PartPerThousand); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeConcentration FromPartsPerTrillion(QuantityValue partspertrillion) + public static VolumeConcentration FromPartsPerTrillion(double partspertrillion) { - double value = (double) partspertrillion; - return new VolumeConcentration(value, VolumeConcentrationUnit.PartPerTrillion); + return new VolumeConcentration(partspertrillion, VolumeConcentrationUnit.PartPerTrillion); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeConcentration FromPercent(QuantityValue percent) + public static VolumeConcentration FromPercent(double percent) { - double value = (double) percent; - return new VolumeConcentration(value, VolumeConcentrationUnit.Percent); + return new VolumeConcentration(percent, VolumeConcentrationUnit.Percent); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeConcentration FromPicolitersPerLiter(QuantityValue picolitersperliter) + public static VolumeConcentration FromPicolitersPerLiter(double picolitersperliter) { - double value = (double) picolitersperliter; - return new VolumeConcentration(value, VolumeConcentrationUnit.PicolitersPerLiter); + return new VolumeConcentration(picolitersperliter, VolumeConcentrationUnit.PicolitersPerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeConcentration FromPicolitersPerMililiter(QuantityValue picoliterspermililiter) + public static VolumeConcentration FromPicolitersPerMililiter(double picoliterspermililiter) { - double value = (double) picoliterspermililiter; - return new VolumeConcentration(value, VolumeConcentrationUnit.PicolitersPerMililiter); + return new VolumeConcentration(picoliterspermililiter, 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..9431de6549 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,670 +759,603 @@ 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 acrefeetperday) { - double value = (double) acrefeetperday; - return new VolumeFlow(value, VolumeFlowUnit.AcreFootPerDay); + return new VolumeFlow(acrefeetperday, VolumeFlowUnit.AcreFootPerDay); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromAcreFeetPerHour(QuantityValue acrefeetperhour) + public static VolumeFlow FromAcreFeetPerHour(double acrefeetperhour) { - double value = (double) acrefeetperhour; - return new VolumeFlow(value, VolumeFlowUnit.AcreFootPerHour); + return new VolumeFlow(acrefeetperhour, VolumeFlowUnit.AcreFootPerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromAcreFeetPerMinute(QuantityValue acrefeetperminute) + public static VolumeFlow FromAcreFeetPerMinute(double acrefeetperminute) { - double value = (double) acrefeetperminute; - return new VolumeFlow(value, VolumeFlowUnit.AcreFootPerMinute); + return new VolumeFlow(acrefeetperminute, VolumeFlowUnit.AcreFootPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromAcreFeetPerSecond(QuantityValue acrefeetpersecond) + public static VolumeFlow FromAcreFeetPerSecond(double acrefeetpersecond) { - double value = (double) acrefeetpersecond; - return new VolumeFlow(value, VolumeFlowUnit.AcreFootPerSecond); + return new VolumeFlow(acrefeetpersecond, VolumeFlowUnit.AcreFootPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromCentilitersPerDay(QuantityValue centilitersperday) + public static VolumeFlow FromCentilitersPerDay(double centilitersperday) { - double value = (double) centilitersperday; - return new VolumeFlow(value, VolumeFlowUnit.CentiliterPerDay); + return new VolumeFlow(centilitersperday, VolumeFlowUnit.CentiliterPerDay); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromCentilitersPerHour(QuantityValue centilitersperhour) + public static VolumeFlow FromCentilitersPerHour(double centilitersperhour) { - double value = (double) centilitersperhour; - return new VolumeFlow(value, VolumeFlowUnit.CentiliterPerHour); + return new VolumeFlow(centilitersperhour, VolumeFlowUnit.CentiliterPerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromCentilitersPerMinute(QuantityValue centilitersperminute) + public static VolumeFlow FromCentilitersPerMinute(double centilitersperminute) { - double value = (double) centilitersperminute; - return new VolumeFlow(value, VolumeFlowUnit.CentiliterPerMinute); + return new VolumeFlow(centilitersperminute, VolumeFlowUnit.CentiliterPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromCentilitersPerSecond(QuantityValue centiliterspersecond) + public static VolumeFlow FromCentilitersPerSecond(double centiliterspersecond) { - double value = (double) centiliterspersecond; - return new VolumeFlow(value, VolumeFlowUnit.CentiliterPerSecond); + return new VolumeFlow(centiliterspersecond, VolumeFlowUnit.CentiliterPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromCubicCentimetersPerMinute(QuantityValue cubiccentimetersperminute) + public static VolumeFlow FromCubicCentimetersPerMinute(double cubiccentimetersperminute) { - double value = (double) cubiccentimetersperminute; - return new VolumeFlow(value, VolumeFlowUnit.CubicCentimeterPerMinute); + return new VolumeFlow(cubiccentimetersperminute, VolumeFlowUnit.CubicCentimeterPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromCubicDecimetersPerMinute(QuantityValue cubicdecimetersperminute) + public static VolumeFlow FromCubicDecimetersPerMinute(double cubicdecimetersperminute) { - double value = (double) cubicdecimetersperminute; - return new VolumeFlow(value, VolumeFlowUnit.CubicDecimeterPerMinute); + return new VolumeFlow(cubicdecimetersperminute, VolumeFlowUnit.CubicDecimeterPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromCubicFeetPerHour(QuantityValue cubicfeetperhour) + public static VolumeFlow FromCubicFeetPerHour(double cubicfeetperhour) { - double value = (double) cubicfeetperhour; - return new VolumeFlow(value, VolumeFlowUnit.CubicFootPerHour); + return new VolumeFlow(cubicfeetperhour, VolumeFlowUnit.CubicFootPerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromCubicFeetPerMinute(QuantityValue cubicfeetperminute) + public static VolumeFlow FromCubicFeetPerMinute(double cubicfeetperminute) { - double value = (double) cubicfeetperminute; - return new VolumeFlow(value, VolumeFlowUnit.CubicFootPerMinute); + return new VolumeFlow(cubicfeetperminute, VolumeFlowUnit.CubicFootPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromCubicFeetPerSecond(QuantityValue cubicfeetpersecond) + public static VolumeFlow FromCubicFeetPerSecond(double cubicfeetpersecond) { - double value = (double) cubicfeetpersecond; - return new VolumeFlow(value, VolumeFlowUnit.CubicFootPerSecond); + return new VolumeFlow(cubicfeetpersecond, VolumeFlowUnit.CubicFootPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromCubicMetersPerDay(QuantityValue cubicmetersperday) + public static VolumeFlow FromCubicMetersPerDay(double cubicmetersperday) { - double value = (double) cubicmetersperday; - return new VolumeFlow(value, VolumeFlowUnit.CubicMeterPerDay); + return new VolumeFlow(cubicmetersperday, VolumeFlowUnit.CubicMeterPerDay); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromCubicMetersPerHour(QuantityValue cubicmetersperhour) + public static VolumeFlow FromCubicMetersPerHour(double cubicmetersperhour) { - double value = (double) cubicmetersperhour; - return new VolumeFlow(value, VolumeFlowUnit.CubicMeterPerHour); + return new VolumeFlow(cubicmetersperhour, VolumeFlowUnit.CubicMeterPerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromCubicMetersPerMinute(QuantityValue cubicmetersperminute) + public static VolumeFlow FromCubicMetersPerMinute(double cubicmetersperminute) { - double value = (double) cubicmetersperminute; - return new VolumeFlow(value, VolumeFlowUnit.CubicMeterPerMinute); + return new VolumeFlow(cubicmetersperminute, VolumeFlowUnit.CubicMeterPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromCubicMetersPerSecond(QuantityValue cubicmeterspersecond) + public static VolumeFlow FromCubicMetersPerSecond(double cubicmeterspersecond) { - double value = (double) cubicmeterspersecond; - return new VolumeFlow(value, VolumeFlowUnit.CubicMeterPerSecond); + return new VolumeFlow(cubicmeterspersecond, VolumeFlowUnit.CubicMeterPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromCubicMillimetersPerSecond(QuantityValue cubicmillimeterspersecond) + public static VolumeFlow FromCubicMillimetersPerSecond(double cubicmillimeterspersecond) { - double value = (double) cubicmillimeterspersecond; - return new VolumeFlow(value, VolumeFlowUnit.CubicMillimeterPerSecond); + return new VolumeFlow(cubicmillimeterspersecond, VolumeFlowUnit.CubicMillimeterPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromCubicYardsPerDay(QuantityValue cubicyardsperday) + public static VolumeFlow FromCubicYardsPerDay(double cubicyardsperday) { - double value = (double) cubicyardsperday; - return new VolumeFlow(value, VolumeFlowUnit.CubicYardPerDay); + return new VolumeFlow(cubicyardsperday, VolumeFlowUnit.CubicYardPerDay); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromCubicYardsPerHour(QuantityValue cubicyardsperhour) + public static VolumeFlow FromCubicYardsPerHour(double cubicyardsperhour) { - double value = (double) cubicyardsperhour; - return new VolumeFlow(value, VolumeFlowUnit.CubicYardPerHour); + return new VolumeFlow(cubicyardsperhour, VolumeFlowUnit.CubicYardPerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromCubicYardsPerMinute(QuantityValue cubicyardsperminute) + public static VolumeFlow FromCubicYardsPerMinute(double cubicyardsperminute) { - double value = (double) cubicyardsperminute; - return new VolumeFlow(value, VolumeFlowUnit.CubicYardPerMinute); + return new VolumeFlow(cubicyardsperminute, VolumeFlowUnit.CubicYardPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromCubicYardsPerSecond(QuantityValue cubicyardspersecond) + public static VolumeFlow FromCubicYardsPerSecond(double cubicyardspersecond) { - double value = (double) cubicyardspersecond; - return new VolumeFlow(value, VolumeFlowUnit.CubicYardPerSecond); + return new VolumeFlow(cubicyardspersecond, VolumeFlowUnit.CubicYardPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromDecilitersPerDay(QuantityValue decilitersperday) + public static VolumeFlow FromDecilitersPerDay(double decilitersperday) { - double value = (double) decilitersperday; - return new VolumeFlow(value, VolumeFlowUnit.DeciliterPerDay); + return new VolumeFlow(decilitersperday, VolumeFlowUnit.DeciliterPerDay); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromDecilitersPerHour(QuantityValue decilitersperhour) + public static VolumeFlow FromDecilitersPerHour(double decilitersperhour) { - double value = (double) decilitersperhour; - return new VolumeFlow(value, VolumeFlowUnit.DeciliterPerHour); + return new VolumeFlow(decilitersperhour, VolumeFlowUnit.DeciliterPerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromDecilitersPerMinute(QuantityValue decilitersperminute) + public static VolumeFlow FromDecilitersPerMinute(double decilitersperminute) { - double value = (double) decilitersperminute; - return new VolumeFlow(value, VolumeFlowUnit.DeciliterPerMinute); + return new VolumeFlow(decilitersperminute, VolumeFlowUnit.DeciliterPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromDecilitersPerSecond(QuantityValue deciliterspersecond) + public static VolumeFlow FromDecilitersPerSecond(double deciliterspersecond) { - double value = (double) deciliterspersecond; - return new VolumeFlow(value, VolumeFlowUnit.DeciliterPerSecond); + return new VolumeFlow(deciliterspersecond, VolumeFlowUnit.DeciliterPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromKilolitersPerDay(QuantityValue kilolitersperday) + public static VolumeFlow FromKilolitersPerDay(double kilolitersperday) { - double value = (double) kilolitersperday; - return new VolumeFlow(value, VolumeFlowUnit.KiloliterPerDay); + return new VolumeFlow(kilolitersperday, VolumeFlowUnit.KiloliterPerDay); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromKilolitersPerHour(QuantityValue kilolitersperhour) + public static VolumeFlow FromKilolitersPerHour(double kilolitersperhour) { - double value = (double) kilolitersperhour; - return new VolumeFlow(value, VolumeFlowUnit.KiloliterPerHour); + return new VolumeFlow(kilolitersperhour, VolumeFlowUnit.KiloliterPerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromKilolitersPerMinute(QuantityValue kilolitersperminute) + public static VolumeFlow FromKilolitersPerMinute(double kilolitersperminute) { - double value = (double) kilolitersperminute; - return new VolumeFlow(value, VolumeFlowUnit.KiloliterPerMinute); + return new VolumeFlow(kilolitersperminute, VolumeFlowUnit.KiloliterPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromKilolitersPerSecond(QuantityValue kiloliterspersecond) + public static VolumeFlow FromKilolitersPerSecond(double kiloliterspersecond) { - double value = (double) kiloliterspersecond; - return new VolumeFlow(value, VolumeFlowUnit.KiloliterPerSecond); + return new VolumeFlow(kiloliterspersecond, VolumeFlowUnit.KiloliterPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromKilousGallonsPerMinute(QuantityValue kilousgallonsperminute) + public static VolumeFlow FromKilousGallonsPerMinute(double kilousgallonsperminute) { - double value = (double) kilousgallonsperminute; - return new VolumeFlow(value, VolumeFlowUnit.KilousGallonPerMinute); + return new VolumeFlow(kilousgallonsperminute, VolumeFlowUnit.KilousGallonPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromLitersPerDay(QuantityValue litersperday) + public static VolumeFlow FromLitersPerDay(double litersperday) { - double value = (double) litersperday; - return new VolumeFlow(value, VolumeFlowUnit.LiterPerDay); + return new VolumeFlow(litersperday, VolumeFlowUnit.LiterPerDay); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromLitersPerHour(QuantityValue litersperhour) + public static VolumeFlow FromLitersPerHour(double litersperhour) { - double value = (double) litersperhour; - return new VolumeFlow(value, VolumeFlowUnit.LiterPerHour); + return new VolumeFlow(litersperhour, VolumeFlowUnit.LiterPerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromLitersPerMinute(QuantityValue litersperminute) + public static VolumeFlow FromLitersPerMinute(double litersperminute) { - double value = (double) litersperminute; - return new VolumeFlow(value, VolumeFlowUnit.LiterPerMinute); + return new VolumeFlow(litersperminute, VolumeFlowUnit.LiterPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromLitersPerSecond(QuantityValue literspersecond) + public static VolumeFlow FromLitersPerSecond(double literspersecond) { - double value = (double) literspersecond; - return new VolumeFlow(value, VolumeFlowUnit.LiterPerSecond); + return new VolumeFlow(literspersecond, VolumeFlowUnit.LiterPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromMegalitersPerDay(QuantityValue megalitersperday) + public static VolumeFlow FromMegalitersPerDay(double megalitersperday) { - double value = (double) megalitersperday; - return new VolumeFlow(value, VolumeFlowUnit.MegaliterPerDay); + return new VolumeFlow(megalitersperday, VolumeFlowUnit.MegaliterPerDay); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromMegalitersPerHour(QuantityValue megalitersperhour) + public static VolumeFlow FromMegalitersPerHour(double megalitersperhour) { - double value = (double) megalitersperhour; - return new VolumeFlow(value, VolumeFlowUnit.MegaliterPerHour); + return new VolumeFlow(megalitersperhour, VolumeFlowUnit.MegaliterPerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromMegalitersPerMinute(QuantityValue megalitersperminute) + public static VolumeFlow FromMegalitersPerMinute(double megalitersperminute) { - double value = (double) megalitersperminute; - return new VolumeFlow(value, VolumeFlowUnit.MegaliterPerMinute); + return new VolumeFlow(megalitersperminute, VolumeFlowUnit.MegaliterPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromMegalitersPerSecond(QuantityValue megaliterspersecond) + public static VolumeFlow FromMegalitersPerSecond(double megaliterspersecond) { - double value = (double) megaliterspersecond; - return new VolumeFlow(value, VolumeFlowUnit.MegaliterPerSecond); + return new VolumeFlow(megaliterspersecond, VolumeFlowUnit.MegaliterPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromMegaukGallonsPerDay(QuantityValue megaukgallonsperday) + public static VolumeFlow FromMegaukGallonsPerDay(double megaukgallonsperday) { - double value = (double) megaukgallonsperday; - return new VolumeFlow(value, VolumeFlowUnit.MegaukGallonPerDay); + return new VolumeFlow(megaukgallonsperday, VolumeFlowUnit.MegaukGallonPerDay); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromMegaukGallonsPerSecond(QuantityValue megaukgallonspersecond) + public static VolumeFlow FromMegaukGallonsPerSecond(double megaukgallonspersecond) { - double value = (double) megaukgallonspersecond; - return new VolumeFlow(value, VolumeFlowUnit.MegaukGallonPerSecond); + return new VolumeFlow(megaukgallonspersecond, VolumeFlowUnit.MegaukGallonPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromMegausGallonsPerDay(QuantityValue megausgallonsperday) + public static VolumeFlow FromMegausGallonsPerDay(double megausgallonsperday) { - double value = (double) megausgallonsperday; - return new VolumeFlow(value, VolumeFlowUnit.MegausGallonPerDay); + return new VolumeFlow(megausgallonsperday, VolumeFlowUnit.MegausGallonPerDay); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromMicrolitersPerDay(QuantityValue microlitersperday) + public static VolumeFlow FromMicrolitersPerDay(double microlitersperday) { - double value = (double) microlitersperday; - return new VolumeFlow(value, VolumeFlowUnit.MicroliterPerDay); + return new VolumeFlow(microlitersperday, VolumeFlowUnit.MicroliterPerDay); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromMicrolitersPerHour(QuantityValue microlitersperhour) + public static VolumeFlow FromMicrolitersPerHour(double microlitersperhour) { - double value = (double) microlitersperhour; - return new VolumeFlow(value, VolumeFlowUnit.MicroliterPerHour); + return new VolumeFlow(microlitersperhour, VolumeFlowUnit.MicroliterPerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromMicrolitersPerMinute(QuantityValue microlitersperminute) + public static VolumeFlow FromMicrolitersPerMinute(double microlitersperminute) { - double value = (double) microlitersperminute; - return new VolumeFlow(value, VolumeFlowUnit.MicroliterPerMinute); + return new VolumeFlow(microlitersperminute, VolumeFlowUnit.MicroliterPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromMicrolitersPerSecond(QuantityValue microliterspersecond) + public static VolumeFlow FromMicrolitersPerSecond(double microliterspersecond) { - double value = (double) microliterspersecond; - return new VolumeFlow(value, VolumeFlowUnit.MicroliterPerSecond); + return new VolumeFlow(microliterspersecond, VolumeFlowUnit.MicroliterPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromMillilitersPerDay(QuantityValue millilitersperday) + public static VolumeFlow FromMillilitersPerDay(double millilitersperday) { - double value = (double) millilitersperday; - return new VolumeFlow(value, VolumeFlowUnit.MilliliterPerDay); + return new VolumeFlow(millilitersperday, VolumeFlowUnit.MilliliterPerDay); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromMillilitersPerHour(QuantityValue millilitersperhour) + public static VolumeFlow FromMillilitersPerHour(double millilitersperhour) { - double value = (double) millilitersperhour; - return new VolumeFlow(value, VolumeFlowUnit.MilliliterPerHour); + return new VolumeFlow(millilitersperhour, VolumeFlowUnit.MilliliterPerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromMillilitersPerMinute(QuantityValue millilitersperminute) + public static VolumeFlow FromMillilitersPerMinute(double millilitersperminute) { - double value = (double) millilitersperminute; - return new VolumeFlow(value, VolumeFlowUnit.MilliliterPerMinute); + return new VolumeFlow(millilitersperminute, VolumeFlowUnit.MilliliterPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromMillilitersPerSecond(QuantityValue milliliterspersecond) + public static VolumeFlow FromMillilitersPerSecond(double milliliterspersecond) { - double value = (double) milliliterspersecond; - return new VolumeFlow(value, VolumeFlowUnit.MilliliterPerSecond); + return new VolumeFlow(milliliterspersecond, VolumeFlowUnit.MilliliterPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromMillionUsGallonsPerDay(QuantityValue millionusgallonsperday) + public static VolumeFlow FromMillionUsGallonsPerDay(double millionusgallonsperday) { - double value = (double) millionusgallonsperday; - return new VolumeFlow(value, VolumeFlowUnit.MillionUsGallonPerDay); + return new VolumeFlow(millionusgallonsperday, VolumeFlowUnit.MillionUsGallonPerDay); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromNanolitersPerDay(QuantityValue nanolitersperday) + public static VolumeFlow FromNanolitersPerDay(double nanolitersperday) { - double value = (double) nanolitersperday; - return new VolumeFlow(value, VolumeFlowUnit.NanoliterPerDay); + return new VolumeFlow(nanolitersperday, VolumeFlowUnit.NanoliterPerDay); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromNanolitersPerHour(QuantityValue nanolitersperhour) + public static VolumeFlow FromNanolitersPerHour(double nanolitersperhour) { - double value = (double) nanolitersperhour; - return new VolumeFlow(value, VolumeFlowUnit.NanoliterPerHour); + return new VolumeFlow(nanolitersperhour, VolumeFlowUnit.NanoliterPerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromNanolitersPerMinute(QuantityValue nanolitersperminute) + public static VolumeFlow FromNanolitersPerMinute(double nanolitersperminute) { - double value = (double) nanolitersperminute; - return new VolumeFlow(value, VolumeFlowUnit.NanoliterPerMinute); + return new VolumeFlow(nanolitersperminute, VolumeFlowUnit.NanoliterPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromNanolitersPerSecond(QuantityValue nanoliterspersecond) + public static VolumeFlow FromNanolitersPerSecond(double nanoliterspersecond) { - double value = (double) nanoliterspersecond; - return new VolumeFlow(value, VolumeFlowUnit.NanoliterPerSecond); + return new VolumeFlow(nanoliterspersecond, VolumeFlowUnit.NanoliterPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromOilBarrelsPerDay(QuantityValue oilbarrelsperday) + public static VolumeFlow FromOilBarrelsPerDay(double oilbarrelsperday) { - double value = (double) oilbarrelsperday; - return new VolumeFlow(value, VolumeFlowUnit.OilBarrelPerDay); + return new VolumeFlow(oilbarrelsperday, VolumeFlowUnit.OilBarrelPerDay); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromOilBarrelsPerHour(QuantityValue oilbarrelsperhour) + public static VolumeFlow FromOilBarrelsPerHour(double oilbarrelsperhour) { - double value = (double) oilbarrelsperhour; - return new VolumeFlow(value, VolumeFlowUnit.OilBarrelPerHour); + return new VolumeFlow(oilbarrelsperhour, VolumeFlowUnit.OilBarrelPerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromOilBarrelsPerMinute(QuantityValue oilbarrelsperminute) + public static VolumeFlow FromOilBarrelsPerMinute(double oilbarrelsperminute) { - double value = (double) oilbarrelsperminute; - return new VolumeFlow(value, VolumeFlowUnit.OilBarrelPerMinute); + return new VolumeFlow(oilbarrelsperminute, VolumeFlowUnit.OilBarrelPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromOilBarrelsPerSecond(QuantityValue oilbarrelspersecond) + public static VolumeFlow FromOilBarrelsPerSecond(double oilbarrelspersecond) { - double value = (double) oilbarrelspersecond; - return new VolumeFlow(value, VolumeFlowUnit.OilBarrelPerSecond); + return new VolumeFlow(oilbarrelspersecond, VolumeFlowUnit.OilBarrelPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromUkGallonsPerDay(QuantityValue ukgallonsperday) + public static VolumeFlow FromUkGallonsPerDay(double ukgallonsperday) { - double value = (double) ukgallonsperday; - return new VolumeFlow(value, VolumeFlowUnit.UkGallonPerDay); + return new VolumeFlow(ukgallonsperday, VolumeFlowUnit.UkGallonPerDay); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromUkGallonsPerHour(QuantityValue ukgallonsperhour) + public static VolumeFlow FromUkGallonsPerHour(double ukgallonsperhour) { - double value = (double) ukgallonsperhour; - return new VolumeFlow(value, VolumeFlowUnit.UkGallonPerHour); + return new VolumeFlow(ukgallonsperhour, VolumeFlowUnit.UkGallonPerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromUkGallonsPerMinute(QuantityValue ukgallonsperminute) + public static VolumeFlow FromUkGallonsPerMinute(double ukgallonsperminute) { - double value = (double) ukgallonsperminute; - return new VolumeFlow(value, VolumeFlowUnit.UkGallonPerMinute); + return new VolumeFlow(ukgallonsperminute, VolumeFlowUnit.UkGallonPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromUkGallonsPerSecond(QuantityValue ukgallonspersecond) + public static VolumeFlow FromUkGallonsPerSecond(double ukgallonspersecond) { - double value = (double) ukgallonspersecond; - return new VolumeFlow(value, VolumeFlowUnit.UkGallonPerSecond); + return new VolumeFlow(ukgallonspersecond, VolumeFlowUnit.UkGallonPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromUsGallonsPerDay(QuantityValue usgallonsperday) + public static VolumeFlow FromUsGallonsPerDay(double usgallonsperday) { - double value = (double) usgallonsperday; - return new VolumeFlow(value, VolumeFlowUnit.UsGallonPerDay); + return new VolumeFlow(usgallonsperday, VolumeFlowUnit.UsGallonPerDay); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromUsGallonsPerHour(QuantityValue usgallonsperhour) + public static VolumeFlow FromUsGallonsPerHour(double usgallonsperhour) { - double value = (double) usgallonsperhour; - return new VolumeFlow(value, VolumeFlowUnit.UsGallonPerHour); + return new VolumeFlow(usgallonsperhour, VolumeFlowUnit.UsGallonPerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromUsGallonsPerMinute(QuantityValue usgallonsperminute) + public static VolumeFlow FromUsGallonsPerMinute(double usgallonsperminute) { - double value = (double) usgallonsperminute; - return new VolumeFlow(value, VolumeFlowUnit.UsGallonPerMinute); + return new VolumeFlow(usgallonsperminute, VolumeFlowUnit.UsGallonPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromUsGallonsPerSecond(QuantityValue usgallonspersecond) + public static VolumeFlow FromUsGallonsPerSecond(double usgallonspersecond) { - double value = (double) usgallonspersecond; - return new VolumeFlow(value, VolumeFlowUnit.UsGallonPerSecond); + return new VolumeFlow(usgallonspersecond, 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..1c902215c3 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,20 +229,18 @@ 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 cubicfeetperminutepersquarefoot) { - double value = (double) cubicfeetperminutepersquarefoot; - return new VolumeFlowPerArea(value, VolumeFlowPerAreaUnit.CubicFootPerMinutePerSquareFoot); + return new VolumeFlowPerArea(cubicfeetperminutepersquarefoot, VolumeFlowPerAreaUnit.CubicFootPerMinutePerSquareFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlowPerArea FromCubicMetersPerSecondPerSquareMeter(QuantityValue cubicmeterspersecondpersquaremeter) + public static VolumeFlowPerArea FromCubicMetersPerSecondPerSquareMeter(double cubicmeterspersecondpersquaremeter) { - double value = (double) cubicmeterspersecondpersquaremeter; - return new VolumeFlowPerArea(value, VolumeFlowPerAreaUnit.CubicMeterPerSecondPerSquareMeter); + return new VolumeFlowPerArea(cubicmeterspersecondpersquaremeter, 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..dab420b6c8 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,90 +285,81 @@ 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 cubicmeterspermeter) { - double value = (double) cubicmeterspermeter; - return new VolumePerLength(value, VolumePerLengthUnit.CubicMeterPerMeter); + return new VolumePerLength(cubicmeterspermeter, VolumePerLengthUnit.CubicMeterPerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumePerLength FromCubicYardsPerFoot(QuantityValue cubicyardsperfoot) + public static VolumePerLength FromCubicYardsPerFoot(double cubicyardsperfoot) { - double value = (double) cubicyardsperfoot; - return new VolumePerLength(value, VolumePerLengthUnit.CubicYardPerFoot); + return new VolumePerLength(cubicyardsperfoot, VolumePerLengthUnit.CubicYardPerFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumePerLength FromCubicYardsPerUsSurveyFoot(QuantityValue cubicyardsperussurveyfoot) + public static VolumePerLength FromCubicYardsPerUsSurveyFoot(double cubicyardsperussurveyfoot) { - double value = (double) cubicyardsperussurveyfoot; - return new VolumePerLength(value, VolumePerLengthUnit.CubicYardPerUsSurveyFoot); + return new VolumePerLength(cubicyardsperussurveyfoot, VolumePerLengthUnit.CubicYardPerUsSurveyFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumePerLength FromImperialGallonsPerMile(QuantityValue imperialgallonspermile) + public static VolumePerLength FromImperialGallonsPerMile(double imperialgallonspermile) { - double value = (double) imperialgallonspermile; - return new VolumePerLength(value, VolumePerLengthUnit.ImperialGallonPerMile); + return new VolumePerLength(imperialgallonspermile, VolumePerLengthUnit.ImperialGallonPerMile); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumePerLength FromLitersPerKilometer(QuantityValue litersperkilometer) + public static VolumePerLength FromLitersPerKilometer(double litersperkilometer) { - double value = (double) litersperkilometer; - return new VolumePerLength(value, VolumePerLengthUnit.LiterPerKilometer); + return new VolumePerLength(litersperkilometer, VolumePerLengthUnit.LiterPerKilometer); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumePerLength FromLitersPerMeter(QuantityValue literspermeter) + public static VolumePerLength FromLitersPerMeter(double literspermeter) { - double value = (double) literspermeter; - return new VolumePerLength(value, VolumePerLengthUnit.LiterPerMeter); + return new VolumePerLength(literspermeter, VolumePerLengthUnit.LiterPerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumePerLength FromLitersPerMillimeter(QuantityValue literspermillimeter) + public static VolumePerLength FromLitersPerMillimeter(double literspermillimeter) { - double value = (double) literspermillimeter; - return new VolumePerLength(value, VolumePerLengthUnit.LiterPerMillimeter); + return new VolumePerLength(literspermillimeter, VolumePerLengthUnit.LiterPerMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumePerLength FromOilBarrelsPerFoot(QuantityValue oilbarrelsperfoot) + public static VolumePerLength FromOilBarrelsPerFoot(double oilbarrelsperfoot) { - double value = (double) oilbarrelsperfoot; - return new VolumePerLength(value, VolumePerLengthUnit.OilBarrelPerFoot); + return new VolumePerLength(oilbarrelsperfoot, VolumePerLengthUnit.OilBarrelPerFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumePerLength FromUsGallonsPerMile(QuantityValue usgallonspermile) + public static VolumePerLength FromUsGallonsPerMile(double usgallonspermile) { - double value = (double) usgallonspermile; - return new VolumePerLength(value, VolumePerLengthUnit.UsGallonPerMile); + return new VolumePerLength(usgallonspermile, 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..ebd63a3c3b 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,90 +288,81 @@ 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 btuspercubicfootdegreefahrenheit) { - double value = (double) btuspercubicfootdegreefahrenheit; - return new VolumetricHeatCapacity(value, VolumetricHeatCapacityUnit.BtuPerCubicFootDegreeFahrenheit); + return new VolumetricHeatCapacity(btuspercubicfootdegreefahrenheit, VolumetricHeatCapacityUnit.BtuPerCubicFootDegreeFahrenheit); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumetricHeatCapacity FromCaloriesPerCubicCentimeterDegreeCelsius(QuantityValue caloriespercubiccentimeterdegreecelsius) + public static VolumetricHeatCapacity FromCaloriesPerCubicCentimeterDegreeCelsius(double caloriespercubiccentimeterdegreecelsius) { - double value = (double) caloriespercubiccentimeterdegreecelsius; - return new VolumetricHeatCapacity(value, VolumetricHeatCapacityUnit.CaloriePerCubicCentimeterDegreeCelsius); + return new VolumetricHeatCapacity(caloriespercubiccentimeterdegreecelsius, VolumetricHeatCapacityUnit.CaloriePerCubicCentimeterDegreeCelsius); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumetricHeatCapacity FromJoulesPerCubicMeterDegreeCelsius(QuantityValue joulespercubicmeterdegreecelsius) + public static VolumetricHeatCapacity FromJoulesPerCubicMeterDegreeCelsius(double joulespercubicmeterdegreecelsius) { - double value = (double) joulespercubicmeterdegreecelsius; - return new VolumetricHeatCapacity(value, VolumetricHeatCapacityUnit.JoulePerCubicMeterDegreeCelsius); + return new VolumetricHeatCapacity(joulespercubicmeterdegreecelsius, VolumetricHeatCapacityUnit.JoulePerCubicMeterDegreeCelsius); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumetricHeatCapacity FromJoulesPerCubicMeterKelvin(QuantityValue joulespercubicmeterkelvin) + public static VolumetricHeatCapacity FromJoulesPerCubicMeterKelvin(double joulespercubicmeterkelvin) { - double value = (double) joulespercubicmeterkelvin; - return new VolumetricHeatCapacity(value, VolumetricHeatCapacityUnit.JoulePerCubicMeterKelvin); + return new VolumetricHeatCapacity(joulespercubicmeterkelvin, VolumetricHeatCapacityUnit.JoulePerCubicMeterKelvin); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumetricHeatCapacity FromKilocaloriesPerCubicCentimeterDegreeCelsius(QuantityValue kilocaloriespercubiccentimeterdegreecelsius) + public static VolumetricHeatCapacity FromKilocaloriesPerCubicCentimeterDegreeCelsius(double kilocaloriespercubiccentimeterdegreecelsius) { - double value = (double) kilocaloriespercubiccentimeterdegreecelsius; - return new VolumetricHeatCapacity(value, VolumetricHeatCapacityUnit.KilocaloriePerCubicCentimeterDegreeCelsius); + return new VolumetricHeatCapacity(kilocaloriespercubiccentimeterdegreecelsius, VolumetricHeatCapacityUnit.KilocaloriePerCubicCentimeterDegreeCelsius); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumetricHeatCapacity FromKilojoulesPerCubicMeterDegreeCelsius(QuantityValue kilojoulespercubicmeterdegreecelsius) + public static VolumetricHeatCapacity FromKilojoulesPerCubicMeterDegreeCelsius(double kilojoulespercubicmeterdegreecelsius) { - double value = (double) kilojoulespercubicmeterdegreecelsius; - return new VolumetricHeatCapacity(value, VolumetricHeatCapacityUnit.KilojoulePerCubicMeterDegreeCelsius); + return new VolumetricHeatCapacity(kilojoulespercubicmeterdegreecelsius, VolumetricHeatCapacityUnit.KilojoulePerCubicMeterDegreeCelsius); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumetricHeatCapacity FromKilojoulesPerCubicMeterKelvin(QuantityValue kilojoulespercubicmeterkelvin) + public static VolumetricHeatCapacity FromKilojoulesPerCubicMeterKelvin(double kilojoulespercubicmeterkelvin) { - double value = (double) kilojoulespercubicmeterkelvin; - return new VolumetricHeatCapacity(value, VolumetricHeatCapacityUnit.KilojoulePerCubicMeterKelvin); + return new VolumetricHeatCapacity(kilojoulespercubicmeterkelvin, VolumetricHeatCapacityUnit.KilojoulePerCubicMeterKelvin); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumetricHeatCapacity FromMegajoulesPerCubicMeterDegreeCelsius(QuantityValue megajoulespercubicmeterdegreecelsius) + public static VolumetricHeatCapacity FromMegajoulesPerCubicMeterDegreeCelsius(double megajoulespercubicmeterdegreecelsius) { - double value = (double) megajoulespercubicmeterdegreecelsius; - return new VolumetricHeatCapacity(value, VolumetricHeatCapacityUnit.MegajoulePerCubicMeterDegreeCelsius); + return new VolumetricHeatCapacity(megajoulespercubicmeterdegreecelsius, VolumetricHeatCapacityUnit.MegajoulePerCubicMeterDegreeCelsius); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumetricHeatCapacity FromMegajoulesPerCubicMeterKelvin(QuantityValue megajoulespercubicmeterkelvin) + public static VolumetricHeatCapacity FromMegajoulesPerCubicMeterKelvin(double megajoulespercubicmeterkelvin) { - double value = (double) megajoulespercubicmeterkelvin; - return new VolumetricHeatCapacity(value, VolumetricHeatCapacityUnit.MegajoulePerCubicMeterKelvin); + return new VolumetricHeatCapacity(megajoulespercubicmeterkelvin, 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..cad17c0388 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,60 +261,54 @@ 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 centimeterstothesixth) { - double value = (double) centimeterstothesixth; - return new WarpingMomentOfInertia(value, WarpingMomentOfInertiaUnit.CentimeterToTheSixth); + return new WarpingMomentOfInertia(centimeterstothesixth, WarpingMomentOfInertiaUnit.CentimeterToTheSixth); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static WarpingMomentOfInertia FromDecimetersToTheSixth(QuantityValue decimeterstothesixth) + public static WarpingMomentOfInertia FromDecimetersToTheSixth(double decimeterstothesixth) { - double value = (double) decimeterstothesixth; - return new WarpingMomentOfInertia(value, WarpingMomentOfInertiaUnit.DecimeterToTheSixth); + return new WarpingMomentOfInertia(decimeterstothesixth, WarpingMomentOfInertiaUnit.DecimeterToTheSixth); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static WarpingMomentOfInertia FromFeetToTheSixth(QuantityValue feettothesixth) + public static WarpingMomentOfInertia FromFeetToTheSixth(double feettothesixth) { - double value = (double) feettothesixth; - return new WarpingMomentOfInertia(value, WarpingMomentOfInertiaUnit.FootToTheSixth); + return new WarpingMomentOfInertia(feettothesixth, WarpingMomentOfInertiaUnit.FootToTheSixth); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static WarpingMomentOfInertia FromInchesToTheSixth(QuantityValue inchestothesixth) + public static WarpingMomentOfInertia FromInchesToTheSixth(double inchestothesixth) { - double value = (double) inchestothesixth; - return new WarpingMomentOfInertia(value, WarpingMomentOfInertiaUnit.InchToTheSixth); + return new WarpingMomentOfInertia(inchestothesixth, WarpingMomentOfInertiaUnit.InchToTheSixth); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static WarpingMomentOfInertia FromMetersToTheSixth(QuantityValue meterstothesixth) + public static WarpingMomentOfInertia FromMetersToTheSixth(double meterstothesixth) { - double value = (double) meterstothesixth; - return new WarpingMomentOfInertia(value, WarpingMomentOfInertiaUnit.MeterToTheSixth); + return new WarpingMomentOfInertia(meterstothesixth, WarpingMomentOfInertiaUnit.MeterToTheSixth); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static WarpingMomentOfInertia FromMillimetersToTheSixth(QuantityValue millimeterstothesixth) + public static WarpingMomentOfInertia FromMillimetersToTheSixth(double millimeterstothesixth) { - double value = (double) millimeterstothesixth; - return new WarpingMomentOfInertia(value, WarpingMomentOfInertiaUnit.MillimeterToTheSixth); + return new WarpingMomentOfInertia(millimeterstothesixth, 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 { From 2c9685afc5566af719d61d5e0eb23a13ffc77be7 Mon Sep 17 00:00:00 2001 From: Andreas Gullberg Larsen Date: Fri, 23 Feb 2024 21:45:32 +0100 Subject: [PATCH 08/11] Add back test cases in UnitsNetBaseJsonConvertTests They were not specific to decimal, adapted to work with double values. --- .../UnitsNetBaseJsonConverterTest.cs | 107 ++++++++++++++++++ 1 file changed, 107 insertions(+) diff --git a/UnitsNet.Serialization.JsonNet.Tests/UnitsNetBaseJsonConverterTest.cs b/UnitsNet.Serialization.JsonNet.Tests/UnitsNetBaseJsonConverterTest.cs index 112f65de2a..f6f6707788 100644 --- a/UnitsNet.Serialization.JsonNet.Tests/UnitsNetBaseJsonConverterTest.cs +++ b/UnitsNet.Serialization.JsonNet.Tests/UnitsNetBaseJsonConverterTest.cs @@ -37,6 +37,16 @@ public void UnitsNetBaseJsonConverter_ConvertIQuantity_throws_ArgumentNullExcept Assert.Equal("Value cannot be null. (Parameter 'quantity')", result.Message); } + [Fact] + public void UnitsNetBaseJsonConverter_ConvertValueUnit_works_as_expected() + { + var result = _sut.Test_ConvertDoubleValueUnit("PowerUnit.Watt", 10.2365); + + Assert.NotNull(result); + Assert.IsType(result); + Assert.True(Power.FromWatts(10.2365).Equals((Power)result, 1e-5, ComparisonType.Absolute)); + } + [Fact] public void UnitsNetBaseJsonConverter_ConvertValueUnit_throws_UnitsNetException_when_unit_does_not_exist() { @@ -47,6 +57,16 @@ public void UnitsNetBaseJsonConverter_ConvertValueUnit_throws_UnitsNetException_ Assert.Equal("UnitsNet.Units.SomeImaginaryUnit,UnitsNet", result.Data["type"]); } + [Fact] + public void UnitsNetBaseJsonConverter_ConvertValueUnit_throws_UnitsNetException_when_unit_is_in_unexpected_format() + { + 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")); + Assert.Equal("PowerUnit Watt", result.Data["type"]); + } + [Fact] public void UnitsNetBaseJsonConverter_CreateLocalSerializer_works_as_expected() { @@ -86,6 +106,48 @@ 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_legacy_decimal_quantity() + { + var token = new JObject {{"Unit", "PowerUnit.Watt"}, {"Value", 10.2365}, {"ValueString", "10.2365"}, {"ValueType", "decimal"}}; + + var result = _sut.Test_ReadDoubleValueUnit(token); + + Assert.NotNull(result); + Assert.Equal("PowerUnit.Watt", result?.Unit); + Assert.Equal(10.2365, result?.Value); + } + + [Fact] + public void UnitsNetBaseJsonConverter_ReadValueUnit_returns_null_when_value_is_a_string() + { + var token = new JObject {{"Unit", "PowerUnit.Watt"}, {"Value", "10.2365"}}; + + var result = _sut.Test_ReadDoubleValueUnit(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_ReadDoubleValueUnit(token); + + Assert.Null(result); + } + [Fact] public void UnitsNetBaseJsonConverter_ReadDoubleValueUnit_works_with_empty_token() { @@ -96,6 +158,51 @@ public void UnitsNetBaseJsonConverter_ReadDoubleValueUnit_works_with_empty_token Assert.Null(result); } + [Theory] + [InlineData(false, true)] + [InlineData(true, false)] + public void UnitsNetBaseJsonConverter_ReadValueUnit_returns_null_when_unit_or_value_is_missing(bool withUnit, bool withValue) + { + var token = new JObject(); + + if (withUnit) + { + token.Add("Unit", "PowerUnit.Watt"); + } + + if (withValue) + { + token.Add("Value", 10.2365); + } + + var result = _sut.Test_ReadDoubleValueUnit(token); + + Assert.Null(result); + } + + [Theory] + [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) + { + var token = new JObject + { + {unitPropertyName, "PowerUnit.Watt"}, + {valuePropertyName, 10.2365}, + }; + + var result = _sut.Test_ReadDoubleValueUnit(token); + + Assert.NotNull(result); + Assert.Equal("PowerUnit.Watt", result?.Unit); + Assert.Equal(10.2365, result?.Value); + } + /// /// Dummy converter, used to access protected methods on abstract UnitsNetBaseJsonConverter{T} /// From 9f2824de313e54173d767b860fd0bb1f1bf8e5d6 Mon Sep 17 00:00:00 2001 From: Andreas Gullberg Larsen Date: Fri, 23 Feb 2024 21:48:58 +0100 Subject: [PATCH 09/11] Rename FromXxx argument to value --- .../UnitsNetGen/QuantityGenerator.cs | 7 +- .../AbsorbedDoseOfIonizingRadiation.g.cs | 64 ++--- .../Quantities/Acceleration.g.cs | 56 ++-- .../Quantities/AmountOfSubstance.g.cs | 68 ++--- .../Quantities/AmplitudeRatio.g.cs | 16 +- UnitsNet/GeneratedCode/Quantities/Angle.g.cs | 64 ++--- .../Quantities/ApparentEnergy.g.cs | 12 +- .../Quantities/ApparentPower.g.cs | 24 +- UnitsNet/GeneratedCode/Quantities/Area.g.cs | 56 ++-- .../GeneratedCode/Quantities/AreaDensity.g.cs | 12 +- .../Quantities/AreaMomentOfInertia.g.cs | 24 +- .../GeneratedCode/Quantities/BitRate.g.cs | 104 +++---- .../BrakeSpecificFuelConsumption.g.cs | 12 +- .../GeneratedCode/Quantities/Capacitance.g.cs | 28 +- .../CoefficientOfThermalExpansion.g.cs | 36 +-- .../Quantities/Compressibility.g.cs | 28 +- .../GeneratedCode/Quantities/Density.g.cs | 224 +++++++-------- .../GeneratedCode/Quantities/Duration.g.cs | 44 +-- .../Quantities/DynamicViscosity.g.cs | 40 +-- .../Quantities/ElectricAdmittance.g.cs | 16 +- .../Quantities/ElectricCharge.g.cs | 44 +-- .../Quantities/ElectricChargeDensity.g.cs | 4 +- .../Quantities/ElectricConductance.g.cs | 20 +- .../Quantities/ElectricConductivity.g.cs | 24 +- .../Quantities/ElectricCurrent.g.cs | 36 +-- .../Quantities/ElectricCurrentDensity.g.cs | 12 +- .../Quantities/ElectricCurrentGradient.g.cs | 28 +- .../Quantities/ElectricField.g.cs | 4 +- .../Quantities/ElectricInductance.g.cs | 20 +- .../Quantities/ElectricPotential.g.cs | 24 +- .../Quantities/ElectricPotentialAc.g.cs | 20 +- .../ElectricPotentialChangeRate.g.cs | 80 +++--- .../Quantities/ElectricPotentialDc.g.cs | 20 +- .../Quantities/ElectricResistance.g.cs | 28 +- .../Quantities/ElectricResistivity.g.cs | 56 ++-- .../ElectricSurfaceChargeDensity.g.cs | 12 +- UnitsNet/GeneratedCode/Quantities/Energy.g.cs | 160 +++++------ .../Quantities/EnergyDensity.g.cs | 48 ++-- .../GeneratedCode/Quantities/Entropy.g.cs | 28 +- UnitsNet/GeneratedCode/Quantities/Force.g.cs | 60 ++-- .../Quantities/ForceChangeRate.g.cs | 60 ++-- .../Quantities/ForcePerLength.g.cs | 152 +++++----- .../GeneratedCode/Quantities/Frequency.g.cs | 52 ++-- .../Quantities/FuelEfficiency.g.cs | 16 +- .../GeneratedCode/Quantities/HeatFlux.g.cs | 72 ++--- .../Quantities/HeatTransferCoefficient.g.cs | 24 +- .../GeneratedCode/Quantities/Illuminance.g.cs | 16 +- .../GeneratedCode/Quantities/Impulse.g.cs | 52 ++-- .../GeneratedCode/Quantities/Information.g.cs | 104 +++---- .../GeneratedCode/Quantities/Irradiance.g.cs | 56 ++-- .../GeneratedCode/Quantities/Irradiation.g.cs | 28 +- UnitsNet/GeneratedCode/Quantities/Jerk.g.cs | 44 +-- .../Quantities/KinematicViscosity.g.cs | 36 +-- .../GeneratedCode/Quantities/LeakRate.g.cs | 12 +- UnitsNet/GeneratedCode/Quantities/Length.g.cs | 168 +++++------ UnitsNet/GeneratedCode/Quantities/Level.g.cs | 8 +- .../Quantities/LinearDensity.g.cs | 56 ++-- .../Quantities/LinearPowerDensity.g.cs | 100 +++---- .../GeneratedCode/Quantities/Luminance.g.cs | 40 +-- .../GeneratedCode/Quantities/Luminosity.g.cs | 56 ++-- .../Quantities/LuminousFlux.g.cs | 4 +- .../Quantities/LuminousIntensity.g.cs | 4 +- .../Quantities/MagneticField.g.cs | 24 +- .../Quantities/MagneticFlux.g.cs | 4 +- .../Quantities/Magnetization.g.cs | 4 +- UnitsNet/GeneratedCode/Quantities/Mass.g.cs | 108 +++---- .../Quantities/MassConcentration.g.cs | 196 ++++++------- .../GeneratedCode/Quantities/MassFlow.g.cs | 132 ++++----- .../GeneratedCode/Quantities/MassFlux.g.cs | 48 ++-- .../Quantities/MassFraction.g.cs | 96 +++---- .../Quantities/MassMomentOfInertia.g.cs | 112 ++++---- .../GeneratedCode/Quantities/Molality.g.cs | 8 +- .../GeneratedCode/Quantities/MolarEnergy.g.cs | 12 +- .../Quantities/MolarEntropy.g.cs | 12 +- .../GeneratedCode/Quantities/MolarFlow.g.cs | 36 +-- .../GeneratedCode/Quantities/MolarMass.g.cs | 52 ++-- .../GeneratedCode/Quantities/Molarity.g.cs | 44 +-- .../Quantities/Permeability.g.cs | 4 +- .../Quantities/Permittivity.g.cs | 4 +- .../Quantities/PorousMediumPermeability.g.cs | 20 +- UnitsNet/GeneratedCode/Quantities/Power.g.cs | 104 +++---- .../Quantities/PowerDensity.g.cs | 176 ++++++------ .../GeneratedCode/Quantities/PowerRatio.g.cs | 8 +- .../GeneratedCode/Quantities/Pressure.g.cs | 196 ++++++------- .../Quantities/PressureChangeRate.g.cs | 72 ++--- .../Quantities/RadiationExposure.g.cs | 32 +-- .../Quantities/Radioactivity.g.cs | 116 ++++---- UnitsNet/GeneratedCode/Quantities/Ratio.g.cs | 24 +- .../Quantities/RatioChangeRate.g.cs | 8 +- .../Quantities/ReactiveEnergy.g.cs | 12 +- .../Quantities/ReactivePower.g.cs | 16 +- .../Quantities/ReciprocalArea.g.cs | 44 +-- .../Quantities/ReciprocalLength.g.cs | 40 +-- .../Quantities/RelativeHumidity.g.cs | 4 +- .../Quantities/RotationalAcceleration.g.cs | 16 +- .../Quantities/RotationalSpeed.g.cs | 52 ++-- .../Quantities/RotationalStiffness.g.cs | 132 ++++----- .../RotationalStiffnessPerLength.g.cs | 20 +- UnitsNet/GeneratedCode/Quantities/Scalar.g.cs | 4 +- .../GeneratedCode/Quantities/SolidAngle.g.cs | 4 +- .../Quantities/SpecificEnergy.g.cs | 120 ++++---- .../Quantities/SpecificEntropy.g.cs | 36 +-- .../Quantities/SpecificFuelConsumption.g.cs | 16 +- .../Quantities/SpecificVolume.g.cs | 12 +- .../Quantities/SpecificWeight.g.cs | 68 ++--- UnitsNet/GeneratedCode/Quantities/Speed.g.cs | 132 ++++----- .../Quantities/StandardVolumeFlow.g.cs | 36 +-- .../GeneratedCode/Quantities/Temperature.g.cs | 40 +-- .../Quantities/TemperatureChangeRate.g.cs | 40 +-- .../Quantities/TemperatureDelta.g.cs | 36 +-- .../Quantities/TemperatureGradient.g.cs | 16 +- .../Quantities/ThermalConductivity.g.cs | 8 +- .../Quantities/ThermalResistance.g.cs | 24 +- UnitsNet/GeneratedCode/Quantities/Torque.g.cs | 100 +++---- .../Quantities/TorquePerLength.g.cs | 84 +++--- .../GeneratedCode/Quantities/Turbidity.g.cs | 4 +- .../GeneratedCode/Quantities/VitaminA.g.cs | 4 +- UnitsNet/GeneratedCode/Quantities/Volume.g.cs | 216 +++++++------- .../Quantities/VolumeConcentration.g.cs | 80 +++--- .../GeneratedCode/Quantities/VolumeFlow.g.cs | 268 +++++++++--------- .../Quantities/VolumeFlowPerArea.g.cs | 8 +- .../Quantities/VolumePerLength.g.cs | 36 +-- .../Quantities/VolumetricHeatCapacity.g.cs | 36 +-- .../Quantities/WarpingMomentOfInertia.g.cs | 24 +- 124 files changed, 3131 insertions(+), 3132 deletions(-) diff --git a/CodeGen/Generators/UnitsNetGen/QuantityGenerator.cs b/CodeGen/Generators/UnitsNetGen/QuantityGenerator.cs index 72a9b5cfdc..e0d5f41066 100644 --- a/CodeGen/Generators/UnitsNetGen/QuantityGenerator.cs +++ b/CodeGen/Generators/UnitsNetGen/QuantityGenerator.cs @@ -416,7 +416,6 @@ private void GenerateStaticFactoryMethods() { if (unit.SkipConversionGeneration) continue; - var valueParamName = unit.PluralName.ToLowerInvariant(); Writer.WL($@" /// /// Creates a from . @@ -424,9 +423,9 @@ private void GenerateStaticFactoryMethods() /// If value is NaN or Infinity."); Writer.WLIfText(2, GetObsoleteAttributeOrNull(unit)); Writer.WL($@" - public static {_quantity.Name} From{unit.PluralName}(double {valueParamName}) + public static {_quantity.Name} From{unit.PluralName}(double value) {{ - return new {_quantity.Name}({valueParamName}, {_unitEnumName}.{unit.SingularName}); + return new {_quantity.Name}(value, {_unitEnumName}.{unit.SingularName}); }} "); } @@ -777,7 +776,7 @@ private void GenerateRelationalOperators() { rightParameter = rightPart = "value"; } - + var expression = $"{leftPart} {relation.Operator} {rightPart}"; if (relation.ResultQuantity.Name is not "double") diff --git a/UnitsNet/GeneratedCode/Quantities/AbsorbedDoseOfIonizingRadiation.g.cs b/UnitsNet/GeneratedCode/Quantities/AbsorbedDoseOfIonizingRadiation.g.cs index cd1a5e3dc8..2946054ac8 100644 --- a/UnitsNet/GeneratedCode/Quantities/AbsorbedDoseOfIonizingRadiation.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AbsorbedDoseOfIonizingRadiation.g.cs @@ -344,144 +344,144 @@ public static string GetAbbreviation(AbsorbedDoseOfIonizingRadiationUnit unit, I /// Creates a from . /// /// If value is NaN or Infinity. - public static AbsorbedDoseOfIonizingRadiation FromCentigrays(double centigrays) + public static AbsorbedDoseOfIonizingRadiation FromCentigrays(double value) { - return new AbsorbedDoseOfIonizingRadiation(centigrays, AbsorbedDoseOfIonizingRadiationUnit.Centigray); + return new AbsorbedDoseOfIonizingRadiation(value, AbsorbedDoseOfIonizingRadiationUnit.Centigray); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AbsorbedDoseOfIonizingRadiation FromFemtograys(double femtograys) + public static AbsorbedDoseOfIonizingRadiation FromFemtograys(double value) { - return new AbsorbedDoseOfIonizingRadiation(femtograys, AbsorbedDoseOfIonizingRadiationUnit.Femtogray); + return new AbsorbedDoseOfIonizingRadiation(value, AbsorbedDoseOfIonizingRadiationUnit.Femtogray); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AbsorbedDoseOfIonizingRadiation FromGigagrays(double gigagrays) + public static AbsorbedDoseOfIonizingRadiation FromGigagrays(double value) { - return new AbsorbedDoseOfIonizingRadiation(gigagrays, AbsorbedDoseOfIonizingRadiationUnit.Gigagray); + return new AbsorbedDoseOfIonizingRadiation(value, AbsorbedDoseOfIonizingRadiationUnit.Gigagray); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AbsorbedDoseOfIonizingRadiation FromGrays(double grays) + public static AbsorbedDoseOfIonizingRadiation FromGrays(double value) { - return new AbsorbedDoseOfIonizingRadiation(grays, AbsorbedDoseOfIonizingRadiationUnit.Gray); + return new AbsorbedDoseOfIonizingRadiation(value, AbsorbedDoseOfIonizingRadiationUnit.Gray); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AbsorbedDoseOfIonizingRadiation FromKilograys(double kilograys) + public static AbsorbedDoseOfIonizingRadiation FromKilograys(double value) { - return new AbsorbedDoseOfIonizingRadiation(kilograys, AbsorbedDoseOfIonizingRadiationUnit.Kilogray); + return new AbsorbedDoseOfIonizingRadiation(value, AbsorbedDoseOfIonizingRadiationUnit.Kilogray); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AbsorbedDoseOfIonizingRadiation FromKilorads(double kilorads) + public static AbsorbedDoseOfIonizingRadiation FromKilorads(double value) { - return new AbsorbedDoseOfIonizingRadiation(kilorads, AbsorbedDoseOfIonizingRadiationUnit.Kilorad); + return new AbsorbedDoseOfIonizingRadiation(value, AbsorbedDoseOfIonizingRadiationUnit.Kilorad); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AbsorbedDoseOfIonizingRadiation FromMegagrays(double megagrays) + public static AbsorbedDoseOfIonizingRadiation FromMegagrays(double value) { - return new AbsorbedDoseOfIonizingRadiation(megagrays, AbsorbedDoseOfIonizingRadiationUnit.Megagray); + return new AbsorbedDoseOfIonizingRadiation(value, AbsorbedDoseOfIonizingRadiationUnit.Megagray); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AbsorbedDoseOfIonizingRadiation FromMegarads(double megarads) + public static AbsorbedDoseOfIonizingRadiation FromMegarads(double value) { - return new AbsorbedDoseOfIonizingRadiation(megarads, AbsorbedDoseOfIonizingRadiationUnit.Megarad); + return new AbsorbedDoseOfIonizingRadiation(value, AbsorbedDoseOfIonizingRadiationUnit.Megarad); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AbsorbedDoseOfIonizingRadiation FromMicrograys(double micrograys) + public static AbsorbedDoseOfIonizingRadiation FromMicrograys(double value) { - return new AbsorbedDoseOfIonizingRadiation(micrograys, AbsorbedDoseOfIonizingRadiationUnit.Microgray); + return new AbsorbedDoseOfIonizingRadiation(value, AbsorbedDoseOfIonizingRadiationUnit.Microgray); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AbsorbedDoseOfIonizingRadiation FromMilligrays(double milligrays) + public static AbsorbedDoseOfIonizingRadiation FromMilligrays(double value) { - return new AbsorbedDoseOfIonizingRadiation(milligrays, AbsorbedDoseOfIonizingRadiationUnit.Milligray); + return new AbsorbedDoseOfIonizingRadiation(value, AbsorbedDoseOfIonizingRadiationUnit.Milligray); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AbsorbedDoseOfIonizingRadiation FromMillirads(double millirads) + public static AbsorbedDoseOfIonizingRadiation FromMillirads(double value) { - return new AbsorbedDoseOfIonizingRadiation(millirads, AbsorbedDoseOfIonizingRadiationUnit.Millirad); + return new AbsorbedDoseOfIonizingRadiation(value, AbsorbedDoseOfIonizingRadiationUnit.Millirad); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AbsorbedDoseOfIonizingRadiation FromNanograys(double nanograys) + public static AbsorbedDoseOfIonizingRadiation FromNanograys(double value) { - return new AbsorbedDoseOfIonizingRadiation(nanograys, AbsorbedDoseOfIonizingRadiationUnit.Nanogray); + return new AbsorbedDoseOfIonizingRadiation(value, AbsorbedDoseOfIonizingRadiationUnit.Nanogray); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AbsorbedDoseOfIonizingRadiation FromPetagrays(double petagrays) + public static AbsorbedDoseOfIonizingRadiation FromPetagrays(double value) { - return new AbsorbedDoseOfIonizingRadiation(petagrays, AbsorbedDoseOfIonizingRadiationUnit.Petagray); + return new AbsorbedDoseOfIonizingRadiation(value, AbsorbedDoseOfIonizingRadiationUnit.Petagray); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AbsorbedDoseOfIonizingRadiation FromPicograys(double picograys) + public static AbsorbedDoseOfIonizingRadiation FromPicograys(double value) { - return new AbsorbedDoseOfIonizingRadiation(picograys, AbsorbedDoseOfIonizingRadiationUnit.Picogray); + return new AbsorbedDoseOfIonizingRadiation(value, AbsorbedDoseOfIonizingRadiationUnit.Picogray); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AbsorbedDoseOfIonizingRadiation FromRads(double rads) + public static AbsorbedDoseOfIonizingRadiation FromRads(double value) { - return new AbsorbedDoseOfIonizingRadiation(rads, AbsorbedDoseOfIonizingRadiationUnit.Rad); + return new AbsorbedDoseOfIonizingRadiation(value, AbsorbedDoseOfIonizingRadiationUnit.Rad); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AbsorbedDoseOfIonizingRadiation FromTeragrays(double teragrays) + public static AbsorbedDoseOfIonizingRadiation FromTeragrays(double value) { - return new AbsorbedDoseOfIonizingRadiation(teragrays, AbsorbedDoseOfIonizingRadiationUnit.Teragray); + return new AbsorbedDoseOfIonizingRadiation(value, AbsorbedDoseOfIonizingRadiationUnit.Teragray); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs b/UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs index 7c0dda39bc..9da774ea22 100644 --- a/UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs @@ -336,126 +336,126 @@ public static string GetAbbreviation(AccelerationUnit unit, IFormatProvider? pro /// Creates a from . /// /// If value is NaN or Infinity. - public static Acceleration FromCentimetersPerSecondSquared(double centimeterspersecondsquared) + public static Acceleration FromCentimetersPerSecondSquared(double value) { - return new Acceleration(centimeterspersecondsquared, AccelerationUnit.CentimeterPerSecondSquared); + return new Acceleration(value, AccelerationUnit.CentimeterPerSecondSquared); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Acceleration FromDecimetersPerSecondSquared(double decimeterspersecondsquared) + public static Acceleration FromDecimetersPerSecondSquared(double value) { - return new Acceleration(decimeterspersecondsquared, AccelerationUnit.DecimeterPerSecondSquared); + return new Acceleration(value, AccelerationUnit.DecimeterPerSecondSquared); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Acceleration FromFeetPerSecondSquared(double feetpersecondsquared) + public static Acceleration FromFeetPerSecondSquared(double value) { - return new Acceleration(feetpersecondsquared, AccelerationUnit.FootPerSecondSquared); + return new Acceleration(value, AccelerationUnit.FootPerSecondSquared); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Acceleration FromInchesPerSecondSquared(double inchespersecondsquared) + public static Acceleration FromInchesPerSecondSquared(double value) { - return new Acceleration(inchespersecondsquared, AccelerationUnit.InchPerSecondSquared); + return new Acceleration(value, AccelerationUnit.InchPerSecondSquared); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Acceleration FromKilometersPerSecondSquared(double kilometerspersecondsquared) + public static Acceleration FromKilometersPerSecondSquared(double value) { - return new Acceleration(kilometerspersecondsquared, AccelerationUnit.KilometerPerSecondSquared); + return new Acceleration(value, AccelerationUnit.KilometerPerSecondSquared); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Acceleration FromKnotsPerHour(double knotsperhour) + public static Acceleration FromKnotsPerHour(double value) { - return new Acceleration(knotsperhour, AccelerationUnit.KnotPerHour); + return new Acceleration(value, AccelerationUnit.KnotPerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Acceleration FromKnotsPerMinute(double knotsperminute) + public static Acceleration FromKnotsPerMinute(double value) { - return new Acceleration(knotsperminute, AccelerationUnit.KnotPerMinute); + return new Acceleration(value, AccelerationUnit.KnotPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Acceleration FromKnotsPerSecond(double knotspersecond) + public static Acceleration FromKnotsPerSecond(double value) { - return new Acceleration(knotspersecond, AccelerationUnit.KnotPerSecond); + return new Acceleration(value, AccelerationUnit.KnotPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Acceleration FromMetersPerSecondSquared(double meterspersecondsquared) + public static Acceleration FromMetersPerSecondSquared(double value) { - return new Acceleration(meterspersecondsquared, AccelerationUnit.MeterPerSecondSquared); + return new Acceleration(value, AccelerationUnit.MeterPerSecondSquared); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Acceleration FromMicrometersPerSecondSquared(double micrometerspersecondsquared) + public static Acceleration FromMicrometersPerSecondSquared(double value) { - return new Acceleration(micrometerspersecondsquared, AccelerationUnit.MicrometerPerSecondSquared); + return new Acceleration(value, AccelerationUnit.MicrometerPerSecondSquared); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Acceleration FromMillimetersPerSecondSquared(double millimeterspersecondsquared) + public static Acceleration FromMillimetersPerSecondSquared(double value) { - return new Acceleration(millimeterspersecondsquared, AccelerationUnit.MillimeterPerSecondSquared); + return new Acceleration(value, AccelerationUnit.MillimeterPerSecondSquared); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Acceleration FromMillistandardGravity(double millistandardgravity) + public static Acceleration FromMillistandardGravity(double value) { - return new Acceleration(millistandardgravity, AccelerationUnit.MillistandardGravity); + return new Acceleration(value, AccelerationUnit.MillistandardGravity); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Acceleration FromNanometersPerSecondSquared(double nanometerspersecondsquared) + public static Acceleration FromNanometersPerSecondSquared(double value) { - return new Acceleration(nanometerspersecondsquared, AccelerationUnit.NanometerPerSecondSquared); + return new Acceleration(value, AccelerationUnit.NanometerPerSecondSquared); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Acceleration FromStandardGravity(double standardgravity) + public static Acceleration FromStandardGravity(double value) { - return new Acceleration(standardgravity, AccelerationUnit.StandardGravity); + return new Acceleration(value, AccelerationUnit.StandardGravity); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs b/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs index af5a890bd8..31bb489dc9 100644 --- a/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs @@ -357,153 +357,153 @@ public static string GetAbbreviation(AmountOfSubstanceUnit unit, IFormatProvider /// Creates a from . /// /// If value is NaN or Infinity. - public static AmountOfSubstance FromCentimoles(double centimoles) + public static AmountOfSubstance FromCentimoles(double value) { - return new AmountOfSubstance(centimoles, AmountOfSubstanceUnit.Centimole); + return new AmountOfSubstance(value, AmountOfSubstanceUnit.Centimole); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AmountOfSubstance FromCentipoundMoles(double centipoundmoles) + public static AmountOfSubstance FromCentipoundMoles(double value) { - return new AmountOfSubstance(centipoundmoles, AmountOfSubstanceUnit.CentipoundMole); + return new AmountOfSubstance(value, AmountOfSubstanceUnit.CentipoundMole); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AmountOfSubstance FromDecimoles(double decimoles) + public static AmountOfSubstance FromDecimoles(double value) { - return new AmountOfSubstance(decimoles, AmountOfSubstanceUnit.Decimole); + return new AmountOfSubstance(value, AmountOfSubstanceUnit.Decimole); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AmountOfSubstance FromDecipoundMoles(double decipoundmoles) + public static AmountOfSubstance FromDecipoundMoles(double value) { - return new AmountOfSubstance(decipoundmoles, AmountOfSubstanceUnit.DecipoundMole); + return new AmountOfSubstance(value, AmountOfSubstanceUnit.DecipoundMole); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AmountOfSubstance FromFemtomoles(double femtomoles) + public static AmountOfSubstance FromFemtomoles(double value) { - return new AmountOfSubstance(femtomoles, AmountOfSubstanceUnit.Femtomole); + return new AmountOfSubstance(value, AmountOfSubstanceUnit.Femtomole); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AmountOfSubstance FromKilomoles(double kilomoles) + public static AmountOfSubstance FromKilomoles(double value) { - return new AmountOfSubstance(kilomoles, AmountOfSubstanceUnit.Kilomole); + return new AmountOfSubstance(value, AmountOfSubstanceUnit.Kilomole); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AmountOfSubstance FromKilopoundMoles(double kilopoundmoles) + public static AmountOfSubstance FromKilopoundMoles(double value) { - return new AmountOfSubstance(kilopoundmoles, AmountOfSubstanceUnit.KilopoundMole); + return new AmountOfSubstance(value, AmountOfSubstanceUnit.KilopoundMole); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AmountOfSubstance FromMegamoles(double megamoles) + public static AmountOfSubstance FromMegamoles(double value) { - return new AmountOfSubstance(megamoles, AmountOfSubstanceUnit.Megamole); + return new AmountOfSubstance(value, AmountOfSubstanceUnit.Megamole); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AmountOfSubstance FromMicromoles(double micromoles) + public static AmountOfSubstance FromMicromoles(double value) { - return new AmountOfSubstance(micromoles, AmountOfSubstanceUnit.Micromole); + return new AmountOfSubstance(value, AmountOfSubstanceUnit.Micromole); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AmountOfSubstance FromMicropoundMoles(double micropoundmoles) + public static AmountOfSubstance FromMicropoundMoles(double value) { - return new AmountOfSubstance(micropoundmoles, AmountOfSubstanceUnit.MicropoundMole); + return new AmountOfSubstance(value, AmountOfSubstanceUnit.MicropoundMole); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AmountOfSubstance FromMillimoles(double millimoles) + public static AmountOfSubstance FromMillimoles(double value) { - return new AmountOfSubstance(millimoles, AmountOfSubstanceUnit.Millimole); + return new AmountOfSubstance(value, AmountOfSubstanceUnit.Millimole); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AmountOfSubstance FromMillipoundMoles(double millipoundmoles) + public static AmountOfSubstance FromMillipoundMoles(double value) { - return new AmountOfSubstance(millipoundmoles, AmountOfSubstanceUnit.MillipoundMole); + return new AmountOfSubstance(value, AmountOfSubstanceUnit.MillipoundMole); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AmountOfSubstance FromMoles(double moles) + public static AmountOfSubstance FromMoles(double value) { - return new AmountOfSubstance(moles, AmountOfSubstanceUnit.Mole); + return new AmountOfSubstance(value, AmountOfSubstanceUnit.Mole); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AmountOfSubstance FromNanomoles(double nanomoles) + public static AmountOfSubstance FromNanomoles(double value) { - return new AmountOfSubstance(nanomoles, AmountOfSubstanceUnit.Nanomole); + return new AmountOfSubstance(value, AmountOfSubstanceUnit.Nanomole); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AmountOfSubstance FromNanopoundMoles(double nanopoundmoles) + public static AmountOfSubstance FromNanopoundMoles(double value) { - return new AmountOfSubstance(nanopoundmoles, AmountOfSubstanceUnit.NanopoundMole); + return new AmountOfSubstance(value, AmountOfSubstanceUnit.NanopoundMole); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AmountOfSubstance FromPicomoles(double picomoles) + public static AmountOfSubstance FromPicomoles(double value) { - return new AmountOfSubstance(picomoles, AmountOfSubstanceUnit.Picomole); + return new AmountOfSubstance(value, AmountOfSubstanceUnit.Picomole); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AmountOfSubstance FromPoundMoles(double poundmoles) + public static AmountOfSubstance FromPoundMoles(double value) { - return new AmountOfSubstance(poundmoles, AmountOfSubstanceUnit.PoundMole); + return new AmountOfSubstance(value, AmountOfSubstanceUnit.PoundMole); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.g.cs b/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.g.cs index 28965ce755..80fd371fb9 100644 --- a/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.g.cs @@ -245,36 +245,36 @@ public static string GetAbbreviation(AmplitudeRatioUnit unit, IFormatProvider? p /// Creates a from . /// /// If value is NaN or Infinity. - public static AmplitudeRatio FromDecibelMicrovolts(double decibelmicrovolts) + public static AmplitudeRatio FromDecibelMicrovolts(double value) { - return new AmplitudeRatio(decibelmicrovolts, AmplitudeRatioUnit.DecibelMicrovolt); + return new AmplitudeRatio(value, AmplitudeRatioUnit.DecibelMicrovolt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AmplitudeRatio FromDecibelMillivolts(double decibelmillivolts) + public static AmplitudeRatio FromDecibelMillivolts(double value) { - return new AmplitudeRatio(decibelmillivolts, AmplitudeRatioUnit.DecibelMillivolt); + return new AmplitudeRatio(value, AmplitudeRatioUnit.DecibelMillivolt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AmplitudeRatio FromDecibelsUnloaded(double decibelsunloaded) + public static AmplitudeRatio FromDecibelsUnloaded(double value) { - return new AmplitudeRatio(decibelsunloaded, AmplitudeRatioUnit.DecibelUnloaded); + return new AmplitudeRatio(value, AmplitudeRatioUnit.DecibelUnloaded); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AmplitudeRatio FromDecibelVolts(double decibelvolts) + public static AmplitudeRatio FromDecibelVolts(double value) { - return new AmplitudeRatio(decibelvolts, AmplitudeRatioUnit.DecibelVolt); + return new AmplitudeRatio(value, AmplitudeRatioUnit.DecibelVolt); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Angle.g.cs b/UnitsNet/GeneratedCode/Quantities/Angle.g.cs index 9154199798..4a885a77a6 100644 --- a/UnitsNet/GeneratedCode/Quantities/Angle.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Angle.g.cs @@ -349,144 +349,144 @@ public static string GetAbbreviation(AngleUnit unit, IFormatProvider? provider) /// Creates a from . /// /// If value is NaN or Infinity. - public static Angle FromArcminutes(double arcminutes) + public static Angle FromArcminutes(double value) { - return new Angle(arcminutes, AngleUnit.Arcminute); + return new Angle(value, AngleUnit.Arcminute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Angle FromArcseconds(double arcseconds) + public static Angle FromArcseconds(double value) { - return new Angle(arcseconds, AngleUnit.Arcsecond); + return new Angle(value, AngleUnit.Arcsecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Angle FromCentiradians(double centiradians) + public static Angle FromCentiradians(double value) { - return new Angle(centiradians, AngleUnit.Centiradian); + return new Angle(value, AngleUnit.Centiradian); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Angle FromDeciradians(double deciradians) + public static Angle FromDeciradians(double value) { - return new Angle(deciradians, AngleUnit.Deciradian); + return new Angle(value, AngleUnit.Deciradian); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Angle FromDegrees(double degrees) + public static Angle FromDegrees(double value) { - return new Angle(degrees, AngleUnit.Degree); + return new Angle(value, AngleUnit.Degree); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Angle FromGradians(double gradians) + public static Angle FromGradians(double value) { - return new Angle(gradians, AngleUnit.Gradian); + return new Angle(value, AngleUnit.Gradian); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Angle FromMicrodegrees(double microdegrees) + public static Angle FromMicrodegrees(double value) { - return new Angle(microdegrees, AngleUnit.Microdegree); + return new Angle(value, AngleUnit.Microdegree); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Angle FromMicroradians(double microradians) + public static Angle FromMicroradians(double value) { - return new Angle(microradians, AngleUnit.Microradian); + return new Angle(value, AngleUnit.Microradian); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Angle FromMillidegrees(double millidegrees) + public static Angle FromMillidegrees(double value) { - return new Angle(millidegrees, AngleUnit.Millidegree); + return new Angle(value, AngleUnit.Millidegree); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Angle FromMilliradians(double milliradians) + public static Angle FromMilliradians(double value) { - return new Angle(milliradians, AngleUnit.Milliradian); + return new Angle(value, AngleUnit.Milliradian); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Angle FromNanodegrees(double nanodegrees) + public static Angle FromNanodegrees(double value) { - return new Angle(nanodegrees, AngleUnit.Nanodegree); + return new Angle(value, AngleUnit.Nanodegree); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Angle FromNanoradians(double nanoradians) + public static Angle FromNanoradians(double value) { - return new Angle(nanoradians, AngleUnit.Nanoradian); + return new Angle(value, AngleUnit.Nanoradian); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Angle FromNatoMils(double natomils) + public static Angle FromNatoMils(double value) { - return new Angle(natomils, AngleUnit.NatoMil); + return new Angle(value, AngleUnit.NatoMil); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Angle FromRadians(double radians) + public static Angle FromRadians(double value) { - return new Angle(radians, AngleUnit.Radian); + return new Angle(value, AngleUnit.Radian); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Angle FromRevolutions(double revolutions) + public static Angle FromRevolutions(double value) { - return new Angle(revolutions, AngleUnit.Revolution); + return new Angle(value, AngleUnit.Revolution); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Angle FromTilt(double tilt) + public static Angle FromTilt(double value) { - return new Angle(tilt, AngleUnit.Tilt); + return new Angle(value, AngleUnit.Tilt); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.g.cs b/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.g.cs index 368a86ea9f..dcd8442fbe 100644 --- a/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.g.cs @@ -237,27 +237,27 @@ public static string GetAbbreviation(ApparentEnergyUnit unit, IFormatProvider? p /// Creates a from . /// /// If value is NaN or Infinity. - public static ApparentEnergy FromKilovoltampereHours(double kilovoltamperehours) + public static ApparentEnergy FromKilovoltampereHours(double value) { - return new ApparentEnergy(kilovoltamperehours, ApparentEnergyUnit.KilovoltampereHour); + return new ApparentEnergy(value, ApparentEnergyUnit.KilovoltampereHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ApparentEnergy FromMegavoltampereHours(double megavoltamperehours) + public static ApparentEnergy FromMegavoltampereHours(double value) { - return new ApparentEnergy(megavoltamperehours, ApparentEnergyUnit.MegavoltampereHour); + return new ApparentEnergy(value, ApparentEnergyUnit.MegavoltampereHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ApparentEnergy FromVoltampereHours(double voltamperehours) + public static ApparentEnergy FromVoltampereHours(double value) { - return new ApparentEnergy(voltamperehours, ApparentEnergyUnit.VoltampereHour); + return new ApparentEnergy(value, ApparentEnergyUnit.VoltampereHour); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ApparentPower.g.cs b/UnitsNet/GeneratedCode/Quantities/ApparentPower.g.cs index b05a40ab9e..196fde0960 100644 --- a/UnitsNet/GeneratedCode/Quantities/ApparentPower.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ApparentPower.g.cs @@ -261,54 +261,54 @@ public static string GetAbbreviation(ApparentPowerUnit unit, IFormatProvider? pr /// Creates a from . /// /// If value is NaN or Infinity. - public static ApparentPower FromGigavoltamperes(double gigavoltamperes) + public static ApparentPower FromGigavoltamperes(double value) { - return new ApparentPower(gigavoltamperes, ApparentPowerUnit.Gigavoltampere); + return new ApparentPower(value, ApparentPowerUnit.Gigavoltampere); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ApparentPower FromKilovoltamperes(double kilovoltamperes) + public static ApparentPower FromKilovoltamperes(double value) { - return new ApparentPower(kilovoltamperes, ApparentPowerUnit.Kilovoltampere); + return new ApparentPower(value, ApparentPowerUnit.Kilovoltampere); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ApparentPower FromMegavoltamperes(double megavoltamperes) + public static ApparentPower FromMegavoltamperes(double value) { - return new ApparentPower(megavoltamperes, ApparentPowerUnit.Megavoltampere); + return new ApparentPower(value, ApparentPowerUnit.Megavoltampere); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ApparentPower FromMicrovoltamperes(double microvoltamperes) + public static ApparentPower FromMicrovoltamperes(double value) { - return new ApparentPower(microvoltamperes, ApparentPowerUnit.Microvoltampere); + return new ApparentPower(value, ApparentPowerUnit.Microvoltampere); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ApparentPower FromMillivoltamperes(double millivoltamperes) + public static ApparentPower FromMillivoltamperes(double value) { - return new ApparentPower(millivoltamperes, ApparentPowerUnit.Millivoltampere); + return new ApparentPower(value, ApparentPowerUnit.Millivoltampere); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ApparentPower FromVoltamperes(double voltamperes) + public static ApparentPower FromVoltamperes(double value) { - return new ApparentPower(voltamperes, ApparentPowerUnit.Voltampere); + return new ApparentPower(value, ApparentPowerUnit.Voltampere); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Area.g.cs b/UnitsNet/GeneratedCode/Quantities/Area.g.cs index 4f8c25c7a0..281f995046 100644 --- a/UnitsNet/GeneratedCode/Quantities/Area.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Area.g.cs @@ -342,126 +342,126 @@ public static string GetAbbreviation(AreaUnit unit, IFormatProvider? provider) /// Creates a from . /// /// If value is NaN or Infinity. - public static Area FromAcres(double acres) + public static Area FromAcres(double value) { - return new Area(acres, AreaUnit.Acre); + return new Area(value, AreaUnit.Acre); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Area FromHectares(double hectares) + public static Area FromHectares(double value) { - return new Area(hectares, AreaUnit.Hectare); + return new Area(value, AreaUnit.Hectare); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Area FromSquareCentimeters(double squarecentimeters) + public static Area FromSquareCentimeters(double value) { - return new Area(squarecentimeters, AreaUnit.SquareCentimeter); + return new Area(value, AreaUnit.SquareCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Area FromSquareDecimeters(double squaredecimeters) + public static Area FromSquareDecimeters(double value) { - return new Area(squaredecimeters, AreaUnit.SquareDecimeter); + return new Area(value, AreaUnit.SquareDecimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Area FromSquareFeet(double squarefeet) + public static Area FromSquareFeet(double value) { - return new Area(squarefeet, AreaUnit.SquareFoot); + return new Area(value, AreaUnit.SquareFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Area FromSquareInches(double squareinches) + public static Area FromSquareInches(double value) { - return new Area(squareinches, AreaUnit.SquareInch); + return new Area(value, AreaUnit.SquareInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Area FromSquareKilometers(double squarekilometers) + public static Area FromSquareKilometers(double value) { - return new Area(squarekilometers, AreaUnit.SquareKilometer); + return new Area(value, AreaUnit.SquareKilometer); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Area FromSquareMeters(double squaremeters) + public static Area FromSquareMeters(double value) { - return new Area(squaremeters, AreaUnit.SquareMeter); + return new Area(value, AreaUnit.SquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Area FromSquareMicrometers(double squaremicrometers) + public static Area FromSquareMicrometers(double value) { - return new Area(squaremicrometers, AreaUnit.SquareMicrometer); + return new Area(value, AreaUnit.SquareMicrometer); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Area FromSquareMiles(double squaremiles) + public static Area FromSquareMiles(double value) { - return new Area(squaremiles, AreaUnit.SquareMile); + return new Area(value, AreaUnit.SquareMile); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Area FromSquareMillimeters(double squaremillimeters) + public static Area FromSquareMillimeters(double value) { - return new Area(squaremillimeters, AreaUnit.SquareMillimeter); + return new Area(value, AreaUnit.SquareMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Area FromSquareNauticalMiles(double squarenauticalmiles) + public static Area FromSquareNauticalMiles(double value) { - return new Area(squarenauticalmiles, AreaUnit.SquareNauticalMile); + return new Area(value, AreaUnit.SquareNauticalMile); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Area FromSquareYards(double squareyards) + public static Area FromSquareYards(double value) { - return new Area(squareyards, AreaUnit.SquareYard); + return new Area(value, AreaUnit.SquareYard); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Area FromUsSurveySquareFeet(double ussurveysquarefeet) + public static Area FromUsSurveySquareFeet(double value) { - return new Area(ussurveysquarefeet, AreaUnit.UsSurveySquareFoot); + return new Area(value, AreaUnit.UsSurveySquareFoot); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/AreaDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/AreaDensity.g.cs index dc3473d5dc..557e60eb93 100644 --- a/UnitsNet/GeneratedCode/Quantities/AreaDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AreaDensity.g.cs @@ -243,27 +243,27 @@ public static string GetAbbreviation(AreaDensityUnit unit, IFormatProvider? prov /// Creates a from . /// /// If value is NaN or Infinity. - public static AreaDensity FromGramsPerSquareMeter(double gramspersquaremeter) + public static AreaDensity FromGramsPerSquareMeter(double value) { - return new AreaDensity(gramspersquaremeter, AreaDensityUnit.GramPerSquareMeter); + return new AreaDensity(value, AreaDensityUnit.GramPerSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AreaDensity FromKilogramsPerSquareMeter(double kilogramspersquaremeter) + public static AreaDensity FromKilogramsPerSquareMeter(double value) { - return new AreaDensity(kilogramspersquaremeter, AreaDensityUnit.KilogramPerSquareMeter); + return new AreaDensity(value, AreaDensityUnit.KilogramPerSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AreaDensity FromMilligramsPerSquareMeter(double milligramspersquaremeter) + public static AreaDensity FromMilligramsPerSquareMeter(double value) { - return new AreaDensity(milligramspersquaremeter, AreaDensityUnit.MilligramPerSquareMeter); + return new AreaDensity(value, AreaDensityUnit.MilligramPerSquareMeter); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs b/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs index 78f1ad2b29..8ce16faf93 100644 --- a/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs @@ -267,54 +267,54 @@ public static string GetAbbreviation(AreaMomentOfInertiaUnit unit, IFormatProvid /// Creates a from . /// /// If value is NaN or Infinity. - public static AreaMomentOfInertia FromCentimetersToTheFourth(double centimeterstothefourth) + public static AreaMomentOfInertia FromCentimetersToTheFourth(double value) { - return new AreaMomentOfInertia(centimeterstothefourth, AreaMomentOfInertiaUnit.CentimeterToTheFourth); + return new AreaMomentOfInertia(value, AreaMomentOfInertiaUnit.CentimeterToTheFourth); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AreaMomentOfInertia FromDecimetersToTheFourth(double decimeterstothefourth) + public static AreaMomentOfInertia FromDecimetersToTheFourth(double value) { - return new AreaMomentOfInertia(decimeterstothefourth, AreaMomentOfInertiaUnit.DecimeterToTheFourth); + return new AreaMomentOfInertia(value, AreaMomentOfInertiaUnit.DecimeterToTheFourth); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AreaMomentOfInertia FromFeetToTheFourth(double feettothefourth) + public static AreaMomentOfInertia FromFeetToTheFourth(double value) { - return new AreaMomentOfInertia(feettothefourth, AreaMomentOfInertiaUnit.FootToTheFourth); + return new AreaMomentOfInertia(value, AreaMomentOfInertiaUnit.FootToTheFourth); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AreaMomentOfInertia FromInchesToTheFourth(double inchestothefourth) + public static AreaMomentOfInertia FromInchesToTheFourth(double value) { - return new AreaMomentOfInertia(inchestothefourth, AreaMomentOfInertiaUnit.InchToTheFourth); + return new AreaMomentOfInertia(value, AreaMomentOfInertiaUnit.InchToTheFourth); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AreaMomentOfInertia FromMetersToTheFourth(double meterstothefourth) + public static AreaMomentOfInertia FromMetersToTheFourth(double value) { - return new AreaMomentOfInertia(meterstothefourth, AreaMomentOfInertiaUnit.MeterToTheFourth); + return new AreaMomentOfInertia(value, AreaMomentOfInertiaUnit.MeterToTheFourth); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static AreaMomentOfInertia FromMillimetersToTheFourth(double millimeterstothefourth) + public static AreaMomentOfInertia FromMillimetersToTheFourth(double value) { - return new AreaMomentOfInertia(millimeterstothefourth, AreaMomentOfInertiaUnit.MillimeterToTheFourth); + return new AreaMomentOfInertia(value, AreaMomentOfInertiaUnit.MillimeterToTheFourth); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/BitRate.g.cs b/UnitsNet/GeneratedCode/Quantities/BitRate.g.cs index ccfb357344..25e8ea4743 100644 --- a/UnitsNet/GeneratedCode/Quantities/BitRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/BitRate.g.cs @@ -424,234 +424,234 @@ public static string GetAbbreviation(BitRateUnit unit, IFormatProvider? provider /// Creates a from . /// /// If value is NaN or Infinity. - public static BitRate FromBitsPerSecond(double bitspersecond) + public static BitRate FromBitsPerSecond(double value) { - return new BitRate(bitspersecond, BitRateUnit.BitPerSecond); + return new BitRate(value, BitRateUnit.BitPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static BitRate FromBytesPerSecond(double bytespersecond) + public static BitRate FromBytesPerSecond(double value) { - return new BitRate(bytespersecond, BitRateUnit.BytePerSecond); + return new BitRate(value, BitRateUnit.BytePerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static BitRate FromExabitsPerSecond(double exabitspersecond) + public static BitRate FromExabitsPerSecond(double value) { - return new BitRate(exabitspersecond, BitRateUnit.ExabitPerSecond); + return new BitRate(value, BitRateUnit.ExabitPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static BitRate FromExabytesPerSecond(double exabytespersecond) + public static BitRate FromExabytesPerSecond(double value) { - return new BitRate(exabytespersecond, BitRateUnit.ExabytePerSecond); + return new BitRate(value, BitRateUnit.ExabytePerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static BitRate FromExbibitsPerSecond(double exbibitspersecond) + public static BitRate FromExbibitsPerSecond(double value) { - return new BitRate(exbibitspersecond, BitRateUnit.ExbibitPerSecond); + return new BitRate(value, BitRateUnit.ExbibitPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static BitRate FromExbibytesPerSecond(double exbibytespersecond) + public static BitRate FromExbibytesPerSecond(double value) { - return new BitRate(exbibytespersecond, BitRateUnit.ExbibytePerSecond); + return new BitRate(value, BitRateUnit.ExbibytePerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static BitRate FromGibibitsPerSecond(double gibibitspersecond) + public static BitRate FromGibibitsPerSecond(double value) { - return new BitRate(gibibitspersecond, BitRateUnit.GibibitPerSecond); + return new BitRate(value, BitRateUnit.GibibitPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static BitRate FromGibibytesPerSecond(double gibibytespersecond) + public static BitRate FromGibibytesPerSecond(double value) { - return new BitRate(gibibytespersecond, BitRateUnit.GibibytePerSecond); + return new BitRate(value, BitRateUnit.GibibytePerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static BitRate FromGigabitsPerSecond(double gigabitspersecond) + public static BitRate FromGigabitsPerSecond(double value) { - return new BitRate(gigabitspersecond, BitRateUnit.GigabitPerSecond); + return new BitRate(value, BitRateUnit.GigabitPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static BitRate FromGigabytesPerSecond(double gigabytespersecond) + public static BitRate FromGigabytesPerSecond(double value) { - return new BitRate(gigabytespersecond, BitRateUnit.GigabytePerSecond); + return new BitRate(value, BitRateUnit.GigabytePerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static BitRate FromKibibitsPerSecond(double kibibitspersecond) + public static BitRate FromKibibitsPerSecond(double value) { - return new BitRate(kibibitspersecond, BitRateUnit.KibibitPerSecond); + return new BitRate(value, BitRateUnit.KibibitPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static BitRate FromKibibytesPerSecond(double kibibytespersecond) + public static BitRate FromKibibytesPerSecond(double value) { - return new BitRate(kibibytespersecond, BitRateUnit.KibibytePerSecond); + return new BitRate(value, BitRateUnit.KibibytePerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static BitRate FromKilobitsPerSecond(double kilobitspersecond) + public static BitRate FromKilobitsPerSecond(double value) { - return new BitRate(kilobitspersecond, BitRateUnit.KilobitPerSecond); + return new BitRate(value, BitRateUnit.KilobitPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static BitRate FromKilobytesPerSecond(double kilobytespersecond) + public static BitRate FromKilobytesPerSecond(double value) { - return new BitRate(kilobytespersecond, BitRateUnit.KilobytePerSecond); + return new BitRate(value, BitRateUnit.KilobytePerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static BitRate FromMebibitsPerSecond(double mebibitspersecond) + public static BitRate FromMebibitsPerSecond(double value) { - return new BitRate(mebibitspersecond, BitRateUnit.MebibitPerSecond); + return new BitRate(value, BitRateUnit.MebibitPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static BitRate FromMebibytesPerSecond(double mebibytespersecond) + public static BitRate FromMebibytesPerSecond(double value) { - return new BitRate(mebibytespersecond, BitRateUnit.MebibytePerSecond); + return new BitRate(value, BitRateUnit.MebibytePerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static BitRate FromMegabitsPerSecond(double megabitspersecond) + public static BitRate FromMegabitsPerSecond(double value) { - return new BitRate(megabitspersecond, BitRateUnit.MegabitPerSecond); + return new BitRate(value, BitRateUnit.MegabitPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static BitRate FromMegabytesPerSecond(double megabytespersecond) + public static BitRate FromMegabytesPerSecond(double value) { - return new BitRate(megabytespersecond, BitRateUnit.MegabytePerSecond); + return new BitRate(value, BitRateUnit.MegabytePerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static BitRate FromPebibitsPerSecond(double pebibitspersecond) + public static BitRate FromPebibitsPerSecond(double value) { - return new BitRate(pebibitspersecond, BitRateUnit.PebibitPerSecond); + return new BitRate(value, BitRateUnit.PebibitPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static BitRate FromPebibytesPerSecond(double pebibytespersecond) + public static BitRate FromPebibytesPerSecond(double value) { - return new BitRate(pebibytespersecond, BitRateUnit.PebibytePerSecond); + return new BitRate(value, BitRateUnit.PebibytePerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static BitRate FromPetabitsPerSecond(double petabitspersecond) + public static BitRate FromPetabitsPerSecond(double value) { - return new BitRate(petabitspersecond, BitRateUnit.PetabitPerSecond); + return new BitRate(value, BitRateUnit.PetabitPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static BitRate FromPetabytesPerSecond(double petabytespersecond) + public static BitRate FromPetabytesPerSecond(double value) { - return new BitRate(petabytespersecond, BitRateUnit.PetabytePerSecond); + return new BitRate(value, BitRateUnit.PetabytePerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static BitRate FromTebibitsPerSecond(double tebibitspersecond) + public static BitRate FromTebibitsPerSecond(double value) { - return new BitRate(tebibitspersecond, BitRateUnit.TebibitPerSecond); + return new BitRate(value, BitRateUnit.TebibitPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static BitRate FromTebibytesPerSecond(double tebibytespersecond) + public static BitRate FromTebibytesPerSecond(double value) { - return new BitRate(tebibytespersecond, BitRateUnit.TebibytePerSecond); + return new BitRate(value, BitRateUnit.TebibytePerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static BitRate FromTerabitsPerSecond(double terabitspersecond) + public static BitRate FromTerabitsPerSecond(double value) { - return new BitRate(terabitspersecond, BitRateUnit.TerabitPerSecond); + return new BitRate(value, BitRateUnit.TerabitPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static BitRate FromTerabytesPerSecond(double terabytespersecond) + public static BitRate FromTerabytesPerSecond(double value) { - return new BitRate(terabytespersecond, BitRateUnit.TerabytePerSecond); + return new BitRate(value, BitRateUnit.TerabytePerSecond); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.g.cs b/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.g.cs index f206c16e94..712af22d80 100644 --- a/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.g.cs @@ -244,27 +244,27 @@ public static string GetAbbreviation(BrakeSpecificFuelConsumptionUnit unit, IFor /// Creates a from . /// /// If value is NaN or Infinity. - public static BrakeSpecificFuelConsumption FromGramsPerKiloWattHour(double gramsperkilowatthour) + public static BrakeSpecificFuelConsumption FromGramsPerKiloWattHour(double value) { - return new BrakeSpecificFuelConsumption(gramsperkilowatthour, BrakeSpecificFuelConsumptionUnit.GramPerKiloWattHour); + return new BrakeSpecificFuelConsumption(value, BrakeSpecificFuelConsumptionUnit.GramPerKiloWattHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static BrakeSpecificFuelConsumption FromKilogramsPerJoule(double kilogramsperjoule) + public static BrakeSpecificFuelConsumption FromKilogramsPerJoule(double value) { - return new BrakeSpecificFuelConsumption(kilogramsperjoule, BrakeSpecificFuelConsumptionUnit.KilogramPerJoule); + return new BrakeSpecificFuelConsumption(value, BrakeSpecificFuelConsumptionUnit.KilogramPerJoule); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static BrakeSpecificFuelConsumption FromPoundsPerMechanicalHorsepowerHour(double poundspermechanicalhorsepowerhour) + public static BrakeSpecificFuelConsumption FromPoundsPerMechanicalHorsepowerHour(double value) { - return new BrakeSpecificFuelConsumption(poundspermechanicalhorsepowerhour, BrakeSpecificFuelConsumptionUnit.PoundPerMechanicalHorsepowerHour); + return new BrakeSpecificFuelConsumption(value, BrakeSpecificFuelConsumptionUnit.PoundPerMechanicalHorsepowerHour); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Capacitance.g.cs b/UnitsNet/GeneratedCode/Quantities/Capacitance.g.cs index 8d9907fa89..e2ed75d852 100644 --- a/UnitsNet/GeneratedCode/Quantities/Capacitance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Capacitance.g.cs @@ -272,63 +272,63 @@ public static string GetAbbreviation(CapacitanceUnit unit, IFormatProvider? prov /// Creates a from . /// /// If value is NaN or Infinity. - public static Capacitance FromFarads(double farads) + public static Capacitance FromFarads(double value) { - return new Capacitance(farads, CapacitanceUnit.Farad); + return new Capacitance(value, CapacitanceUnit.Farad); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Capacitance FromKilofarads(double kilofarads) + public static Capacitance FromKilofarads(double value) { - return new Capacitance(kilofarads, CapacitanceUnit.Kilofarad); + return new Capacitance(value, CapacitanceUnit.Kilofarad); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Capacitance FromMegafarads(double megafarads) + public static Capacitance FromMegafarads(double value) { - return new Capacitance(megafarads, CapacitanceUnit.Megafarad); + return new Capacitance(value, CapacitanceUnit.Megafarad); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Capacitance FromMicrofarads(double microfarads) + public static Capacitance FromMicrofarads(double value) { - return new Capacitance(microfarads, CapacitanceUnit.Microfarad); + return new Capacitance(value, CapacitanceUnit.Microfarad); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Capacitance FromMillifarads(double millifarads) + public static Capacitance FromMillifarads(double value) { - return new Capacitance(millifarads, CapacitanceUnit.Millifarad); + return new Capacitance(value, CapacitanceUnit.Millifarad); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Capacitance FromNanofarads(double nanofarads) + public static Capacitance FromNanofarads(double value) { - return new Capacitance(nanofarads, CapacitanceUnit.Nanofarad); + return new Capacitance(value, CapacitanceUnit.Nanofarad); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Capacitance FromPicofarads(double picofarads) + public static Capacitance FromPicofarads(double value) { - return new Capacitance(picofarads, CapacitanceUnit.Picofarad); + return new Capacitance(value, CapacitanceUnit.Picofarad); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.g.cs b/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.g.cs index cbd02a5a19..1b66a2090a 100644 --- a/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.g.cs @@ -295,9 +295,9 @@ public static string GetAbbreviation(CoefficientOfThermalExpansionUnit unit, IFo /// /// If value is NaN or Infinity. [Obsolete("Use PerDegreeCelsius instead.")] - public static CoefficientOfThermalExpansion FromInverseDegreeCelsius(double inversedegreecelsius) + public static CoefficientOfThermalExpansion FromInverseDegreeCelsius(double value) { - return new CoefficientOfThermalExpansion(inversedegreecelsius, CoefficientOfThermalExpansionUnit.InverseDegreeCelsius); + return new CoefficientOfThermalExpansion(value, CoefficientOfThermalExpansionUnit.InverseDegreeCelsius); } /// @@ -305,9 +305,9 @@ public static CoefficientOfThermalExpansion FromInverseDegreeCelsius(double inve /// /// If value is NaN or Infinity. [Obsolete("Use PerDegreeFahrenheit instead.")] - public static CoefficientOfThermalExpansion FromInverseDegreeFahrenheit(double inversedegreefahrenheit) + public static CoefficientOfThermalExpansion FromInverseDegreeFahrenheit(double value) { - return new CoefficientOfThermalExpansion(inversedegreefahrenheit, CoefficientOfThermalExpansionUnit.InverseDegreeFahrenheit); + return new CoefficientOfThermalExpansion(value, CoefficientOfThermalExpansionUnit.InverseDegreeFahrenheit); } /// @@ -315,63 +315,63 @@ public static CoefficientOfThermalExpansion FromInverseDegreeFahrenheit(double i /// /// If value is NaN or Infinity. [Obsolete("Use PerKelvin instead.")] - public static CoefficientOfThermalExpansion FromInverseKelvin(double inversekelvin) + public static CoefficientOfThermalExpansion FromInverseKelvin(double value) { - return new CoefficientOfThermalExpansion(inversekelvin, CoefficientOfThermalExpansionUnit.InverseKelvin); + return new CoefficientOfThermalExpansion(value, CoefficientOfThermalExpansionUnit.InverseKelvin); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static CoefficientOfThermalExpansion FromPerDegreeCelsius(double perdegreecelsius) + public static CoefficientOfThermalExpansion FromPerDegreeCelsius(double value) { - return new CoefficientOfThermalExpansion(perdegreecelsius, CoefficientOfThermalExpansionUnit.PerDegreeCelsius); + return new CoefficientOfThermalExpansion(value, CoefficientOfThermalExpansionUnit.PerDegreeCelsius); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static CoefficientOfThermalExpansion FromPerDegreeFahrenheit(double perdegreefahrenheit) + public static CoefficientOfThermalExpansion FromPerDegreeFahrenheit(double value) { - return new CoefficientOfThermalExpansion(perdegreefahrenheit, CoefficientOfThermalExpansionUnit.PerDegreeFahrenheit); + return new CoefficientOfThermalExpansion(value, CoefficientOfThermalExpansionUnit.PerDegreeFahrenheit); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static CoefficientOfThermalExpansion FromPerKelvin(double perkelvin) + public static CoefficientOfThermalExpansion FromPerKelvin(double value) { - return new CoefficientOfThermalExpansion(perkelvin, CoefficientOfThermalExpansionUnit.PerKelvin); + return new CoefficientOfThermalExpansion(value, CoefficientOfThermalExpansionUnit.PerKelvin); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static CoefficientOfThermalExpansion FromPpmPerDegreeCelsius(double ppmperdegreecelsius) + public static CoefficientOfThermalExpansion FromPpmPerDegreeCelsius(double value) { - return new CoefficientOfThermalExpansion(ppmperdegreecelsius, CoefficientOfThermalExpansionUnit.PpmPerDegreeCelsius); + return new CoefficientOfThermalExpansion(value, CoefficientOfThermalExpansionUnit.PpmPerDegreeCelsius); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static CoefficientOfThermalExpansion FromPpmPerDegreeFahrenheit(double ppmperdegreefahrenheit) + public static CoefficientOfThermalExpansion FromPpmPerDegreeFahrenheit(double value) { - return new CoefficientOfThermalExpansion(ppmperdegreefahrenheit, CoefficientOfThermalExpansionUnit.PpmPerDegreeFahrenheit); + return new CoefficientOfThermalExpansion(value, CoefficientOfThermalExpansionUnit.PpmPerDegreeFahrenheit); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static CoefficientOfThermalExpansion FromPpmPerKelvin(double ppmperkelvin) + public static CoefficientOfThermalExpansion FromPpmPerKelvin(double value) { - return new CoefficientOfThermalExpansion(ppmperkelvin, CoefficientOfThermalExpansionUnit.PpmPerKelvin); + return new CoefficientOfThermalExpansion(value, CoefficientOfThermalExpansionUnit.PpmPerKelvin); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Compressibility.g.cs b/UnitsNet/GeneratedCode/Quantities/Compressibility.g.cs index c0dd43106d..b5d7cae6c5 100644 --- a/UnitsNet/GeneratedCode/Quantities/Compressibility.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Compressibility.g.cs @@ -269,63 +269,63 @@ public static string GetAbbreviation(CompressibilityUnit unit, IFormatProvider? /// Creates a from . /// /// If value is NaN or Infinity. - public static Compressibility FromInverseAtmospheres(double inverseatmospheres) + public static Compressibility FromInverseAtmospheres(double value) { - return new Compressibility(inverseatmospheres, CompressibilityUnit.InverseAtmosphere); + return new Compressibility(value, CompressibilityUnit.InverseAtmosphere); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Compressibility FromInverseBars(double inversebars) + public static Compressibility FromInverseBars(double value) { - return new Compressibility(inversebars, CompressibilityUnit.InverseBar); + return new Compressibility(value, CompressibilityUnit.InverseBar); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Compressibility FromInverseKilopascals(double inversekilopascals) + public static Compressibility FromInverseKilopascals(double value) { - return new Compressibility(inversekilopascals, CompressibilityUnit.InverseKilopascal); + return new Compressibility(value, CompressibilityUnit.InverseKilopascal); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Compressibility FromInverseMegapascals(double inversemegapascals) + public static Compressibility FromInverseMegapascals(double value) { - return new Compressibility(inversemegapascals, CompressibilityUnit.InverseMegapascal); + return new Compressibility(value, CompressibilityUnit.InverseMegapascal); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Compressibility FromInverseMillibars(double inversemillibars) + public static Compressibility FromInverseMillibars(double value) { - return new Compressibility(inversemillibars, CompressibilityUnit.InverseMillibar); + return new Compressibility(value, CompressibilityUnit.InverseMillibar); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Compressibility FromInversePascals(double inversepascals) + public static Compressibility FromInversePascals(double value) { - return new Compressibility(inversepascals, CompressibilityUnit.InversePascal); + return new Compressibility(value, CompressibilityUnit.InversePascal); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Compressibility FromInversePoundsForcePerSquareInch(double inversepoundsforcepersquareinch) + public static Compressibility FromInversePoundsForcePerSquareInch(double value) { - return new Compressibility(inversepoundsforcepersquareinch, CompressibilityUnit.InversePoundForcePerSquareInch); + return new Compressibility(value, CompressibilityUnit.InversePoundForcePerSquareInch); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Density.g.cs b/UnitsNet/GeneratedCode/Quantities/Density.g.cs index f0760bf017..1b3c8a592d 100644 --- a/UnitsNet/GeneratedCode/Quantities/Density.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Density.g.cs @@ -676,504 +676,504 @@ public static string GetAbbreviation(DensityUnit unit, IFormatProvider? provider /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromCentigramsPerDeciliter(double centigramsperdeciliter) + public static Density FromCentigramsPerDeciliter(double value) { - return new Density(centigramsperdeciliter, DensityUnit.CentigramPerDeciliter); + return new Density(value, DensityUnit.CentigramPerDeciliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromCentigramsPerLiter(double centigramsperliter) + public static Density FromCentigramsPerLiter(double value) { - return new Density(centigramsperliter, DensityUnit.CentigramPerLiter); + return new Density(value, DensityUnit.CentigramPerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromCentigramsPerMilliliter(double centigramspermilliliter) + public static Density FromCentigramsPerMilliliter(double value) { - return new Density(centigramspermilliliter, DensityUnit.CentigramPerMilliliter); + return new Density(value, DensityUnit.CentigramPerMilliliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromDecigramsPerDeciliter(double decigramsperdeciliter) + public static Density FromDecigramsPerDeciliter(double value) { - return new Density(decigramsperdeciliter, DensityUnit.DecigramPerDeciliter); + return new Density(value, DensityUnit.DecigramPerDeciliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromDecigramsPerLiter(double decigramsperliter) + public static Density FromDecigramsPerLiter(double value) { - return new Density(decigramsperliter, DensityUnit.DecigramPerLiter); + return new Density(value, DensityUnit.DecigramPerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromDecigramsPerMilliliter(double decigramspermilliliter) + public static Density FromDecigramsPerMilliliter(double value) { - return new Density(decigramspermilliliter, DensityUnit.DecigramPerMilliliter); + return new Density(value, DensityUnit.DecigramPerMilliliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromFemtogramsPerDeciliter(double femtogramsperdeciliter) + public static Density FromFemtogramsPerDeciliter(double value) { - return new Density(femtogramsperdeciliter, DensityUnit.FemtogramPerDeciliter); + return new Density(value, DensityUnit.FemtogramPerDeciliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromFemtogramsPerLiter(double femtogramsperliter) + public static Density FromFemtogramsPerLiter(double value) { - return new Density(femtogramsperliter, DensityUnit.FemtogramPerLiter); + return new Density(value, DensityUnit.FemtogramPerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromFemtogramsPerMilliliter(double femtogramspermilliliter) + public static Density FromFemtogramsPerMilliliter(double value) { - return new Density(femtogramspermilliliter, DensityUnit.FemtogramPerMilliliter); + return new Density(value, DensityUnit.FemtogramPerMilliliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromGramsPerCubicCentimeter(double gramspercubiccentimeter) + public static Density FromGramsPerCubicCentimeter(double value) { - return new Density(gramspercubiccentimeter, DensityUnit.GramPerCubicCentimeter); + return new Density(value, DensityUnit.GramPerCubicCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromGramsPerCubicFoot(double gramspercubicfoot) + public static Density FromGramsPerCubicFoot(double value) { - return new Density(gramspercubicfoot, DensityUnit.GramPerCubicFoot); + return new Density(value, DensityUnit.GramPerCubicFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromGramsPerCubicInch(double gramspercubicinch) + public static Density FromGramsPerCubicInch(double value) { - return new Density(gramspercubicinch, DensityUnit.GramPerCubicInch); + return new Density(value, DensityUnit.GramPerCubicInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromGramsPerCubicMeter(double gramspercubicmeter) + public static Density FromGramsPerCubicMeter(double value) { - return new Density(gramspercubicmeter, DensityUnit.GramPerCubicMeter); + return new Density(value, DensityUnit.GramPerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromGramsPerCubicMillimeter(double gramspercubicmillimeter) + public static Density FromGramsPerCubicMillimeter(double value) { - return new Density(gramspercubicmillimeter, DensityUnit.GramPerCubicMillimeter); + return new Density(value, DensityUnit.GramPerCubicMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromGramsPerDeciliter(double gramsperdeciliter) + public static Density FromGramsPerDeciliter(double value) { - return new Density(gramsperdeciliter, DensityUnit.GramPerDeciliter); + return new Density(value, DensityUnit.GramPerDeciliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromGramsPerLiter(double gramsperliter) + public static Density FromGramsPerLiter(double value) { - return new Density(gramsperliter, DensityUnit.GramPerLiter); + return new Density(value, DensityUnit.GramPerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromGramsPerMilliliter(double gramspermilliliter) + public static Density FromGramsPerMilliliter(double value) { - return new Density(gramspermilliliter, DensityUnit.GramPerMilliliter); + return new Density(value, DensityUnit.GramPerMilliliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromKilogramsPerCubicCentimeter(double kilogramspercubiccentimeter) + public static Density FromKilogramsPerCubicCentimeter(double value) { - return new Density(kilogramspercubiccentimeter, DensityUnit.KilogramPerCubicCentimeter); + return new Density(value, DensityUnit.KilogramPerCubicCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromKilogramsPerCubicMeter(double kilogramspercubicmeter) + public static Density FromKilogramsPerCubicMeter(double value) { - return new Density(kilogramspercubicmeter, DensityUnit.KilogramPerCubicMeter); + return new Density(value, DensityUnit.KilogramPerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromKilogramsPerCubicMillimeter(double kilogramspercubicmillimeter) + public static Density FromKilogramsPerCubicMillimeter(double value) { - return new Density(kilogramspercubicmillimeter, DensityUnit.KilogramPerCubicMillimeter); + return new Density(value, DensityUnit.KilogramPerCubicMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromKilogramsPerLiter(double kilogramsperliter) + public static Density FromKilogramsPerLiter(double value) { - return new Density(kilogramsperliter, DensityUnit.KilogramPerLiter); + return new Density(value, DensityUnit.KilogramPerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromKilopoundsPerCubicFoot(double kilopoundspercubicfoot) + public static Density FromKilopoundsPerCubicFoot(double value) { - return new Density(kilopoundspercubicfoot, DensityUnit.KilopoundPerCubicFoot); + return new Density(value, DensityUnit.KilopoundPerCubicFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromKilopoundsPerCubicInch(double kilopoundspercubicinch) + public static Density FromKilopoundsPerCubicInch(double value) { - return new Density(kilopoundspercubicinch, DensityUnit.KilopoundPerCubicInch); + return new Density(value, DensityUnit.KilopoundPerCubicInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromKilopoundsPerCubicYard(double kilopoundspercubicyard) + public static Density FromKilopoundsPerCubicYard(double value) { - return new Density(kilopoundspercubicyard, DensityUnit.KilopoundPerCubicYard); + return new Density(value, DensityUnit.KilopoundPerCubicYard); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromMicrogramsPerCubicMeter(double microgramspercubicmeter) + public static Density FromMicrogramsPerCubicMeter(double value) { - return new Density(microgramspercubicmeter, DensityUnit.MicrogramPerCubicMeter); + return new Density(value, DensityUnit.MicrogramPerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromMicrogramsPerDeciliter(double microgramsperdeciliter) + public static Density FromMicrogramsPerDeciliter(double value) { - return new Density(microgramsperdeciliter, DensityUnit.MicrogramPerDeciliter); + return new Density(value, DensityUnit.MicrogramPerDeciliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromMicrogramsPerLiter(double microgramsperliter) + public static Density FromMicrogramsPerLiter(double value) { - return new Density(microgramsperliter, DensityUnit.MicrogramPerLiter); + return new Density(value, DensityUnit.MicrogramPerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromMicrogramsPerMilliliter(double microgramspermilliliter) + public static Density FromMicrogramsPerMilliliter(double value) { - return new Density(microgramspermilliliter, DensityUnit.MicrogramPerMilliliter); + return new Density(value, DensityUnit.MicrogramPerMilliliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromMilligramsPerCubicMeter(double milligramspercubicmeter) + public static Density FromMilligramsPerCubicMeter(double value) { - return new Density(milligramspercubicmeter, DensityUnit.MilligramPerCubicMeter); + return new Density(value, DensityUnit.MilligramPerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromMilligramsPerDeciliter(double milligramsperdeciliter) + public static Density FromMilligramsPerDeciliter(double value) { - return new Density(milligramsperdeciliter, DensityUnit.MilligramPerDeciliter); + return new Density(value, DensityUnit.MilligramPerDeciliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromMilligramsPerLiter(double milligramsperliter) + public static Density FromMilligramsPerLiter(double value) { - return new Density(milligramsperliter, DensityUnit.MilligramPerLiter); + return new Density(value, DensityUnit.MilligramPerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromMilligramsPerMilliliter(double milligramspermilliliter) + public static Density FromMilligramsPerMilliliter(double value) { - return new Density(milligramspermilliliter, DensityUnit.MilligramPerMilliliter); + return new Density(value, DensityUnit.MilligramPerMilliliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromNanogramsPerDeciliter(double nanogramsperdeciliter) + public static Density FromNanogramsPerDeciliter(double value) { - return new Density(nanogramsperdeciliter, DensityUnit.NanogramPerDeciliter); + return new Density(value, DensityUnit.NanogramPerDeciliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromNanogramsPerLiter(double nanogramsperliter) + public static Density FromNanogramsPerLiter(double value) { - return new Density(nanogramsperliter, DensityUnit.NanogramPerLiter); + return new Density(value, DensityUnit.NanogramPerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromNanogramsPerMilliliter(double nanogramspermilliliter) + public static Density FromNanogramsPerMilliliter(double value) { - return new Density(nanogramspermilliliter, DensityUnit.NanogramPerMilliliter); + return new Density(value, DensityUnit.NanogramPerMilliliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromPicogramsPerDeciliter(double picogramsperdeciliter) + public static Density FromPicogramsPerDeciliter(double value) { - return new Density(picogramsperdeciliter, DensityUnit.PicogramPerDeciliter); + return new Density(value, DensityUnit.PicogramPerDeciliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromPicogramsPerLiter(double picogramsperliter) + public static Density FromPicogramsPerLiter(double value) { - return new Density(picogramsperliter, DensityUnit.PicogramPerLiter); + return new Density(value, DensityUnit.PicogramPerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromPicogramsPerMilliliter(double picogramspermilliliter) + public static Density FromPicogramsPerMilliliter(double value) { - return new Density(picogramspermilliliter, DensityUnit.PicogramPerMilliliter); + return new Density(value, DensityUnit.PicogramPerMilliliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromPoundsPerCubicCentimeter(double poundspercubiccentimeter) + public static Density FromPoundsPerCubicCentimeter(double value) { - return new Density(poundspercubiccentimeter, DensityUnit.PoundPerCubicCentimeter); + return new Density(value, DensityUnit.PoundPerCubicCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromPoundsPerCubicFoot(double poundspercubicfoot) + public static Density FromPoundsPerCubicFoot(double value) { - return new Density(poundspercubicfoot, DensityUnit.PoundPerCubicFoot); + return new Density(value, DensityUnit.PoundPerCubicFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromPoundsPerCubicInch(double poundspercubicinch) + public static Density FromPoundsPerCubicInch(double value) { - return new Density(poundspercubicinch, DensityUnit.PoundPerCubicInch); + return new Density(value, DensityUnit.PoundPerCubicInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromPoundsPerCubicMeter(double poundspercubicmeter) + public static Density FromPoundsPerCubicMeter(double value) { - return new Density(poundspercubicmeter, DensityUnit.PoundPerCubicMeter); + return new Density(value, DensityUnit.PoundPerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromPoundsPerCubicMillimeter(double poundspercubicmillimeter) + public static Density FromPoundsPerCubicMillimeter(double value) { - return new Density(poundspercubicmillimeter, DensityUnit.PoundPerCubicMillimeter); + return new Density(value, DensityUnit.PoundPerCubicMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromPoundsPerCubicYard(double poundspercubicyard) + public static Density FromPoundsPerCubicYard(double value) { - return new Density(poundspercubicyard, DensityUnit.PoundPerCubicYard); + return new Density(value, DensityUnit.PoundPerCubicYard); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromPoundsPerImperialGallon(double poundsperimperialgallon) + public static Density FromPoundsPerImperialGallon(double value) { - return new Density(poundsperimperialgallon, DensityUnit.PoundPerImperialGallon); + return new Density(value, DensityUnit.PoundPerImperialGallon); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromPoundsPerUSGallon(double poundsperusgallon) + public static Density FromPoundsPerUSGallon(double value) { - return new Density(poundsperusgallon, DensityUnit.PoundPerUSGallon); + return new Density(value, DensityUnit.PoundPerUSGallon); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromSlugsPerCubicCentimeter(double slugspercubiccentimeter) + public static Density FromSlugsPerCubicCentimeter(double value) { - return new Density(slugspercubiccentimeter, DensityUnit.SlugPerCubicCentimeter); + return new Density(value, DensityUnit.SlugPerCubicCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromSlugsPerCubicFoot(double slugspercubicfoot) + public static Density FromSlugsPerCubicFoot(double value) { - return new Density(slugspercubicfoot, DensityUnit.SlugPerCubicFoot); + return new Density(value, DensityUnit.SlugPerCubicFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromSlugsPerCubicInch(double slugspercubicinch) + public static Density FromSlugsPerCubicInch(double value) { - return new Density(slugspercubicinch, DensityUnit.SlugPerCubicInch); + return new Density(value, DensityUnit.SlugPerCubicInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromSlugsPerCubicMeter(double slugspercubicmeter) + public static Density FromSlugsPerCubicMeter(double value) { - return new Density(slugspercubicmeter, DensityUnit.SlugPerCubicMeter); + return new Density(value, DensityUnit.SlugPerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromSlugsPerCubicMillimeter(double slugspercubicmillimeter) + public static Density FromSlugsPerCubicMillimeter(double value) { - return new Density(slugspercubicmillimeter, DensityUnit.SlugPerCubicMillimeter); + return new Density(value, DensityUnit.SlugPerCubicMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromTonnesPerCubicCentimeter(double tonnespercubiccentimeter) + public static Density FromTonnesPerCubicCentimeter(double value) { - return new Density(tonnespercubiccentimeter, DensityUnit.TonnePerCubicCentimeter); + return new Density(value, DensityUnit.TonnePerCubicCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromTonnesPerCubicFoot(double tonnespercubicfoot) + public static Density FromTonnesPerCubicFoot(double value) { - return new Density(tonnespercubicfoot, DensityUnit.TonnePerCubicFoot); + return new Density(value, DensityUnit.TonnePerCubicFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromTonnesPerCubicInch(double tonnespercubicinch) + public static Density FromTonnesPerCubicInch(double value) { - return new Density(tonnespercubicinch, DensityUnit.TonnePerCubicInch); + return new Density(value, DensityUnit.TonnePerCubicInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromTonnesPerCubicMeter(double tonnespercubicmeter) + public static Density FromTonnesPerCubicMeter(double value) { - return new Density(tonnespercubicmeter, DensityUnit.TonnePerCubicMeter); + return new Density(value, DensityUnit.TonnePerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Density FromTonnesPerCubicMillimeter(double tonnespercubicmillimeter) + public static Density FromTonnesPerCubicMillimeter(double value) { - return new Density(tonnespercubicmillimeter, DensityUnit.TonnePerCubicMillimeter); + return new Density(value, DensityUnit.TonnePerCubicMillimeter); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Duration.g.cs b/UnitsNet/GeneratedCode/Quantities/Duration.g.cs index ed094880bb..85029f0a63 100644 --- a/UnitsNet/GeneratedCode/Quantities/Duration.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Duration.g.cs @@ -319,99 +319,99 @@ public static string GetAbbreviation(DurationUnit unit, IFormatProvider? provide /// Creates a from . /// /// If value is NaN or Infinity. - public static Duration FromDays(double days) + public static Duration FromDays(double value) { - return new Duration(days, DurationUnit.Day); + return new Duration(value, DurationUnit.Day); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Duration FromHours(double hours) + public static Duration FromHours(double value) { - return new Duration(hours, DurationUnit.Hour); + return new Duration(value, DurationUnit.Hour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Duration FromJulianYears(double julianyears) + public static Duration FromJulianYears(double value) { - return new Duration(julianyears, DurationUnit.JulianYear); + return new Duration(value, DurationUnit.JulianYear); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Duration FromMicroseconds(double microseconds) + public static Duration FromMicroseconds(double value) { - return new Duration(microseconds, DurationUnit.Microsecond); + return new Duration(value, DurationUnit.Microsecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Duration FromMilliseconds(double milliseconds) + public static Duration FromMilliseconds(double value) { - return new Duration(milliseconds, DurationUnit.Millisecond); + return new Duration(value, DurationUnit.Millisecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Duration FromMinutes(double minutes) + public static Duration FromMinutes(double value) { - return new Duration(minutes, DurationUnit.Minute); + return new Duration(value, DurationUnit.Minute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Duration FromMonths30(double months30) + public static Duration FromMonths30(double value) { - return new Duration(months30, DurationUnit.Month30); + return new Duration(value, DurationUnit.Month30); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Duration FromNanoseconds(double nanoseconds) + public static Duration FromNanoseconds(double value) { - return new Duration(nanoseconds, DurationUnit.Nanosecond); + return new Duration(value, DurationUnit.Nanosecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Duration FromSeconds(double seconds) + public static Duration FromSeconds(double value) { - return new Duration(seconds, DurationUnit.Second); + return new Duration(value, DurationUnit.Second); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Duration FromWeeks(double weeks) + public static Duration FromWeeks(double value) { - return new Duration(weeks, DurationUnit.Week); + return new Duration(value, DurationUnit.Week); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Duration FromYears365(double years365) + public static Duration FromYears365(double value) { - return new Duration(years365, DurationUnit.Year365); + return new Duration(value, DurationUnit.Year365); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.g.cs b/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.g.cs index 982af348d6..e3b9e103ac 100644 --- a/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.g.cs @@ -302,90 +302,90 @@ public static string GetAbbreviation(DynamicViscosityUnit unit, IFormatProvider? /// Creates a from . /// /// If value is NaN or Infinity. - public static DynamicViscosity FromCentipoise(double centipoise) + public static DynamicViscosity FromCentipoise(double value) { - return new DynamicViscosity(centipoise, DynamicViscosityUnit.Centipoise); + return new DynamicViscosity(value, DynamicViscosityUnit.Centipoise); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static DynamicViscosity FromMicropascalSeconds(double micropascalseconds) + public static DynamicViscosity FromMicropascalSeconds(double value) { - return new DynamicViscosity(micropascalseconds, DynamicViscosityUnit.MicropascalSecond); + return new DynamicViscosity(value, DynamicViscosityUnit.MicropascalSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static DynamicViscosity FromMillipascalSeconds(double millipascalseconds) + public static DynamicViscosity FromMillipascalSeconds(double value) { - return new DynamicViscosity(millipascalseconds, DynamicViscosityUnit.MillipascalSecond); + return new DynamicViscosity(value, DynamicViscosityUnit.MillipascalSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static DynamicViscosity FromNewtonSecondsPerMeterSquared(double newtonsecondspermetersquared) + public static DynamicViscosity FromNewtonSecondsPerMeterSquared(double value) { - return new DynamicViscosity(newtonsecondspermetersquared, DynamicViscosityUnit.NewtonSecondPerMeterSquared); + return new DynamicViscosity(value, DynamicViscosityUnit.NewtonSecondPerMeterSquared); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static DynamicViscosity FromPascalSeconds(double pascalseconds) + public static DynamicViscosity FromPascalSeconds(double value) { - return new DynamicViscosity(pascalseconds, DynamicViscosityUnit.PascalSecond); + return new DynamicViscosity(value, DynamicViscosityUnit.PascalSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static DynamicViscosity FromPoise(double poise) + public static DynamicViscosity FromPoise(double value) { - return new DynamicViscosity(poise, DynamicViscosityUnit.Poise); + return new DynamicViscosity(value, DynamicViscosityUnit.Poise); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static DynamicViscosity FromPoundsForceSecondPerSquareFoot(double poundsforcesecondpersquarefoot) + public static DynamicViscosity FromPoundsForceSecondPerSquareFoot(double value) { - return new DynamicViscosity(poundsforcesecondpersquarefoot, DynamicViscosityUnit.PoundForceSecondPerSquareFoot); + return new DynamicViscosity(value, DynamicViscosityUnit.PoundForceSecondPerSquareFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static DynamicViscosity FromPoundsForceSecondPerSquareInch(double poundsforcesecondpersquareinch) + public static DynamicViscosity FromPoundsForceSecondPerSquareInch(double value) { - return new DynamicViscosity(poundsforcesecondpersquareinch, DynamicViscosityUnit.PoundForceSecondPerSquareInch); + return new DynamicViscosity(value, DynamicViscosityUnit.PoundForceSecondPerSquareInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static DynamicViscosity FromPoundsPerFootSecond(double poundsperfootsecond) + public static DynamicViscosity FromPoundsPerFootSecond(double value) { - return new DynamicViscosity(poundsperfootsecond, DynamicViscosityUnit.PoundPerFootSecond); + return new DynamicViscosity(value, DynamicViscosityUnit.PoundPerFootSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static DynamicViscosity FromReyns(double reyns) + public static DynamicViscosity FromReyns(double value) { - return new DynamicViscosity(reyns, DynamicViscosityUnit.Reyn); + return new DynamicViscosity(value, DynamicViscosityUnit.Reyn); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.g.cs index fd7f91d288..03b7123ae4 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.g.cs @@ -245,36 +245,36 @@ public static string GetAbbreviation(ElectricAdmittanceUnit unit, IFormatProvide /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricAdmittance FromMicrosiemens(double microsiemens) + public static ElectricAdmittance FromMicrosiemens(double value) { - return new ElectricAdmittance(microsiemens, ElectricAdmittanceUnit.Microsiemens); + return new ElectricAdmittance(value, ElectricAdmittanceUnit.Microsiemens); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricAdmittance FromMillisiemens(double millisiemens) + public static ElectricAdmittance FromMillisiemens(double value) { - return new ElectricAdmittance(millisiemens, ElectricAdmittanceUnit.Millisiemens); + return new ElectricAdmittance(value, ElectricAdmittanceUnit.Millisiemens); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricAdmittance FromNanosiemens(double nanosiemens) + public static ElectricAdmittance FromNanosiemens(double value) { - return new ElectricAdmittance(nanosiemens, ElectricAdmittanceUnit.Nanosiemens); + return new ElectricAdmittance(value, ElectricAdmittanceUnit.Nanosiemens); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricAdmittance FromSiemens(double siemens) + public static ElectricAdmittance FromSiemens(double value) { - return new ElectricAdmittance(siemens, ElectricAdmittanceUnit.Siemens); + return new ElectricAdmittance(value, ElectricAdmittanceUnit.Siemens); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCharge.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCharge.g.cs index dde56c8b82..e5c4251ad8 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCharge.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCharge.g.cs @@ -313,99 +313,99 @@ public static string GetAbbreviation(ElectricChargeUnit unit, IFormatProvider? p /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCharge FromAmpereHours(double amperehours) + public static ElectricCharge FromAmpereHours(double value) { - return new ElectricCharge(amperehours, ElectricChargeUnit.AmpereHour); + return new ElectricCharge(value, ElectricChargeUnit.AmpereHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCharge FromCoulombs(double coulombs) + public static ElectricCharge FromCoulombs(double value) { - return new ElectricCharge(coulombs, ElectricChargeUnit.Coulomb); + return new ElectricCharge(value, ElectricChargeUnit.Coulomb); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCharge FromKiloampereHours(double kiloamperehours) + public static ElectricCharge FromKiloampereHours(double value) { - return new ElectricCharge(kiloamperehours, ElectricChargeUnit.KiloampereHour); + return new ElectricCharge(value, ElectricChargeUnit.KiloampereHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCharge FromKilocoulombs(double kilocoulombs) + public static ElectricCharge FromKilocoulombs(double value) { - return new ElectricCharge(kilocoulombs, ElectricChargeUnit.Kilocoulomb); + return new ElectricCharge(value, ElectricChargeUnit.Kilocoulomb); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCharge FromMegaampereHours(double megaamperehours) + public static ElectricCharge FromMegaampereHours(double value) { - return new ElectricCharge(megaamperehours, ElectricChargeUnit.MegaampereHour); + return new ElectricCharge(value, ElectricChargeUnit.MegaampereHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCharge FromMegacoulombs(double megacoulombs) + public static ElectricCharge FromMegacoulombs(double value) { - return new ElectricCharge(megacoulombs, ElectricChargeUnit.Megacoulomb); + return new ElectricCharge(value, ElectricChargeUnit.Megacoulomb); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCharge FromMicrocoulombs(double microcoulombs) + public static ElectricCharge FromMicrocoulombs(double value) { - return new ElectricCharge(microcoulombs, ElectricChargeUnit.Microcoulomb); + return new ElectricCharge(value, ElectricChargeUnit.Microcoulomb); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCharge FromMilliampereHours(double milliamperehours) + public static ElectricCharge FromMilliampereHours(double value) { - return new ElectricCharge(milliamperehours, ElectricChargeUnit.MilliampereHour); + return new ElectricCharge(value, ElectricChargeUnit.MilliampereHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCharge FromMillicoulombs(double millicoulombs) + public static ElectricCharge FromMillicoulombs(double value) { - return new ElectricCharge(millicoulombs, ElectricChargeUnit.Millicoulomb); + return new ElectricCharge(value, ElectricChargeUnit.Millicoulomb); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCharge FromNanocoulombs(double nanocoulombs) + public static ElectricCharge FromNanocoulombs(double value) { - return new ElectricCharge(nanocoulombs, ElectricChargeUnit.Nanocoulomb); + return new ElectricCharge(value, ElectricChargeUnit.Nanocoulomb); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCharge FromPicocoulombs(double picocoulombs) + public static ElectricCharge FromPicocoulombs(double value) { - return new ElectricCharge(picocoulombs, ElectricChargeUnit.Picocoulomb); + return new ElectricCharge(value, ElectricChargeUnit.Picocoulomb); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.g.cs index 0b7f5315d8..5d91680e82 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.g.cs @@ -224,9 +224,9 @@ public static string GetAbbreviation(ElectricChargeDensityUnit unit, IFormatProv /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricChargeDensity FromCoulombsPerCubicMeter(double coulombspercubicmeter) + public static ElectricChargeDensity FromCoulombsPerCubicMeter(double value) { - return new ElectricChargeDensity(coulombspercubicmeter, ElectricChargeDensityUnit.CoulombPerCubicMeter); + return new ElectricChargeDensity(value, ElectricChargeDensityUnit.CoulombPerCubicMeter); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricConductance.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricConductance.g.cs index 7d3ecf9956..604f0d51f8 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricConductance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricConductance.g.cs @@ -256,45 +256,45 @@ public static string GetAbbreviation(ElectricConductanceUnit unit, IFormatProvid /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricConductance FromKilosiemens(double kilosiemens) + public static ElectricConductance FromKilosiemens(double value) { - return new ElectricConductance(kilosiemens, ElectricConductanceUnit.Kilosiemens); + return new ElectricConductance(value, ElectricConductanceUnit.Kilosiemens); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricConductance FromMicrosiemens(double microsiemens) + public static ElectricConductance FromMicrosiemens(double value) { - return new ElectricConductance(microsiemens, ElectricConductanceUnit.Microsiemens); + return new ElectricConductance(value, ElectricConductanceUnit.Microsiemens); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricConductance FromMillisiemens(double millisiemens) + public static ElectricConductance FromMillisiemens(double value) { - return new ElectricConductance(millisiemens, ElectricConductanceUnit.Millisiemens); + return new ElectricConductance(value, ElectricConductanceUnit.Millisiemens); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricConductance FromNanosiemens(double nanosiemens) + public static ElectricConductance FromNanosiemens(double value) { - return new ElectricConductance(nanosiemens, ElectricConductanceUnit.Nanosiemens); + return new ElectricConductance(value, ElectricConductanceUnit.Nanosiemens); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricConductance FromSiemens(double siemens) + public static ElectricConductance FromSiemens(double value) { - return new ElectricConductance(siemens, ElectricConductanceUnit.Siemens); + return new ElectricConductance(value, ElectricConductanceUnit.Siemens); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.g.cs index 778999e06a..3ce5967489 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.g.cs @@ -264,54 +264,54 @@ public static string GetAbbreviation(ElectricConductivityUnit unit, IFormatProvi /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricConductivity FromMicrosiemensPerCentimeter(double microsiemenspercentimeter) + public static ElectricConductivity FromMicrosiemensPerCentimeter(double value) { - return new ElectricConductivity(microsiemenspercentimeter, ElectricConductivityUnit.MicrosiemensPerCentimeter); + return new ElectricConductivity(value, ElectricConductivityUnit.MicrosiemensPerCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricConductivity FromMillisiemensPerCentimeter(double millisiemenspercentimeter) + public static ElectricConductivity FromMillisiemensPerCentimeter(double value) { - return new ElectricConductivity(millisiemenspercentimeter, ElectricConductivityUnit.MillisiemensPerCentimeter); + return new ElectricConductivity(value, ElectricConductivityUnit.MillisiemensPerCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricConductivity FromSiemensPerCentimeter(double siemenspercentimeter) + public static ElectricConductivity FromSiemensPerCentimeter(double value) { - return new ElectricConductivity(siemenspercentimeter, ElectricConductivityUnit.SiemensPerCentimeter); + return new ElectricConductivity(value, ElectricConductivityUnit.SiemensPerCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricConductivity FromSiemensPerFoot(double siemensperfoot) + public static ElectricConductivity FromSiemensPerFoot(double value) { - return new ElectricConductivity(siemensperfoot, ElectricConductivityUnit.SiemensPerFoot); + return new ElectricConductivity(value, ElectricConductivityUnit.SiemensPerFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricConductivity FromSiemensPerInch(double siemensperinch) + public static ElectricConductivity FromSiemensPerInch(double value) { - return new ElectricConductivity(siemensperinch, ElectricConductivityUnit.SiemensPerInch); + return new ElectricConductivity(value, ElectricConductivityUnit.SiemensPerInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricConductivity FromSiemensPerMeter(double siemenspermeter) + public static ElectricConductivity FromSiemensPerMeter(double value) { - return new ElectricConductivity(siemenspermeter, ElectricConductivityUnit.SiemensPerMeter); + return new ElectricConductivity(value, ElectricConductivityUnit.SiemensPerMeter); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.g.cs index d5760a8a01..abc2e5d080 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.g.cs @@ -296,81 +296,81 @@ public static string GetAbbreviation(ElectricCurrentUnit unit, IFormatProvider? /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCurrent FromAmperes(double amperes) + public static ElectricCurrent FromAmperes(double value) { - return new ElectricCurrent(amperes, ElectricCurrentUnit.Ampere); + return new ElectricCurrent(value, ElectricCurrentUnit.Ampere); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCurrent FromCentiamperes(double centiamperes) + public static ElectricCurrent FromCentiamperes(double value) { - return new ElectricCurrent(centiamperes, ElectricCurrentUnit.Centiampere); + return new ElectricCurrent(value, ElectricCurrentUnit.Centiampere); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCurrent FromFemtoamperes(double femtoamperes) + public static ElectricCurrent FromFemtoamperes(double value) { - return new ElectricCurrent(femtoamperes, ElectricCurrentUnit.Femtoampere); + return new ElectricCurrent(value, ElectricCurrentUnit.Femtoampere); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCurrent FromKiloamperes(double kiloamperes) + public static ElectricCurrent FromKiloamperes(double value) { - return new ElectricCurrent(kiloamperes, ElectricCurrentUnit.Kiloampere); + return new ElectricCurrent(value, ElectricCurrentUnit.Kiloampere); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCurrent FromMegaamperes(double megaamperes) + public static ElectricCurrent FromMegaamperes(double value) { - return new ElectricCurrent(megaamperes, ElectricCurrentUnit.Megaampere); + return new ElectricCurrent(value, ElectricCurrentUnit.Megaampere); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCurrent FromMicroamperes(double microamperes) + public static ElectricCurrent FromMicroamperes(double value) { - return new ElectricCurrent(microamperes, ElectricCurrentUnit.Microampere); + return new ElectricCurrent(value, ElectricCurrentUnit.Microampere); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCurrent FromMilliamperes(double milliamperes) + public static ElectricCurrent FromMilliamperes(double value) { - return new ElectricCurrent(milliamperes, ElectricCurrentUnit.Milliampere); + return new ElectricCurrent(value, ElectricCurrentUnit.Milliampere); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCurrent FromNanoamperes(double nanoamperes) + public static ElectricCurrent FromNanoamperes(double value) { - return new ElectricCurrent(nanoamperes, ElectricCurrentUnit.Nanoampere); + return new ElectricCurrent(value, ElectricCurrentUnit.Nanoampere); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCurrent FromPicoamperes(double picoamperes) + public static ElectricCurrent FromPicoamperes(double value) { - return new ElectricCurrent(picoamperes, ElectricCurrentUnit.Picoampere); + return new ElectricCurrent(value, ElectricCurrentUnit.Picoampere); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.g.cs index 5f0f5f3ebe..ba7c9b30f2 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.g.cs @@ -240,27 +240,27 @@ public static string GetAbbreviation(ElectricCurrentDensityUnit unit, IFormatPro /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCurrentDensity FromAmperesPerSquareFoot(double amperespersquarefoot) + public static ElectricCurrentDensity FromAmperesPerSquareFoot(double value) { - return new ElectricCurrentDensity(amperespersquarefoot, ElectricCurrentDensityUnit.AmperePerSquareFoot); + return new ElectricCurrentDensity(value, ElectricCurrentDensityUnit.AmperePerSquareFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCurrentDensity FromAmperesPerSquareInch(double amperespersquareinch) + public static ElectricCurrentDensity FromAmperesPerSquareInch(double value) { - return new ElectricCurrentDensity(amperespersquareinch, ElectricCurrentDensityUnit.AmperePerSquareInch); + return new ElectricCurrentDensity(value, ElectricCurrentDensityUnit.AmperePerSquareInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCurrentDensity FromAmperesPerSquareMeter(double amperespersquaremeter) + public static ElectricCurrentDensity FromAmperesPerSquareMeter(double value) { - return new ElectricCurrentDensity(amperespersquaremeter, ElectricCurrentDensityUnit.AmperePerSquareMeter); + return new ElectricCurrentDensity(value, ElectricCurrentDensityUnit.AmperePerSquareMeter); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.g.cs index a0715fa4e7..ee47836741 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.g.cs @@ -276,63 +276,63 @@ public static string GetAbbreviation(ElectricCurrentGradientUnit unit, IFormatPr /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCurrentGradient FromAmperesPerMicrosecond(double amperespermicrosecond) + public static ElectricCurrentGradient FromAmperesPerMicrosecond(double value) { - return new ElectricCurrentGradient(amperespermicrosecond, ElectricCurrentGradientUnit.AmperePerMicrosecond); + return new ElectricCurrentGradient(value, ElectricCurrentGradientUnit.AmperePerMicrosecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCurrentGradient FromAmperesPerMillisecond(double amperespermillisecond) + public static ElectricCurrentGradient FromAmperesPerMillisecond(double value) { - return new ElectricCurrentGradient(amperespermillisecond, ElectricCurrentGradientUnit.AmperePerMillisecond); + return new ElectricCurrentGradient(value, ElectricCurrentGradientUnit.AmperePerMillisecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCurrentGradient FromAmperesPerMinute(double amperesperminute) + public static ElectricCurrentGradient FromAmperesPerMinute(double value) { - return new ElectricCurrentGradient(amperesperminute, ElectricCurrentGradientUnit.AmperePerMinute); + return new ElectricCurrentGradient(value, ElectricCurrentGradientUnit.AmperePerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCurrentGradient FromAmperesPerNanosecond(double amperespernanosecond) + public static ElectricCurrentGradient FromAmperesPerNanosecond(double value) { - return new ElectricCurrentGradient(amperespernanosecond, ElectricCurrentGradientUnit.AmperePerNanosecond); + return new ElectricCurrentGradient(value, ElectricCurrentGradientUnit.AmperePerNanosecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCurrentGradient FromAmperesPerSecond(double amperespersecond) + public static ElectricCurrentGradient FromAmperesPerSecond(double value) { - return new ElectricCurrentGradient(amperespersecond, ElectricCurrentGradientUnit.AmperePerSecond); + return new ElectricCurrentGradient(value, ElectricCurrentGradientUnit.AmperePerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCurrentGradient FromMilliamperesPerMinute(double milliamperesperminute) + public static ElectricCurrentGradient FromMilliamperesPerMinute(double value) { - return new ElectricCurrentGradient(milliamperesperminute, ElectricCurrentGradientUnit.MilliamperePerMinute); + return new ElectricCurrentGradient(value, ElectricCurrentGradientUnit.MilliamperePerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricCurrentGradient FromMilliamperesPerSecond(double milliamperespersecond) + public static ElectricCurrentGradient FromMilliamperesPerSecond(double value) { - return new ElectricCurrentGradient(milliamperespersecond, ElectricCurrentGradientUnit.MilliamperePerSecond); + return new ElectricCurrentGradient(value, ElectricCurrentGradientUnit.MilliamperePerSecond); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricField.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricField.g.cs index 1d73e8c481..bc2c96547d 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricField.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricField.g.cs @@ -224,9 +224,9 @@ public static string GetAbbreviation(ElectricFieldUnit unit, IFormatProvider? pr /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricField FromVoltsPerMeter(double voltspermeter) + public static ElectricField FromVoltsPerMeter(double value) { - return new ElectricField(voltspermeter, ElectricFieldUnit.VoltPerMeter); + return new ElectricField(value, ElectricFieldUnit.VoltPerMeter); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricInductance.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricInductance.g.cs index cef87cde96..8e9965dfd1 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricInductance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricInductance.g.cs @@ -256,45 +256,45 @@ public static string GetAbbreviation(ElectricInductanceUnit unit, IFormatProvide /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricInductance FromHenries(double henries) + public static ElectricInductance FromHenries(double value) { - return new ElectricInductance(henries, ElectricInductanceUnit.Henry); + return new ElectricInductance(value, ElectricInductanceUnit.Henry); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricInductance FromMicrohenries(double microhenries) + public static ElectricInductance FromMicrohenries(double value) { - return new ElectricInductance(microhenries, ElectricInductanceUnit.Microhenry); + return new ElectricInductance(value, ElectricInductanceUnit.Microhenry); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricInductance FromMillihenries(double millihenries) + public static ElectricInductance FromMillihenries(double value) { - return new ElectricInductance(millihenries, ElectricInductanceUnit.Millihenry); + return new ElectricInductance(value, ElectricInductanceUnit.Millihenry); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricInductance FromNanohenries(double nanohenries) + public static ElectricInductance FromNanohenries(double value) { - return new ElectricInductance(nanohenries, ElectricInductanceUnit.Nanohenry); + return new ElectricInductance(value, ElectricInductanceUnit.Nanohenry); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricInductance FromPicohenries(double picohenries) + public static ElectricInductance FromPicohenries(double value) { - return new ElectricInductance(picohenries, ElectricInductanceUnit.Picohenry); + return new ElectricInductance(value, ElectricInductanceUnit.Picohenry); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotential.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotential.g.cs index 0fd783a39a..4a7d20dedf 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotential.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotential.g.cs @@ -270,54 +270,54 @@ public static string GetAbbreviation(ElectricPotentialUnit unit, IFormatProvider /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotential FromKilovolts(double kilovolts) + public static ElectricPotential FromKilovolts(double value) { - return new ElectricPotential(kilovolts, ElectricPotentialUnit.Kilovolt); + return new ElectricPotential(value, ElectricPotentialUnit.Kilovolt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotential FromMegavolts(double megavolts) + public static ElectricPotential FromMegavolts(double value) { - return new ElectricPotential(megavolts, ElectricPotentialUnit.Megavolt); + return new ElectricPotential(value, ElectricPotentialUnit.Megavolt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotential FromMicrovolts(double microvolts) + public static ElectricPotential FromMicrovolts(double value) { - return new ElectricPotential(microvolts, ElectricPotentialUnit.Microvolt); + return new ElectricPotential(value, ElectricPotentialUnit.Microvolt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotential FromMillivolts(double millivolts) + public static ElectricPotential FromMillivolts(double value) { - return new ElectricPotential(millivolts, ElectricPotentialUnit.Millivolt); + return new ElectricPotential(value, ElectricPotentialUnit.Millivolt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotential FromNanovolts(double nanovolts) + public static ElectricPotential FromNanovolts(double value) { - return new ElectricPotential(nanovolts, ElectricPotentialUnit.Nanovolt); + return new ElectricPotential(value, ElectricPotentialUnit.Nanovolt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotential FromVolts(double volts) + public static ElectricPotential FromVolts(double value) { - return new ElectricPotential(volts, ElectricPotentialUnit.Volt); + return new ElectricPotential(value, ElectricPotentialUnit.Volt); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.g.cs index 529a67a34c..fd93ea730f 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.g.cs @@ -253,45 +253,45 @@ public static string GetAbbreviation(ElectricPotentialAcUnit unit, IFormatProvid /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialAc FromKilovoltsAc(double kilovoltsac) + public static ElectricPotentialAc FromKilovoltsAc(double value) { - return new ElectricPotentialAc(kilovoltsac, ElectricPotentialAcUnit.KilovoltAc); + return new ElectricPotentialAc(value, ElectricPotentialAcUnit.KilovoltAc); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialAc FromMegavoltsAc(double megavoltsac) + public static ElectricPotentialAc FromMegavoltsAc(double value) { - return new ElectricPotentialAc(megavoltsac, ElectricPotentialAcUnit.MegavoltAc); + return new ElectricPotentialAc(value, ElectricPotentialAcUnit.MegavoltAc); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialAc FromMicrovoltsAc(double microvoltsac) + public static ElectricPotentialAc FromMicrovoltsAc(double value) { - return new ElectricPotentialAc(microvoltsac, ElectricPotentialAcUnit.MicrovoltAc); + return new ElectricPotentialAc(value, ElectricPotentialAcUnit.MicrovoltAc); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialAc FromMillivoltsAc(double millivoltsac) + public static ElectricPotentialAc FromMillivoltsAc(double value) { - return new ElectricPotentialAc(millivoltsac, ElectricPotentialAcUnit.MillivoltAc); + return new ElectricPotentialAc(value, ElectricPotentialAcUnit.MillivoltAc); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialAc FromVoltsAc(double voltsac) + public static ElectricPotentialAc FromVoltsAc(double value) { - return new ElectricPotentialAc(voltsac, ElectricPotentialAcUnit.VoltAc); + return new ElectricPotentialAc(value, ElectricPotentialAcUnit.VoltAc); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialChangeRate.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialChangeRate.g.cs index 876ccd5ebf..b6784e0d4f 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialChangeRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialChangeRate.g.cs @@ -373,180 +373,180 @@ public static string GetAbbreviation(ElectricPotentialChangeRateUnit unit, IForm /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialChangeRate FromKilovoltsPerHour(double kilovoltsperhour) + public static ElectricPotentialChangeRate FromKilovoltsPerHour(double value) { - return new ElectricPotentialChangeRate(kilovoltsperhour, ElectricPotentialChangeRateUnit.KilovoltPerHour); + return new ElectricPotentialChangeRate(value, ElectricPotentialChangeRateUnit.KilovoltPerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialChangeRate FromKilovoltsPerMicrosecond(double kilovoltspermicrosecond) + public static ElectricPotentialChangeRate FromKilovoltsPerMicrosecond(double value) { - return new ElectricPotentialChangeRate(kilovoltspermicrosecond, ElectricPotentialChangeRateUnit.KilovoltPerMicrosecond); + return new ElectricPotentialChangeRate(value, ElectricPotentialChangeRateUnit.KilovoltPerMicrosecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialChangeRate FromKilovoltsPerMinute(double kilovoltsperminute) + public static ElectricPotentialChangeRate FromKilovoltsPerMinute(double value) { - return new ElectricPotentialChangeRate(kilovoltsperminute, ElectricPotentialChangeRateUnit.KilovoltPerMinute); + return new ElectricPotentialChangeRate(value, ElectricPotentialChangeRateUnit.KilovoltPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialChangeRate FromKilovoltsPerSecond(double kilovoltspersecond) + public static ElectricPotentialChangeRate FromKilovoltsPerSecond(double value) { - return new ElectricPotentialChangeRate(kilovoltspersecond, ElectricPotentialChangeRateUnit.KilovoltPerSecond); + return new ElectricPotentialChangeRate(value, ElectricPotentialChangeRateUnit.KilovoltPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialChangeRate FromMegavoltsPerHour(double megavoltsperhour) + public static ElectricPotentialChangeRate FromMegavoltsPerHour(double value) { - return new ElectricPotentialChangeRate(megavoltsperhour, ElectricPotentialChangeRateUnit.MegavoltPerHour); + return new ElectricPotentialChangeRate(value, ElectricPotentialChangeRateUnit.MegavoltPerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialChangeRate FromMegavoltsPerMicrosecond(double megavoltspermicrosecond) + public static ElectricPotentialChangeRate FromMegavoltsPerMicrosecond(double value) { - return new ElectricPotentialChangeRate(megavoltspermicrosecond, ElectricPotentialChangeRateUnit.MegavoltPerMicrosecond); + return new ElectricPotentialChangeRate(value, ElectricPotentialChangeRateUnit.MegavoltPerMicrosecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialChangeRate FromMegavoltsPerMinute(double megavoltsperminute) + public static ElectricPotentialChangeRate FromMegavoltsPerMinute(double value) { - return new ElectricPotentialChangeRate(megavoltsperminute, ElectricPotentialChangeRateUnit.MegavoltPerMinute); + return new ElectricPotentialChangeRate(value, ElectricPotentialChangeRateUnit.MegavoltPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialChangeRate FromMegavoltsPerSecond(double megavoltspersecond) + public static ElectricPotentialChangeRate FromMegavoltsPerSecond(double value) { - return new ElectricPotentialChangeRate(megavoltspersecond, ElectricPotentialChangeRateUnit.MegavoltPerSecond); + return new ElectricPotentialChangeRate(value, ElectricPotentialChangeRateUnit.MegavoltPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialChangeRate FromMicrovoltsPerHour(double microvoltsperhour) + public static ElectricPotentialChangeRate FromMicrovoltsPerHour(double value) { - return new ElectricPotentialChangeRate(microvoltsperhour, ElectricPotentialChangeRateUnit.MicrovoltPerHour); + return new ElectricPotentialChangeRate(value, ElectricPotentialChangeRateUnit.MicrovoltPerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialChangeRate FromMicrovoltsPerMicrosecond(double microvoltspermicrosecond) + public static ElectricPotentialChangeRate FromMicrovoltsPerMicrosecond(double value) { - return new ElectricPotentialChangeRate(microvoltspermicrosecond, ElectricPotentialChangeRateUnit.MicrovoltPerMicrosecond); + return new ElectricPotentialChangeRate(value, ElectricPotentialChangeRateUnit.MicrovoltPerMicrosecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialChangeRate FromMicrovoltsPerMinute(double microvoltsperminute) + public static ElectricPotentialChangeRate FromMicrovoltsPerMinute(double value) { - return new ElectricPotentialChangeRate(microvoltsperminute, ElectricPotentialChangeRateUnit.MicrovoltPerMinute); + return new ElectricPotentialChangeRate(value, ElectricPotentialChangeRateUnit.MicrovoltPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialChangeRate FromMicrovoltsPerSecond(double microvoltspersecond) + public static ElectricPotentialChangeRate FromMicrovoltsPerSecond(double value) { - return new ElectricPotentialChangeRate(microvoltspersecond, ElectricPotentialChangeRateUnit.MicrovoltPerSecond); + return new ElectricPotentialChangeRate(value, ElectricPotentialChangeRateUnit.MicrovoltPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialChangeRate FromMillivoltsPerHour(double millivoltsperhour) + public static ElectricPotentialChangeRate FromMillivoltsPerHour(double value) { - return new ElectricPotentialChangeRate(millivoltsperhour, ElectricPotentialChangeRateUnit.MillivoltPerHour); + return new ElectricPotentialChangeRate(value, ElectricPotentialChangeRateUnit.MillivoltPerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialChangeRate FromMillivoltsPerMicrosecond(double millivoltspermicrosecond) + public static ElectricPotentialChangeRate FromMillivoltsPerMicrosecond(double value) { - return new ElectricPotentialChangeRate(millivoltspermicrosecond, ElectricPotentialChangeRateUnit.MillivoltPerMicrosecond); + return new ElectricPotentialChangeRate(value, ElectricPotentialChangeRateUnit.MillivoltPerMicrosecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialChangeRate FromMillivoltsPerMinute(double millivoltsperminute) + public static ElectricPotentialChangeRate FromMillivoltsPerMinute(double value) { - return new ElectricPotentialChangeRate(millivoltsperminute, ElectricPotentialChangeRateUnit.MillivoltPerMinute); + return new ElectricPotentialChangeRate(value, ElectricPotentialChangeRateUnit.MillivoltPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialChangeRate FromMillivoltsPerSecond(double millivoltspersecond) + public static ElectricPotentialChangeRate FromMillivoltsPerSecond(double value) { - return new ElectricPotentialChangeRate(millivoltspersecond, ElectricPotentialChangeRateUnit.MillivoltPerSecond); + return new ElectricPotentialChangeRate(value, ElectricPotentialChangeRateUnit.MillivoltPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialChangeRate FromVoltsPerHour(double voltsperhour) + public static ElectricPotentialChangeRate FromVoltsPerHour(double value) { - return new ElectricPotentialChangeRate(voltsperhour, ElectricPotentialChangeRateUnit.VoltPerHour); + return new ElectricPotentialChangeRate(value, ElectricPotentialChangeRateUnit.VoltPerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialChangeRate FromVoltsPerMicrosecond(double voltspermicrosecond) + public static ElectricPotentialChangeRate FromVoltsPerMicrosecond(double value) { - return new ElectricPotentialChangeRate(voltspermicrosecond, ElectricPotentialChangeRateUnit.VoltPerMicrosecond); + return new ElectricPotentialChangeRate(value, ElectricPotentialChangeRateUnit.VoltPerMicrosecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialChangeRate FromVoltsPerMinute(double voltsperminute) + public static ElectricPotentialChangeRate FromVoltsPerMinute(double value) { - return new ElectricPotentialChangeRate(voltsperminute, ElectricPotentialChangeRateUnit.VoltPerMinute); + return new ElectricPotentialChangeRate(value, ElectricPotentialChangeRateUnit.VoltPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialChangeRate FromVoltsPerSecond(double voltspersecond) + public static ElectricPotentialChangeRate FromVoltsPerSecond(double value) { - return new ElectricPotentialChangeRate(voltspersecond, ElectricPotentialChangeRateUnit.VoltPerSecond); + return new ElectricPotentialChangeRate(value, ElectricPotentialChangeRateUnit.VoltPerSecond); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.g.cs index 63f8ddc2e6..c587100854 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.g.cs @@ -253,45 +253,45 @@ public static string GetAbbreviation(ElectricPotentialDcUnit unit, IFormatProvid /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialDc FromKilovoltsDc(double kilovoltsdc) + public static ElectricPotentialDc FromKilovoltsDc(double value) { - return new ElectricPotentialDc(kilovoltsdc, ElectricPotentialDcUnit.KilovoltDc); + return new ElectricPotentialDc(value, ElectricPotentialDcUnit.KilovoltDc); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialDc FromMegavoltsDc(double megavoltsdc) + public static ElectricPotentialDc FromMegavoltsDc(double value) { - return new ElectricPotentialDc(megavoltsdc, ElectricPotentialDcUnit.MegavoltDc); + return new ElectricPotentialDc(value, ElectricPotentialDcUnit.MegavoltDc); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialDc FromMicrovoltsDc(double microvoltsdc) + public static ElectricPotentialDc FromMicrovoltsDc(double value) { - return new ElectricPotentialDc(microvoltsdc, ElectricPotentialDcUnit.MicrovoltDc); + return new ElectricPotentialDc(value, ElectricPotentialDcUnit.MicrovoltDc); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialDc FromMillivoltsDc(double millivoltsdc) + public static ElectricPotentialDc FromMillivoltsDc(double value) { - return new ElectricPotentialDc(millivoltsdc, ElectricPotentialDcUnit.MillivoltDc); + return new ElectricPotentialDc(value, ElectricPotentialDcUnit.MillivoltDc); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricPotentialDc FromVoltsDc(double voltsdc) + public static ElectricPotentialDc FromVoltsDc(double value) { - return new ElectricPotentialDc(voltsdc, ElectricPotentialDcUnit.VoltDc); + return new ElectricPotentialDc(value, ElectricPotentialDcUnit.VoltDc); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricResistance.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricResistance.g.cs index ea9498d3a8..1773329f76 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricResistance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricResistance.g.cs @@ -275,63 +275,63 @@ public static string GetAbbreviation(ElectricResistanceUnit unit, IFormatProvide /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricResistance FromGigaohms(double gigaohms) + public static ElectricResistance FromGigaohms(double value) { - return new ElectricResistance(gigaohms, ElectricResistanceUnit.Gigaohm); + return new ElectricResistance(value, ElectricResistanceUnit.Gigaohm); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricResistance FromKiloohms(double kiloohms) + public static ElectricResistance FromKiloohms(double value) { - return new ElectricResistance(kiloohms, ElectricResistanceUnit.Kiloohm); + return new ElectricResistance(value, ElectricResistanceUnit.Kiloohm); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricResistance FromMegaohms(double megaohms) + public static ElectricResistance FromMegaohms(double value) { - return new ElectricResistance(megaohms, ElectricResistanceUnit.Megaohm); + return new ElectricResistance(value, ElectricResistanceUnit.Megaohm); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricResistance FromMicroohms(double microohms) + public static ElectricResistance FromMicroohms(double value) { - return new ElectricResistance(microohms, ElectricResistanceUnit.Microohm); + return new ElectricResistance(value, ElectricResistanceUnit.Microohm); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricResistance FromMilliohms(double milliohms) + public static ElectricResistance FromMilliohms(double value) { - return new ElectricResistance(milliohms, ElectricResistanceUnit.Milliohm); + return new ElectricResistance(value, ElectricResistanceUnit.Milliohm); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricResistance FromOhms(double ohms) + public static ElectricResistance FromOhms(double value) { - return new ElectricResistance(ohms, ElectricResistanceUnit.Ohm); + return new ElectricResistance(value, ElectricResistanceUnit.Ohm); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricResistance FromTeraohms(double teraohms) + public static ElectricResistance FromTeraohms(double value) { - return new ElectricResistance(teraohms, ElectricResistanceUnit.Teraohm); + return new ElectricResistance(value, ElectricResistanceUnit.Teraohm); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.g.cs index 8e569cbc49..600264c115 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.g.cs @@ -328,126 +328,126 @@ public static string GetAbbreviation(ElectricResistivityUnit unit, IFormatProvid /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricResistivity FromKiloohmsCentimeter(double kiloohmscentimeter) + public static ElectricResistivity FromKiloohmsCentimeter(double value) { - return new ElectricResistivity(kiloohmscentimeter, ElectricResistivityUnit.KiloohmCentimeter); + return new ElectricResistivity(value, ElectricResistivityUnit.KiloohmCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricResistivity FromKiloohmMeters(double kiloohmmeters) + public static ElectricResistivity FromKiloohmMeters(double value) { - return new ElectricResistivity(kiloohmmeters, ElectricResistivityUnit.KiloohmMeter); + return new ElectricResistivity(value, ElectricResistivityUnit.KiloohmMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricResistivity FromMegaohmsCentimeter(double megaohmscentimeter) + public static ElectricResistivity FromMegaohmsCentimeter(double value) { - return new ElectricResistivity(megaohmscentimeter, ElectricResistivityUnit.MegaohmCentimeter); + return new ElectricResistivity(value, ElectricResistivityUnit.MegaohmCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricResistivity FromMegaohmMeters(double megaohmmeters) + public static ElectricResistivity FromMegaohmMeters(double value) { - return new ElectricResistivity(megaohmmeters, ElectricResistivityUnit.MegaohmMeter); + return new ElectricResistivity(value, ElectricResistivityUnit.MegaohmMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricResistivity FromMicroohmsCentimeter(double microohmscentimeter) + public static ElectricResistivity FromMicroohmsCentimeter(double value) { - return new ElectricResistivity(microohmscentimeter, ElectricResistivityUnit.MicroohmCentimeter); + return new ElectricResistivity(value, ElectricResistivityUnit.MicroohmCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricResistivity FromMicroohmMeters(double microohmmeters) + public static ElectricResistivity FromMicroohmMeters(double value) { - return new ElectricResistivity(microohmmeters, ElectricResistivityUnit.MicroohmMeter); + return new ElectricResistivity(value, ElectricResistivityUnit.MicroohmMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricResistivity FromMilliohmsCentimeter(double milliohmscentimeter) + public static ElectricResistivity FromMilliohmsCentimeter(double value) { - return new ElectricResistivity(milliohmscentimeter, ElectricResistivityUnit.MilliohmCentimeter); + return new ElectricResistivity(value, ElectricResistivityUnit.MilliohmCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricResistivity FromMilliohmMeters(double milliohmmeters) + public static ElectricResistivity FromMilliohmMeters(double value) { - return new ElectricResistivity(milliohmmeters, ElectricResistivityUnit.MilliohmMeter); + return new ElectricResistivity(value, ElectricResistivityUnit.MilliohmMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricResistivity FromNanoohmsCentimeter(double nanoohmscentimeter) + public static ElectricResistivity FromNanoohmsCentimeter(double value) { - return new ElectricResistivity(nanoohmscentimeter, ElectricResistivityUnit.NanoohmCentimeter); + return new ElectricResistivity(value, ElectricResistivityUnit.NanoohmCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricResistivity FromNanoohmMeters(double nanoohmmeters) + public static ElectricResistivity FromNanoohmMeters(double value) { - return new ElectricResistivity(nanoohmmeters, ElectricResistivityUnit.NanoohmMeter); + return new ElectricResistivity(value, ElectricResistivityUnit.NanoohmMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricResistivity FromOhmsCentimeter(double ohmscentimeter) + public static ElectricResistivity FromOhmsCentimeter(double value) { - return new ElectricResistivity(ohmscentimeter, ElectricResistivityUnit.OhmCentimeter); + return new ElectricResistivity(value, ElectricResistivityUnit.OhmCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricResistivity FromOhmMeters(double ohmmeters) + public static ElectricResistivity FromOhmMeters(double value) { - return new ElectricResistivity(ohmmeters, ElectricResistivityUnit.OhmMeter); + return new ElectricResistivity(value, ElectricResistivityUnit.OhmMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricResistivity FromPicoohmsCentimeter(double picoohmscentimeter) + public static ElectricResistivity FromPicoohmsCentimeter(double value) { - return new ElectricResistivity(picoohmscentimeter, ElectricResistivityUnit.PicoohmCentimeter); + return new ElectricResistivity(value, ElectricResistivityUnit.PicoohmCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricResistivity FromPicoohmMeters(double picoohmmeters) + public static ElectricResistivity FromPicoohmMeters(double value) { - return new ElectricResistivity(picoohmmeters, ElectricResistivityUnit.PicoohmMeter); + return new ElectricResistivity(value, ElectricResistivityUnit.PicoohmMeter); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricSurfaceChargeDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricSurfaceChargeDensity.g.cs index 0100afc14f..5e34876016 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricSurfaceChargeDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricSurfaceChargeDensity.g.cs @@ -240,27 +240,27 @@ public static string GetAbbreviation(ElectricSurfaceChargeDensityUnit unit, IFor /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricSurfaceChargeDensity FromCoulombsPerSquareCentimeter(double coulombspersquarecentimeter) + public static ElectricSurfaceChargeDensity FromCoulombsPerSquareCentimeter(double value) { - return new ElectricSurfaceChargeDensity(coulombspersquarecentimeter, ElectricSurfaceChargeDensityUnit.CoulombPerSquareCentimeter); + return new ElectricSurfaceChargeDensity(value, ElectricSurfaceChargeDensityUnit.CoulombPerSquareCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricSurfaceChargeDensity FromCoulombsPerSquareInch(double coulombspersquareinch) + public static ElectricSurfaceChargeDensity FromCoulombsPerSquareInch(double value) { - return new ElectricSurfaceChargeDensity(coulombspersquareinch, ElectricSurfaceChargeDensityUnit.CoulombPerSquareInch); + return new ElectricSurfaceChargeDensity(value, ElectricSurfaceChargeDensityUnit.CoulombPerSquareInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ElectricSurfaceChargeDensity FromCoulombsPerSquareMeter(double coulombspersquaremeter) + public static ElectricSurfaceChargeDensity FromCoulombsPerSquareMeter(double value) { - return new ElectricSurfaceChargeDensity(coulombspersquaremeter, ElectricSurfaceChargeDensityUnit.CoulombPerSquareMeter); + return new ElectricSurfaceChargeDensity(value, ElectricSurfaceChargeDensityUnit.CoulombPerSquareMeter); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Energy.g.cs b/UnitsNet/GeneratedCode/Quantities/Energy.g.cs index b0dc36db32..398081c271 100644 --- a/UnitsNet/GeneratedCode/Quantities/Energy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Energy.g.cs @@ -548,360 +548,360 @@ public static string GetAbbreviation(EnergyUnit unit, IFormatProvider? provider) /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromBritishThermalUnits(double britishthermalunits) + public static Energy FromBritishThermalUnits(double value) { - return new Energy(britishthermalunits, EnergyUnit.BritishThermalUnit); + return new Energy(value, EnergyUnit.BritishThermalUnit); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromCalories(double calories) + public static Energy FromCalories(double value) { - return new Energy(calories, EnergyUnit.Calorie); + return new Energy(value, EnergyUnit.Calorie); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromDecathermsEc(double decathermsec) + public static Energy FromDecathermsEc(double value) { - return new Energy(decathermsec, EnergyUnit.DecathermEc); + return new Energy(value, EnergyUnit.DecathermEc); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromDecathermsImperial(double decathermsimperial) + public static Energy FromDecathermsImperial(double value) { - return new Energy(decathermsimperial, EnergyUnit.DecathermImperial); + return new Energy(value, EnergyUnit.DecathermImperial); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromDecathermsUs(double decathermsus) + public static Energy FromDecathermsUs(double value) { - return new Energy(decathermsus, EnergyUnit.DecathermUs); + return new Energy(value, EnergyUnit.DecathermUs); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromElectronVolts(double electronvolts) + public static Energy FromElectronVolts(double value) { - return new Energy(electronvolts, EnergyUnit.ElectronVolt); + return new Energy(value, EnergyUnit.ElectronVolt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromErgs(double ergs) + public static Energy FromErgs(double value) { - return new Energy(ergs, EnergyUnit.Erg); + return new Energy(value, EnergyUnit.Erg); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromFootPounds(double footpounds) + public static Energy FromFootPounds(double value) { - return new Energy(footpounds, EnergyUnit.FootPound); + return new Energy(value, EnergyUnit.FootPound); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromGigabritishThermalUnits(double gigabritishthermalunits) + public static Energy FromGigabritishThermalUnits(double value) { - return new Energy(gigabritishthermalunits, EnergyUnit.GigabritishThermalUnit); + return new Energy(value, EnergyUnit.GigabritishThermalUnit); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromGigaelectronVolts(double gigaelectronvolts) + public static Energy FromGigaelectronVolts(double value) { - return new Energy(gigaelectronvolts, EnergyUnit.GigaelectronVolt); + return new Energy(value, EnergyUnit.GigaelectronVolt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromGigajoules(double gigajoules) + public static Energy FromGigajoules(double value) { - return new Energy(gigajoules, EnergyUnit.Gigajoule); + return new Energy(value, EnergyUnit.Gigajoule); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromGigawattDays(double gigawattdays) + public static Energy FromGigawattDays(double value) { - return new Energy(gigawattdays, EnergyUnit.GigawattDay); + return new Energy(value, EnergyUnit.GigawattDay); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromGigawattHours(double gigawatthours) + public static Energy FromGigawattHours(double value) { - return new Energy(gigawatthours, EnergyUnit.GigawattHour); + return new Energy(value, EnergyUnit.GigawattHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromHorsepowerHours(double horsepowerhours) + public static Energy FromHorsepowerHours(double value) { - return new Energy(horsepowerhours, EnergyUnit.HorsepowerHour); + return new Energy(value, EnergyUnit.HorsepowerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromJoules(double joules) + public static Energy FromJoules(double value) { - return new Energy(joules, EnergyUnit.Joule); + return new Energy(value, EnergyUnit.Joule); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromKilobritishThermalUnits(double kilobritishthermalunits) + public static Energy FromKilobritishThermalUnits(double value) { - return new Energy(kilobritishthermalunits, EnergyUnit.KilobritishThermalUnit); + return new Energy(value, EnergyUnit.KilobritishThermalUnit); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromKilocalories(double kilocalories) + public static Energy FromKilocalories(double value) { - return new Energy(kilocalories, EnergyUnit.Kilocalorie); + return new Energy(value, EnergyUnit.Kilocalorie); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromKiloelectronVolts(double kiloelectronvolts) + public static Energy FromKiloelectronVolts(double value) { - return new Energy(kiloelectronvolts, EnergyUnit.KiloelectronVolt); + return new Energy(value, EnergyUnit.KiloelectronVolt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromKilojoules(double kilojoules) + public static Energy FromKilojoules(double value) { - return new Energy(kilojoules, EnergyUnit.Kilojoule); + return new Energy(value, EnergyUnit.Kilojoule); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromKilowattDays(double kilowattdays) + public static Energy FromKilowattDays(double value) { - return new Energy(kilowattdays, EnergyUnit.KilowattDay); + return new Energy(value, EnergyUnit.KilowattDay); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromKilowattHours(double kilowatthours) + public static Energy FromKilowattHours(double value) { - return new Energy(kilowatthours, EnergyUnit.KilowattHour); + return new Energy(value, EnergyUnit.KilowattHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromMegabritishThermalUnits(double megabritishthermalunits) + public static Energy FromMegabritishThermalUnits(double value) { - return new Energy(megabritishthermalunits, EnergyUnit.MegabritishThermalUnit); + return new Energy(value, EnergyUnit.MegabritishThermalUnit); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromMegacalories(double megacalories) + public static Energy FromMegacalories(double value) { - return new Energy(megacalories, EnergyUnit.Megacalorie); + return new Energy(value, EnergyUnit.Megacalorie); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromMegaelectronVolts(double megaelectronvolts) + public static Energy FromMegaelectronVolts(double value) { - return new Energy(megaelectronvolts, EnergyUnit.MegaelectronVolt); + return new Energy(value, EnergyUnit.MegaelectronVolt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromMegajoules(double megajoules) + public static Energy FromMegajoules(double value) { - return new Energy(megajoules, EnergyUnit.Megajoule); + return new Energy(value, EnergyUnit.Megajoule); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromMegawattDays(double megawattdays) + public static Energy FromMegawattDays(double value) { - return new Energy(megawattdays, EnergyUnit.MegawattDay); + return new Energy(value, EnergyUnit.MegawattDay); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromMegawattHours(double megawatthours) + public static Energy FromMegawattHours(double value) { - return new Energy(megawatthours, EnergyUnit.MegawattHour); + return new Energy(value, EnergyUnit.MegawattHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromMicrojoules(double microjoules) + public static Energy FromMicrojoules(double value) { - return new Energy(microjoules, EnergyUnit.Microjoule); + return new Energy(value, EnergyUnit.Microjoule); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromMillijoules(double millijoules) + public static Energy FromMillijoules(double value) { - return new Energy(millijoules, EnergyUnit.Millijoule); + return new Energy(value, EnergyUnit.Millijoule); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromNanojoules(double nanojoules) + public static Energy FromNanojoules(double value) { - return new Energy(nanojoules, EnergyUnit.Nanojoule); + return new Energy(value, EnergyUnit.Nanojoule); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromPetajoules(double petajoules) + public static Energy FromPetajoules(double value) { - return new Energy(petajoules, EnergyUnit.Petajoule); + return new Energy(value, EnergyUnit.Petajoule); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromTeraelectronVolts(double teraelectronvolts) + public static Energy FromTeraelectronVolts(double value) { - return new Energy(teraelectronvolts, EnergyUnit.TeraelectronVolt); + return new Energy(value, EnergyUnit.TeraelectronVolt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromTerajoules(double terajoules) + public static Energy FromTerajoules(double value) { - return new Energy(terajoules, EnergyUnit.Terajoule); + return new Energy(value, EnergyUnit.Terajoule); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromTerawattDays(double terawattdays) + public static Energy FromTerawattDays(double value) { - return new Energy(terawattdays, EnergyUnit.TerawattDay); + return new Energy(value, EnergyUnit.TerawattDay); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromTerawattHours(double terawatthours) + public static Energy FromTerawattHours(double value) { - return new Energy(terawatthours, EnergyUnit.TerawattHour); + return new Energy(value, EnergyUnit.TerawattHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromThermsEc(double thermsec) + public static Energy FromThermsEc(double value) { - return new Energy(thermsec, EnergyUnit.ThermEc); + return new Energy(value, EnergyUnit.ThermEc); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromThermsImperial(double thermsimperial) + public static Energy FromThermsImperial(double value) { - return new Energy(thermsimperial, EnergyUnit.ThermImperial); + return new Energy(value, EnergyUnit.ThermImperial); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromThermsUs(double thermsus) + public static Energy FromThermsUs(double value) { - return new Energy(thermsus, EnergyUnit.ThermUs); + return new Energy(value, EnergyUnit.ThermUs); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromWattDays(double wattdays) + public static Energy FromWattDays(double value) { - return new Energy(wattdays, EnergyUnit.WattDay); + return new Energy(value, EnergyUnit.WattDay); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Energy FromWattHours(double watthours) + public static Energy FromWattHours(double value) { - return new Energy(watthours, EnergyUnit.WattHour); + return new Energy(value, EnergyUnit.WattHour); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/EnergyDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/EnergyDensity.g.cs index da6aa0ead8..b9b53f8fee 100644 --- a/UnitsNet/GeneratedCode/Quantities/EnergyDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/EnergyDensity.g.cs @@ -315,108 +315,108 @@ public static string GetAbbreviation(EnergyDensityUnit unit, IFormatProvider? pr /// Creates a from . /// /// If value is NaN or Infinity. - public static EnergyDensity FromGigajoulesPerCubicMeter(double gigajoulespercubicmeter) + public static EnergyDensity FromGigajoulesPerCubicMeter(double value) { - return new EnergyDensity(gigajoulespercubicmeter, EnergyDensityUnit.GigajoulePerCubicMeter); + return new EnergyDensity(value, EnergyDensityUnit.GigajoulePerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static EnergyDensity FromGigawattHoursPerCubicMeter(double gigawatthourspercubicmeter) + public static EnergyDensity FromGigawattHoursPerCubicMeter(double value) { - return new EnergyDensity(gigawatthourspercubicmeter, EnergyDensityUnit.GigawattHourPerCubicMeter); + return new EnergyDensity(value, EnergyDensityUnit.GigawattHourPerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static EnergyDensity FromJoulesPerCubicMeter(double joulespercubicmeter) + public static EnergyDensity FromJoulesPerCubicMeter(double value) { - return new EnergyDensity(joulespercubicmeter, EnergyDensityUnit.JoulePerCubicMeter); + return new EnergyDensity(value, EnergyDensityUnit.JoulePerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static EnergyDensity FromKilojoulesPerCubicMeter(double kilojoulespercubicmeter) + public static EnergyDensity FromKilojoulesPerCubicMeter(double value) { - return new EnergyDensity(kilojoulespercubicmeter, EnergyDensityUnit.KilojoulePerCubicMeter); + return new EnergyDensity(value, EnergyDensityUnit.KilojoulePerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static EnergyDensity FromKilowattHoursPerCubicMeter(double kilowatthourspercubicmeter) + public static EnergyDensity FromKilowattHoursPerCubicMeter(double value) { - return new EnergyDensity(kilowatthourspercubicmeter, EnergyDensityUnit.KilowattHourPerCubicMeter); + return new EnergyDensity(value, EnergyDensityUnit.KilowattHourPerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static EnergyDensity FromMegajoulesPerCubicMeter(double megajoulespercubicmeter) + public static EnergyDensity FromMegajoulesPerCubicMeter(double value) { - return new EnergyDensity(megajoulespercubicmeter, EnergyDensityUnit.MegajoulePerCubicMeter); + return new EnergyDensity(value, EnergyDensityUnit.MegajoulePerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static EnergyDensity FromMegawattHoursPerCubicMeter(double megawatthourspercubicmeter) + public static EnergyDensity FromMegawattHoursPerCubicMeter(double value) { - return new EnergyDensity(megawatthourspercubicmeter, EnergyDensityUnit.MegawattHourPerCubicMeter); + return new EnergyDensity(value, EnergyDensityUnit.MegawattHourPerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static EnergyDensity FromPetajoulesPerCubicMeter(double petajoulespercubicmeter) + public static EnergyDensity FromPetajoulesPerCubicMeter(double value) { - return new EnergyDensity(petajoulespercubicmeter, EnergyDensityUnit.PetajoulePerCubicMeter); + return new EnergyDensity(value, EnergyDensityUnit.PetajoulePerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static EnergyDensity FromPetawattHoursPerCubicMeter(double petawatthourspercubicmeter) + public static EnergyDensity FromPetawattHoursPerCubicMeter(double value) { - return new EnergyDensity(petawatthourspercubicmeter, EnergyDensityUnit.PetawattHourPerCubicMeter); + return new EnergyDensity(value, EnergyDensityUnit.PetawattHourPerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static EnergyDensity FromTerajoulesPerCubicMeter(double terajoulespercubicmeter) + public static EnergyDensity FromTerajoulesPerCubicMeter(double value) { - return new EnergyDensity(terajoulespercubicmeter, EnergyDensityUnit.TerajoulePerCubicMeter); + return new EnergyDensity(value, EnergyDensityUnit.TerajoulePerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static EnergyDensity FromTerawattHoursPerCubicMeter(double terawatthourspercubicmeter) + public static EnergyDensity FromTerawattHoursPerCubicMeter(double value) { - return new EnergyDensity(terawatthourspercubicmeter, EnergyDensityUnit.TerawattHourPerCubicMeter); + return new EnergyDensity(value, EnergyDensityUnit.TerawattHourPerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static EnergyDensity FromWattHoursPerCubicMeter(double watthourspercubicmeter) + public static EnergyDensity FromWattHoursPerCubicMeter(double value) { - return new EnergyDensity(watthourspercubicmeter, EnergyDensityUnit.WattHourPerCubicMeter); + return new EnergyDensity(value, EnergyDensityUnit.WattHourPerCubicMeter); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Entropy.g.cs b/UnitsNet/GeneratedCode/Quantities/Entropy.g.cs index 53677dec17..179ae809d3 100644 --- a/UnitsNet/GeneratedCode/Quantities/Entropy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Entropy.g.cs @@ -276,63 +276,63 @@ public static string GetAbbreviation(EntropyUnit unit, IFormatProvider? provider /// Creates a from . /// /// If value is NaN or Infinity. - public static Entropy FromCaloriesPerKelvin(double caloriesperkelvin) + public static Entropy FromCaloriesPerKelvin(double value) { - return new Entropy(caloriesperkelvin, EntropyUnit.CaloriePerKelvin); + return new Entropy(value, EntropyUnit.CaloriePerKelvin); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Entropy FromJoulesPerDegreeCelsius(double joulesperdegreecelsius) + public static Entropy FromJoulesPerDegreeCelsius(double value) { - return new Entropy(joulesperdegreecelsius, EntropyUnit.JoulePerDegreeCelsius); + return new Entropy(value, EntropyUnit.JoulePerDegreeCelsius); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Entropy FromJoulesPerKelvin(double joulesperkelvin) + public static Entropy FromJoulesPerKelvin(double value) { - return new Entropy(joulesperkelvin, EntropyUnit.JoulePerKelvin); + return new Entropy(value, EntropyUnit.JoulePerKelvin); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Entropy FromKilocaloriesPerKelvin(double kilocaloriesperkelvin) + public static Entropy FromKilocaloriesPerKelvin(double value) { - return new Entropy(kilocaloriesperkelvin, EntropyUnit.KilocaloriePerKelvin); + return new Entropy(value, EntropyUnit.KilocaloriePerKelvin); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Entropy FromKilojoulesPerDegreeCelsius(double kilojoulesperdegreecelsius) + public static Entropy FromKilojoulesPerDegreeCelsius(double value) { - return new Entropy(kilojoulesperdegreecelsius, EntropyUnit.KilojoulePerDegreeCelsius); + return new Entropy(value, EntropyUnit.KilojoulePerDegreeCelsius); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Entropy FromKilojoulesPerKelvin(double kilojoulesperkelvin) + public static Entropy FromKilojoulesPerKelvin(double value) { - return new Entropy(kilojoulesperkelvin, EntropyUnit.KilojoulePerKelvin); + return new Entropy(value, EntropyUnit.KilojoulePerKelvin); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Entropy FromMegajoulesPerKelvin(double megajoulesperkelvin) + public static Entropy FromMegajoulesPerKelvin(double value) { - return new Entropy(megajoulesperkelvin, EntropyUnit.MegajoulePerKelvin); + return new Entropy(value, EntropyUnit.MegajoulePerKelvin); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Force.g.cs b/UnitsNet/GeneratedCode/Quantities/Force.g.cs index 8e0d17e118..7589bb7e99 100644 --- a/UnitsNet/GeneratedCode/Quantities/Force.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Force.g.cs @@ -348,135 +348,135 @@ public static string GetAbbreviation(ForceUnit unit, IFormatProvider? provider) /// Creates a from . /// /// If value is NaN or Infinity. - public static Force FromDecanewtons(double decanewtons) + public static Force FromDecanewtons(double value) { - return new Force(decanewtons, ForceUnit.Decanewton); + return new Force(value, ForceUnit.Decanewton); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Force FromDyne(double dyne) + public static Force FromDyne(double value) { - return new Force(dyne, ForceUnit.Dyn); + return new Force(value, ForceUnit.Dyn); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Force FromKilogramsForce(double kilogramsforce) + public static Force FromKilogramsForce(double value) { - return new Force(kilogramsforce, ForceUnit.KilogramForce); + return new Force(value, ForceUnit.KilogramForce); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Force FromKilonewtons(double kilonewtons) + public static Force FromKilonewtons(double value) { - return new Force(kilonewtons, ForceUnit.Kilonewton); + return new Force(value, ForceUnit.Kilonewton); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Force FromKiloPonds(double kiloponds) + public static Force FromKiloPonds(double value) { - return new Force(kiloponds, ForceUnit.KiloPond); + return new Force(value, ForceUnit.KiloPond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Force FromKilopoundsForce(double kilopoundsforce) + public static Force FromKilopoundsForce(double value) { - return new Force(kilopoundsforce, ForceUnit.KilopoundForce); + return new Force(value, ForceUnit.KilopoundForce); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Force FromMeganewtons(double meganewtons) + public static Force FromMeganewtons(double value) { - return new Force(meganewtons, ForceUnit.Meganewton); + return new Force(value, ForceUnit.Meganewton); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Force FromMicronewtons(double micronewtons) + public static Force FromMicronewtons(double value) { - return new Force(micronewtons, ForceUnit.Micronewton); + return new Force(value, ForceUnit.Micronewton); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Force FromMillinewtons(double millinewtons) + public static Force FromMillinewtons(double value) { - return new Force(millinewtons, ForceUnit.Millinewton); + return new Force(value, ForceUnit.Millinewton); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Force FromNewtons(double newtons) + public static Force FromNewtons(double value) { - return new Force(newtons, ForceUnit.Newton); + return new Force(value, ForceUnit.Newton); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Force FromOunceForce(double ounceforce) + public static Force FromOunceForce(double value) { - return new Force(ounceforce, ForceUnit.OunceForce); + return new Force(value, ForceUnit.OunceForce); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Force FromPoundals(double poundals) + public static Force FromPoundals(double value) { - return new Force(poundals, ForceUnit.Poundal); + return new Force(value, ForceUnit.Poundal); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Force FromPoundsForce(double poundsforce) + public static Force FromPoundsForce(double value) { - return new Force(poundsforce, ForceUnit.PoundForce); + return new Force(value, ForceUnit.PoundForce); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Force FromShortTonsForce(double shorttonsforce) + public static Force FromShortTonsForce(double value) { - return new Force(shorttonsforce, ForceUnit.ShortTonForce); + return new Force(value, ForceUnit.ShortTonForce); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Force FromTonnesForce(double tonnesforce) + public static Force FromTonnesForce(double value) { - return new Force(tonnesforce, ForceUnit.TonneForce); + return new Force(value, ForceUnit.TonneForce); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.g.cs b/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.g.cs index 63b0c2a3cc..7e45485779 100644 --- a/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.g.cs @@ -340,135 +340,135 @@ public static string GetAbbreviation(ForceChangeRateUnit unit, IFormatProvider? /// Creates a from . /// /// If value is NaN or Infinity. - public static ForceChangeRate FromCentinewtonsPerSecond(double centinewtonspersecond) + public static ForceChangeRate FromCentinewtonsPerSecond(double value) { - return new ForceChangeRate(centinewtonspersecond, ForceChangeRateUnit.CentinewtonPerSecond); + return new ForceChangeRate(value, ForceChangeRateUnit.CentinewtonPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForceChangeRate FromDecanewtonsPerMinute(double decanewtonsperminute) + public static ForceChangeRate FromDecanewtonsPerMinute(double value) { - return new ForceChangeRate(decanewtonsperminute, ForceChangeRateUnit.DecanewtonPerMinute); + return new ForceChangeRate(value, ForceChangeRateUnit.DecanewtonPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForceChangeRate FromDecanewtonsPerSecond(double decanewtonspersecond) + public static ForceChangeRate FromDecanewtonsPerSecond(double value) { - return new ForceChangeRate(decanewtonspersecond, ForceChangeRateUnit.DecanewtonPerSecond); + return new ForceChangeRate(value, ForceChangeRateUnit.DecanewtonPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForceChangeRate FromDecinewtonsPerSecond(double decinewtonspersecond) + public static ForceChangeRate FromDecinewtonsPerSecond(double value) { - return new ForceChangeRate(decinewtonspersecond, ForceChangeRateUnit.DecinewtonPerSecond); + return new ForceChangeRate(value, ForceChangeRateUnit.DecinewtonPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForceChangeRate FromKilonewtonsPerMinute(double kilonewtonsperminute) + public static ForceChangeRate FromKilonewtonsPerMinute(double value) { - return new ForceChangeRate(kilonewtonsperminute, ForceChangeRateUnit.KilonewtonPerMinute); + return new ForceChangeRate(value, ForceChangeRateUnit.KilonewtonPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForceChangeRate FromKilonewtonsPerSecond(double kilonewtonspersecond) + public static ForceChangeRate FromKilonewtonsPerSecond(double value) { - return new ForceChangeRate(kilonewtonspersecond, ForceChangeRateUnit.KilonewtonPerSecond); + return new ForceChangeRate(value, ForceChangeRateUnit.KilonewtonPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForceChangeRate FromKilopoundsForcePerMinute(double kilopoundsforceperminute) + public static ForceChangeRate FromKilopoundsForcePerMinute(double value) { - return new ForceChangeRate(kilopoundsforceperminute, ForceChangeRateUnit.KilopoundForcePerMinute); + return new ForceChangeRate(value, ForceChangeRateUnit.KilopoundForcePerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForceChangeRate FromKilopoundsForcePerSecond(double kilopoundsforcepersecond) + public static ForceChangeRate FromKilopoundsForcePerSecond(double value) { - return new ForceChangeRate(kilopoundsforcepersecond, ForceChangeRateUnit.KilopoundForcePerSecond); + return new ForceChangeRate(value, ForceChangeRateUnit.KilopoundForcePerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForceChangeRate FromMicronewtonsPerSecond(double micronewtonspersecond) + public static ForceChangeRate FromMicronewtonsPerSecond(double value) { - return new ForceChangeRate(micronewtonspersecond, ForceChangeRateUnit.MicronewtonPerSecond); + return new ForceChangeRate(value, ForceChangeRateUnit.MicronewtonPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForceChangeRate FromMillinewtonsPerSecond(double millinewtonspersecond) + public static ForceChangeRate FromMillinewtonsPerSecond(double value) { - return new ForceChangeRate(millinewtonspersecond, ForceChangeRateUnit.MillinewtonPerSecond); + return new ForceChangeRate(value, ForceChangeRateUnit.MillinewtonPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForceChangeRate FromNanonewtonsPerSecond(double nanonewtonspersecond) + public static ForceChangeRate FromNanonewtonsPerSecond(double value) { - return new ForceChangeRate(nanonewtonspersecond, ForceChangeRateUnit.NanonewtonPerSecond); + return new ForceChangeRate(value, ForceChangeRateUnit.NanonewtonPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForceChangeRate FromNewtonsPerMinute(double newtonsperminute) + public static ForceChangeRate FromNewtonsPerMinute(double value) { - return new ForceChangeRate(newtonsperminute, ForceChangeRateUnit.NewtonPerMinute); + return new ForceChangeRate(value, ForceChangeRateUnit.NewtonPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForceChangeRate FromNewtonsPerSecond(double newtonspersecond) + public static ForceChangeRate FromNewtonsPerSecond(double value) { - return new ForceChangeRate(newtonspersecond, ForceChangeRateUnit.NewtonPerSecond); + return new ForceChangeRate(value, ForceChangeRateUnit.NewtonPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForceChangeRate FromPoundsForcePerMinute(double poundsforceperminute) + public static ForceChangeRate FromPoundsForcePerMinute(double value) { - return new ForceChangeRate(poundsforceperminute, ForceChangeRateUnit.PoundForcePerMinute); + return new ForceChangeRate(value, ForceChangeRateUnit.PoundForcePerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForceChangeRate FromPoundsForcePerSecond(double poundsforcepersecond) + public static ForceChangeRate FromPoundsForcePerSecond(double value) { - return new ForceChangeRate(poundsforcepersecond, ForceChangeRateUnit.PoundForcePerSecond); + return new ForceChangeRate(value, ForceChangeRateUnit.PoundForcePerSecond); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ForcePerLength.g.cs b/UnitsNet/GeneratedCode/Quantities/ForcePerLength.g.cs index ccb2a8f698..a03cd01f8a 100644 --- a/UnitsNet/GeneratedCode/Quantities/ForcePerLength.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ForcePerLength.g.cs @@ -527,342 +527,342 @@ public static string GetAbbreviation(ForcePerLengthUnit unit, IFormatProvider? p /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromCentinewtonsPerCentimeter(double centinewtonspercentimeter) + public static ForcePerLength FromCentinewtonsPerCentimeter(double value) { - return new ForcePerLength(centinewtonspercentimeter, ForcePerLengthUnit.CentinewtonPerCentimeter); + return new ForcePerLength(value, ForcePerLengthUnit.CentinewtonPerCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromCentinewtonsPerMeter(double centinewtonspermeter) + public static ForcePerLength FromCentinewtonsPerMeter(double value) { - return new ForcePerLength(centinewtonspermeter, ForcePerLengthUnit.CentinewtonPerMeter); + return new ForcePerLength(value, ForcePerLengthUnit.CentinewtonPerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromCentinewtonsPerMillimeter(double centinewtonspermillimeter) + public static ForcePerLength FromCentinewtonsPerMillimeter(double value) { - return new ForcePerLength(centinewtonspermillimeter, ForcePerLengthUnit.CentinewtonPerMillimeter); + return new ForcePerLength(value, ForcePerLengthUnit.CentinewtonPerMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromDecanewtonsPerCentimeter(double decanewtonspercentimeter) + public static ForcePerLength FromDecanewtonsPerCentimeter(double value) { - return new ForcePerLength(decanewtonspercentimeter, ForcePerLengthUnit.DecanewtonPerCentimeter); + return new ForcePerLength(value, ForcePerLengthUnit.DecanewtonPerCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromDecanewtonsPerMeter(double decanewtonspermeter) + public static ForcePerLength FromDecanewtonsPerMeter(double value) { - return new ForcePerLength(decanewtonspermeter, ForcePerLengthUnit.DecanewtonPerMeter); + return new ForcePerLength(value, ForcePerLengthUnit.DecanewtonPerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromDecanewtonsPerMillimeter(double decanewtonspermillimeter) + public static ForcePerLength FromDecanewtonsPerMillimeter(double value) { - return new ForcePerLength(decanewtonspermillimeter, ForcePerLengthUnit.DecanewtonPerMillimeter); + return new ForcePerLength(value, ForcePerLengthUnit.DecanewtonPerMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromDecinewtonsPerCentimeter(double decinewtonspercentimeter) + public static ForcePerLength FromDecinewtonsPerCentimeter(double value) { - return new ForcePerLength(decinewtonspercentimeter, ForcePerLengthUnit.DecinewtonPerCentimeter); + return new ForcePerLength(value, ForcePerLengthUnit.DecinewtonPerCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromDecinewtonsPerMeter(double decinewtonspermeter) + public static ForcePerLength FromDecinewtonsPerMeter(double value) { - return new ForcePerLength(decinewtonspermeter, ForcePerLengthUnit.DecinewtonPerMeter); + return new ForcePerLength(value, ForcePerLengthUnit.DecinewtonPerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromDecinewtonsPerMillimeter(double decinewtonspermillimeter) + public static ForcePerLength FromDecinewtonsPerMillimeter(double value) { - return new ForcePerLength(decinewtonspermillimeter, ForcePerLengthUnit.DecinewtonPerMillimeter); + return new ForcePerLength(value, ForcePerLengthUnit.DecinewtonPerMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromKilogramsForcePerCentimeter(double kilogramsforcepercentimeter) + public static ForcePerLength FromKilogramsForcePerCentimeter(double value) { - return new ForcePerLength(kilogramsforcepercentimeter, ForcePerLengthUnit.KilogramForcePerCentimeter); + return new ForcePerLength(value, ForcePerLengthUnit.KilogramForcePerCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromKilogramsForcePerMeter(double kilogramsforcepermeter) + public static ForcePerLength FromKilogramsForcePerMeter(double value) { - return new ForcePerLength(kilogramsforcepermeter, ForcePerLengthUnit.KilogramForcePerMeter); + return new ForcePerLength(value, ForcePerLengthUnit.KilogramForcePerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromKilogramsForcePerMillimeter(double kilogramsforcepermillimeter) + public static ForcePerLength FromKilogramsForcePerMillimeter(double value) { - return new ForcePerLength(kilogramsforcepermillimeter, ForcePerLengthUnit.KilogramForcePerMillimeter); + return new ForcePerLength(value, ForcePerLengthUnit.KilogramForcePerMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromKilonewtonsPerCentimeter(double kilonewtonspercentimeter) + public static ForcePerLength FromKilonewtonsPerCentimeter(double value) { - return new ForcePerLength(kilonewtonspercentimeter, ForcePerLengthUnit.KilonewtonPerCentimeter); + return new ForcePerLength(value, ForcePerLengthUnit.KilonewtonPerCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromKilonewtonsPerMeter(double kilonewtonspermeter) + public static ForcePerLength FromKilonewtonsPerMeter(double value) { - return new ForcePerLength(kilonewtonspermeter, ForcePerLengthUnit.KilonewtonPerMeter); + return new ForcePerLength(value, ForcePerLengthUnit.KilonewtonPerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromKilonewtonsPerMillimeter(double kilonewtonspermillimeter) + public static ForcePerLength FromKilonewtonsPerMillimeter(double value) { - return new ForcePerLength(kilonewtonspermillimeter, ForcePerLengthUnit.KilonewtonPerMillimeter); + return new ForcePerLength(value, ForcePerLengthUnit.KilonewtonPerMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromKilopoundsForcePerFoot(double kilopoundsforceperfoot) + public static ForcePerLength FromKilopoundsForcePerFoot(double value) { - return new ForcePerLength(kilopoundsforceperfoot, ForcePerLengthUnit.KilopoundForcePerFoot); + return new ForcePerLength(value, ForcePerLengthUnit.KilopoundForcePerFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromKilopoundsForcePerInch(double kilopoundsforceperinch) + public static ForcePerLength FromKilopoundsForcePerInch(double value) { - return new ForcePerLength(kilopoundsforceperinch, ForcePerLengthUnit.KilopoundForcePerInch); + return new ForcePerLength(value, ForcePerLengthUnit.KilopoundForcePerInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromMeganewtonsPerCentimeter(double meganewtonspercentimeter) + public static ForcePerLength FromMeganewtonsPerCentimeter(double value) { - return new ForcePerLength(meganewtonspercentimeter, ForcePerLengthUnit.MeganewtonPerCentimeter); + return new ForcePerLength(value, ForcePerLengthUnit.MeganewtonPerCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromMeganewtonsPerMeter(double meganewtonspermeter) + public static ForcePerLength FromMeganewtonsPerMeter(double value) { - return new ForcePerLength(meganewtonspermeter, ForcePerLengthUnit.MeganewtonPerMeter); + return new ForcePerLength(value, ForcePerLengthUnit.MeganewtonPerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromMeganewtonsPerMillimeter(double meganewtonspermillimeter) + public static ForcePerLength FromMeganewtonsPerMillimeter(double value) { - return new ForcePerLength(meganewtonspermillimeter, ForcePerLengthUnit.MeganewtonPerMillimeter); + return new ForcePerLength(value, ForcePerLengthUnit.MeganewtonPerMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromMicronewtonsPerCentimeter(double micronewtonspercentimeter) + public static ForcePerLength FromMicronewtonsPerCentimeter(double value) { - return new ForcePerLength(micronewtonspercentimeter, ForcePerLengthUnit.MicronewtonPerCentimeter); + return new ForcePerLength(value, ForcePerLengthUnit.MicronewtonPerCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromMicronewtonsPerMeter(double micronewtonspermeter) + public static ForcePerLength FromMicronewtonsPerMeter(double value) { - return new ForcePerLength(micronewtonspermeter, ForcePerLengthUnit.MicronewtonPerMeter); + return new ForcePerLength(value, ForcePerLengthUnit.MicronewtonPerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromMicronewtonsPerMillimeter(double micronewtonspermillimeter) + public static ForcePerLength FromMicronewtonsPerMillimeter(double value) { - return new ForcePerLength(micronewtonspermillimeter, ForcePerLengthUnit.MicronewtonPerMillimeter); + return new ForcePerLength(value, ForcePerLengthUnit.MicronewtonPerMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromMillinewtonsPerCentimeter(double millinewtonspercentimeter) + public static ForcePerLength FromMillinewtonsPerCentimeter(double value) { - return new ForcePerLength(millinewtonspercentimeter, ForcePerLengthUnit.MillinewtonPerCentimeter); + return new ForcePerLength(value, ForcePerLengthUnit.MillinewtonPerCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromMillinewtonsPerMeter(double millinewtonspermeter) + public static ForcePerLength FromMillinewtonsPerMeter(double value) { - return new ForcePerLength(millinewtonspermeter, ForcePerLengthUnit.MillinewtonPerMeter); + return new ForcePerLength(value, ForcePerLengthUnit.MillinewtonPerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromMillinewtonsPerMillimeter(double millinewtonspermillimeter) + public static ForcePerLength FromMillinewtonsPerMillimeter(double value) { - return new ForcePerLength(millinewtonspermillimeter, ForcePerLengthUnit.MillinewtonPerMillimeter); + return new ForcePerLength(value, ForcePerLengthUnit.MillinewtonPerMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromNanonewtonsPerCentimeter(double nanonewtonspercentimeter) + public static ForcePerLength FromNanonewtonsPerCentimeter(double value) { - return new ForcePerLength(nanonewtonspercentimeter, ForcePerLengthUnit.NanonewtonPerCentimeter); + return new ForcePerLength(value, ForcePerLengthUnit.NanonewtonPerCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromNanonewtonsPerMeter(double nanonewtonspermeter) + public static ForcePerLength FromNanonewtonsPerMeter(double value) { - return new ForcePerLength(nanonewtonspermeter, ForcePerLengthUnit.NanonewtonPerMeter); + return new ForcePerLength(value, ForcePerLengthUnit.NanonewtonPerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromNanonewtonsPerMillimeter(double nanonewtonspermillimeter) + public static ForcePerLength FromNanonewtonsPerMillimeter(double value) { - return new ForcePerLength(nanonewtonspermillimeter, ForcePerLengthUnit.NanonewtonPerMillimeter); + return new ForcePerLength(value, ForcePerLengthUnit.NanonewtonPerMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromNewtonsPerCentimeter(double newtonspercentimeter) + public static ForcePerLength FromNewtonsPerCentimeter(double value) { - return new ForcePerLength(newtonspercentimeter, ForcePerLengthUnit.NewtonPerCentimeter); + return new ForcePerLength(value, ForcePerLengthUnit.NewtonPerCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromNewtonsPerMeter(double newtonspermeter) + public static ForcePerLength FromNewtonsPerMeter(double value) { - return new ForcePerLength(newtonspermeter, ForcePerLengthUnit.NewtonPerMeter); + return new ForcePerLength(value, ForcePerLengthUnit.NewtonPerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromNewtonsPerMillimeter(double newtonspermillimeter) + public static ForcePerLength FromNewtonsPerMillimeter(double value) { - return new ForcePerLength(newtonspermillimeter, ForcePerLengthUnit.NewtonPerMillimeter); + return new ForcePerLength(value, ForcePerLengthUnit.NewtonPerMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromPoundsForcePerFoot(double poundsforceperfoot) + public static ForcePerLength FromPoundsForcePerFoot(double value) { - return new ForcePerLength(poundsforceperfoot, ForcePerLengthUnit.PoundForcePerFoot); + return new ForcePerLength(value, ForcePerLengthUnit.PoundForcePerFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromPoundsForcePerInch(double poundsforceperinch) + public static ForcePerLength FromPoundsForcePerInch(double value) { - return new ForcePerLength(poundsforceperinch, ForcePerLengthUnit.PoundForcePerInch); + return new ForcePerLength(value, ForcePerLengthUnit.PoundForcePerInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromPoundsForcePerYard(double poundsforceperyard) + public static ForcePerLength FromPoundsForcePerYard(double value) { - return new ForcePerLength(poundsforceperyard, ForcePerLengthUnit.PoundForcePerYard); + return new ForcePerLength(value, ForcePerLengthUnit.PoundForcePerYard); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromTonnesForcePerCentimeter(double tonnesforcepercentimeter) + public static ForcePerLength FromTonnesForcePerCentimeter(double value) { - return new ForcePerLength(tonnesforcepercentimeter, ForcePerLengthUnit.TonneForcePerCentimeter); + return new ForcePerLength(value, ForcePerLengthUnit.TonneForcePerCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromTonnesForcePerMeter(double tonnesforcepermeter) + public static ForcePerLength FromTonnesForcePerMeter(double value) { - return new ForcePerLength(tonnesforcepermeter, ForcePerLengthUnit.TonneForcePerMeter); + return new ForcePerLength(value, ForcePerLengthUnit.TonneForcePerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ForcePerLength FromTonnesForcePerMillimeter(double tonnesforcepermillimeter) + public static ForcePerLength FromTonnesForcePerMillimeter(double value) { - return new ForcePerLength(tonnesforcepermillimeter, ForcePerLengthUnit.TonneForcePerMillimeter); + return new ForcePerLength(value, ForcePerLengthUnit.TonneForcePerMillimeter); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Frequency.g.cs b/UnitsNet/GeneratedCode/Quantities/Frequency.g.cs index 49aa24a00a..475e716416 100644 --- a/UnitsNet/GeneratedCode/Quantities/Frequency.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Frequency.g.cs @@ -323,117 +323,117 @@ public static string GetAbbreviation(FrequencyUnit unit, IFormatProvider? provid /// Creates a from . /// /// If value is NaN or Infinity. - public static Frequency FromBeatsPerMinute(double beatsperminute) + public static Frequency FromBeatsPerMinute(double value) { - return new Frequency(beatsperminute, FrequencyUnit.BeatPerMinute); + return new Frequency(value, FrequencyUnit.BeatPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Frequency FromBUnits(double bunits) + public static Frequency FromBUnits(double value) { - return new Frequency(bunits, FrequencyUnit.BUnit); + return new Frequency(value, FrequencyUnit.BUnit); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Frequency FromCyclesPerHour(double cyclesperhour) + public static Frequency FromCyclesPerHour(double value) { - return new Frequency(cyclesperhour, FrequencyUnit.CyclePerHour); + return new Frequency(value, FrequencyUnit.CyclePerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Frequency FromCyclesPerMinute(double cyclesperminute) + public static Frequency FromCyclesPerMinute(double value) { - return new Frequency(cyclesperminute, FrequencyUnit.CyclePerMinute); + return new Frequency(value, FrequencyUnit.CyclePerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Frequency FromGigahertz(double gigahertz) + public static Frequency FromGigahertz(double value) { - return new Frequency(gigahertz, FrequencyUnit.Gigahertz); + return new Frequency(value, FrequencyUnit.Gigahertz); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Frequency FromHertz(double hertz) + public static Frequency FromHertz(double value) { - return new Frequency(hertz, FrequencyUnit.Hertz); + return new Frequency(value, FrequencyUnit.Hertz); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Frequency FromKilohertz(double kilohertz) + public static Frequency FromKilohertz(double value) { - return new Frequency(kilohertz, FrequencyUnit.Kilohertz); + return new Frequency(value, FrequencyUnit.Kilohertz); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Frequency FromMegahertz(double megahertz) + public static Frequency FromMegahertz(double value) { - return new Frequency(megahertz, FrequencyUnit.Megahertz); + return new Frequency(value, FrequencyUnit.Megahertz); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Frequency FromMicrohertz(double microhertz) + public static Frequency FromMicrohertz(double value) { - return new Frequency(microhertz, FrequencyUnit.Microhertz); + return new Frequency(value, FrequencyUnit.Microhertz); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Frequency FromMillihertz(double millihertz) + public static Frequency FromMillihertz(double value) { - return new Frequency(millihertz, FrequencyUnit.Millihertz); + return new Frequency(value, FrequencyUnit.Millihertz); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Frequency FromPerSecond(double persecond) + public static Frequency FromPerSecond(double value) { - return new Frequency(persecond, FrequencyUnit.PerSecond); + return new Frequency(value, FrequencyUnit.PerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Frequency FromRadiansPerSecond(double radianspersecond) + public static Frequency FromRadiansPerSecond(double value) { - return new Frequency(radianspersecond, FrequencyUnit.RadianPerSecond); + return new Frequency(value, FrequencyUnit.RadianPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Frequency FromTerahertz(double terahertz) + public static Frequency FromTerahertz(double value) { - return new Frequency(terahertz, FrequencyUnit.Terahertz); + return new Frequency(value, FrequencyUnit.Terahertz); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/FuelEfficiency.g.cs b/UnitsNet/GeneratedCode/Quantities/FuelEfficiency.g.cs index cd57722a34..66a00f14f6 100644 --- a/UnitsNet/GeneratedCode/Quantities/FuelEfficiency.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/FuelEfficiency.g.cs @@ -248,36 +248,36 @@ public static string GetAbbreviation(FuelEfficiencyUnit unit, IFormatProvider? p /// Creates a from . /// /// If value is NaN or Infinity. - public static FuelEfficiency FromKilometersPerLiter(double kilometersperliter) + public static FuelEfficiency FromKilometersPerLiter(double value) { - return new FuelEfficiency(kilometersperliter, FuelEfficiencyUnit.KilometerPerLiter); + return new FuelEfficiency(value, FuelEfficiencyUnit.KilometerPerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static FuelEfficiency FromLitersPer100Kilometers(double litersper100kilometers) + public static FuelEfficiency FromLitersPer100Kilometers(double value) { - return new FuelEfficiency(litersper100kilometers, FuelEfficiencyUnit.LiterPer100Kilometers); + return new FuelEfficiency(value, FuelEfficiencyUnit.LiterPer100Kilometers); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static FuelEfficiency FromMilesPerUkGallon(double milesperukgallon) + public static FuelEfficiency FromMilesPerUkGallon(double value) { - return new FuelEfficiency(milesperukgallon, FuelEfficiencyUnit.MilePerUkGallon); + return new FuelEfficiency(value, FuelEfficiencyUnit.MilePerUkGallon); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static FuelEfficiency FromMilesPerUsGallon(double milesperusgallon) + public static FuelEfficiency FromMilesPerUsGallon(double value) { - return new FuelEfficiency(milesperusgallon, FuelEfficiencyUnit.MilePerUsGallon); + return new FuelEfficiency(value, FuelEfficiencyUnit.MilePerUsGallon); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/HeatFlux.g.cs b/UnitsNet/GeneratedCode/Quantities/HeatFlux.g.cs index 577af9701d..6a31f77be8 100644 --- a/UnitsNet/GeneratedCode/Quantities/HeatFlux.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/HeatFlux.g.cs @@ -363,162 +363,162 @@ public static string GetAbbreviation(HeatFluxUnit unit, IFormatProvider? provide /// Creates a from . /// /// If value is NaN or Infinity. - public static HeatFlux FromBtusPerHourSquareFoot(double btusperhoursquarefoot) + public static HeatFlux FromBtusPerHourSquareFoot(double value) { - return new HeatFlux(btusperhoursquarefoot, HeatFluxUnit.BtuPerHourSquareFoot); + return new HeatFlux(value, HeatFluxUnit.BtuPerHourSquareFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static HeatFlux FromBtusPerMinuteSquareFoot(double btusperminutesquarefoot) + public static HeatFlux FromBtusPerMinuteSquareFoot(double value) { - return new HeatFlux(btusperminutesquarefoot, HeatFluxUnit.BtuPerMinuteSquareFoot); + return new HeatFlux(value, HeatFluxUnit.BtuPerMinuteSquareFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static HeatFlux FromBtusPerSecondSquareFoot(double btuspersecondsquarefoot) + public static HeatFlux FromBtusPerSecondSquareFoot(double value) { - return new HeatFlux(btuspersecondsquarefoot, HeatFluxUnit.BtuPerSecondSquareFoot); + return new HeatFlux(value, HeatFluxUnit.BtuPerSecondSquareFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static HeatFlux FromBtusPerSecondSquareInch(double btuspersecondsquareinch) + public static HeatFlux FromBtusPerSecondSquareInch(double value) { - return new HeatFlux(btuspersecondsquareinch, HeatFluxUnit.BtuPerSecondSquareInch); + return new HeatFlux(value, HeatFluxUnit.BtuPerSecondSquareInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static HeatFlux FromCaloriesPerSecondSquareCentimeter(double caloriespersecondsquarecentimeter) + public static HeatFlux FromCaloriesPerSecondSquareCentimeter(double value) { - return new HeatFlux(caloriespersecondsquarecentimeter, HeatFluxUnit.CaloriePerSecondSquareCentimeter); + return new HeatFlux(value, HeatFluxUnit.CaloriePerSecondSquareCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static HeatFlux FromCentiwattsPerSquareMeter(double centiwattspersquaremeter) + public static HeatFlux FromCentiwattsPerSquareMeter(double value) { - return new HeatFlux(centiwattspersquaremeter, HeatFluxUnit.CentiwattPerSquareMeter); + return new HeatFlux(value, HeatFluxUnit.CentiwattPerSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static HeatFlux FromDeciwattsPerSquareMeter(double deciwattspersquaremeter) + public static HeatFlux FromDeciwattsPerSquareMeter(double value) { - return new HeatFlux(deciwattspersquaremeter, HeatFluxUnit.DeciwattPerSquareMeter); + return new HeatFlux(value, HeatFluxUnit.DeciwattPerSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static HeatFlux FromKilocaloriesPerHourSquareMeter(double kilocaloriesperhoursquaremeter) + public static HeatFlux FromKilocaloriesPerHourSquareMeter(double value) { - return new HeatFlux(kilocaloriesperhoursquaremeter, HeatFluxUnit.KilocaloriePerHourSquareMeter); + return new HeatFlux(value, HeatFluxUnit.KilocaloriePerHourSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static HeatFlux FromKilocaloriesPerSecondSquareCentimeter(double kilocaloriespersecondsquarecentimeter) + public static HeatFlux FromKilocaloriesPerSecondSquareCentimeter(double value) { - return new HeatFlux(kilocaloriespersecondsquarecentimeter, HeatFluxUnit.KilocaloriePerSecondSquareCentimeter); + return new HeatFlux(value, HeatFluxUnit.KilocaloriePerSecondSquareCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static HeatFlux FromKilowattsPerSquareMeter(double kilowattspersquaremeter) + public static HeatFlux FromKilowattsPerSquareMeter(double value) { - return new HeatFlux(kilowattspersquaremeter, HeatFluxUnit.KilowattPerSquareMeter); + return new HeatFlux(value, HeatFluxUnit.KilowattPerSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static HeatFlux FromMicrowattsPerSquareMeter(double microwattspersquaremeter) + public static HeatFlux FromMicrowattsPerSquareMeter(double value) { - return new HeatFlux(microwattspersquaremeter, HeatFluxUnit.MicrowattPerSquareMeter); + return new HeatFlux(value, HeatFluxUnit.MicrowattPerSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static HeatFlux FromMilliwattsPerSquareMeter(double milliwattspersquaremeter) + public static HeatFlux FromMilliwattsPerSquareMeter(double value) { - return new HeatFlux(milliwattspersquaremeter, HeatFluxUnit.MilliwattPerSquareMeter); + return new HeatFlux(value, HeatFluxUnit.MilliwattPerSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static HeatFlux FromNanowattsPerSquareMeter(double nanowattspersquaremeter) + public static HeatFlux FromNanowattsPerSquareMeter(double value) { - return new HeatFlux(nanowattspersquaremeter, HeatFluxUnit.NanowattPerSquareMeter); + return new HeatFlux(value, HeatFluxUnit.NanowattPerSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static HeatFlux FromPoundsForcePerFootSecond(double poundsforceperfootsecond) + public static HeatFlux FromPoundsForcePerFootSecond(double value) { - return new HeatFlux(poundsforceperfootsecond, HeatFluxUnit.PoundForcePerFootSecond); + return new HeatFlux(value, HeatFluxUnit.PoundForcePerFootSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static HeatFlux FromPoundsPerSecondCubed(double poundspersecondcubed) + public static HeatFlux FromPoundsPerSecondCubed(double value) { - return new HeatFlux(poundspersecondcubed, HeatFluxUnit.PoundPerSecondCubed); + return new HeatFlux(value, HeatFluxUnit.PoundPerSecondCubed); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static HeatFlux FromWattsPerSquareFoot(double wattspersquarefoot) + public static HeatFlux FromWattsPerSquareFoot(double value) { - return new HeatFlux(wattspersquarefoot, HeatFluxUnit.WattPerSquareFoot); + return new HeatFlux(value, HeatFluxUnit.WattPerSquareFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static HeatFlux FromWattsPerSquareInch(double wattspersquareinch) + public static HeatFlux FromWattsPerSquareInch(double value) { - return new HeatFlux(wattspersquareinch, HeatFluxUnit.WattPerSquareInch); + return new HeatFlux(value, HeatFluxUnit.WattPerSquareInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static HeatFlux FromWattsPerSquareMeter(double wattspersquaremeter) + public static HeatFlux FromWattsPerSquareMeter(double value) { - return new HeatFlux(wattspersquaremeter, HeatFluxUnit.WattPerSquareMeter); + return new HeatFlux(value, HeatFluxUnit.WattPerSquareMeter); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.g.cs b/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.g.cs index 1c8b3d95f0..3b594f1644 100644 --- a/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.g.cs @@ -262,9 +262,9 @@ public static string GetAbbreviation(HeatTransferCoefficientUnit unit, IFormatPr /// Creates a from . /// /// If value is NaN or Infinity. - public static HeatTransferCoefficient FromBtusPerHourSquareFootDegreeFahrenheit(double btusperhoursquarefootdegreefahrenheit) + public static HeatTransferCoefficient FromBtusPerHourSquareFootDegreeFahrenheit(double value) { - return new HeatTransferCoefficient(btusperhoursquarefootdegreefahrenheit, HeatTransferCoefficientUnit.BtuPerHourSquareFootDegreeFahrenheit); + return new HeatTransferCoefficient(value, HeatTransferCoefficientUnit.BtuPerHourSquareFootDegreeFahrenheit); } /// @@ -272,45 +272,45 @@ 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(double btuspersquarefootdegreefahrenheit) + public static HeatTransferCoefficient FromBtusPerSquareFootDegreeFahrenheit(double value) { - return new HeatTransferCoefficient(btuspersquarefootdegreefahrenheit, HeatTransferCoefficientUnit.BtuPerSquareFootDegreeFahrenheit); + return new HeatTransferCoefficient(value, HeatTransferCoefficientUnit.BtuPerSquareFootDegreeFahrenheit); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static HeatTransferCoefficient FromCaloriesPerHourSquareMeterDegreeCelsius(double caloriesperhoursquaremeterdegreecelsius) + public static HeatTransferCoefficient FromCaloriesPerHourSquareMeterDegreeCelsius(double value) { - return new HeatTransferCoefficient(caloriesperhoursquaremeterdegreecelsius, HeatTransferCoefficientUnit.CaloriePerHourSquareMeterDegreeCelsius); + return new HeatTransferCoefficient(value, HeatTransferCoefficientUnit.CaloriePerHourSquareMeterDegreeCelsius); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static HeatTransferCoefficient FromKilocaloriesPerHourSquareMeterDegreeCelsius(double kilocaloriesperhoursquaremeterdegreecelsius) + public static HeatTransferCoefficient FromKilocaloriesPerHourSquareMeterDegreeCelsius(double value) { - return new HeatTransferCoefficient(kilocaloriesperhoursquaremeterdegreecelsius, HeatTransferCoefficientUnit.KilocaloriePerHourSquareMeterDegreeCelsius); + return new HeatTransferCoefficient(value, HeatTransferCoefficientUnit.KilocaloriePerHourSquareMeterDegreeCelsius); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static HeatTransferCoefficient FromWattsPerSquareMeterCelsius(double wattspersquaremetercelsius) + public static HeatTransferCoefficient FromWattsPerSquareMeterCelsius(double value) { - return new HeatTransferCoefficient(wattspersquaremetercelsius, HeatTransferCoefficientUnit.WattPerSquareMeterCelsius); + return new HeatTransferCoefficient(value, HeatTransferCoefficientUnit.WattPerSquareMeterCelsius); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static HeatTransferCoefficient FromWattsPerSquareMeterKelvin(double wattspersquaremeterkelvin) + public static HeatTransferCoefficient FromWattsPerSquareMeterKelvin(double value) { - return new HeatTransferCoefficient(wattspersquaremeterkelvin, HeatTransferCoefficientUnit.WattPerSquareMeterKelvin); + return new HeatTransferCoefficient(value, HeatTransferCoefficientUnit.WattPerSquareMeterKelvin); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Illuminance.g.cs b/UnitsNet/GeneratedCode/Quantities/Illuminance.g.cs index c35b8a1fe1..d3ec835c8b 100644 --- a/UnitsNet/GeneratedCode/Quantities/Illuminance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Illuminance.g.cs @@ -248,36 +248,36 @@ public static string GetAbbreviation(IlluminanceUnit unit, IFormatProvider? prov /// Creates a from . /// /// If value is NaN or Infinity. - public static Illuminance FromKilolux(double kilolux) + public static Illuminance FromKilolux(double value) { - return new Illuminance(kilolux, IlluminanceUnit.Kilolux); + return new Illuminance(value, IlluminanceUnit.Kilolux); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Illuminance FromLux(double lux) + public static Illuminance FromLux(double value) { - return new Illuminance(lux, IlluminanceUnit.Lux); + return new Illuminance(value, IlluminanceUnit.Lux); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Illuminance FromMegalux(double megalux) + public static Illuminance FromMegalux(double value) { - return new Illuminance(megalux, IlluminanceUnit.Megalux); + return new Illuminance(value, IlluminanceUnit.Megalux); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Illuminance FromMillilux(double millilux) + public static Illuminance FromMillilux(double value) { - return new Illuminance(millilux, IlluminanceUnit.Millilux); + return new Illuminance(value, IlluminanceUnit.Millilux); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Impulse.g.cs b/UnitsNet/GeneratedCode/Quantities/Impulse.g.cs index 4981926abc..3b0e7de806 100644 --- a/UnitsNet/GeneratedCode/Quantities/Impulse.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Impulse.g.cs @@ -317,117 +317,117 @@ public static string GetAbbreviation(ImpulseUnit unit, IFormatProvider? provider /// Creates a from . /// /// If value is NaN or Infinity. - public static Impulse FromCentinewtonSeconds(double centinewtonseconds) + public static Impulse FromCentinewtonSeconds(double value) { - return new Impulse(centinewtonseconds, ImpulseUnit.CentinewtonSecond); + return new Impulse(value, ImpulseUnit.CentinewtonSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Impulse FromDecanewtonSeconds(double decanewtonseconds) + public static Impulse FromDecanewtonSeconds(double value) { - return new Impulse(decanewtonseconds, ImpulseUnit.DecanewtonSecond); + return new Impulse(value, ImpulseUnit.DecanewtonSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Impulse FromDecinewtonSeconds(double decinewtonseconds) + public static Impulse FromDecinewtonSeconds(double value) { - return new Impulse(decinewtonseconds, ImpulseUnit.DecinewtonSecond); + return new Impulse(value, ImpulseUnit.DecinewtonSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Impulse FromKilogramMetersPerSecond(double kilogrammeterspersecond) + public static Impulse FromKilogramMetersPerSecond(double value) { - return new Impulse(kilogrammeterspersecond, ImpulseUnit.KilogramMeterPerSecond); + return new Impulse(value, ImpulseUnit.KilogramMeterPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Impulse FromKilonewtonSeconds(double kilonewtonseconds) + public static Impulse FromKilonewtonSeconds(double value) { - return new Impulse(kilonewtonseconds, ImpulseUnit.KilonewtonSecond); + return new Impulse(value, ImpulseUnit.KilonewtonSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Impulse FromMeganewtonSeconds(double meganewtonseconds) + public static Impulse FromMeganewtonSeconds(double value) { - return new Impulse(meganewtonseconds, ImpulseUnit.MeganewtonSecond); + return new Impulse(value, ImpulseUnit.MeganewtonSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Impulse FromMicronewtonSeconds(double micronewtonseconds) + public static Impulse FromMicronewtonSeconds(double value) { - return new Impulse(micronewtonseconds, ImpulseUnit.MicronewtonSecond); + return new Impulse(value, ImpulseUnit.MicronewtonSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Impulse FromMillinewtonSeconds(double millinewtonseconds) + public static Impulse FromMillinewtonSeconds(double value) { - return new Impulse(millinewtonseconds, ImpulseUnit.MillinewtonSecond); + return new Impulse(value, ImpulseUnit.MillinewtonSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Impulse FromNanonewtonSeconds(double nanonewtonseconds) + public static Impulse FromNanonewtonSeconds(double value) { - return new Impulse(nanonewtonseconds, ImpulseUnit.NanonewtonSecond); + return new Impulse(value, ImpulseUnit.NanonewtonSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Impulse FromNewtonSeconds(double newtonseconds) + public static Impulse FromNewtonSeconds(double value) { - return new Impulse(newtonseconds, ImpulseUnit.NewtonSecond); + return new Impulse(value, ImpulseUnit.NewtonSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Impulse FromPoundFeetPerSecond(double poundfeetpersecond) + public static Impulse FromPoundFeetPerSecond(double value) { - return new Impulse(poundfeetpersecond, ImpulseUnit.PoundFootPerSecond); + return new Impulse(value, ImpulseUnit.PoundFootPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Impulse FromPoundForceSeconds(double poundforceseconds) + public static Impulse FromPoundForceSeconds(double value) { - return new Impulse(poundforceseconds, ImpulseUnit.PoundForceSecond); + return new Impulse(value, ImpulseUnit.PoundForceSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Impulse FromSlugFeetPerSecond(double slugfeetpersecond) + public static Impulse FromSlugFeetPerSecond(double value) { - return new Impulse(slugfeetpersecond, ImpulseUnit.SlugFootPerSecond); + return new Impulse(value, ImpulseUnit.SlugFootPerSecond); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Information.g.cs b/UnitsNet/GeneratedCode/Quantities/Information.g.cs index 892c978953..cde77174b2 100644 --- a/UnitsNet/GeneratedCode/Quantities/Information.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Information.g.cs @@ -421,234 +421,234 @@ public static string GetAbbreviation(InformationUnit unit, IFormatProvider? prov /// Creates a from . /// /// If value is NaN or Infinity. - public static Information FromBits(double bits) + public static Information FromBits(double value) { - return new Information(bits, InformationUnit.Bit); + return new Information(value, InformationUnit.Bit); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Information FromBytes(double bytes) + public static Information FromBytes(double value) { - return new Information(bytes, InformationUnit.Byte); + return new Information(value, InformationUnit.Byte); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Information FromExabits(double exabits) + public static Information FromExabits(double value) { - return new Information(exabits, InformationUnit.Exabit); + return new Information(value, InformationUnit.Exabit); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Information FromExabytes(double exabytes) + public static Information FromExabytes(double value) { - return new Information(exabytes, InformationUnit.Exabyte); + return new Information(value, InformationUnit.Exabyte); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Information FromExbibits(double exbibits) + public static Information FromExbibits(double value) { - return new Information(exbibits, InformationUnit.Exbibit); + return new Information(value, InformationUnit.Exbibit); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Information FromExbibytes(double exbibytes) + public static Information FromExbibytes(double value) { - return new Information(exbibytes, InformationUnit.Exbibyte); + return new Information(value, InformationUnit.Exbibyte); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Information FromGibibits(double gibibits) + public static Information FromGibibits(double value) { - return new Information(gibibits, InformationUnit.Gibibit); + return new Information(value, InformationUnit.Gibibit); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Information FromGibibytes(double gibibytes) + public static Information FromGibibytes(double value) { - return new Information(gibibytes, InformationUnit.Gibibyte); + return new Information(value, InformationUnit.Gibibyte); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Information FromGigabits(double gigabits) + public static Information FromGigabits(double value) { - return new Information(gigabits, InformationUnit.Gigabit); + return new Information(value, InformationUnit.Gigabit); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Information FromGigabytes(double gigabytes) + public static Information FromGigabytes(double value) { - return new Information(gigabytes, InformationUnit.Gigabyte); + return new Information(value, InformationUnit.Gigabyte); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Information FromKibibits(double kibibits) + public static Information FromKibibits(double value) { - return new Information(kibibits, InformationUnit.Kibibit); + return new Information(value, InformationUnit.Kibibit); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Information FromKibibytes(double kibibytes) + public static Information FromKibibytes(double value) { - return new Information(kibibytes, InformationUnit.Kibibyte); + return new Information(value, InformationUnit.Kibibyte); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Information FromKilobits(double kilobits) + public static Information FromKilobits(double value) { - return new Information(kilobits, InformationUnit.Kilobit); + return new Information(value, InformationUnit.Kilobit); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Information FromKilobytes(double kilobytes) + public static Information FromKilobytes(double value) { - return new Information(kilobytes, InformationUnit.Kilobyte); + return new Information(value, InformationUnit.Kilobyte); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Information FromMebibits(double mebibits) + public static Information FromMebibits(double value) { - return new Information(mebibits, InformationUnit.Mebibit); + return new Information(value, InformationUnit.Mebibit); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Information FromMebibytes(double mebibytes) + public static Information FromMebibytes(double value) { - return new Information(mebibytes, InformationUnit.Mebibyte); + return new Information(value, InformationUnit.Mebibyte); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Information FromMegabits(double megabits) + public static Information FromMegabits(double value) { - return new Information(megabits, InformationUnit.Megabit); + return new Information(value, InformationUnit.Megabit); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Information FromMegabytes(double megabytes) + public static Information FromMegabytes(double value) { - return new Information(megabytes, InformationUnit.Megabyte); + return new Information(value, InformationUnit.Megabyte); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Information FromPebibits(double pebibits) + public static Information FromPebibits(double value) { - return new Information(pebibits, InformationUnit.Pebibit); + return new Information(value, InformationUnit.Pebibit); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Information FromPebibytes(double pebibytes) + public static Information FromPebibytes(double value) { - return new Information(pebibytes, InformationUnit.Pebibyte); + return new Information(value, InformationUnit.Pebibyte); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Information FromPetabits(double petabits) + public static Information FromPetabits(double value) { - return new Information(petabits, InformationUnit.Petabit); + return new Information(value, InformationUnit.Petabit); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Information FromPetabytes(double petabytes) + public static Information FromPetabytes(double value) { - return new Information(petabytes, InformationUnit.Petabyte); + return new Information(value, InformationUnit.Petabyte); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Information FromTebibits(double tebibits) + public static Information FromTebibits(double value) { - return new Information(tebibits, InformationUnit.Tebibit); + return new Information(value, InformationUnit.Tebibit); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Information FromTebibytes(double tebibytes) + public static Information FromTebibytes(double value) { - return new Information(tebibytes, InformationUnit.Tebibyte); + return new Information(value, InformationUnit.Tebibyte); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Information FromTerabits(double terabits) + public static Information FromTerabits(double value) { - return new Information(terabits, InformationUnit.Terabit); + return new Information(value, InformationUnit.Terabit); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Information FromTerabytes(double terabytes) + public static Information FromTerabytes(double value) { - return new Information(terabytes, InformationUnit.Terabyte); + return new Information(value, InformationUnit.Terabyte); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Irradiance.g.cs b/UnitsNet/GeneratedCode/Quantities/Irradiance.g.cs index fa1233967f..e2b5a1fac0 100644 --- a/UnitsNet/GeneratedCode/Quantities/Irradiance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Irradiance.g.cs @@ -325,126 +325,126 @@ public static string GetAbbreviation(IrradianceUnit unit, IFormatProvider? provi /// Creates a from . /// /// If value is NaN or Infinity. - public static Irradiance FromKilowattsPerSquareCentimeter(double kilowattspersquarecentimeter) + public static Irradiance FromKilowattsPerSquareCentimeter(double value) { - return new Irradiance(kilowattspersquarecentimeter, IrradianceUnit.KilowattPerSquareCentimeter); + return new Irradiance(value, IrradianceUnit.KilowattPerSquareCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Irradiance FromKilowattsPerSquareMeter(double kilowattspersquaremeter) + public static Irradiance FromKilowattsPerSquareMeter(double value) { - return new Irradiance(kilowattspersquaremeter, IrradianceUnit.KilowattPerSquareMeter); + return new Irradiance(value, IrradianceUnit.KilowattPerSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Irradiance FromMegawattsPerSquareCentimeter(double megawattspersquarecentimeter) + public static Irradiance FromMegawattsPerSquareCentimeter(double value) { - return new Irradiance(megawattspersquarecentimeter, IrradianceUnit.MegawattPerSquareCentimeter); + return new Irradiance(value, IrradianceUnit.MegawattPerSquareCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Irradiance FromMegawattsPerSquareMeter(double megawattspersquaremeter) + public static Irradiance FromMegawattsPerSquareMeter(double value) { - return new Irradiance(megawattspersquaremeter, IrradianceUnit.MegawattPerSquareMeter); + return new Irradiance(value, IrradianceUnit.MegawattPerSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Irradiance FromMicrowattsPerSquareCentimeter(double microwattspersquarecentimeter) + public static Irradiance FromMicrowattsPerSquareCentimeter(double value) { - return new Irradiance(microwattspersquarecentimeter, IrradianceUnit.MicrowattPerSquareCentimeter); + return new Irradiance(value, IrradianceUnit.MicrowattPerSquareCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Irradiance FromMicrowattsPerSquareMeter(double microwattspersquaremeter) + public static Irradiance FromMicrowattsPerSquareMeter(double value) { - return new Irradiance(microwattspersquaremeter, IrradianceUnit.MicrowattPerSquareMeter); + return new Irradiance(value, IrradianceUnit.MicrowattPerSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Irradiance FromMilliwattsPerSquareCentimeter(double milliwattspersquarecentimeter) + public static Irradiance FromMilliwattsPerSquareCentimeter(double value) { - return new Irradiance(milliwattspersquarecentimeter, IrradianceUnit.MilliwattPerSquareCentimeter); + return new Irradiance(value, IrradianceUnit.MilliwattPerSquareCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Irradiance FromMilliwattsPerSquareMeter(double milliwattspersquaremeter) + public static Irradiance FromMilliwattsPerSquareMeter(double value) { - return new Irradiance(milliwattspersquaremeter, IrradianceUnit.MilliwattPerSquareMeter); + return new Irradiance(value, IrradianceUnit.MilliwattPerSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Irradiance FromNanowattsPerSquareCentimeter(double nanowattspersquarecentimeter) + public static Irradiance FromNanowattsPerSquareCentimeter(double value) { - return new Irradiance(nanowattspersquarecentimeter, IrradianceUnit.NanowattPerSquareCentimeter); + return new Irradiance(value, IrradianceUnit.NanowattPerSquareCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Irradiance FromNanowattsPerSquareMeter(double nanowattspersquaremeter) + public static Irradiance FromNanowattsPerSquareMeter(double value) { - return new Irradiance(nanowattspersquaremeter, IrradianceUnit.NanowattPerSquareMeter); + return new Irradiance(value, IrradianceUnit.NanowattPerSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Irradiance FromPicowattsPerSquareCentimeter(double picowattspersquarecentimeter) + public static Irradiance FromPicowattsPerSquareCentimeter(double value) { - return new Irradiance(picowattspersquarecentimeter, IrradianceUnit.PicowattPerSquareCentimeter); + return new Irradiance(value, IrradianceUnit.PicowattPerSquareCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Irradiance FromPicowattsPerSquareMeter(double picowattspersquaremeter) + public static Irradiance FromPicowattsPerSquareMeter(double value) { - return new Irradiance(picowattspersquaremeter, IrradianceUnit.PicowattPerSquareMeter); + return new Irradiance(value, IrradianceUnit.PicowattPerSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Irradiance FromWattsPerSquareCentimeter(double wattspersquarecentimeter) + public static Irradiance FromWattsPerSquareCentimeter(double value) { - return new Irradiance(wattspersquarecentimeter, IrradianceUnit.WattPerSquareCentimeter); + return new Irradiance(value, IrradianceUnit.WattPerSquareCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Irradiance FromWattsPerSquareMeter(double wattspersquaremeter) + public static Irradiance FromWattsPerSquareMeter(double value) { - return new Irradiance(wattspersquaremeter, IrradianceUnit.WattPerSquareMeter); + return new Irradiance(value, IrradianceUnit.WattPerSquareMeter); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Irradiation.g.cs b/UnitsNet/GeneratedCode/Quantities/Irradiation.g.cs index 9d294e4e23..b9aecce6af 100644 --- a/UnitsNet/GeneratedCode/Quantities/Irradiation.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Irradiation.g.cs @@ -272,63 +272,63 @@ public static string GetAbbreviation(IrradiationUnit unit, IFormatProvider? prov /// Creates a from . /// /// If value is NaN or Infinity. - public static Irradiation FromJoulesPerSquareCentimeter(double joulespersquarecentimeter) + public static Irradiation FromJoulesPerSquareCentimeter(double value) { - return new Irradiation(joulespersquarecentimeter, IrradiationUnit.JoulePerSquareCentimeter); + return new Irradiation(value, IrradiationUnit.JoulePerSquareCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Irradiation FromJoulesPerSquareMeter(double joulespersquaremeter) + public static Irradiation FromJoulesPerSquareMeter(double value) { - return new Irradiation(joulespersquaremeter, IrradiationUnit.JoulePerSquareMeter); + return new Irradiation(value, IrradiationUnit.JoulePerSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Irradiation FromJoulesPerSquareMillimeter(double joulespersquaremillimeter) + public static Irradiation FromJoulesPerSquareMillimeter(double value) { - return new Irradiation(joulespersquaremillimeter, IrradiationUnit.JoulePerSquareMillimeter); + return new Irradiation(value, IrradiationUnit.JoulePerSquareMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Irradiation FromKilojoulesPerSquareMeter(double kilojoulespersquaremeter) + public static Irradiation FromKilojoulesPerSquareMeter(double value) { - return new Irradiation(kilojoulespersquaremeter, IrradiationUnit.KilojoulePerSquareMeter); + return new Irradiation(value, IrradiationUnit.KilojoulePerSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Irradiation FromKilowattHoursPerSquareMeter(double kilowatthourspersquaremeter) + public static Irradiation FromKilowattHoursPerSquareMeter(double value) { - return new Irradiation(kilowatthourspersquaremeter, IrradiationUnit.KilowattHourPerSquareMeter); + return new Irradiation(value, IrradiationUnit.KilowattHourPerSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Irradiation FromMillijoulesPerSquareCentimeter(double millijoulespersquarecentimeter) + public static Irradiation FromMillijoulesPerSquareCentimeter(double value) { - return new Irradiation(millijoulespersquarecentimeter, IrradiationUnit.MillijoulePerSquareCentimeter); + return new Irradiation(value, IrradiationUnit.MillijoulePerSquareCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Irradiation FromWattHoursPerSquareMeter(double watthourspersquaremeter) + public static Irradiation FromWattHoursPerSquareMeter(double value) { - return new Irradiation(watthourspersquaremeter, IrradiationUnit.WattHourPerSquareMeter); + return new Irradiation(value, IrradiationUnit.WattHourPerSquareMeter); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Jerk.g.cs b/UnitsNet/GeneratedCode/Quantities/Jerk.g.cs index 473fb34652..c52efa5dc8 100644 --- a/UnitsNet/GeneratedCode/Quantities/Jerk.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Jerk.g.cs @@ -301,99 +301,99 @@ public static string GetAbbreviation(JerkUnit unit, IFormatProvider? provider) /// Creates a from . /// /// If value is NaN or Infinity. - public static Jerk FromCentimetersPerSecondCubed(double centimeterspersecondcubed) + public static Jerk FromCentimetersPerSecondCubed(double value) { - return new Jerk(centimeterspersecondcubed, JerkUnit.CentimeterPerSecondCubed); + return new Jerk(value, JerkUnit.CentimeterPerSecondCubed); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Jerk FromDecimetersPerSecondCubed(double decimeterspersecondcubed) + public static Jerk FromDecimetersPerSecondCubed(double value) { - return new Jerk(decimeterspersecondcubed, JerkUnit.DecimeterPerSecondCubed); + return new Jerk(value, JerkUnit.DecimeterPerSecondCubed); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Jerk FromFeetPerSecondCubed(double feetpersecondcubed) + public static Jerk FromFeetPerSecondCubed(double value) { - return new Jerk(feetpersecondcubed, JerkUnit.FootPerSecondCubed); + return new Jerk(value, JerkUnit.FootPerSecondCubed); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Jerk FromInchesPerSecondCubed(double inchespersecondcubed) + public static Jerk FromInchesPerSecondCubed(double value) { - return new Jerk(inchespersecondcubed, JerkUnit.InchPerSecondCubed); + return new Jerk(value, JerkUnit.InchPerSecondCubed); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Jerk FromKilometersPerSecondCubed(double kilometerspersecondcubed) + public static Jerk FromKilometersPerSecondCubed(double value) { - return new Jerk(kilometerspersecondcubed, JerkUnit.KilometerPerSecondCubed); + return new Jerk(value, JerkUnit.KilometerPerSecondCubed); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Jerk FromMetersPerSecondCubed(double meterspersecondcubed) + public static Jerk FromMetersPerSecondCubed(double value) { - return new Jerk(meterspersecondcubed, JerkUnit.MeterPerSecondCubed); + return new Jerk(value, JerkUnit.MeterPerSecondCubed); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Jerk FromMicrometersPerSecondCubed(double micrometerspersecondcubed) + public static Jerk FromMicrometersPerSecondCubed(double value) { - return new Jerk(micrometerspersecondcubed, JerkUnit.MicrometerPerSecondCubed); + return new Jerk(value, JerkUnit.MicrometerPerSecondCubed); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Jerk FromMillimetersPerSecondCubed(double millimeterspersecondcubed) + public static Jerk FromMillimetersPerSecondCubed(double value) { - return new Jerk(millimeterspersecondcubed, JerkUnit.MillimeterPerSecondCubed); + return new Jerk(value, JerkUnit.MillimeterPerSecondCubed); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Jerk FromMillistandardGravitiesPerSecond(double millistandardgravitiespersecond) + public static Jerk FromMillistandardGravitiesPerSecond(double value) { - return new Jerk(millistandardgravitiespersecond, JerkUnit.MillistandardGravitiesPerSecond); + return new Jerk(value, JerkUnit.MillistandardGravitiesPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Jerk FromNanometersPerSecondCubed(double nanometerspersecondcubed) + public static Jerk FromNanometersPerSecondCubed(double value) { - return new Jerk(nanometerspersecondcubed, JerkUnit.NanometerPerSecondCubed); + return new Jerk(value, JerkUnit.NanometerPerSecondCubed); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Jerk FromStandardGravitiesPerSecond(double standardgravitiespersecond) + public static Jerk FromStandardGravitiesPerSecond(double value) { - return new Jerk(standardgravitiespersecond, JerkUnit.StandardGravitiesPerSecond); + return new Jerk(value, JerkUnit.StandardGravitiesPerSecond); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.g.cs b/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.g.cs index 0988035e9f..e668624bac 100644 --- a/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.g.cs @@ -297,81 +297,81 @@ public static string GetAbbreviation(KinematicViscosityUnit unit, IFormatProvide /// Creates a from . /// /// If value is NaN or Infinity. - public static KinematicViscosity FromCentistokes(double centistokes) + public static KinematicViscosity FromCentistokes(double value) { - return new KinematicViscosity(centistokes, KinematicViscosityUnit.Centistokes); + return new KinematicViscosity(value, KinematicViscosityUnit.Centistokes); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static KinematicViscosity FromDecistokes(double decistokes) + public static KinematicViscosity FromDecistokes(double value) { - return new KinematicViscosity(decistokes, KinematicViscosityUnit.Decistokes); + return new KinematicViscosity(value, KinematicViscosityUnit.Decistokes); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static KinematicViscosity FromKilostokes(double kilostokes) + public static KinematicViscosity FromKilostokes(double value) { - return new KinematicViscosity(kilostokes, KinematicViscosityUnit.Kilostokes); + return new KinematicViscosity(value, KinematicViscosityUnit.Kilostokes); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static KinematicViscosity FromMicrostokes(double microstokes) + public static KinematicViscosity FromMicrostokes(double value) { - return new KinematicViscosity(microstokes, KinematicViscosityUnit.Microstokes); + return new KinematicViscosity(value, KinematicViscosityUnit.Microstokes); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static KinematicViscosity FromMillistokes(double millistokes) + public static KinematicViscosity FromMillistokes(double value) { - return new KinematicViscosity(millistokes, KinematicViscosityUnit.Millistokes); + return new KinematicViscosity(value, KinematicViscosityUnit.Millistokes); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static KinematicViscosity FromNanostokes(double nanostokes) + public static KinematicViscosity FromNanostokes(double value) { - return new KinematicViscosity(nanostokes, KinematicViscosityUnit.Nanostokes); + return new KinematicViscosity(value, KinematicViscosityUnit.Nanostokes); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static KinematicViscosity FromSquareFeetPerSecond(double squarefeetpersecond) + public static KinematicViscosity FromSquareFeetPerSecond(double value) { - return new KinematicViscosity(squarefeetpersecond, KinematicViscosityUnit.SquareFootPerSecond); + return new KinematicViscosity(value, KinematicViscosityUnit.SquareFootPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static KinematicViscosity FromSquareMetersPerSecond(double squaremeterspersecond) + public static KinematicViscosity FromSquareMetersPerSecond(double value) { - return new KinematicViscosity(squaremeterspersecond, KinematicViscosityUnit.SquareMeterPerSecond); + return new KinematicViscosity(value, KinematicViscosityUnit.SquareMeterPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static KinematicViscosity FromStokes(double stokes) + public static KinematicViscosity FromStokes(double value) { - return new KinematicViscosity(stokes, KinematicViscosityUnit.Stokes); + return new KinematicViscosity(value, KinematicViscosityUnit.Stokes); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/LeakRate.g.cs b/UnitsNet/GeneratedCode/Quantities/LeakRate.g.cs index 0c6ea0fdfe..42c88fbd83 100644 --- a/UnitsNet/GeneratedCode/Quantities/LeakRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LeakRate.g.cs @@ -240,27 +240,27 @@ public static string GetAbbreviation(LeakRateUnit unit, IFormatProvider? provide /// Creates a from . /// /// If value is NaN or Infinity. - public static LeakRate FromMillibarLitersPerSecond(double millibarliterspersecond) + public static LeakRate FromMillibarLitersPerSecond(double value) { - return new LeakRate(millibarliterspersecond, LeakRateUnit.MillibarLiterPerSecond); + return new LeakRate(value, LeakRateUnit.MillibarLiterPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static LeakRate FromPascalCubicMetersPerSecond(double pascalcubicmeterspersecond) + public static LeakRate FromPascalCubicMetersPerSecond(double value) { - return new LeakRate(pascalcubicmeterspersecond, LeakRateUnit.PascalCubicMeterPerSecond); + return new LeakRate(value, LeakRateUnit.PascalCubicMeterPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static LeakRate FromTorrLitersPerSecond(double torrliterspersecond) + public static LeakRate FromTorrLitersPerSecond(double value) { - return new LeakRate(torrliterspersecond, LeakRateUnit.TorrLiterPerSecond); + return new LeakRate(value, LeakRateUnit.TorrLiterPerSecond); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Length.g.cs b/UnitsNet/GeneratedCode/Quantities/Length.g.cs index 0a6d1841dd..bd849fd3e5 100644 --- a/UnitsNet/GeneratedCode/Quantities/Length.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Length.g.cs @@ -566,378 +566,378 @@ public static string GetAbbreviation(LengthUnit unit, IFormatProvider? provider) /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromAngstroms(double angstroms) + public static Length FromAngstroms(double value) { - return new Length(angstroms, LengthUnit.Angstrom); + return new Length(value, LengthUnit.Angstrom); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromAstronomicalUnits(double astronomicalunits) + public static Length FromAstronomicalUnits(double value) { - return new Length(astronomicalunits, LengthUnit.AstronomicalUnit); + return new Length(value, LengthUnit.AstronomicalUnit); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromCentimeters(double centimeters) + public static Length FromCentimeters(double value) { - return new Length(centimeters, LengthUnit.Centimeter); + return new Length(value, LengthUnit.Centimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromChains(double chains) + public static Length FromChains(double value) { - return new Length(chains, LengthUnit.Chain); + return new Length(value, LengthUnit.Chain); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromDataMiles(double datamiles) + public static Length FromDataMiles(double value) { - return new Length(datamiles, LengthUnit.DataMile); + return new Length(value, LengthUnit.DataMile); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromDecameters(double decameters) + public static Length FromDecameters(double value) { - return new Length(decameters, LengthUnit.Decameter); + return new Length(value, LengthUnit.Decameter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromDecimeters(double decimeters) + public static Length FromDecimeters(double value) { - return new Length(decimeters, LengthUnit.Decimeter); + return new Length(value, LengthUnit.Decimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromDtpPicas(double dtppicas) + public static Length FromDtpPicas(double value) { - return new Length(dtppicas, LengthUnit.DtpPica); + return new Length(value, LengthUnit.DtpPica); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromDtpPoints(double dtppoints) + public static Length FromDtpPoints(double value) { - return new Length(dtppoints, LengthUnit.DtpPoint); + return new Length(value, LengthUnit.DtpPoint); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromFathoms(double fathoms) + public static Length FromFathoms(double value) { - return new Length(fathoms, LengthUnit.Fathom); + return new Length(value, LengthUnit.Fathom); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromFemtometers(double femtometers) + public static Length FromFemtometers(double value) { - return new Length(femtometers, LengthUnit.Femtometer); + return new Length(value, LengthUnit.Femtometer); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromFeet(double feet) + public static Length FromFeet(double value) { - return new Length(feet, LengthUnit.Foot); + return new Length(value, LengthUnit.Foot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromGigameters(double gigameters) + public static Length FromGigameters(double value) { - return new Length(gigameters, LengthUnit.Gigameter); + return new Length(value, LengthUnit.Gigameter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromHands(double hands) + public static Length FromHands(double value) { - return new Length(hands, LengthUnit.Hand); + return new Length(value, LengthUnit.Hand); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromHectometers(double hectometers) + public static Length FromHectometers(double value) { - return new Length(hectometers, LengthUnit.Hectometer); + return new Length(value, LengthUnit.Hectometer); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromInches(double inches) + public static Length FromInches(double value) { - return new Length(inches, LengthUnit.Inch); + return new Length(value, LengthUnit.Inch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromKilofeet(double kilofeet) + public static Length FromKilofeet(double value) { - return new Length(kilofeet, LengthUnit.Kilofoot); + return new Length(value, LengthUnit.Kilofoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromKilolightYears(double kilolightyears) + public static Length FromKilolightYears(double value) { - return new Length(kilolightyears, LengthUnit.KilolightYear); + return new Length(value, LengthUnit.KilolightYear); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromKilometers(double kilometers) + public static Length FromKilometers(double value) { - return new Length(kilometers, LengthUnit.Kilometer); + return new Length(value, LengthUnit.Kilometer); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromKiloparsecs(double kiloparsecs) + public static Length FromKiloparsecs(double value) { - return new Length(kiloparsecs, LengthUnit.Kiloparsec); + return new Length(value, LengthUnit.Kiloparsec); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromKiloyards(double kiloyards) + public static Length FromKiloyards(double value) { - return new Length(kiloyards, LengthUnit.Kiloyard); + return new Length(value, LengthUnit.Kiloyard); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromLightYears(double lightyears) + public static Length FromLightYears(double value) { - return new Length(lightyears, LengthUnit.LightYear); + return new Length(value, LengthUnit.LightYear); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromMegalightYears(double megalightyears) + public static Length FromMegalightYears(double value) { - return new Length(megalightyears, LengthUnit.MegalightYear); + return new Length(value, LengthUnit.MegalightYear); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromMegameters(double megameters) + public static Length FromMegameters(double value) { - return new Length(megameters, LengthUnit.Megameter); + return new Length(value, LengthUnit.Megameter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromMegaparsecs(double megaparsecs) + public static Length FromMegaparsecs(double value) { - return new Length(megaparsecs, LengthUnit.Megaparsec); + return new Length(value, LengthUnit.Megaparsec); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromMeters(double meters) + public static Length FromMeters(double value) { - return new Length(meters, LengthUnit.Meter); + return new Length(value, LengthUnit.Meter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromMicroinches(double microinches) + public static Length FromMicroinches(double value) { - return new Length(microinches, LengthUnit.Microinch); + return new Length(value, LengthUnit.Microinch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromMicrometers(double micrometers) + public static Length FromMicrometers(double value) { - return new Length(micrometers, LengthUnit.Micrometer); + return new Length(value, LengthUnit.Micrometer); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromMils(double mils) + public static Length FromMils(double value) { - return new Length(mils, LengthUnit.Mil); + return new Length(value, LengthUnit.Mil); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromMiles(double miles) + public static Length FromMiles(double value) { - return new Length(miles, LengthUnit.Mile); + return new Length(value, LengthUnit.Mile); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromMillimeters(double millimeters) + public static Length FromMillimeters(double value) { - return new Length(millimeters, LengthUnit.Millimeter); + return new Length(value, LengthUnit.Millimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromNanometers(double nanometers) + public static Length FromNanometers(double value) { - return new Length(nanometers, LengthUnit.Nanometer); + return new Length(value, LengthUnit.Nanometer); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromNauticalMiles(double nauticalmiles) + public static Length FromNauticalMiles(double value) { - return new Length(nauticalmiles, LengthUnit.NauticalMile); + return new Length(value, LengthUnit.NauticalMile); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromParsecs(double parsecs) + public static Length FromParsecs(double value) { - return new Length(parsecs, LengthUnit.Parsec); + return new Length(value, LengthUnit.Parsec); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromPicometers(double picometers) + public static Length FromPicometers(double value) { - return new Length(picometers, LengthUnit.Picometer); + return new Length(value, LengthUnit.Picometer); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromPrinterPicas(double printerpicas) + public static Length FromPrinterPicas(double value) { - return new Length(printerpicas, LengthUnit.PrinterPica); + return new Length(value, LengthUnit.PrinterPica); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromPrinterPoints(double printerpoints) + public static Length FromPrinterPoints(double value) { - return new Length(printerpoints, LengthUnit.PrinterPoint); + return new Length(value, LengthUnit.PrinterPoint); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromShackles(double shackles) + public static Length FromShackles(double value) { - return new Length(shackles, LengthUnit.Shackle); + return new Length(value, LengthUnit.Shackle); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromSolarRadiuses(double solarradiuses) + public static Length FromSolarRadiuses(double value) { - return new Length(solarradiuses, LengthUnit.SolarRadius); + return new Length(value, LengthUnit.SolarRadius); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromTwips(double twips) + public static Length FromTwips(double value) { - return new Length(twips, LengthUnit.Twip); + return new Length(value, LengthUnit.Twip); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromUsSurveyFeet(double ussurveyfeet) + public static Length FromUsSurveyFeet(double value) { - return new Length(ussurveyfeet, LengthUnit.UsSurveyFoot); + return new Length(value, LengthUnit.UsSurveyFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Length FromYards(double yards) + public static Length FromYards(double value) { - return new Length(yards, LengthUnit.Yard); + return new Length(value, LengthUnit.Yard); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Level.g.cs b/UnitsNet/GeneratedCode/Quantities/Level.g.cs index 5343025e4f..3cfbe10c83 100644 --- a/UnitsNet/GeneratedCode/Quantities/Level.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Level.g.cs @@ -229,18 +229,18 @@ public static string GetAbbreviation(LevelUnit unit, IFormatProvider? provider) /// Creates a from . /// /// If value is NaN or Infinity. - public static Level FromDecibels(double decibels) + public static Level FromDecibels(double value) { - return new Level(decibels, LevelUnit.Decibel); + return new Level(value, LevelUnit.Decibel); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Level FromNepers(double nepers) + public static Level FromNepers(double value) { - return new Level(nepers, LevelUnit.Neper); + return new Level(value, LevelUnit.Neper); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/LinearDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/LinearDensity.g.cs index d244dbf6d5..150aad3fda 100644 --- a/UnitsNet/GeneratedCode/Quantities/LinearDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LinearDensity.g.cs @@ -336,126 +336,126 @@ public static string GetAbbreviation(LinearDensityUnit unit, IFormatProvider? pr /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearDensity FromGramsPerCentimeter(double gramspercentimeter) + public static LinearDensity FromGramsPerCentimeter(double value) { - return new LinearDensity(gramspercentimeter, LinearDensityUnit.GramPerCentimeter); + return new LinearDensity(value, LinearDensityUnit.GramPerCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearDensity FromGramsPerMeter(double gramspermeter) + public static LinearDensity FromGramsPerMeter(double value) { - return new LinearDensity(gramspermeter, LinearDensityUnit.GramPerMeter); + return new LinearDensity(value, LinearDensityUnit.GramPerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearDensity FromGramsPerMillimeter(double gramspermillimeter) + public static LinearDensity FromGramsPerMillimeter(double value) { - return new LinearDensity(gramspermillimeter, LinearDensityUnit.GramPerMillimeter); + return new LinearDensity(value, LinearDensityUnit.GramPerMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearDensity FromKilogramsPerCentimeter(double kilogramspercentimeter) + public static LinearDensity FromKilogramsPerCentimeter(double value) { - return new LinearDensity(kilogramspercentimeter, LinearDensityUnit.KilogramPerCentimeter); + return new LinearDensity(value, LinearDensityUnit.KilogramPerCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearDensity FromKilogramsPerMeter(double kilogramspermeter) + public static LinearDensity FromKilogramsPerMeter(double value) { - return new LinearDensity(kilogramspermeter, LinearDensityUnit.KilogramPerMeter); + return new LinearDensity(value, LinearDensityUnit.KilogramPerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearDensity FromKilogramsPerMillimeter(double kilogramspermillimeter) + public static LinearDensity FromKilogramsPerMillimeter(double value) { - return new LinearDensity(kilogramspermillimeter, LinearDensityUnit.KilogramPerMillimeter); + return new LinearDensity(value, LinearDensityUnit.KilogramPerMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearDensity FromMicrogramsPerCentimeter(double microgramspercentimeter) + public static LinearDensity FromMicrogramsPerCentimeter(double value) { - return new LinearDensity(microgramspercentimeter, LinearDensityUnit.MicrogramPerCentimeter); + return new LinearDensity(value, LinearDensityUnit.MicrogramPerCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearDensity FromMicrogramsPerMeter(double microgramspermeter) + public static LinearDensity FromMicrogramsPerMeter(double value) { - return new LinearDensity(microgramspermeter, LinearDensityUnit.MicrogramPerMeter); + return new LinearDensity(value, LinearDensityUnit.MicrogramPerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearDensity FromMicrogramsPerMillimeter(double microgramspermillimeter) + public static LinearDensity FromMicrogramsPerMillimeter(double value) { - return new LinearDensity(microgramspermillimeter, LinearDensityUnit.MicrogramPerMillimeter); + return new LinearDensity(value, LinearDensityUnit.MicrogramPerMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearDensity FromMilligramsPerCentimeter(double milligramspercentimeter) + public static LinearDensity FromMilligramsPerCentimeter(double value) { - return new LinearDensity(milligramspercentimeter, LinearDensityUnit.MilligramPerCentimeter); + return new LinearDensity(value, LinearDensityUnit.MilligramPerCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearDensity FromMilligramsPerMeter(double milligramspermeter) + public static LinearDensity FromMilligramsPerMeter(double value) { - return new LinearDensity(milligramspermeter, LinearDensityUnit.MilligramPerMeter); + return new LinearDensity(value, LinearDensityUnit.MilligramPerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearDensity FromMilligramsPerMillimeter(double milligramspermillimeter) + public static LinearDensity FromMilligramsPerMillimeter(double value) { - return new LinearDensity(milligramspermillimeter, LinearDensityUnit.MilligramPerMillimeter); + return new LinearDensity(value, LinearDensityUnit.MilligramPerMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearDensity FromPoundsPerFoot(double poundsperfoot) + public static LinearDensity FromPoundsPerFoot(double value) { - return new LinearDensity(poundsperfoot, LinearDensityUnit.PoundPerFoot); + return new LinearDensity(value, LinearDensityUnit.PoundPerFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearDensity FromPoundsPerInch(double poundsperinch) + public static LinearDensity FromPoundsPerInch(double value) { - return new LinearDensity(poundsperinch, LinearDensityUnit.PoundPerInch); + return new LinearDensity(value, LinearDensityUnit.PoundPerInch); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/LinearPowerDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/LinearPowerDensity.g.cs index 900302a53e..c8ecfb66ae 100644 --- a/UnitsNet/GeneratedCode/Quantities/LinearPowerDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LinearPowerDensity.g.cs @@ -416,225 +416,225 @@ public static string GetAbbreviation(LinearPowerDensityUnit unit, IFormatProvide /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearPowerDensity FromGigawattsPerCentimeter(double gigawattspercentimeter) + public static LinearPowerDensity FromGigawattsPerCentimeter(double value) { - return new LinearPowerDensity(gigawattspercentimeter, LinearPowerDensityUnit.GigawattPerCentimeter); + return new LinearPowerDensity(value, LinearPowerDensityUnit.GigawattPerCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearPowerDensity FromGigawattsPerFoot(double gigawattsperfoot) + public static LinearPowerDensity FromGigawattsPerFoot(double value) { - return new LinearPowerDensity(gigawattsperfoot, LinearPowerDensityUnit.GigawattPerFoot); + return new LinearPowerDensity(value, LinearPowerDensityUnit.GigawattPerFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearPowerDensity FromGigawattsPerInch(double gigawattsperinch) + public static LinearPowerDensity FromGigawattsPerInch(double value) { - return new LinearPowerDensity(gigawattsperinch, LinearPowerDensityUnit.GigawattPerInch); + return new LinearPowerDensity(value, LinearPowerDensityUnit.GigawattPerInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearPowerDensity FromGigawattsPerMeter(double gigawattspermeter) + public static LinearPowerDensity FromGigawattsPerMeter(double value) { - return new LinearPowerDensity(gigawattspermeter, LinearPowerDensityUnit.GigawattPerMeter); + return new LinearPowerDensity(value, LinearPowerDensityUnit.GigawattPerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearPowerDensity FromGigawattsPerMillimeter(double gigawattspermillimeter) + public static LinearPowerDensity FromGigawattsPerMillimeter(double value) { - return new LinearPowerDensity(gigawattspermillimeter, LinearPowerDensityUnit.GigawattPerMillimeter); + return new LinearPowerDensity(value, LinearPowerDensityUnit.GigawattPerMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearPowerDensity FromKilowattsPerCentimeter(double kilowattspercentimeter) + public static LinearPowerDensity FromKilowattsPerCentimeter(double value) { - return new LinearPowerDensity(kilowattspercentimeter, LinearPowerDensityUnit.KilowattPerCentimeter); + return new LinearPowerDensity(value, LinearPowerDensityUnit.KilowattPerCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearPowerDensity FromKilowattsPerFoot(double kilowattsperfoot) + public static LinearPowerDensity FromKilowattsPerFoot(double value) { - return new LinearPowerDensity(kilowattsperfoot, LinearPowerDensityUnit.KilowattPerFoot); + return new LinearPowerDensity(value, LinearPowerDensityUnit.KilowattPerFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearPowerDensity FromKilowattsPerInch(double kilowattsperinch) + public static LinearPowerDensity FromKilowattsPerInch(double value) { - return new LinearPowerDensity(kilowattsperinch, LinearPowerDensityUnit.KilowattPerInch); + return new LinearPowerDensity(value, LinearPowerDensityUnit.KilowattPerInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearPowerDensity FromKilowattsPerMeter(double kilowattspermeter) + public static LinearPowerDensity FromKilowattsPerMeter(double value) { - return new LinearPowerDensity(kilowattspermeter, LinearPowerDensityUnit.KilowattPerMeter); + return new LinearPowerDensity(value, LinearPowerDensityUnit.KilowattPerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearPowerDensity FromKilowattsPerMillimeter(double kilowattspermillimeter) + public static LinearPowerDensity FromKilowattsPerMillimeter(double value) { - return new LinearPowerDensity(kilowattspermillimeter, LinearPowerDensityUnit.KilowattPerMillimeter); + return new LinearPowerDensity(value, LinearPowerDensityUnit.KilowattPerMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearPowerDensity FromMegawattsPerCentimeter(double megawattspercentimeter) + public static LinearPowerDensity FromMegawattsPerCentimeter(double value) { - return new LinearPowerDensity(megawattspercentimeter, LinearPowerDensityUnit.MegawattPerCentimeter); + return new LinearPowerDensity(value, LinearPowerDensityUnit.MegawattPerCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearPowerDensity FromMegawattsPerFoot(double megawattsperfoot) + public static LinearPowerDensity FromMegawattsPerFoot(double value) { - return new LinearPowerDensity(megawattsperfoot, LinearPowerDensityUnit.MegawattPerFoot); + return new LinearPowerDensity(value, LinearPowerDensityUnit.MegawattPerFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearPowerDensity FromMegawattsPerInch(double megawattsperinch) + public static LinearPowerDensity FromMegawattsPerInch(double value) { - return new LinearPowerDensity(megawattsperinch, LinearPowerDensityUnit.MegawattPerInch); + return new LinearPowerDensity(value, LinearPowerDensityUnit.MegawattPerInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearPowerDensity FromMegawattsPerMeter(double megawattspermeter) + public static LinearPowerDensity FromMegawattsPerMeter(double value) { - return new LinearPowerDensity(megawattspermeter, LinearPowerDensityUnit.MegawattPerMeter); + return new LinearPowerDensity(value, LinearPowerDensityUnit.MegawattPerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearPowerDensity FromMegawattsPerMillimeter(double megawattspermillimeter) + public static LinearPowerDensity FromMegawattsPerMillimeter(double value) { - return new LinearPowerDensity(megawattspermillimeter, LinearPowerDensityUnit.MegawattPerMillimeter); + return new LinearPowerDensity(value, LinearPowerDensityUnit.MegawattPerMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearPowerDensity FromMilliwattsPerCentimeter(double milliwattspercentimeter) + public static LinearPowerDensity FromMilliwattsPerCentimeter(double value) { - return new LinearPowerDensity(milliwattspercentimeter, LinearPowerDensityUnit.MilliwattPerCentimeter); + return new LinearPowerDensity(value, LinearPowerDensityUnit.MilliwattPerCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearPowerDensity FromMilliwattsPerFoot(double milliwattsperfoot) + public static LinearPowerDensity FromMilliwattsPerFoot(double value) { - return new LinearPowerDensity(milliwattsperfoot, LinearPowerDensityUnit.MilliwattPerFoot); + return new LinearPowerDensity(value, LinearPowerDensityUnit.MilliwattPerFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearPowerDensity FromMilliwattsPerInch(double milliwattsperinch) + public static LinearPowerDensity FromMilliwattsPerInch(double value) { - return new LinearPowerDensity(milliwattsperinch, LinearPowerDensityUnit.MilliwattPerInch); + return new LinearPowerDensity(value, LinearPowerDensityUnit.MilliwattPerInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearPowerDensity FromMilliwattsPerMeter(double milliwattspermeter) + public static LinearPowerDensity FromMilliwattsPerMeter(double value) { - return new LinearPowerDensity(milliwattspermeter, LinearPowerDensityUnit.MilliwattPerMeter); + return new LinearPowerDensity(value, LinearPowerDensityUnit.MilliwattPerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearPowerDensity FromMilliwattsPerMillimeter(double milliwattspermillimeter) + public static LinearPowerDensity FromMilliwattsPerMillimeter(double value) { - return new LinearPowerDensity(milliwattspermillimeter, LinearPowerDensityUnit.MilliwattPerMillimeter); + return new LinearPowerDensity(value, LinearPowerDensityUnit.MilliwattPerMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearPowerDensity FromWattsPerCentimeter(double wattspercentimeter) + public static LinearPowerDensity FromWattsPerCentimeter(double value) { - return new LinearPowerDensity(wattspercentimeter, LinearPowerDensityUnit.WattPerCentimeter); + return new LinearPowerDensity(value, LinearPowerDensityUnit.WattPerCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearPowerDensity FromWattsPerFoot(double wattsperfoot) + public static LinearPowerDensity FromWattsPerFoot(double value) { - return new LinearPowerDensity(wattsperfoot, LinearPowerDensityUnit.WattPerFoot); + return new LinearPowerDensity(value, LinearPowerDensityUnit.WattPerFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearPowerDensity FromWattsPerInch(double wattsperinch) + public static LinearPowerDensity FromWattsPerInch(double value) { - return new LinearPowerDensity(wattsperinch, LinearPowerDensityUnit.WattPerInch); + return new LinearPowerDensity(value, LinearPowerDensityUnit.WattPerInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearPowerDensity FromWattsPerMeter(double wattspermeter) + public static LinearPowerDensity FromWattsPerMeter(double value) { - return new LinearPowerDensity(wattspermeter, LinearPowerDensityUnit.WattPerMeter); + return new LinearPowerDensity(value, LinearPowerDensityUnit.WattPerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static LinearPowerDensity FromWattsPerMillimeter(double wattspermillimeter) + public static LinearPowerDensity FromWattsPerMillimeter(double value) { - return new LinearPowerDensity(wattspermillimeter, LinearPowerDensityUnit.WattPerMillimeter); + return new LinearPowerDensity(value, LinearPowerDensityUnit.WattPerMillimeter); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Luminance.g.cs b/UnitsNet/GeneratedCode/Quantities/Luminance.g.cs index c7f77fe15a..7aeb3c7428 100644 --- a/UnitsNet/GeneratedCode/Quantities/Luminance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Luminance.g.cs @@ -302,90 +302,90 @@ public static string GetAbbreviation(LuminanceUnit unit, IFormatProvider? provid /// Creates a from . /// /// If value is NaN or Infinity. - public static Luminance FromCandelasPerSquareFoot(double candelaspersquarefoot) + public static Luminance FromCandelasPerSquareFoot(double value) { - return new Luminance(candelaspersquarefoot, LuminanceUnit.CandelaPerSquareFoot); + return new Luminance(value, LuminanceUnit.CandelaPerSquareFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Luminance FromCandelasPerSquareInch(double candelaspersquareinch) + public static Luminance FromCandelasPerSquareInch(double value) { - return new Luminance(candelaspersquareinch, LuminanceUnit.CandelaPerSquareInch); + return new Luminance(value, LuminanceUnit.CandelaPerSquareInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Luminance FromCandelasPerSquareMeter(double candelaspersquaremeter) + public static Luminance FromCandelasPerSquareMeter(double value) { - return new Luminance(candelaspersquaremeter, LuminanceUnit.CandelaPerSquareMeter); + return new Luminance(value, LuminanceUnit.CandelaPerSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Luminance FromCenticandelasPerSquareMeter(double centicandelaspersquaremeter) + public static Luminance FromCenticandelasPerSquareMeter(double value) { - return new Luminance(centicandelaspersquaremeter, LuminanceUnit.CenticandelaPerSquareMeter); + return new Luminance(value, LuminanceUnit.CenticandelaPerSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Luminance FromDecicandelasPerSquareMeter(double decicandelaspersquaremeter) + public static Luminance FromDecicandelasPerSquareMeter(double value) { - return new Luminance(decicandelaspersquaremeter, LuminanceUnit.DecicandelaPerSquareMeter); + return new Luminance(value, LuminanceUnit.DecicandelaPerSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Luminance FromKilocandelasPerSquareMeter(double kilocandelaspersquaremeter) + public static Luminance FromKilocandelasPerSquareMeter(double value) { - return new Luminance(kilocandelaspersquaremeter, LuminanceUnit.KilocandelaPerSquareMeter); + return new Luminance(value, LuminanceUnit.KilocandelaPerSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Luminance FromMicrocandelasPerSquareMeter(double microcandelaspersquaremeter) + public static Luminance FromMicrocandelasPerSquareMeter(double value) { - return new Luminance(microcandelaspersquaremeter, LuminanceUnit.MicrocandelaPerSquareMeter); + return new Luminance(value, LuminanceUnit.MicrocandelaPerSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Luminance FromMillicandelasPerSquareMeter(double millicandelaspersquaremeter) + public static Luminance FromMillicandelasPerSquareMeter(double value) { - return new Luminance(millicandelaspersquaremeter, LuminanceUnit.MillicandelaPerSquareMeter); + return new Luminance(value, LuminanceUnit.MillicandelaPerSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Luminance FromNanocandelasPerSquareMeter(double nanocandelaspersquaremeter) + public static Luminance FromNanocandelasPerSquareMeter(double value) { - return new Luminance(nanocandelaspersquaremeter, LuminanceUnit.NanocandelaPerSquareMeter); + return new Luminance(value, LuminanceUnit.NanocandelaPerSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Luminance FromNits(double nits) + public static Luminance FromNits(double value) { - return new Luminance(nits, LuminanceUnit.Nit); + return new Luminance(value, LuminanceUnit.Nit); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Luminosity.g.cs b/UnitsNet/GeneratedCode/Quantities/Luminosity.g.cs index 0df8fb7e24..00dec263fa 100644 --- a/UnitsNet/GeneratedCode/Quantities/Luminosity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Luminosity.g.cs @@ -328,126 +328,126 @@ public static string GetAbbreviation(LuminosityUnit unit, IFormatProvider? provi /// Creates a from . /// /// If value is NaN or Infinity. - public static Luminosity FromDecawatts(double decawatts) + public static Luminosity FromDecawatts(double value) { - return new Luminosity(decawatts, LuminosityUnit.Decawatt); + return new Luminosity(value, LuminosityUnit.Decawatt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Luminosity FromDeciwatts(double deciwatts) + public static Luminosity FromDeciwatts(double value) { - return new Luminosity(deciwatts, LuminosityUnit.Deciwatt); + return new Luminosity(value, LuminosityUnit.Deciwatt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Luminosity FromFemtowatts(double femtowatts) + public static Luminosity FromFemtowatts(double value) { - return new Luminosity(femtowatts, LuminosityUnit.Femtowatt); + return new Luminosity(value, LuminosityUnit.Femtowatt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Luminosity FromGigawatts(double gigawatts) + public static Luminosity FromGigawatts(double value) { - return new Luminosity(gigawatts, LuminosityUnit.Gigawatt); + return new Luminosity(value, LuminosityUnit.Gigawatt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Luminosity FromKilowatts(double kilowatts) + public static Luminosity FromKilowatts(double value) { - return new Luminosity(kilowatts, LuminosityUnit.Kilowatt); + return new Luminosity(value, LuminosityUnit.Kilowatt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Luminosity FromMegawatts(double megawatts) + public static Luminosity FromMegawatts(double value) { - return new Luminosity(megawatts, LuminosityUnit.Megawatt); + return new Luminosity(value, LuminosityUnit.Megawatt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Luminosity FromMicrowatts(double microwatts) + public static Luminosity FromMicrowatts(double value) { - return new Luminosity(microwatts, LuminosityUnit.Microwatt); + return new Luminosity(value, LuminosityUnit.Microwatt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Luminosity FromMilliwatts(double milliwatts) + public static Luminosity FromMilliwatts(double value) { - return new Luminosity(milliwatts, LuminosityUnit.Milliwatt); + return new Luminosity(value, LuminosityUnit.Milliwatt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Luminosity FromNanowatts(double nanowatts) + public static Luminosity FromNanowatts(double value) { - return new Luminosity(nanowatts, LuminosityUnit.Nanowatt); + return new Luminosity(value, LuminosityUnit.Nanowatt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Luminosity FromPetawatts(double petawatts) + public static Luminosity FromPetawatts(double value) { - return new Luminosity(petawatts, LuminosityUnit.Petawatt); + return new Luminosity(value, LuminosityUnit.Petawatt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Luminosity FromPicowatts(double picowatts) + public static Luminosity FromPicowatts(double value) { - return new Luminosity(picowatts, LuminosityUnit.Picowatt); + return new Luminosity(value, LuminosityUnit.Picowatt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Luminosity FromSolarLuminosities(double solarluminosities) + public static Luminosity FromSolarLuminosities(double value) { - return new Luminosity(solarluminosities, LuminosityUnit.SolarLuminosity); + return new Luminosity(value, LuminosityUnit.SolarLuminosity); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Luminosity FromTerawatts(double terawatts) + public static Luminosity FromTerawatts(double value) { - return new Luminosity(terawatts, LuminosityUnit.Terawatt); + return new Luminosity(value, LuminosityUnit.Terawatt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Luminosity FromWatts(double watts) + public static Luminosity FromWatts(double value) { - return new Luminosity(watts, LuminosityUnit.Watt); + return new Luminosity(value, LuminosityUnit.Watt); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/LuminousFlux.g.cs b/UnitsNet/GeneratedCode/Quantities/LuminousFlux.g.cs index 785e2c1a02..9ab25d187b 100644 --- a/UnitsNet/GeneratedCode/Quantities/LuminousFlux.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LuminousFlux.g.cs @@ -224,9 +224,9 @@ public static string GetAbbreviation(LuminousFluxUnit unit, IFormatProvider? pro /// Creates a from . /// /// If value is NaN or Infinity. - public static LuminousFlux FromLumens(double lumens) + public static LuminousFlux FromLumens(double value) { - return new LuminousFlux(lumens, LuminousFluxUnit.Lumen); + return new LuminousFlux(value, LuminousFluxUnit.Lumen); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.g.cs b/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.g.cs index 43d4a65664..a82a6831b8 100644 --- a/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.g.cs @@ -231,9 +231,9 @@ public static string GetAbbreviation(LuminousIntensityUnit unit, IFormatProvider /// Creates a from . /// /// If value is NaN or Infinity. - public static LuminousIntensity FromCandela(double candela) + public static LuminousIntensity FromCandela(double value) { - return new LuminousIntensity(candela, LuminousIntensityUnit.Candela); + return new LuminousIntensity(value, LuminousIntensityUnit.Candela); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/MagneticField.g.cs b/UnitsNet/GeneratedCode/Quantities/MagneticField.g.cs index 583f0dcbd5..1b161d5d12 100644 --- a/UnitsNet/GeneratedCode/Quantities/MagneticField.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MagneticField.g.cs @@ -264,54 +264,54 @@ public static string GetAbbreviation(MagneticFieldUnit unit, IFormatProvider? pr /// Creates a from . /// /// If value is NaN or Infinity. - public static MagneticField FromGausses(double gausses) + public static MagneticField FromGausses(double value) { - return new MagneticField(gausses, MagneticFieldUnit.Gauss); + return new MagneticField(value, MagneticFieldUnit.Gauss); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MagneticField FromMicroteslas(double microteslas) + public static MagneticField FromMicroteslas(double value) { - return new MagneticField(microteslas, MagneticFieldUnit.Microtesla); + return new MagneticField(value, MagneticFieldUnit.Microtesla); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MagneticField FromMilligausses(double milligausses) + public static MagneticField FromMilligausses(double value) { - return new MagneticField(milligausses, MagneticFieldUnit.Milligauss); + return new MagneticField(value, MagneticFieldUnit.Milligauss); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MagneticField FromMilliteslas(double milliteslas) + public static MagneticField FromMilliteslas(double value) { - return new MagneticField(milliteslas, MagneticFieldUnit.Millitesla); + return new MagneticField(value, MagneticFieldUnit.Millitesla); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MagneticField FromNanoteslas(double nanoteslas) + public static MagneticField FromNanoteslas(double value) { - return new MagneticField(nanoteslas, MagneticFieldUnit.Nanotesla); + return new MagneticField(value, MagneticFieldUnit.Nanotesla); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MagneticField FromTeslas(double teslas) + public static MagneticField FromTeslas(double value) { - return new MagneticField(teslas, MagneticFieldUnit.Tesla); + return new MagneticField(value, MagneticFieldUnit.Tesla); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/MagneticFlux.g.cs b/UnitsNet/GeneratedCode/Quantities/MagneticFlux.g.cs index 15465cb859..80e3a9b0fc 100644 --- a/UnitsNet/GeneratedCode/Quantities/MagneticFlux.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MagneticFlux.g.cs @@ -224,9 +224,9 @@ public static string GetAbbreviation(MagneticFluxUnit unit, IFormatProvider? pro /// Creates a from . /// /// If value is NaN or Infinity. - public static MagneticFlux FromWebers(double webers) + public static MagneticFlux FromWebers(double value) { - return new MagneticFlux(webers, MagneticFluxUnit.Weber); + return new MagneticFlux(value, MagneticFluxUnit.Weber); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Magnetization.g.cs b/UnitsNet/GeneratedCode/Quantities/Magnetization.g.cs index df422b1ca0..2d589711e7 100644 --- a/UnitsNet/GeneratedCode/Quantities/Magnetization.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Magnetization.g.cs @@ -224,9 +224,9 @@ public static string GetAbbreviation(MagnetizationUnit unit, IFormatProvider? pr /// Creates a from . /// /// If value is NaN or Infinity. - public static Magnetization FromAmperesPerMeter(double amperespermeter) + public static Magnetization FromAmperesPerMeter(double value) { - return new Magnetization(amperespermeter, MagnetizationUnit.AmperePerMeter); + return new Magnetization(value, MagnetizationUnit.AmperePerMeter); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Mass.g.cs b/UnitsNet/GeneratedCode/Quantities/Mass.g.cs index 1d5da4b22d..d9e495fee2 100644 --- a/UnitsNet/GeneratedCode/Quantities/Mass.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Mass.g.cs @@ -449,243 +449,243 @@ public static string GetAbbreviation(MassUnit unit, IFormatProvider? provider) /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromCentigrams(double centigrams) + public static Mass FromCentigrams(double value) { - return new Mass(centigrams, MassUnit.Centigram); + return new Mass(value, MassUnit.Centigram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromDecagrams(double decagrams) + public static Mass FromDecagrams(double value) { - return new Mass(decagrams, MassUnit.Decagram); + return new Mass(value, MassUnit.Decagram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromDecigrams(double decigrams) + public static Mass FromDecigrams(double value) { - return new Mass(decigrams, MassUnit.Decigram); + return new Mass(value, MassUnit.Decigram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromEarthMasses(double earthmasses) + public static Mass FromEarthMasses(double value) { - return new Mass(earthmasses, MassUnit.EarthMass); + return new Mass(value, MassUnit.EarthMass); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromFemtograms(double femtograms) + public static Mass FromFemtograms(double value) { - return new Mass(femtograms, MassUnit.Femtogram); + return new Mass(value, MassUnit.Femtogram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromGrains(double grains) + public static Mass FromGrains(double value) { - return new Mass(grains, MassUnit.Grain); + return new Mass(value, MassUnit.Grain); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromGrams(double grams) + public static Mass FromGrams(double value) { - return new Mass(grams, MassUnit.Gram); + return new Mass(value, MassUnit.Gram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromHectograms(double hectograms) + public static Mass FromHectograms(double value) { - return new Mass(hectograms, MassUnit.Hectogram); + return new Mass(value, MassUnit.Hectogram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromKilograms(double kilograms) + public static Mass FromKilograms(double value) { - return new Mass(kilograms, MassUnit.Kilogram); + return new Mass(value, MassUnit.Kilogram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromKilopounds(double kilopounds) + public static Mass FromKilopounds(double value) { - return new Mass(kilopounds, MassUnit.Kilopound); + return new Mass(value, MassUnit.Kilopound); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromKilotonnes(double kilotonnes) + public static Mass FromKilotonnes(double value) { - return new Mass(kilotonnes, MassUnit.Kilotonne); + return new Mass(value, MassUnit.Kilotonne); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromLongHundredweight(double longhundredweight) + public static Mass FromLongHundredweight(double value) { - return new Mass(longhundredweight, MassUnit.LongHundredweight); + return new Mass(value, MassUnit.LongHundredweight); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromLongTons(double longtons) + public static Mass FromLongTons(double value) { - return new Mass(longtons, MassUnit.LongTon); + return new Mass(value, MassUnit.LongTon); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromMegapounds(double megapounds) + public static Mass FromMegapounds(double value) { - return new Mass(megapounds, MassUnit.Megapound); + return new Mass(value, MassUnit.Megapound); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromMegatonnes(double megatonnes) + public static Mass FromMegatonnes(double value) { - return new Mass(megatonnes, MassUnit.Megatonne); + return new Mass(value, MassUnit.Megatonne); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromMicrograms(double micrograms) + public static Mass FromMicrograms(double value) { - return new Mass(micrograms, MassUnit.Microgram); + return new Mass(value, MassUnit.Microgram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromMilligrams(double milligrams) + public static Mass FromMilligrams(double value) { - return new Mass(milligrams, MassUnit.Milligram); + return new Mass(value, MassUnit.Milligram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromNanograms(double nanograms) + public static Mass FromNanograms(double value) { - return new Mass(nanograms, MassUnit.Nanogram); + return new Mass(value, MassUnit.Nanogram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromOunces(double ounces) + public static Mass FromOunces(double value) { - return new Mass(ounces, MassUnit.Ounce); + return new Mass(value, MassUnit.Ounce); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromPicograms(double picograms) + public static Mass FromPicograms(double value) { - return new Mass(picograms, MassUnit.Picogram); + return new Mass(value, MassUnit.Picogram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromPounds(double pounds) + public static Mass FromPounds(double value) { - return new Mass(pounds, MassUnit.Pound); + return new Mass(value, MassUnit.Pound); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromShortHundredweight(double shorthundredweight) + public static Mass FromShortHundredweight(double value) { - return new Mass(shorthundredweight, MassUnit.ShortHundredweight); + return new Mass(value, MassUnit.ShortHundredweight); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromShortTons(double shorttons) + public static Mass FromShortTons(double value) { - return new Mass(shorttons, MassUnit.ShortTon); + return new Mass(value, MassUnit.ShortTon); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromSlugs(double slugs) + public static Mass FromSlugs(double value) { - return new Mass(slugs, MassUnit.Slug); + return new Mass(value, MassUnit.Slug); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromSolarMasses(double solarmasses) + public static Mass FromSolarMasses(double value) { - return new Mass(solarmasses, MassUnit.SolarMass); + return new Mass(value, MassUnit.SolarMass); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromStone(double stone) + public static Mass FromStone(double value) { - return new Mass(stone, MassUnit.Stone); + return new Mass(value, MassUnit.Stone); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Mass FromTonnes(double tonnes) + public static Mass FromTonnes(double value) { - return new Mass(tonnes, MassUnit.Tonne); + return new Mass(value, MassUnit.Tonne); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/MassConcentration.g.cs b/UnitsNet/GeneratedCode/Quantities/MassConcentration.g.cs index 5c3625f8f9..bd7feec1d8 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassConcentration.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassConcentration.g.cs @@ -616,441 +616,441 @@ public static string GetAbbreviation(MassConcentrationUnit unit, IFormatProvider /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromCentigramsPerDeciliter(double centigramsperdeciliter) + public static MassConcentration FromCentigramsPerDeciliter(double value) { - return new MassConcentration(centigramsperdeciliter, MassConcentrationUnit.CentigramPerDeciliter); + return new MassConcentration(value, MassConcentrationUnit.CentigramPerDeciliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromCentigramsPerLiter(double centigramsperliter) + public static MassConcentration FromCentigramsPerLiter(double value) { - return new MassConcentration(centigramsperliter, MassConcentrationUnit.CentigramPerLiter); + return new MassConcentration(value, MassConcentrationUnit.CentigramPerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromCentigramsPerMicroliter(double centigramspermicroliter) + public static MassConcentration FromCentigramsPerMicroliter(double value) { - return new MassConcentration(centigramspermicroliter, MassConcentrationUnit.CentigramPerMicroliter); + return new MassConcentration(value, MassConcentrationUnit.CentigramPerMicroliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromCentigramsPerMilliliter(double centigramspermilliliter) + public static MassConcentration FromCentigramsPerMilliliter(double value) { - return new MassConcentration(centigramspermilliliter, MassConcentrationUnit.CentigramPerMilliliter); + return new MassConcentration(value, MassConcentrationUnit.CentigramPerMilliliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromDecigramsPerDeciliter(double decigramsperdeciliter) + public static MassConcentration FromDecigramsPerDeciliter(double value) { - return new MassConcentration(decigramsperdeciliter, MassConcentrationUnit.DecigramPerDeciliter); + return new MassConcentration(value, MassConcentrationUnit.DecigramPerDeciliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromDecigramsPerLiter(double decigramsperliter) + public static MassConcentration FromDecigramsPerLiter(double value) { - return new MassConcentration(decigramsperliter, MassConcentrationUnit.DecigramPerLiter); + return new MassConcentration(value, MassConcentrationUnit.DecigramPerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromDecigramsPerMicroliter(double decigramspermicroliter) + public static MassConcentration FromDecigramsPerMicroliter(double value) { - return new MassConcentration(decigramspermicroliter, MassConcentrationUnit.DecigramPerMicroliter); + return new MassConcentration(value, MassConcentrationUnit.DecigramPerMicroliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromDecigramsPerMilliliter(double decigramspermilliliter) + public static MassConcentration FromDecigramsPerMilliliter(double value) { - return new MassConcentration(decigramspermilliliter, MassConcentrationUnit.DecigramPerMilliliter); + return new MassConcentration(value, MassConcentrationUnit.DecigramPerMilliliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromGramsPerCubicCentimeter(double gramspercubiccentimeter) + public static MassConcentration FromGramsPerCubicCentimeter(double value) { - return new MassConcentration(gramspercubiccentimeter, MassConcentrationUnit.GramPerCubicCentimeter); + return new MassConcentration(value, MassConcentrationUnit.GramPerCubicCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromGramsPerCubicMeter(double gramspercubicmeter) + public static MassConcentration FromGramsPerCubicMeter(double value) { - return new MassConcentration(gramspercubicmeter, MassConcentrationUnit.GramPerCubicMeter); + return new MassConcentration(value, MassConcentrationUnit.GramPerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromGramsPerCubicMillimeter(double gramspercubicmillimeter) + public static MassConcentration FromGramsPerCubicMillimeter(double value) { - return new MassConcentration(gramspercubicmillimeter, MassConcentrationUnit.GramPerCubicMillimeter); + return new MassConcentration(value, MassConcentrationUnit.GramPerCubicMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromGramsPerDeciliter(double gramsperdeciliter) + public static MassConcentration FromGramsPerDeciliter(double value) { - return new MassConcentration(gramsperdeciliter, MassConcentrationUnit.GramPerDeciliter); + return new MassConcentration(value, MassConcentrationUnit.GramPerDeciliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromGramsPerLiter(double gramsperliter) + public static MassConcentration FromGramsPerLiter(double value) { - return new MassConcentration(gramsperliter, MassConcentrationUnit.GramPerLiter); + return new MassConcentration(value, MassConcentrationUnit.GramPerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromGramsPerMicroliter(double gramspermicroliter) + public static MassConcentration FromGramsPerMicroliter(double value) { - return new MassConcentration(gramspermicroliter, MassConcentrationUnit.GramPerMicroliter); + return new MassConcentration(value, MassConcentrationUnit.GramPerMicroliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromGramsPerMilliliter(double gramspermilliliter) + public static MassConcentration FromGramsPerMilliliter(double value) { - return new MassConcentration(gramspermilliliter, MassConcentrationUnit.GramPerMilliliter); + return new MassConcentration(value, MassConcentrationUnit.GramPerMilliliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromKilogramsPerCubicCentimeter(double kilogramspercubiccentimeter) + public static MassConcentration FromKilogramsPerCubicCentimeter(double value) { - return new MassConcentration(kilogramspercubiccentimeter, MassConcentrationUnit.KilogramPerCubicCentimeter); + return new MassConcentration(value, MassConcentrationUnit.KilogramPerCubicCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromKilogramsPerCubicMeter(double kilogramspercubicmeter) + public static MassConcentration FromKilogramsPerCubicMeter(double value) { - return new MassConcentration(kilogramspercubicmeter, MassConcentrationUnit.KilogramPerCubicMeter); + return new MassConcentration(value, MassConcentrationUnit.KilogramPerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromKilogramsPerCubicMillimeter(double kilogramspercubicmillimeter) + public static MassConcentration FromKilogramsPerCubicMillimeter(double value) { - return new MassConcentration(kilogramspercubicmillimeter, MassConcentrationUnit.KilogramPerCubicMillimeter); + return new MassConcentration(value, MassConcentrationUnit.KilogramPerCubicMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromKilogramsPerLiter(double kilogramsperliter) + public static MassConcentration FromKilogramsPerLiter(double value) { - return new MassConcentration(kilogramsperliter, MassConcentrationUnit.KilogramPerLiter); + return new MassConcentration(value, MassConcentrationUnit.KilogramPerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromKilopoundsPerCubicFoot(double kilopoundspercubicfoot) + public static MassConcentration FromKilopoundsPerCubicFoot(double value) { - return new MassConcentration(kilopoundspercubicfoot, MassConcentrationUnit.KilopoundPerCubicFoot); + return new MassConcentration(value, MassConcentrationUnit.KilopoundPerCubicFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromKilopoundsPerCubicInch(double kilopoundspercubicinch) + public static MassConcentration FromKilopoundsPerCubicInch(double value) { - return new MassConcentration(kilopoundspercubicinch, MassConcentrationUnit.KilopoundPerCubicInch); + return new MassConcentration(value, MassConcentrationUnit.KilopoundPerCubicInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromMicrogramsPerCubicMeter(double microgramspercubicmeter) + public static MassConcentration FromMicrogramsPerCubicMeter(double value) { - return new MassConcentration(microgramspercubicmeter, MassConcentrationUnit.MicrogramPerCubicMeter); + return new MassConcentration(value, MassConcentrationUnit.MicrogramPerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromMicrogramsPerDeciliter(double microgramsperdeciliter) + public static MassConcentration FromMicrogramsPerDeciliter(double value) { - return new MassConcentration(microgramsperdeciliter, MassConcentrationUnit.MicrogramPerDeciliter); + return new MassConcentration(value, MassConcentrationUnit.MicrogramPerDeciliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromMicrogramsPerLiter(double microgramsperliter) + public static MassConcentration FromMicrogramsPerLiter(double value) { - return new MassConcentration(microgramsperliter, MassConcentrationUnit.MicrogramPerLiter); + return new MassConcentration(value, MassConcentrationUnit.MicrogramPerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromMicrogramsPerMicroliter(double microgramspermicroliter) + public static MassConcentration FromMicrogramsPerMicroliter(double value) { - return new MassConcentration(microgramspermicroliter, MassConcentrationUnit.MicrogramPerMicroliter); + return new MassConcentration(value, MassConcentrationUnit.MicrogramPerMicroliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromMicrogramsPerMilliliter(double microgramspermilliliter) + public static MassConcentration FromMicrogramsPerMilliliter(double value) { - return new MassConcentration(microgramspermilliliter, MassConcentrationUnit.MicrogramPerMilliliter); + return new MassConcentration(value, MassConcentrationUnit.MicrogramPerMilliliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromMilligramsPerCubicMeter(double milligramspercubicmeter) + public static MassConcentration FromMilligramsPerCubicMeter(double value) { - return new MassConcentration(milligramspercubicmeter, MassConcentrationUnit.MilligramPerCubicMeter); + return new MassConcentration(value, MassConcentrationUnit.MilligramPerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromMilligramsPerDeciliter(double milligramsperdeciliter) + public static MassConcentration FromMilligramsPerDeciliter(double value) { - return new MassConcentration(milligramsperdeciliter, MassConcentrationUnit.MilligramPerDeciliter); + return new MassConcentration(value, MassConcentrationUnit.MilligramPerDeciliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromMilligramsPerLiter(double milligramsperliter) + public static MassConcentration FromMilligramsPerLiter(double value) { - return new MassConcentration(milligramsperliter, MassConcentrationUnit.MilligramPerLiter); + return new MassConcentration(value, MassConcentrationUnit.MilligramPerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromMilligramsPerMicroliter(double milligramspermicroliter) + public static MassConcentration FromMilligramsPerMicroliter(double value) { - return new MassConcentration(milligramspermicroliter, MassConcentrationUnit.MilligramPerMicroliter); + return new MassConcentration(value, MassConcentrationUnit.MilligramPerMicroliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromMilligramsPerMilliliter(double milligramspermilliliter) + public static MassConcentration FromMilligramsPerMilliliter(double value) { - return new MassConcentration(milligramspermilliliter, MassConcentrationUnit.MilligramPerMilliliter); + return new MassConcentration(value, MassConcentrationUnit.MilligramPerMilliliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromNanogramsPerDeciliter(double nanogramsperdeciliter) + public static MassConcentration FromNanogramsPerDeciliter(double value) { - return new MassConcentration(nanogramsperdeciliter, MassConcentrationUnit.NanogramPerDeciliter); + return new MassConcentration(value, MassConcentrationUnit.NanogramPerDeciliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromNanogramsPerLiter(double nanogramsperliter) + public static MassConcentration FromNanogramsPerLiter(double value) { - return new MassConcentration(nanogramsperliter, MassConcentrationUnit.NanogramPerLiter); + return new MassConcentration(value, MassConcentrationUnit.NanogramPerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromNanogramsPerMicroliter(double nanogramspermicroliter) + public static MassConcentration FromNanogramsPerMicroliter(double value) { - return new MassConcentration(nanogramspermicroliter, MassConcentrationUnit.NanogramPerMicroliter); + return new MassConcentration(value, MassConcentrationUnit.NanogramPerMicroliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromNanogramsPerMilliliter(double nanogramspermilliliter) + public static MassConcentration FromNanogramsPerMilliliter(double value) { - return new MassConcentration(nanogramspermilliliter, MassConcentrationUnit.NanogramPerMilliliter); + return new MassConcentration(value, MassConcentrationUnit.NanogramPerMilliliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromOuncesPerImperialGallon(double ouncesperimperialgallon) + public static MassConcentration FromOuncesPerImperialGallon(double value) { - return new MassConcentration(ouncesperimperialgallon, MassConcentrationUnit.OuncePerImperialGallon); + return new MassConcentration(value, MassConcentrationUnit.OuncePerImperialGallon); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromOuncesPerUSGallon(double ouncesperusgallon) + public static MassConcentration FromOuncesPerUSGallon(double value) { - return new MassConcentration(ouncesperusgallon, MassConcentrationUnit.OuncePerUSGallon); + return new MassConcentration(value, MassConcentrationUnit.OuncePerUSGallon); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromPicogramsPerDeciliter(double picogramsperdeciliter) + public static MassConcentration FromPicogramsPerDeciliter(double value) { - return new MassConcentration(picogramsperdeciliter, MassConcentrationUnit.PicogramPerDeciliter); + return new MassConcentration(value, MassConcentrationUnit.PicogramPerDeciliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromPicogramsPerLiter(double picogramsperliter) + public static MassConcentration FromPicogramsPerLiter(double value) { - return new MassConcentration(picogramsperliter, MassConcentrationUnit.PicogramPerLiter); + return new MassConcentration(value, MassConcentrationUnit.PicogramPerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromPicogramsPerMicroliter(double picogramspermicroliter) + public static MassConcentration FromPicogramsPerMicroliter(double value) { - return new MassConcentration(picogramspermicroliter, MassConcentrationUnit.PicogramPerMicroliter); + return new MassConcentration(value, MassConcentrationUnit.PicogramPerMicroliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromPicogramsPerMilliliter(double picogramspermilliliter) + public static MassConcentration FromPicogramsPerMilliliter(double value) { - return new MassConcentration(picogramspermilliliter, MassConcentrationUnit.PicogramPerMilliliter); + return new MassConcentration(value, MassConcentrationUnit.PicogramPerMilliliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromPoundsPerCubicFoot(double poundspercubicfoot) + public static MassConcentration FromPoundsPerCubicFoot(double value) { - return new MassConcentration(poundspercubicfoot, MassConcentrationUnit.PoundPerCubicFoot); + return new MassConcentration(value, MassConcentrationUnit.PoundPerCubicFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromPoundsPerCubicInch(double poundspercubicinch) + public static MassConcentration FromPoundsPerCubicInch(double value) { - return new MassConcentration(poundspercubicinch, MassConcentrationUnit.PoundPerCubicInch); + return new MassConcentration(value, MassConcentrationUnit.PoundPerCubicInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromPoundsPerImperialGallon(double poundsperimperialgallon) + public static MassConcentration FromPoundsPerImperialGallon(double value) { - return new MassConcentration(poundsperimperialgallon, MassConcentrationUnit.PoundPerImperialGallon); + return new MassConcentration(value, MassConcentrationUnit.PoundPerImperialGallon); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromPoundsPerUSGallon(double poundsperusgallon) + public static MassConcentration FromPoundsPerUSGallon(double value) { - return new MassConcentration(poundsperusgallon, MassConcentrationUnit.PoundPerUSGallon); + return new MassConcentration(value, MassConcentrationUnit.PoundPerUSGallon); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromSlugsPerCubicFoot(double slugspercubicfoot) + public static MassConcentration FromSlugsPerCubicFoot(double value) { - return new MassConcentration(slugspercubicfoot, MassConcentrationUnit.SlugPerCubicFoot); + return new MassConcentration(value, MassConcentrationUnit.SlugPerCubicFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromTonnesPerCubicCentimeter(double tonnespercubiccentimeter) + public static MassConcentration FromTonnesPerCubicCentimeter(double value) { - return new MassConcentration(tonnespercubiccentimeter, MassConcentrationUnit.TonnePerCubicCentimeter); + return new MassConcentration(value, MassConcentrationUnit.TonnePerCubicCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromTonnesPerCubicMeter(double tonnespercubicmeter) + public static MassConcentration FromTonnesPerCubicMeter(double value) { - return new MassConcentration(tonnespercubicmeter, MassConcentrationUnit.TonnePerCubicMeter); + return new MassConcentration(value, MassConcentrationUnit.TonnePerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassConcentration FromTonnesPerCubicMillimeter(double tonnespercubicmillimeter) + public static MassConcentration FromTonnesPerCubicMillimeter(double value) { - return new MassConcentration(tonnespercubicmillimeter, MassConcentrationUnit.TonnePerCubicMillimeter); + return new MassConcentration(value, MassConcentrationUnit.TonnePerCubicMillimeter); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/MassFlow.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFlow.g.cs index 07ecac8e86..22b9d72ef2 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFlow.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFlow.g.cs @@ -491,297 +491,297 @@ public static string GetAbbreviation(MassFlowUnit unit, IFormatProvider? provide /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromCentigramsPerDay(double centigramsperday) + public static MassFlow FromCentigramsPerDay(double value) { - return new MassFlow(centigramsperday, MassFlowUnit.CentigramPerDay); + return new MassFlow(value, MassFlowUnit.CentigramPerDay); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromCentigramsPerSecond(double centigramspersecond) + public static MassFlow FromCentigramsPerSecond(double value) { - return new MassFlow(centigramspersecond, MassFlowUnit.CentigramPerSecond); + return new MassFlow(value, MassFlowUnit.CentigramPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromDecagramsPerDay(double decagramsperday) + public static MassFlow FromDecagramsPerDay(double value) { - return new MassFlow(decagramsperday, MassFlowUnit.DecagramPerDay); + return new MassFlow(value, MassFlowUnit.DecagramPerDay); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromDecagramsPerSecond(double decagramspersecond) + public static MassFlow FromDecagramsPerSecond(double value) { - return new MassFlow(decagramspersecond, MassFlowUnit.DecagramPerSecond); + return new MassFlow(value, MassFlowUnit.DecagramPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromDecigramsPerDay(double decigramsperday) + public static MassFlow FromDecigramsPerDay(double value) { - return new MassFlow(decigramsperday, MassFlowUnit.DecigramPerDay); + return new MassFlow(value, MassFlowUnit.DecigramPerDay); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromDecigramsPerSecond(double decigramspersecond) + public static MassFlow FromDecigramsPerSecond(double value) { - return new MassFlow(decigramspersecond, MassFlowUnit.DecigramPerSecond); + return new MassFlow(value, MassFlowUnit.DecigramPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromGramsPerDay(double gramsperday) + public static MassFlow FromGramsPerDay(double value) { - return new MassFlow(gramsperday, MassFlowUnit.GramPerDay); + return new MassFlow(value, MassFlowUnit.GramPerDay); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromGramsPerHour(double gramsperhour) + public static MassFlow FromGramsPerHour(double value) { - return new MassFlow(gramsperhour, MassFlowUnit.GramPerHour); + return new MassFlow(value, MassFlowUnit.GramPerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromGramsPerSecond(double gramspersecond) + public static MassFlow FromGramsPerSecond(double value) { - return new MassFlow(gramspersecond, MassFlowUnit.GramPerSecond); + return new MassFlow(value, MassFlowUnit.GramPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromHectogramsPerDay(double hectogramsperday) + public static MassFlow FromHectogramsPerDay(double value) { - return new MassFlow(hectogramsperday, MassFlowUnit.HectogramPerDay); + return new MassFlow(value, MassFlowUnit.HectogramPerDay); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromHectogramsPerSecond(double hectogramspersecond) + public static MassFlow FromHectogramsPerSecond(double value) { - return new MassFlow(hectogramspersecond, MassFlowUnit.HectogramPerSecond); + return new MassFlow(value, MassFlowUnit.HectogramPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromKilogramsPerDay(double kilogramsperday) + public static MassFlow FromKilogramsPerDay(double value) { - return new MassFlow(kilogramsperday, MassFlowUnit.KilogramPerDay); + return new MassFlow(value, MassFlowUnit.KilogramPerDay); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromKilogramsPerHour(double kilogramsperhour) + public static MassFlow FromKilogramsPerHour(double value) { - return new MassFlow(kilogramsperhour, MassFlowUnit.KilogramPerHour); + return new MassFlow(value, MassFlowUnit.KilogramPerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromKilogramsPerMinute(double kilogramsperminute) + public static MassFlow FromKilogramsPerMinute(double value) { - return new MassFlow(kilogramsperminute, MassFlowUnit.KilogramPerMinute); + return new MassFlow(value, MassFlowUnit.KilogramPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromKilogramsPerSecond(double kilogramspersecond) + public static MassFlow FromKilogramsPerSecond(double value) { - return new MassFlow(kilogramspersecond, MassFlowUnit.KilogramPerSecond); + return new MassFlow(value, MassFlowUnit.KilogramPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromMegagramsPerDay(double megagramsperday) + public static MassFlow FromMegagramsPerDay(double value) { - return new MassFlow(megagramsperday, MassFlowUnit.MegagramPerDay); + return new MassFlow(value, MassFlowUnit.MegagramPerDay); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromMegapoundsPerDay(double megapoundsperday) + public static MassFlow FromMegapoundsPerDay(double value) { - return new MassFlow(megapoundsperday, MassFlowUnit.MegapoundPerDay); + return new MassFlow(value, MassFlowUnit.MegapoundPerDay); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromMegapoundsPerHour(double megapoundsperhour) + public static MassFlow FromMegapoundsPerHour(double value) { - return new MassFlow(megapoundsperhour, MassFlowUnit.MegapoundPerHour); + return new MassFlow(value, MassFlowUnit.MegapoundPerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromMegapoundsPerMinute(double megapoundsperminute) + public static MassFlow FromMegapoundsPerMinute(double value) { - return new MassFlow(megapoundsperminute, MassFlowUnit.MegapoundPerMinute); + return new MassFlow(value, MassFlowUnit.MegapoundPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromMegapoundsPerSecond(double megapoundspersecond) + public static MassFlow FromMegapoundsPerSecond(double value) { - return new MassFlow(megapoundspersecond, MassFlowUnit.MegapoundPerSecond); + return new MassFlow(value, MassFlowUnit.MegapoundPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromMicrogramsPerDay(double microgramsperday) + public static MassFlow FromMicrogramsPerDay(double value) { - return new MassFlow(microgramsperday, MassFlowUnit.MicrogramPerDay); + return new MassFlow(value, MassFlowUnit.MicrogramPerDay); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromMicrogramsPerSecond(double microgramspersecond) + public static MassFlow FromMicrogramsPerSecond(double value) { - return new MassFlow(microgramspersecond, MassFlowUnit.MicrogramPerSecond); + return new MassFlow(value, MassFlowUnit.MicrogramPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromMilligramsPerDay(double milligramsperday) + public static MassFlow FromMilligramsPerDay(double value) { - return new MassFlow(milligramsperday, MassFlowUnit.MilligramPerDay); + return new MassFlow(value, MassFlowUnit.MilligramPerDay); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromMilligramsPerSecond(double milligramspersecond) + public static MassFlow FromMilligramsPerSecond(double value) { - return new MassFlow(milligramspersecond, MassFlowUnit.MilligramPerSecond); + return new MassFlow(value, MassFlowUnit.MilligramPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromNanogramsPerDay(double nanogramsperday) + public static MassFlow FromNanogramsPerDay(double value) { - return new MassFlow(nanogramsperday, MassFlowUnit.NanogramPerDay); + return new MassFlow(value, MassFlowUnit.NanogramPerDay); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromNanogramsPerSecond(double nanogramspersecond) + public static MassFlow FromNanogramsPerSecond(double value) { - return new MassFlow(nanogramspersecond, MassFlowUnit.NanogramPerSecond); + return new MassFlow(value, MassFlowUnit.NanogramPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromPoundsPerDay(double poundsperday) + public static MassFlow FromPoundsPerDay(double value) { - return new MassFlow(poundsperday, MassFlowUnit.PoundPerDay); + return new MassFlow(value, MassFlowUnit.PoundPerDay); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromPoundsPerHour(double poundsperhour) + public static MassFlow FromPoundsPerHour(double value) { - return new MassFlow(poundsperhour, MassFlowUnit.PoundPerHour); + return new MassFlow(value, MassFlowUnit.PoundPerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromPoundsPerMinute(double poundsperminute) + public static MassFlow FromPoundsPerMinute(double value) { - return new MassFlow(poundsperminute, MassFlowUnit.PoundPerMinute); + return new MassFlow(value, MassFlowUnit.PoundPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromPoundsPerSecond(double poundspersecond) + public static MassFlow FromPoundsPerSecond(double value) { - return new MassFlow(poundspersecond, MassFlowUnit.PoundPerSecond); + return new MassFlow(value, MassFlowUnit.PoundPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromShortTonsPerHour(double shorttonsperhour) + public static MassFlow FromShortTonsPerHour(double value) { - return new MassFlow(shorttonsperhour, MassFlowUnit.ShortTonPerHour); + return new MassFlow(value, MassFlowUnit.ShortTonPerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromTonnesPerDay(double tonnesperday) + public static MassFlow FromTonnesPerDay(double value) { - return new MassFlow(tonnesperday, MassFlowUnit.TonnePerDay); + return new MassFlow(value, MassFlowUnit.TonnePerDay); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlow FromTonnesPerHour(double tonnesperhour) + public static MassFlow FromTonnesPerHour(double value) { - return new MassFlow(tonnesperhour, MassFlowUnit.TonnePerHour); + return new MassFlow(value, MassFlowUnit.TonnePerHour); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/MassFlux.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFlux.g.cs index 5e65d320c1..77e91ab108 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFlux.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFlux.g.cs @@ -317,108 +317,108 @@ public static string GetAbbreviation(MassFluxUnit unit, IFormatProvider? provide /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlux FromGramsPerHourPerSquareCentimeter(double gramsperhourpersquarecentimeter) + public static MassFlux FromGramsPerHourPerSquareCentimeter(double value) { - return new MassFlux(gramsperhourpersquarecentimeter, MassFluxUnit.GramPerHourPerSquareCentimeter); + return new MassFlux(value, MassFluxUnit.GramPerHourPerSquareCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlux FromGramsPerHourPerSquareMeter(double gramsperhourpersquaremeter) + public static MassFlux FromGramsPerHourPerSquareMeter(double value) { - return new MassFlux(gramsperhourpersquaremeter, MassFluxUnit.GramPerHourPerSquareMeter); + return new MassFlux(value, MassFluxUnit.GramPerHourPerSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlux FromGramsPerHourPerSquareMillimeter(double gramsperhourpersquaremillimeter) + public static MassFlux FromGramsPerHourPerSquareMillimeter(double value) { - return new MassFlux(gramsperhourpersquaremillimeter, MassFluxUnit.GramPerHourPerSquareMillimeter); + return new MassFlux(value, MassFluxUnit.GramPerHourPerSquareMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlux FromGramsPerSecondPerSquareCentimeter(double gramspersecondpersquarecentimeter) + public static MassFlux FromGramsPerSecondPerSquareCentimeter(double value) { - return new MassFlux(gramspersecondpersquarecentimeter, MassFluxUnit.GramPerSecondPerSquareCentimeter); + return new MassFlux(value, MassFluxUnit.GramPerSecondPerSquareCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlux FromGramsPerSecondPerSquareMeter(double gramspersecondpersquaremeter) + public static MassFlux FromGramsPerSecondPerSquareMeter(double value) { - return new MassFlux(gramspersecondpersquaremeter, MassFluxUnit.GramPerSecondPerSquareMeter); + return new MassFlux(value, MassFluxUnit.GramPerSecondPerSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlux FromGramsPerSecondPerSquareMillimeter(double gramspersecondpersquaremillimeter) + public static MassFlux FromGramsPerSecondPerSquareMillimeter(double value) { - return new MassFlux(gramspersecondpersquaremillimeter, MassFluxUnit.GramPerSecondPerSquareMillimeter); + return new MassFlux(value, MassFluxUnit.GramPerSecondPerSquareMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlux FromKilogramsPerHourPerSquareCentimeter(double kilogramsperhourpersquarecentimeter) + public static MassFlux FromKilogramsPerHourPerSquareCentimeter(double value) { - return new MassFlux(kilogramsperhourpersquarecentimeter, MassFluxUnit.KilogramPerHourPerSquareCentimeter); + return new MassFlux(value, MassFluxUnit.KilogramPerHourPerSquareCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlux FromKilogramsPerHourPerSquareMeter(double kilogramsperhourpersquaremeter) + public static MassFlux FromKilogramsPerHourPerSquareMeter(double value) { - return new MassFlux(kilogramsperhourpersquaremeter, MassFluxUnit.KilogramPerHourPerSquareMeter); + return new MassFlux(value, MassFluxUnit.KilogramPerHourPerSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlux FromKilogramsPerHourPerSquareMillimeter(double kilogramsperhourpersquaremillimeter) + public static MassFlux FromKilogramsPerHourPerSquareMillimeter(double value) { - return new MassFlux(kilogramsperhourpersquaremillimeter, MassFluxUnit.KilogramPerHourPerSquareMillimeter); + return new MassFlux(value, MassFluxUnit.KilogramPerHourPerSquareMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlux FromKilogramsPerSecondPerSquareCentimeter(double kilogramspersecondpersquarecentimeter) + public static MassFlux FromKilogramsPerSecondPerSquareCentimeter(double value) { - return new MassFlux(kilogramspersecondpersquarecentimeter, MassFluxUnit.KilogramPerSecondPerSquareCentimeter); + return new MassFlux(value, MassFluxUnit.KilogramPerSecondPerSquareCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlux FromKilogramsPerSecondPerSquareMeter(double kilogramspersecondpersquaremeter) + public static MassFlux FromKilogramsPerSecondPerSquareMeter(double value) { - return new MassFlux(kilogramspersecondpersquaremeter, MassFluxUnit.KilogramPerSecondPerSquareMeter); + return new MassFlux(value, MassFluxUnit.KilogramPerSecondPerSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFlux FromKilogramsPerSecondPerSquareMillimeter(double kilogramspersecondpersquaremillimeter) + public static MassFlux FromKilogramsPerSecondPerSquareMillimeter(double value) { - return new MassFlux(kilogramspersecondpersquaremillimeter, MassFluxUnit.KilogramPerSecondPerSquareMillimeter); + return new MassFlux(value, MassFluxUnit.KilogramPerSecondPerSquareMillimeter); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/MassFraction.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFraction.g.cs index 391b74441d..0ade3af47b 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFraction.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFraction.g.cs @@ -414,216 +414,216 @@ public static string GetAbbreviation(MassFractionUnit unit, IFormatProvider? pro /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFraction FromCentigramsPerGram(double centigramspergram) + public static MassFraction FromCentigramsPerGram(double value) { - return new MassFraction(centigramspergram, MassFractionUnit.CentigramPerGram); + return new MassFraction(value, MassFractionUnit.CentigramPerGram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFraction FromCentigramsPerKilogram(double centigramsperkilogram) + public static MassFraction FromCentigramsPerKilogram(double value) { - return new MassFraction(centigramsperkilogram, MassFractionUnit.CentigramPerKilogram); + return new MassFraction(value, MassFractionUnit.CentigramPerKilogram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFraction FromDecagramsPerGram(double decagramspergram) + public static MassFraction FromDecagramsPerGram(double value) { - return new MassFraction(decagramspergram, MassFractionUnit.DecagramPerGram); + return new MassFraction(value, MassFractionUnit.DecagramPerGram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFraction FromDecagramsPerKilogram(double decagramsperkilogram) + public static MassFraction FromDecagramsPerKilogram(double value) { - return new MassFraction(decagramsperkilogram, MassFractionUnit.DecagramPerKilogram); + return new MassFraction(value, MassFractionUnit.DecagramPerKilogram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFraction FromDecigramsPerGram(double decigramspergram) + public static MassFraction FromDecigramsPerGram(double value) { - return new MassFraction(decigramspergram, MassFractionUnit.DecigramPerGram); + return new MassFraction(value, MassFractionUnit.DecigramPerGram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFraction FromDecigramsPerKilogram(double decigramsperkilogram) + public static MassFraction FromDecigramsPerKilogram(double value) { - return new MassFraction(decigramsperkilogram, MassFractionUnit.DecigramPerKilogram); + return new MassFraction(value, MassFractionUnit.DecigramPerKilogram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFraction FromDecimalFractions(double decimalfractions) + public static MassFraction FromDecimalFractions(double value) { - return new MassFraction(decimalfractions, MassFractionUnit.DecimalFraction); + return new MassFraction(value, MassFractionUnit.DecimalFraction); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFraction FromGramsPerGram(double gramspergram) + public static MassFraction FromGramsPerGram(double value) { - return new MassFraction(gramspergram, MassFractionUnit.GramPerGram); + return new MassFraction(value, MassFractionUnit.GramPerGram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFraction FromGramsPerKilogram(double gramsperkilogram) + public static MassFraction FromGramsPerKilogram(double value) { - return new MassFraction(gramsperkilogram, MassFractionUnit.GramPerKilogram); + return new MassFraction(value, MassFractionUnit.GramPerKilogram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFraction FromHectogramsPerGram(double hectogramspergram) + public static MassFraction FromHectogramsPerGram(double value) { - return new MassFraction(hectogramspergram, MassFractionUnit.HectogramPerGram); + return new MassFraction(value, MassFractionUnit.HectogramPerGram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFraction FromHectogramsPerKilogram(double hectogramsperkilogram) + public static MassFraction FromHectogramsPerKilogram(double value) { - return new MassFraction(hectogramsperkilogram, MassFractionUnit.HectogramPerKilogram); + return new MassFraction(value, MassFractionUnit.HectogramPerKilogram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFraction FromKilogramsPerGram(double kilogramspergram) + public static MassFraction FromKilogramsPerGram(double value) { - return new MassFraction(kilogramspergram, MassFractionUnit.KilogramPerGram); + return new MassFraction(value, MassFractionUnit.KilogramPerGram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFraction FromKilogramsPerKilogram(double kilogramsperkilogram) + public static MassFraction FromKilogramsPerKilogram(double value) { - return new MassFraction(kilogramsperkilogram, MassFractionUnit.KilogramPerKilogram); + return new MassFraction(value, MassFractionUnit.KilogramPerKilogram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFraction FromMicrogramsPerGram(double microgramspergram) + public static MassFraction FromMicrogramsPerGram(double value) { - return new MassFraction(microgramspergram, MassFractionUnit.MicrogramPerGram); + return new MassFraction(value, MassFractionUnit.MicrogramPerGram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFraction FromMicrogramsPerKilogram(double microgramsperkilogram) + public static MassFraction FromMicrogramsPerKilogram(double value) { - return new MassFraction(microgramsperkilogram, MassFractionUnit.MicrogramPerKilogram); + return new MassFraction(value, MassFractionUnit.MicrogramPerKilogram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFraction FromMilligramsPerGram(double milligramspergram) + public static MassFraction FromMilligramsPerGram(double value) { - return new MassFraction(milligramspergram, MassFractionUnit.MilligramPerGram); + return new MassFraction(value, MassFractionUnit.MilligramPerGram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFraction FromMilligramsPerKilogram(double milligramsperkilogram) + public static MassFraction FromMilligramsPerKilogram(double value) { - return new MassFraction(milligramsperkilogram, MassFractionUnit.MilligramPerKilogram); + return new MassFraction(value, MassFractionUnit.MilligramPerKilogram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFraction FromNanogramsPerGram(double nanogramspergram) + public static MassFraction FromNanogramsPerGram(double value) { - return new MassFraction(nanogramspergram, MassFractionUnit.NanogramPerGram); + return new MassFraction(value, MassFractionUnit.NanogramPerGram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFraction FromNanogramsPerKilogram(double nanogramsperkilogram) + public static MassFraction FromNanogramsPerKilogram(double value) { - return new MassFraction(nanogramsperkilogram, MassFractionUnit.NanogramPerKilogram); + return new MassFraction(value, MassFractionUnit.NanogramPerKilogram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFraction FromPartsPerBillion(double partsperbillion) + public static MassFraction FromPartsPerBillion(double value) { - return new MassFraction(partsperbillion, MassFractionUnit.PartPerBillion); + return new MassFraction(value, MassFractionUnit.PartPerBillion); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFraction FromPartsPerMillion(double partspermillion) + public static MassFraction FromPartsPerMillion(double value) { - return new MassFraction(partspermillion, MassFractionUnit.PartPerMillion); + return new MassFraction(value, MassFractionUnit.PartPerMillion); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFraction FromPartsPerThousand(double partsperthousand) + public static MassFraction FromPartsPerThousand(double value) { - return new MassFraction(partsperthousand, MassFractionUnit.PartPerThousand); + return new MassFraction(value, MassFractionUnit.PartPerThousand); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFraction FromPartsPerTrillion(double partspertrillion) + public static MassFraction FromPartsPerTrillion(double value) { - return new MassFraction(partspertrillion, MassFractionUnit.PartPerTrillion); + return new MassFraction(value, MassFractionUnit.PartPerTrillion); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassFraction FromPercent(double percent) + public static MassFraction FromPercent(double value) { - return new MassFraction(percent, MassFractionUnit.Percent); + return new MassFraction(value, MassFractionUnit.Percent); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.g.cs b/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.g.cs index 1c0c81e360..ac7c6a34a8 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.g.cs @@ -437,252 +437,252 @@ public static string GetAbbreviation(MassMomentOfInertiaUnit unit, IFormatProvid /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromGramSquareCentimeters(double gramsquarecentimeters) + public static MassMomentOfInertia FromGramSquareCentimeters(double value) { - return new MassMomentOfInertia(gramsquarecentimeters, MassMomentOfInertiaUnit.GramSquareCentimeter); + return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.GramSquareCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromGramSquareDecimeters(double gramsquaredecimeters) + public static MassMomentOfInertia FromGramSquareDecimeters(double value) { - return new MassMomentOfInertia(gramsquaredecimeters, MassMomentOfInertiaUnit.GramSquareDecimeter); + return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.GramSquareDecimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromGramSquareMeters(double gramsquaremeters) + public static MassMomentOfInertia FromGramSquareMeters(double value) { - return new MassMomentOfInertia(gramsquaremeters, MassMomentOfInertiaUnit.GramSquareMeter); + return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.GramSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromGramSquareMillimeters(double gramsquaremillimeters) + public static MassMomentOfInertia FromGramSquareMillimeters(double value) { - return new MassMomentOfInertia(gramsquaremillimeters, MassMomentOfInertiaUnit.GramSquareMillimeter); + return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.GramSquareMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromKilogramSquareCentimeters(double kilogramsquarecentimeters) + public static MassMomentOfInertia FromKilogramSquareCentimeters(double value) { - return new MassMomentOfInertia(kilogramsquarecentimeters, MassMomentOfInertiaUnit.KilogramSquareCentimeter); + return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.KilogramSquareCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromKilogramSquareDecimeters(double kilogramsquaredecimeters) + public static MassMomentOfInertia FromKilogramSquareDecimeters(double value) { - return new MassMomentOfInertia(kilogramsquaredecimeters, MassMomentOfInertiaUnit.KilogramSquareDecimeter); + return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.KilogramSquareDecimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromKilogramSquareMeters(double kilogramsquaremeters) + public static MassMomentOfInertia FromKilogramSquareMeters(double value) { - return new MassMomentOfInertia(kilogramsquaremeters, MassMomentOfInertiaUnit.KilogramSquareMeter); + return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.KilogramSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromKilogramSquareMillimeters(double kilogramsquaremillimeters) + public static MassMomentOfInertia FromKilogramSquareMillimeters(double value) { - return new MassMomentOfInertia(kilogramsquaremillimeters, MassMomentOfInertiaUnit.KilogramSquareMillimeter); + return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.KilogramSquareMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromKilotonneSquareCentimeters(double kilotonnesquarecentimeters) + public static MassMomentOfInertia FromKilotonneSquareCentimeters(double value) { - return new MassMomentOfInertia(kilotonnesquarecentimeters, MassMomentOfInertiaUnit.KilotonneSquareCentimeter); + return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.KilotonneSquareCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromKilotonneSquareDecimeters(double kilotonnesquaredecimeters) + public static MassMomentOfInertia FromKilotonneSquareDecimeters(double value) { - return new MassMomentOfInertia(kilotonnesquaredecimeters, MassMomentOfInertiaUnit.KilotonneSquareDecimeter); + return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.KilotonneSquareDecimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromKilotonneSquareMeters(double kilotonnesquaremeters) + public static MassMomentOfInertia FromKilotonneSquareMeters(double value) { - return new MassMomentOfInertia(kilotonnesquaremeters, MassMomentOfInertiaUnit.KilotonneSquareMeter); + return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.KilotonneSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromKilotonneSquareMilimeters(double kilotonnesquaremilimeters) + public static MassMomentOfInertia FromKilotonneSquareMilimeters(double value) { - return new MassMomentOfInertia(kilotonnesquaremilimeters, MassMomentOfInertiaUnit.KilotonneSquareMilimeter); + return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.KilotonneSquareMilimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromMegatonneSquareCentimeters(double megatonnesquarecentimeters) + public static MassMomentOfInertia FromMegatonneSquareCentimeters(double value) { - return new MassMomentOfInertia(megatonnesquarecentimeters, MassMomentOfInertiaUnit.MegatonneSquareCentimeter); + return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.MegatonneSquareCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromMegatonneSquareDecimeters(double megatonnesquaredecimeters) + public static MassMomentOfInertia FromMegatonneSquareDecimeters(double value) { - return new MassMomentOfInertia(megatonnesquaredecimeters, MassMomentOfInertiaUnit.MegatonneSquareDecimeter); + return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.MegatonneSquareDecimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromMegatonneSquareMeters(double megatonnesquaremeters) + public static MassMomentOfInertia FromMegatonneSquareMeters(double value) { - return new MassMomentOfInertia(megatonnesquaremeters, MassMomentOfInertiaUnit.MegatonneSquareMeter); + return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.MegatonneSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromMegatonneSquareMilimeters(double megatonnesquaremilimeters) + public static MassMomentOfInertia FromMegatonneSquareMilimeters(double value) { - return new MassMomentOfInertia(megatonnesquaremilimeters, MassMomentOfInertiaUnit.MegatonneSquareMilimeter); + return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.MegatonneSquareMilimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromMilligramSquareCentimeters(double milligramsquarecentimeters) + public static MassMomentOfInertia FromMilligramSquareCentimeters(double value) { - return new MassMomentOfInertia(milligramsquarecentimeters, MassMomentOfInertiaUnit.MilligramSquareCentimeter); + return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.MilligramSquareCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromMilligramSquareDecimeters(double milligramsquaredecimeters) + public static MassMomentOfInertia FromMilligramSquareDecimeters(double value) { - return new MassMomentOfInertia(milligramsquaredecimeters, MassMomentOfInertiaUnit.MilligramSquareDecimeter); + return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.MilligramSquareDecimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromMilligramSquareMeters(double milligramsquaremeters) + public static MassMomentOfInertia FromMilligramSquareMeters(double value) { - return new MassMomentOfInertia(milligramsquaremeters, MassMomentOfInertiaUnit.MilligramSquareMeter); + return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.MilligramSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromMilligramSquareMillimeters(double milligramsquaremillimeters) + public static MassMomentOfInertia FromMilligramSquareMillimeters(double value) { - return new MassMomentOfInertia(milligramsquaremillimeters, MassMomentOfInertiaUnit.MilligramSquareMillimeter); + return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.MilligramSquareMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromPoundSquareFeet(double poundsquarefeet) + public static MassMomentOfInertia FromPoundSquareFeet(double value) { - return new MassMomentOfInertia(poundsquarefeet, MassMomentOfInertiaUnit.PoundSquareFoot); + return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.PoundSquareFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromPoundSquareInches(double poundsquareinches) + public static MassMomentOfInertia FromPoundSquareInches(double value) { - return new MassMomentOfInertia(poundsquareinches, MassMomentOfInertiaUnit.PoundSquareInch); + return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.PoundSquareInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromSlugSquareFeet(double slugsquarefeet) + public static MassMomentOfInertia FromSlugSquareFeet(double value) { - return new MassMomentOfInertia(slugsquarefeet, MassMomentOfInertiaUnit.SlugSquareFoot); + return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.SlugSquareFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromSlugSquareInches(double slugsquareinches) + public static MassMomentOfInertia FromSlugSquareInches(double value) { - return new MassMomentOfInertia(slugsquareinches, MassMomentOfInertiaUnit.SlugSquareInch); + return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.SlugSquareInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromTonneSquareCentimeters(double tonnesquarecentimeters) + public static MassMomentOfInertia FromTonneSquareCentimeters(double value) { - return new MassMomentOfInertia(tonnesquarecentimeters, MassMomentOfInertiaUnit.TonneSquareCentimeter); + return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.TonneSquareCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromTonneSquareDecimeters(double tonnesquaredecimeters) + public static MassMomentOfInertia FromTonneSquareDecimeters(double value) { - return new MassMomentOfInertia(tonnesquaredecimeters, MassMomentOfInertiaUnit.TonneSquareDecimeter); + return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.TonneSquareDecimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromTonneSquareMeters(double tonnesquaremeters) + public static MassMomentOfInertia FromTonneSquareMeters(double value) { - return new MassMomentOfInertia(tonnesquaremeters, MassMomentOfInertiaUnit.TonneSquareMeter); + return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.TonneSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MassMomentOfInertia FromTonneSquareMilimeters(double tonnesquaremilimeters) + public static MassMomentOfInertia FromTonneSquareMilimeters(double value) { - return new MassMomentOfInertia(tonnesquaremilimeters, MassMomentOfInertiaUnit.TonneSquareMilimeter); + return new MassMomentOfInertia(value, MassMomentOfInertiaUnit.TonneSquareMilimeter); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Molality.g.cs b/UnitsNet/GeneratedCode/Quantities/Molality.g.cs index da1b9a2d1b..017d459c53 100644 --- a/UnitsNet/GeneratedCode/Quantities/Molality.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Molality.g.cs @@ -232,18 +232,18 @@ public static string GetAbbreviation(MolalityUnit unit, IFormatProvider? provide /// Creates a from . /// /// If value is NaN or Infinity. - public static Molality FromMolesPerGram(double molespergram) + public static Molality FromMolesPerGram(double value) { - return new Molality(molespergram, MolalityUnit.MolePerGram); + return new Molality(value, MolalityUnit.MolePerGram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Molality FromMolesPerKilogram(double molesperkilogram) + public static Molality FromMolesPerKilogram(double value) { - return new Molality(molesperkilogram, MolalityUnit.MolePerKilogram); + return new Molality(value, MolalityUnit.MolePerKilogram); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/MolarEnergy.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarEnergy.g.cs index bfba26db00..f30bdc6f7f 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarEnergy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarEnergy.g.cs @@ -237,27 +237,27 @@ public static string GetAbbreviation(MolarEnergyUnit unit, IFormatProvider? prov /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarEnergy FromJoulesPerMole(double joulespermole) + public static MolarEnergy FromJoulesPerMole(double value) { - return new MolarEnergy(joulespermole, MolarEnergyUnit.JoulePerMole); + return new MolarEnergy(value, MolarEnergyUnit.JoulePerMole); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarEnergy FromKilojoulesPerMole(double kilojoulespermole) + public static MolarEnergy FromKilojoulesPerMole(double value) { - return new MolarEnergy(kilojoulespermole, MolarEnergyUnit.KilojoulePerMole); + return new MolarEnergy(value, MolarEnergyUnit.KilojoulePerMole); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarEnergy FromMegajoulesPerMole(double megajoulespermole) + public static MolarEnergy FromMegajoulesPerMole(double value) { - return new MolarEnergy(megajoulespermole, MolarEnergyUnit.MegajoulePerMole); + return new MolarEnergy(value, MolarEnergyUnit.MegajoulePerMole); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/MolarEntropy.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarEntropy.g.cs index b03a52aa8b..e1c0049a88 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarEntropy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarEntropy.g.cs @@ -237,27 +237,27 @@ public static string GetAbbreviation(MolarEntropyUnit unit, IFormatProvider? pro /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarEntropy FromJoulesPerMoleKelvin(double joulespermolekelvin) + public static MolarEntropy FromJoulesPerMoleKelvin(double value) { - return new MolarEntropy(joulespermolekelvin, MolarEntropyUnit.JoulePerMoleKelvin); + return new MolarEntropy(value, MolarEntropyUnit.JoulePerMoleKelvin); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarEntropy FromKilojoulesPerMoleKelvin(double kilojoulespermolekelvin) + public static MolarEntropy FromKilojoulesPerMoleKelvin(double value) { - return new MolarEntropy(kilojoulespermolekelvin, MolarEntropyUnit.KilojoulePerMoleKelvin); + return new MolarEntropy(value, MolarEntropyUnit.KilojoulePerMoleKelvin); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarEntropy FromMegajoulesPerMoleKelvin(double megajoulespermolekelvin) + public static MolarEntropy FromMegajoulesPerMoleKelvin(double value) { - return new MolarEntropy(megajoulespermolekelvin, MolarEntropyUnit.MegajoulePerMoleKelvin); + return new MolarEntropy(value, MolarEntropyUnit.MegajoulePerMoleKelvin); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/MolarFlow.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarFlow.g.cs index 0dd64967c2..52d7f13d6f 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarFlow.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarFlow.g.cs @@ -294,81 +294,81 @@ public static string GetAbbreviation(MolarFlowUnit unit, IFormatProvider? provid /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarFlow FromKilomolesPerHour(double kilomolesperhour) + public static MolarFlow FromKilomolesPerHour(double value) { - return new MolarFlow(kilomolesperhour, MolarFlowUnit.KilomolePerHour); + return new MolarFlow(value, MolarFlowUnit.KilomolePerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarFlow FromKilomolesPerMinute(double kilomolesperminute) + public static MolarFlow FromKilomolesPerMinute(double value) { - return new MolarFlow(kilomolesperminute, MolarFlowUnit.KilomolePerMinute); + return new MolarFlow(value, MolarFlowUnit.KilomolePerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarFlow FromKilomolesPerSecond(double kilomolespersecond) + public static MolarFlow FromKilomolesPerSecond(double value) { - return new MolarFlow(kilomolespersecond, MolarFlowUnit.KilomolePerSecond); + return new MolarFlow(value, MolarFlowUnit.KilomolePerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarFlow FromMolesPerHour(double molesperhour) + public static MolarFlow FromMolesPerHour(double value) { - return new MolarFlow(molesperhour, MolarFlowUnit.MolePerHour); + return new MolarFlow(value, MolarFlowUnit.MolePerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarFlow FromMolesPerMinute(double molesperminute) + public static MolarFlow FromMolesPerMinute(double value) { - return new MolarFlow(molesperminute, MolarFlowUnit.MolePerMinute); + return new MolarFlow(value, MolarFlowUnit.MolePerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarFlow FromMolesPerSecond(double molespersecond) + public static MolarFlow FromMolesPerSecond(double value) { - return new MolarFlow(molespersecond, MolarFlowUnit.MolePerSecond); + return new MolarFlow(value, MolarFlowUnit.MolePerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarFlow FromPoundMolesPerHour(double poundmolesperhour) + public static MolarFlow FromPoundMolesPerHour(double value) { - return new MolarFlow(poundmolesperhour, MolarFlowUnit.PoundMolePerHour); + return new MolarFlow(value, MolarFlowUnit.PoundMolePerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarFlow FromPoundMolesPerMinute(double poundmolesperminute) + public static MolarFlow FromPoundMolesPerMinute(double value) { - return new MolarFlow(poundmolesperminute, MolarFlowUnit.PoundMolePerMinute); + return new MolarFlow(value, MolarFlowUnit.PoundMolePerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarFlow FromPoundMolesPerSecond(double poundmolespersecond) + public static MolarFlow FromPoundMolesPerSecond(double value) { - return new MolarFlow(poundmolespersecond, MolarFlowUnit.PoundMolePerSecond); + return new MolarFlow(value, MolarFlowUnit.PoundMolePerSecond); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/MolarMass.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarMass.g.cs index 3bfbb57fd7..d7b7d6696a 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarMass.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarMass.g.cs @@ -325,117 +325,117 @@ public static string GetAbbreviation(MolarMassUnit unit, IFormatProvider? provid /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarMass FromCentigramsPerMole(double centigramspermole) + public static MolarMass FromCentigramsPerMole(double value) { - return new MolarMass(centigramspermole, MolarMassUnit.CentigramPerMole); + return new MolarMass(value, MolarMassUnit.CentigramPerMole); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarMass FromDecagramsPerMole(double decagramspermole) + public static MolarMass FromDecagramsPerMole(double value) { - return new MolarMass(decagramspermole, MolarMassUnit.DecagramPerMole); + return new MolarMass(value, MolarMassUnit.DecagramPerMole); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarMass FromDecigramsPerMole(double decigramspermole) + public static MolarMass FromDecigramsPerMole(double value) { - return new MolarMass(decigramspermole, MolarMassUnit.DecigramPerMole); + return new MolarMass(value, MolarMassUnit.DecigramPerMole); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarMass FromGramsPerMole(double gramspermole) + public static MolarMass FromGramsPerMole(double value) { - return new MolarMass(gramspermole, MolarMassUnit.GramPerMole); + return new MolarMass(value, MolarMassUnit.GramPerMole); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarMass FromHectogramsPerMole(double hectogramspermole) + public static MolarMass FromHectogramsPerMole(double value) { - return new MolarMass(hectogramspermole, MolarMassUnit.HectogramPerMole); + return new MolarMass(value, MolarMassUnit.HectogramPerMole); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarMass FromKilogramsPerKilomole(double kilogramsperkilomole) + public static MolarMass FromKilogramsPerKilomole(double value) { - return new MolarMass(kilogramsperkilomole, MolarMassUnit.KilogramPerKilomole); + return new MolarMass(value, MolarMassUnit.KilogramPerKilomole); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarMass FromKilogramsPerMole(double kilogramspermole) + public static MolarMass FromKilogramsPerMole(double value) { - return new MolarMass(kilogramspermole, MolarMassUnit.KilogramPerMole); + return new MolarMass(value, MolarMassUnit.KilogramPerMole); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarMass FromKilopoundsPerMole(double kilopoundspermole) + public static MolarMass FromKilopoundsPerMole(double value) { - return new MolarMass(kilopoundspermole, MolarMassUnit.KilopoundPerMole); + return new MolarMass(value, MolarMassUnit.KilopoundPerMole); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarMass FromMegapoundsPerMole(double megapoundspermole) + public static MolarMass FromMegapoundsPerMole(double value) { - return new MolarMass(megapoundspermole, MolarMassUnit.MegapoundPerMole); + return new MolarMass(value, MolarMassUnit.MegapoundPerMole); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarMass FromMicrogramsPerMole(double microgramspermole) + public static MolarMass FromMicrogramsPerMole(double value) { - return new MolarMass(microgramspermole, MolarMassUnit.MicrogramPerMole); + return new MolarMass(value, MolarMassUnit.MicrogramPerMole); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarMass FromMilligramsPerMole(double milligramspermole) + public static MolarMass FromMilligramsPerMole(double value) { - return new MolarMass(milligramspermole, MolarMassUnit.MilligramPerMole); + return new MolarMass(value, MolarMassUnit.MilligramPerMole); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarMass FromNanogramsPerMole(double nanogramspermole) + public static MolarMass FromNanogramsPerMole(double value) { - return new MolarMass(nanogramspermole, MolarMassUnit.NanogramPerMole); + return new MolarMass(value, MolarMassUnit.NanogramPerMole); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static MolarMass FromPoundsPerMole(double poundspermole) + public static MolarMass FromPoundsPerMole(double value) { - return new MolarMass(poundspermole, MolarMassUnit.PoundPerMole); + return new MolarMass(value, MolarMassUnit.PoundPerMole); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Molarity.g.cs b/UnitsNet/GeneratedCode/Quantities/Molarity.g.cs index 65c56868a3..7a1614b281 100644 --- a/UnitsNet/GeneratedCode/Quantities/Molarity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Molarity.g.cs @@ -311,99 +311,99 @@ public static string GetAbbreviation(MolarityUnit unit, IFormatProvider? provide /// Creates a from . /// /// If value is NaN or Infinity. - public static Molarity FromCentimolesPerLiter(double centimolesperliter) + public static Molarity FromCentimolesPerLiter(double value) { - return new Molarity(centimolesperliter, MolarityUnit.CentimolePerLiter); + return new Molarity(value, MolarityUnit.CentimolePerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Molarity FromDecimolesPerLiter(double decimolesperliter) + public static Molarity FromDecimolesPerLiter(double value) { - return new Molarity(decimolesperliter, MolarityUnit.DecimolePerLiter); + return new Molarity(value, MolarityUnit.DecimolePerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Molarity FromFemtomolesPerLiter(double femtomolesperliter) + public static Molarity FromFemtomolesPerLiter(double value) { - return new Molarity(femtomolesperliter, MolarityUnit.FemtomolePerLiter); + return new Molarity(value, MolarityUnit.FemtomolePerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Molarity FromKilomolesPerCubicMeter(double kilomolespercubicmeter) + public static Molarity FromKilomolesPerCubicMeter(double value) { - return new Molarity(kilomolespercubicmeter, MolarityUnit.KilomolePerCubicMeter); + return new Molarity(value, MolarityUnit.KilomolePerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Molarity FromMicromolesPerLiter(double micromolesperliter) + public static Molarity FromMicromolesPerLiter(double value) { - return new Molarity(micromolesperliter, MolarityUnit.MicromolePerLiter); + return new Molarity(value, MolarityUnit.MicromolePerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Molarity FromMillimolesPerLiter(double millimolesperliter) + public static Molarity FromMillimolesPerLiter(double value) { - return new Molarity(millimolesperliter, MolarityUnit.MillimolePerLiter); + return new Molarity(value, MolarityUnit.MillimolePerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Molarity FromMolesPerCubicMeter(double molespercubicmeter) + public static Molarity FromMolesPerCubicMeter(double value) { - return new Molarity(molespercubicmeter, MolarityUnit.MolePerCubicMeter); + return new Molarity(value, MolarityUnit.MolePerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Molarity FromMolesPerLiter(double molesperliter) + public static Molarity FromMolesPerLiter(double value) { - return new Molarity(molesperliter, MolarityUnit.MolePerLiter); + return new Molarity(value, MolarityUnit.MolePerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Molarity FromNanomolesPerLiter(double nanomolesperliter) + public static Molarity FromNanomolesPerLiter(double value) { - return new Molarity(nanomolesperliter, MolarityUnit.NanomolePerLiter); + return new Molarity(value, MolarityUnit.NanomolePerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Molarity FromPicomolesPerLiter(double picomolesperliter) + public static Molarity FromPicomolesPerLiter(double value) { - return new Molarity(picomolesperliter, MolarityUnit.PicomolePerLiter); + return new Molarity(value, MolarityUnit.PicomolePerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Molarity FromPoundMolesPerCubicFoot(double poundmolespercubicfoot) + public static Molarity FromPoundMolesPerCubicFoot(double value) { - return new Molarity(poundmolespercubicfoot, MolarityUnit.PoundMolePerCubicFoot); + return new Molarity(value, MolarityUnit.PoundMolePerCubicFoot); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Permeability.g.cs b/UnitsNet/GeneratedCode/Quantities/Permeability.g.cs index 127dee07c2..0220349934 100644 --- a/UnitsNet/GeneratedCode/Quantities/Permeability.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Permeability.g.cs @@ -224,9 +224,9 @@ public static string GetAbbreviation(PermeabilityUnit unit, IFormatProvider? pro /// Creates a from . /// /// If value is NaN or Infinity. - public static Permeability FromHenriesPerMeter(double henriespermeter) + public static Permeability FromHenriesPerMeter(double value) { - return new Permeability(henriespermeter, PermeabilityUnit.HenryPerMeter); + return new Permeability(value, PermeabilityUnit.HenryPerMeter); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Permittivity.g.cs b/UnitsNet/GeneratedCode/Quantities/Permittivity.g.cs index 0695207fde..9893ff11a7 100644 --- a/UnitsNet/GeneratedCode/Quantities/Permittivity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Permittivity.g.cs @@ -224,9 +224,9 @@ public static string GetAbbreviation(PermittivityUnit unit, IFormatProvider? pro /// Creates a from . /// /// If value is NaN or Infinity. - public static Permittivity FromFaradsPerMeter(double faradspermeter) + public static Permittivity FromFaradsPerMeter(double value) { - return new Permittivity(faradspermeter, PermittivityUnit.FaradPerMeter); + return new Permittivity(value, PermittivityUnit.FaradPerMeter); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/PorousMediumPermeability.g.cs b/UnitsNet/GeneratedCode/Quantities/PorousMediumPermeability.g.cs index 797b6278c8..7317201cad 100644 --- a/UnitsNet/GeneratedCode/Quantities/PorousMediumPermeability.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PorousMediumPermeability.g.cs @@ -256,45 +256,45 @@ public static string GetAbbreviation(PorousMediumPermeabilityUnit unit, IFormatP /// Creates a from . /// /// If value is NaN or Infinity. - public static PorousMediumPermeability FromDarcys(double darcys) + public static PorousMediumPermeability FromDarcys(double value) { - return new PorousMediumPermeability(darcys, PorousMediumPermeabilityUnit.Darcy); + return new PorousMediumPermeability(value, PorousMediumPermeabilityUnit.Darcy); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PorousMediumPermeability FromMicrodarcys(double microdarcys) + public static PorousMediumPermeability FromMicrodarcys(double value) { - return new PorousMediumPermeability(microdarcys, PorousMediumPermeabilityUnit.Microdarcy); + return new PorousMediumPermeability(value, PorousMediumPermeabilityUnit.Microdarcy); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PorousMediumPermeability FromMillidarcys(double millidarcys) + public static PorousMediumPermeability FromMillidarcys(double value) { - return new PorousMediumPermeability(millidarcys, PorousMediumPermeabilityUnit.Millidarcy); + return new PorousMediumPermeability(value, PorousMediumPermeabilityUnit.Millidarcy); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PorousMediumPermeability FromSquareCentimeters(double squarecentimeters) + public static PorousMediumPermeability FromSquareCentimeters(double value) { - return new PorousMediumPermeability(squarecentimeters, PorousMediumPermeabilityUnit.SquareCentimeter); + return new PorousMediumPermeability(value, PorousMediumPermeabilityUnit.SquareCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PorousMediumPermeability FromSquareMeters(double squaremeters) + public static PorousMediumPermeability FromSquareMeters(double value) { - return new PorousMediumPermeability(squaremeters, PorousMediumPermeabilityUnit.SquareMeter); + return new PorousMediumPermeability(value, PorousMediumPermeabilityUnit.SquareMeter); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Power.g.cs b/UnitsNet/GeneratedCode/Quantities/Power.g.cs index aea66bf0d1..186f60ad34 100644 --- a/UnitsNet/GeneratedCode/Quantities/Power.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Power.g.cs @@ -438,234 +438,234 @@ public static string GetAbbreviation(PowerUnit unit, IFormatProvider? provider) /// Creates a from . /// /// If value is NaN or Infinity. - public static Power FromBoilerHorsepower(double boilerhorsepower) + public static Power FromBoilerHorsepower(double value) { - return new Power(boilerhorsepower, PowerUnit.BoilerHorsepower); + return new Power(value, PowerUnit.BoilerHorsepower); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Power FromBritishThermalUnitsPerHour(double britishthermalunitsperhour) + public static Power FromBritishThermalUnitsPerHour(double value) { - return new Power(britishthermalunitsperhour, PowerUnit.BritishThermalUnitPerHour); + return new Power(value, PowerUnit.BritishThermalUnitPerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Power FromDecawatts(double decawatts) + public static Power FromDecawatts(double value) { - return new Power(decawatts, PowerUnit.Decawatt); + return new Power(value, PowerUnit.Decawatt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Power FromDeciwatts(double deciwatts) + public static Power FromDeciwatts(double value) { - return new Power(deciwatts, PowerUnit.Deciwatt); + return new Power(value, PowerUnit.Deciwatt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Power FromElectricalHorsepower(double electricalhorsepower) + public static Power FromElectricalHorsepower(double value) { - return new Power(electricalhorsepower, PowerUnit.ElectricalHorsepower); + return new Power(value, PowerUnit.ElectricalHorsepower); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Power FromFemtowatts(double femtowatts) + public static Power FromFemtowatts(double value) { - return new Power(femtowatts, PowerUnit.Femtowatt); + return new Power(value, PowerUnit.Femtowatt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Power FromGigajoulesPerHour(double gigajoulesperhour) + public static Power FromGigajoulesPerHour(double value) { - return new Power(gigajoulesperhour, PowerUnit.GigajoulePerHour); + return new Power(value, PowerUnit.GigajoulePerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Power FromGigawatts(double gigawatts) + public static Power FromGigawatts(double value) { - return new Power(gigawatts, PowerUnit.Gigawatt); + return new Power(value, PowerUnit.Gigawatt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Power FromHydraulicHorsepower(double hydraulichorsepower) + public static Power FromHydraulicHorsepower(double value) { - return new Power(hydraulichorsepower, PowerUnit.HydraulicHorsepower); + return new Power(value, PowerUnit.HydraulicHorsepower); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Power FromJoulesPerHour(double joulesperhour) + public static Power FromJoulesPerHour(double value) { - return new Power(joulesperhour, PowerUnit.JoulePerHour); + return new Power(value, PowerUnit.JoulePerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Power FromKilobritishThermalUnitsPerHour(double kilobritishthermalunitsperhour) + public static Power FromKilobritishThermalUnitsPerHour(double value) { - return new Power(kilobritishthermalunitsperhour, PowerUnit.KilobritishThermalUnitPerHour); + return new Power(value, PowerUnit.KilobritishThermalUnitPerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Power FromKilojoulesPerHour(double kilojoulesperhour) + public static Power FromKilojoulesPerHour(double value) { - return new Power(kilojoulesperhour, PowerUnit.KilojoulePerHour); + return new Power(value, PowerUnit.KilojoulePerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Power FromKilowatts(double kilowatts) + public static Power FromKilowatts(double value) { - return new Power(kilowatts, PowerUnit.Kilowatt); + return new Power(value, PowerUnit.Kilowatt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Power FromMechanicalHorsepower(double mechanicalhorsepower) + public static Power FromMechanicalHorsepower(double value) { - return new Power(mechanicalhorsepower, PowerUnit.MechanicalHorsepower); + return new Power(value, PowerUnit.MechanicalHorsepower); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Power FromMegabritishThermalUnitsPerHour(double megabritishthermalunitsperhour) + public static Power FromMegabritishThermalUnitsPerHour(double value) { - return new Power(megabritishthermalunitsperhour, PowerUnit.MegabritishThermalUnitPerHour); + return new Power(value, PowerUnit.MegabritishThermalUnitPerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Power FromMegajoulesPerHour(double megajoulesperhour) + public static Power FromMegajoulesPerHour(double value) { - return new Power(megajoulesperhour, PowerUnit.MegajoulePerHour); + return new Power(value, PowerUnit.MegajoulePerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Power FromMegawatts(double megawatts) + public static Power FromMegawatts(double value) { - return new Power(megawatts, PowerUnit.Megawatt); + return new Power(value, PowerUnit.Megawatt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Power FromMetricHorsepower(double metrichorsepower) + public static Power FromMetricHorsepower(double value) { - return new Power(metrichorsepower, PowerUnit.MetricHorsepower); + return new Power(value, PowerUnit.MetricHorsepower); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Power FromMicrowatts(double microwatts) + public static Power FromMicrowatts(double value) { - return new Power(microwatts, PowerUnit.Microwatt); + return new Power(value, PowerUnit.Microwatt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Power FromMillijoulesPerHour(double millijoulesperhour) + public static Power FromMillijoulesPerHour(double value) { - return new Power(millijoulesperhour, PowerUnit.MillijoulePerHour); + return new Power(value, PowerUnit.MillijoulePerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Power FromMilliwatts(double milliwatts) + public static Power FromMilliwatts(double value) { - return new Power(milliwatts, PowerUnit.Milliwatt); + return new Power(value, PowerUnit.Milliwatt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Power FromNanowatts(double nanowatts) + public static Power FromNanowatts(double value) { - return new Power(nanowatts, PowerUnit.Nanowatt); + return new Power(value, PowerUnit.Nanowatt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Power FromPetawatts(double petawatts) + public static Power FromPetawatts(double value) { - return new Power(petawatts, PowerUnit.Petawatt); + return new Power(value, PowerUnit.Petawatt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Power FromPicowatts(double picowatts) + public static Power FromPicowatts(double value) { - return new Power(picowatts, PowerUnit.Picowatt); + return new Power(value, PowerUnit.Picowatt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Power FromTerawatts(double terawatts) + public static Power FromTerawatts(double value) { - return new Power(terawatts, PowerUnit.Terawatt); + return new Power(value, PowerUnit.Terawatt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Power FromWatts(double watts) + public static Power FromWatts(double value) { - return new Power(watts, PowerUnit.Watt); + return new Power(value, PowerUnit.Watt); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/PowerDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/PowerDensity.g.cs index 22731dc022..f28f92ed39 100644 --- a/UnitsNet/GeneratedCode/Quantities/PowerDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PowerDensity.g.cs @@ -565,396 +565,396 @@ public static string GetAbbreviation(PowerDensityUnit unit, IFormatProvider? pro /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromDecawattsPerCubicFoot(double decawattspercubicfoot) + public static PowerDensity FromDecawattsPerCubicFoot(double value) { - return new PowerDensity(decawattspercubicfoot, PowerDensityUnit.DecawattPerCubicFoot); + return new PowerDensity(value, PowerDensityUnit.DecawattPerCubicFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromDecawattsPerCubicInch(double decawattspercubicinch) + public static PowerDensity FromDecawattsPerCubicInch(double value) { - return new PowerDensity(decawattspercubicinch, PowerDensityUnit.DecawattPerCubicInch); + return new PowerDensity(value, PowerDensityUnit.DecawattPerCubicInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromDecawattsPerCubicMeter(double decawattspercubicmeter) + public static PowerDensity FromDecawattsPerCubicMeter(double value) { - return new PowerDensity(decawattspercubicmeter, PowerDensityUnit.DecawattPerCubicMeter); + return new PowerDensity(value, PowerDensityUnit.DecawattPerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromDecawattsPerLiter(double decawattsperliter) + public static PowerDensity FromDecawattsPerLiter(double value) { - return new PowerDensity(decawattsperliter, PowerDensityUnit.DecawattPerLiter); + return new PowerDensity(value, PowerDensityUnit.DecawattPerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromDeciwattsPerCubicFoot(double deciwattspercubicfoot) + public static PowerDensity FromDeciwattsPerCubicFoot(double value) { - return new PowerDensity(deciwattspercubicfoot, PowerDensityUnit.DeciwattPerCubicFoot); + return new PowerDensity(value, PowerDensityUnit.DeciwattPerCubicFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromDeciwattsPerCubicInch(double deciwattspercubicinch) + public static PowerDensity FromDeciwattsPerCubicInch(double value) { - return new PowerDensity(deciwattspercubicinch, PowerDensityUnit.DeciwattPerCubicInch); + return new PowerDensity(value, PowerDensityUnit.DeciwattPerCubicInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromDeciwattsPerCubicMeter(double deciwattspercubicmeter) + public static PowerDensity FromDeciwattsPerCubicMeter(double value) { - return new PowerDensity(deciwattspercubicmeter, PowerDensityUnit.DeciwattPerCubicMeter); + return new PowerDensity(value, PowerDensityUnit.DeciwattPerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromDeciwattsPerLiter(double deciwattsperliter) + public static PowerDensity FromDeciwattsPerLiter(double value) { - return new PowerDensity(deciwattsperliter, PowerDensityUnit.DeciwattPerLiter); + return new PowerDensity(value, PowerDensityUnit.DeciwattPerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromGigawattsPerCubicFoot(double gigawattspercubicfoot) + public static PowerDensity FromGigawattsPerCubicFoot(double value) { - return new PowerDensity(gigawattspercubicfoot, PowerDensityUnit.GigawattPerCubicFoot); + return new PowerDensity(value, PowerDensityUnit.GigawattPerCubicFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromGigawattsPerCubicInch(double gigawattspercubicinch) + public static PowerDensity FromGigawattsPerCubicInch(double value) { - return new PowerDensity(gigawattspercubicinch, PowerDensityUnit.GigawattPerCubicInch); + return new PowerDensity(value, PowerDensityUnit.GigawattPerCubicInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromGigawattsPerCubicMeter(double gigawattspercubicmeter) + public static PowerDensity FromGigawattsPerCubicMeter(double value) { - return new PowerDensity(gigawattspercubicmeter, PowerDensityUnit.GigawattPerCubicMeter); + return new PowerDensity(value, PowerDensityUnit.GigawattPerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromGigawattsPerLiter(double gigawattsperliter) + public static PowerDensity FromGigawattsPerLiter(double value) { - return new PowerDensity(gigawattsperliter, PowerDensityUnit.GigawattPerLiter); + return new PowerDensity(value, PowerDensityUnit.GigawattPerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromKilowattsPerCubicFoot(double kilowattspercubicfoot) + public static PowerDensity FromKilowattsPerCubicFoot(double value) { - return new PowerDensity(kilowattspercubicfoot, PowerDensityUnit.KilowattPerCubicFoot); + return new PowerDensity(value, PowerDensityUnit.KilowattPerCubicFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromKilowattsPerCubicInch(double kilowattspercubicinch) + public static PowerDensity FromKilowattsPerCubicInch(double value) { - return new PowerDensity(kilowattspercubicinch, PowerDensityUnit.KilowattPerCubicInch); + return new PowerDensity(value, PowerDensityUnit.KilowattPerCubicInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromKilowattsPerCubicMeter(double kilowattspercubicmeter) + public static PowerDensity FromKilowattsPerCubicMeter(double value) { - return new PowerDensity(kilowattspercubicmeter, PowerDensityUnit.KilowattPerCubicMeter); + return new PowerDensity(value, PowerDensityUnit.KilowattPerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromKilowattsPerLiter(double kilowattsperliter) + public static PowerDensity FromKilowattsPerLiter(double value) { - return new PowerDensity(kilowattsperliter, PowerDensityUnit.KilowattPerLiter); + return new PowerDensity(value, PowerDensityUnit.KilowattPerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromMegawattsPerCubicFoot(double megawattspercubicfoot) + public static PowerDensity FromMegawattsPerCubicFoot(double value) { - return new PowerDensity(megawattspercubicfoot, PowerDensityUnit.MegawattPerCubicFoot); + return new PowerDensity(value, PowerDensityUnit.MegawattPerCubicFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromMegawattsPerCubicInch(double megawattspercubicinch) + public static PowerDensity FromMegawattsPerCubicInch(double value) { - return new PowerDensity(megawattspercubicinch, PowerDensityUnit.MegawattPerCubicInch); + return new PowerDensity(value, PowerDensityUnit.MegawattPerCubicInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromMegawattsPerCubicMeter(double megawattspercubicmeter) + public static PowerDensity FromMegawattsPerCubicMeter(double value) { - return new PowerDensity(megawattspercubicmeter, PowerDensityUnit.MegawattPerCubicMeter); + return new PowerDensity(value, PowerDensityUnit.MegawattPerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromMegawattsPerLiter(double megawattsperliter) + public static PowerDensity FromMegawattsPerLiter(double value) { - return new PowerDensity(megawattsperliter, PowerDensityUnit.MegawattPerLiter); + return new PowerDensity(value, PowerDensityUnit.MegawattPerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromMicrowattsPerCubicFoot(double microwattspercubicfoot) + public static PowerDensity FromMicrowattsPerCubicFoot(double value) { - return new PowerDensity(microwattspercubicfoot, PowerDensityUnit.MicrowattPerCubicFoot); + return new PowerDensity(value, PowerDensityUnit.MicrowattPerCubicFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromMicrowattsPerCubicInch(double microwattspercubicinch) + public static PowerDensity FromMicrowattsPerCubicInch(double value) { - return new PowerDensity(microwattspercubicinch, PowerDensityUnit.MicrowattPerCubicInch); + return new PowerDensity(value, PowerDensityUnit.MicrowattPerCubicInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromMicrowattsPerCubicMeter(double microwattspercubicmeter) + public static PowerDensity FromMicrowattsPerCubicMeter(double value) { - return new PowerDensity(microwattspercubicmeter, PowerDensityUnit.MicrowattPerCubicMeter); + return new PowerDensity(value, PowerDensityUnit.MicrowattPerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromMicrowattsPerLiter(double microwattsperliter) + public static PowerDensity FromMicrowattsPerLiter(double value) { - return new PowerDensity(microwattsperliter, PowerDensityUnit.MicrowattPerLiter); + return new PowerDensity(value, PowerDensityUnit.MicrowattPerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromMilliwattsPerCubicFoot(double milliwattspercubicfoot) + public static PowerDensity FromMilliwattsPerCubicFoot(double value) { - return new PowerDensity(milliwattspercubicfoot, PowerDensityUnit.MilliwattPerCubicFoot); + return new PowerDensity(value, PowerDensityUnit.MilliwattPerCubicFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromMilliwattsPerCubicInch(double milliwattspercubicinch) + public static PowerDensity FromMilliwattsPerCubicInch(double value) { - return new PowerDensity(milliwattspercubicinch, PowerDensityUnit.MilliwattPerCubicInch); + return new PowerDensity(value, PowerDensityUnit.MilliwattPerCubicInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromMilliwattsPerCubicMeter(double milliwattspercubicmeter) + public static PowerDensity FromMilliwattsPerCubicMeter(double value) { - return new PowerDensity(milliwattspercubicmeter, PowerDensityUnit.MilliwattPerCubicMeter); + return new PowerDensity(value, PowerDensityUnit.MilliwattPerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromMilliwattsPerLiter(double milliwattsperliter) + public static PowerDensity FromMilliwattsPerLiter(double value) { - return new PowerDensity(milliwattsperliter, PowerDensityUnit.MilliwattPerLiter); + return new PowerDensity(value, PowerDensityUnit.MilliwattPerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromNanowattsPerCubicFoot(double nanowattspercubicfoot) + public static PowerDensity FromNanowattsPerCubicFoot(double value) { - return new PowerDensity(nanowattspercubicfoot, PowerDensityUnit.NanowattPerCubicFoot); + return new PowerDensity(value, PowerDensityUnit.NanowattPerCubicFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromNanowattsPerCubicInch(double nanowattspercubicinch) + public static PowerDensity FromNanowattsPerCubicInch(double value) { - return new PowerDensity(nanowattspercubicinch, PowerDensityUnit.NanowattPerCubicInch); + return new PowerDensity(value, PowerDensityUnit.NanowattPerCubicInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromNanowattsPerCubicMeter(double nanowattspercubicmeter) + public static PowerDensity FromNanowattsPerCubicMeter(double value) { - return new PowerDensity(nanowattspercubicmeter, PowerDensityUnit.NanowattPerCubicMeter); + return new PowerDensity(value, PowerDensityUnit.NanowattPerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromNanowattsPerLiter(double nanowattsperliter) + public static PowerDensity FromNanowattsPerLiter(double value) { - return new PowerDensity(nanowattsperliter, PowerDensityUnit.NanowattPerLiter); + return new PowerDensity(value, PowerDensityUnit.NanowattPerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromPicowattsPerCubicFoot(double picowattspercubicfoot) + public static PowerDensity FromPicowattsPerCubicFoot(double value) { - return new PowerDensity(picowattspercubicfoot, PowerDensityUnit.PicowattPerCubicFoot); + return new PowerDensity(value, PowerDensityUnit.PicowattPerCubicFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromPicowattsPerCubicInch(double picowattspercubicinch) + public static PowerDensity FromPicowattsPerCubicInch(double value) { - return new PowerDensity(picowattspercubicinch, PowerDensityUnit.PicowattPerCubicInch); + return new PowerDensity(value, PowerDensityUnit.PicowattPerCubicInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromPicowattsPerCubicMeter(double picowattspercubicmeter) + public static PowerDensity FromPicowattsPerCubicMeter(double value) { - return new PowerDensity(picowattspercubicmeter, PowerDensityUnit.PicowattPerCubicMeter); + return new PowerDensity(value, PowerDensityUnit.PicowattPerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromPicowattsPerLiter(double picowattsperliter) + public static PowerDensity FromPicowattsPerLiter(double value) { - return new PowerDensity(picowattsperliter, PowerDensityUnit.PicowattPerLiter); + return new PowerDensity(value, PowerDensityUnit.PicowattPerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromTerawattsPerCubicFoot(double terawattspercubicfoot) + public static PowerDensity FromTerawattsPerCubicFoot(double value) { - return new PowerDensity(terawattspercubicfoot, PowerDensityUnit.TerawattPerCubicFoot); + return new PowerDensity(value, PowerDensityUnit.TerawattPerCubicFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromTerawattsPerCubicInch(double terawattspercubicinch) + public static PowerDensity FromTerawattsPerCubicInch(double value) { - return new PowerDensity(terawattspercubicinch, PowerDensityUnit.TerawattPerCubicInch); + return new PowerDensity(value, PowerDensityUnit.TerawattPerCubicInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromTerawattsPerCubicMeter(double terawattspercubicmeter) + public static PowerDensity FromTerawattsPerCubicMeter(double value) { - return new PowerDensity(terawattspercubicmeter, PowerDensityUnit.TerawattPerCubicMeter); + return new PowerDensity(value, PowerDensityUnit.TerawattPerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromTerawattsPerLiter(double terawattsperliter) + public static PowerDensity FromTerawattsPerLiter(double value) { - return new PowerDensity(terawattsperliter, PowerDensityUnit.TerawattPerLiter); + return new PowerDensity(value, PowerDensityUnit.TerawattPerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromWattsPerCubicFoot(double wattspercubicfoot) + public static PowerDensity FromWattsPerCubicFoot(double value) { - return new PowerDensity(wattspercubicfoot, PowerDensityUnit.WattPerCubicFoot); + return new PowerDensity(value, PowerDensityUnit.WattPerCubicFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromWattsPerCubicInch(double wattspercubicinch) + public static PowerDensity FromWattsPerCubicInch(double value) { - return new PowerDensity(wattspercubicinch, PowerDensityUnit.WattPerCubicInch); + return new PowerDensity(value, PowerDensityUnit.WattPerCubicInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromWattsPerCubicMeter(double wattspercubicmeter) + public static PowerDensity FromWattsPerCubicMeter(double value) { - return new PowerDensity(wattspercubicmeter, PowerDensityUnit.WattPerCubicMeter); + return new PowerDensity(value, PowerDensityUnit.WattPerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerDensity FromWattsPerLiter(double wattsperliter) + public static PowerDensity FromWattsPerLiter(double value) { - return new PowerDensity(wattsperliter, PowerDensityUnit.WattPerLiter); + return new PowerDensity(value, PowerDensityUnit.WattPerLiter); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/PowerRatio.g.cs b/UnitsNet/GeneratedCode/Quantities/PowerRatio.g.cs index 32d914c432..135515997d 100644 --- a/UnitsNet/GeneratedCode/Quantities/PowerRatio.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PowerRatio.g.cs @@ -229,18 +229,18 @@ public static string GetAbbreviation(PowerRatioUnit unit, IFormatProvider? provi /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerRatio FromDecibelMilliwatts(double decibelmilliwatts) + public static PowerRatio FromDecibelMilliwatts(double value) { - return new PowerRatio(decibelmilliwatts, PowerRatioUnit.DecibelMilliwatt); + return new PowerRatio(value, PowerRatioUnit.DecibelMilliwatt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PowerRatio FromDecibelWatts(double decibelwatts) + public static PowerRatio FromDecibelWatts(double value) { - return new PowerRatio(decibelwatts, PowerRatioUnit.DecibelWatt); + return new PowerRatio(value, PowerRatioUnit.DecibelWatt); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Pressure.g.cs b/UnitsNet/GeneratedCode/Quantities/Pressure.g.cs index a0c06f2a49..cc8e6aa4d4 100644 --- a/UnitsNet/GeneratedCode/Quantities/Pressure.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Pressure.g.cs @@ -617,441 +617,441 @@ public static string GetAbbreviation(PressureUnit unit, IFormatProvider? provide /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromAtmospheres(double atmospheres) + public static Pressure FromAtmospheres(double value) { - return new Pressure(atmospheres, PressureUnit.Atmosphere); + return new Pressure(value, PressureUnit.Atmosphere); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromBars(double bars) + public static Pressure FromBars(double value) { - return new Pressure(bars, PressureUnit.Bar); + return new Pressure(value, PressureUnit.Bar); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromCentibars(double centibars) + public static Pressure FromCentibars(double value) { - return new Pressure(centibars, PressureUnit.Centibar); + return new Pressure(value, PressureUnit.Centibar); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromCentimetersOfWaterColumn(double centimetersofwatercolumn) + public static Pressure FromCentimetersOfWaterColumn(double value) { - return new Pressure(centimetersofwatercolumn, PressureUnit.CentimeterOfWaterColumn); + return new Pressure(value, PressureUnit.CentimeterOfWaterColumn); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromDecapascals(double decapascals) + public static Pressure FromDecapascals(double value) { - return new Pressure(decapascals, PressureUnit.Decapascal); + return new Pressure(value, PressureUnit.Decapascal); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromDecibars(double decibars) + public static Pressure FromDecibars(double value) { - return new Pressure(decibars, PressureUnit.Decibar); + return new Pressure(value, PressureUnit.Decibar); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromDynesPerSquareCentimeter(double dynespersquarecentimeter) + public static Pressure FromDynesPerSquareCentimeter(double value) { - return new Pressure(dynespersquarecentimeter, PressureUnit.DynePerSquareCentimeter); + return new Pressure(value, PressureUnit.DynePerSquareCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromFeetOfElevation(double feetofelevation) + public static Pressure FromFeetOfElevation(double value) { - return new Pressure(feetofelevation, PressureUnit.FootOfElevation); + return new Pressure(value, PressureUnit.FootOfElevation); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromFeetOfHead(double feetofhead) + public static Pressure FromFeetOfHead(double value) { - return new Pressure(feetofhead, PressureUnit.FootOfHead); + return new Pressure(value, PressureUnit.FootOfHead); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromGigapascals(double gigapascals) + public static Pressure FromGigapascals(double value) { - return new Pressure(gigapascals, PressureUnit.Gigapascal); + return new Pressure(value, PressureUnit.Gigapascal); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromHectopascals(double hectopascals) + public static Pressure FromHectopascals(double value) { - return new Pressure(hectopascals, PressureUnit.Hectopascal); + return new Pressure(value, PressureUnit.Hectopascal); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromInchesOfMercury(double inchesofmercury) + public static Pressure FromInchesOfMercury(double value) { - return new Pressure(inchesofmercury, PressureUnit.InchOfMercury); + return new Pressure(value, PressureUnit.InchOfMercury); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromInchesOfWaterColumn(double inchesofwatercolumn) + public static Pressure FromInchesOfWaterColumn(double value) { - return new Pressure(inchesofwatercolumn, PressureUnit.InchOfWaterColumn); + return new Pressure(value, PressureUnit.InchOfWaterColumn); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromKilobars(double kilobars) + public static Pressure FromKilobars(double value) { - return new Pressure(kilobars, PressureUnit.Kilobar); + return new Pressure(value, PressureUnit.Kilobar); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromKilogramsForcePerSquareCentimeter(double kilogramsforcepersquarecentimeter) + public static Pressure FromKilogramsForcePerSquareCentimeter(double value) { - return new Pressure(kilogramsforcepersquarecentimeter, PressureUnit.KilogramForcePerSquareCentimeter); + return new Pressure(value, PressureUnit.KilogramForcePerSquareCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromKilogramsForcePerSquareMeter(double kilogramsforcepersquaremeter) + public static Pressure FromKilogramsForcePerSquareMeter(double value) { - return new Pressure(kilogramsforcepersquaremeter, PressureUnit.KilogramForcePerSquareMeter); + return new Pressure(value, PressureUnit.KilogramForcePerSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromKilogramsForcePerSquareMillimeter(double kilogramsforcepersquaremillimeter) + public static Pressure FromKilogramsForcePerSquareMillimeter(double value) { - return new Pressure(kilogramsforcepersquaremillimeter, PressureUnit.KilogramForcePerSquareMillimeter); + return new Pressure(value, PressureUnit.KilogramForcePerSquareMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromKilonewtonsPerSquareCentimeter(double kilonewtonspersquarecentimeter) + public static Pressure FromKilonewtonsPerSquareCentimeter(double value) { - return new Pressure(kilonewtonspersquarecentimeter, PressureUnit.KilonewtonPerSquareCentimeter); + return new Pressure(value, PressureUnit.KilonewtonPerSquareCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromKilonewtonsPerSquareMeter(double kilonewtonspersquaremeter) + public static Pressure FromKilonewtonsPerSquareMeter(double value) { - return new Pressure(kilonewtonspersquaremeter, PressureUnit.KilonewtonPerSquareMeter); + return new Pressure(value, PressureUnit.KilonewtonPerSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromKilonewtonsPerSquareMillimeter(double kilonewtonspersquaremillimeter) + public static Pressure FromKilonewtonsPerSquareMillimeter(double value) { - return new Pressure(kilonewtonspersquaremillimeter, PressureUnit.KilonewtonPerSquareMillimeter); + return new Pressure(value, PressureUnit.KilonewtonPerSquareMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromKilopascals(double kilopascals) + public static Pressure FromKilopascals(double value) { - return new Pressure(kilopascals, PressureUnit.Kilopascal); + return new Pressure(value, PressureUnit.Kilopascal); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromKilopoundsForcePerSquareFoot(double kilopoundsforcepersquarefoot) + public static Pressure FromKilopoundsForcePerSquareFoot(double value) { - return new Pressure(kilopoundsforcepersquarefoot, PressureUnit.KilopoundForcePerSquareFoot); + return new Pressure(value, PressureUnit.KilopoundForcePerSquareFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromKilopoundsForcePerSquareInch(double kilopoundsforcepersquareinch) + public static Pressure FromKilopoundsForcePerSquareInch(double value) { - return new Pressure(kilopoundsforcepersquareinch, PressureUnit.KilopoundForcePerSquareInch); + return new Pressure(value, PressureUnit.KilopoundForcePerSquareInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromKilopoundsForcePerSquareMil(double kilopoundsforcepersquaremil) + public static Pressure FromKilopoundsForcePerSquareMil(double value) { - return new Pressure(kilopoundsforcepersquaremil, PressureUnit.KilopoundForcePerSquareMil); + return new Pressure(value, PressureUnit.KilopoundForcePerSquareMil); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromMegabars(double megabars) + public static Pressure FromMegabars(double value) { - return new Pressure(megabars, PressureUnit.Megabar); + return new Pressure(value, PressureUnit.Megabar); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromMeganewtonsPerSquareMeter(double meganewtonspersquaremeter) + public static Pressure FromMeganewtonsPerSquareMeter(double value) { - return new Pressure(meganewtonspersquaremeter, PressureUnit.MeganewtonPerSquareMeter); + return new Pressure(value, PressureUnit.MeganewtonPerSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromMegapascals(double megapascals) + public static Pressure FromMegapascals(double value) { - return new Pressure(megapascals, PressureUnit.Megapascal); + return new Pressure(value, PressureUnit.Megapascal); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromMetersOfElevation(double metersofelevation) + public static Pressure FromMetersOfElevation(double value) { - return new Pressure(metersofelevation, PressureUnit.MeterOfElevation); + return new Pressure(value, PressureUnit.MeterOfElevation); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromMetersOfHead(double metersofhead) + public static Pressure FromMetersOfHead(double value) { - return new Pressure(metersofhead, PressureUnit.MeterOfHead); + return new Pressure(value, PressureUnit.MeterOfHead); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromMetersOfWaterColumn(double metersofwatercolumn) + public static Pressure FromMetersOfWaterColumn(double value) { - return new Pressure(metersofwatercolumn, PressureUnit.MeterOfWaterColumn); + return new Pressure(value, PressureUnit.MeterOfWaterColumn); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromMicrobars(double microbars) + public static Pressure FromMicrobars(double value) { - return new Pressure(microbars, PressureUnit.Microbar); + return new Pressure(value, PressureUnit.Microbar); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromMicropascals(double micropascals) + public static Pressure FromMicropascals(double value) { - return new Pressure(micropascals, PressureUnit.Micropascal); + return new Pressure(value, PressureUnit.Micropascal); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromMillibars(double millibars) + public static Pressure FromMillibars(double value) { - return new Pressure(millibars, PressureUnit.Millibar); + return new Pressure(value, PressureUnit.Millibar); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromMillimetersOfMercury(double millimetersofmercury) + public static Pressure FromMillimetersOfMercury(double value) { - return new Pressure(millimetersofmercury, PressureUnit.MillimeterOfMercury); + return new Pressure(value, PressureUnit.MillimeterOfMercury); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromMillimetersOfWaterColumn(double millimetersofwatercolumn) + public static Pressure FromMillimetersOfWaterColumn(double value) { - return new Pressure(millimetersofwatercolumn, PressureUnit.MillimeterOfWaterColumn); + return new Pressure(value, PressureUnit.MillimeterOfWaterColumn); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromMillipascals(double millipascals) + public static Pressure FromMillipascals(double value) { - return new Pressure(millipascals, PressureUnit.Millipascal); + return new Pressure(value, PressureUnit.Millipascal); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromNewtonsPerSquareCentimeter(double newtonspersquarecentimeter) + public static Pressure FromNewtonsPerSquareCentimeter(double value) { - return new Pressure(newtonspersquarecentimeter, PressureUnit.NewtonPerSquareCentimeter); + return new Pressure(value, PressureUnit.NewtonPerSquareCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromNewtonsPerSquareMeter(double newtonspersquaremeter) + public static Pressure FromNewtonsPerSquareMeter(double value) { - return new Pressure(newtonspersquaremeter, PressureUnit.NewtonPerSquareMeter); + return new Pressure(value, PressureUnit.NewtonPerSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromNewtonsPerSquareMillimeter(double newtonspersquaremillimeter) + public static Pressure FromNewtonsPerSquareMillimeter(double value) { - return new Pressure(newtonspersquaremillimeter, PressureUnit.NewtonPerSquareMillimeter); + return new Pressure(value, PressureUnit.NewtonPerSquareMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromPascals(double pascals) + public static Pressure FromPascals(double value) { - return new Pressure(pascals, PressureUnit.Pascal); + return new Pressure(value, PressureUnit.Pascal); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromPoundsForcePerSquareFoot(double poundsforcepersquarefoot) + public static Pressure FromPoundsForcePerSquareFoot(double value) { - return new Pressure(poundsforcepersquarefoot, PressureUnit.PoundForcePerSquareFoot); + return new Pressure(value, PressureUnit.PoundForcePerSquareFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromPoundsForcePerSquareInch(double poundsforcepersquareinch) + public static Pressure FromPoundsForcePerSquareInch(double value) { - return new Pressure(poundsforcepersquareinch, PressureUnit.PoundForcePerSquareInch); + return new Pressure(value, PressureUnit.PoundForcePerSquareInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromPoundsForcePerSquareMil(double poundsforcepersquaremil) + public static Pressure FromPoundsForcePerSquareMil(double value) { - return new Pressure(poundsforcepersquaremil, PressureUnit.PoundForcePerSquareMil); + return new Pressure(value, PressureUnit.PoundForcePerSquareMil); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromPoundsPerInchSecondSquared(double poundsperinchsecondsquared) + public static Pressure FromPoundsPerInchSecondSquared(double value) { - return new Pressure(poundsperinchsecondsquared, PressureUnit.PoundPerInchSecondSquared); + return new Pressure(value, PressureUnit.PoundPerInchSecondSquared); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromTechnicalAtmospheres(double technicalatmospheres) + public static Pressure FromTechnicalAtmospheres(double value) { - return new Pressure(technicalatmospheres, PressureUnit.TechnicalAtmosphere); + return new Pressure(value, PressureUnit.TechnicalAtmosphere); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromTonnesForcePerSquareCentimeter(double tonnesforcepersquarecentimeter) + public static Pressure FromTonnesForcePerSquareCentimeter(double value) { - return new Pressure(tonnesforcepersquarecentimeter, PressureUnit.TonneForcePerSquareCentimeter); + return new Pressure(value, PressureUnit.TonneForcePerSquareCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromTonnesForcePerSquareMeter(double tonnesforcepersquaremeter) + public static Pressure FromTonnesForcePerSquareMeter(double value) { - return new Pressure(tonnesforcepersquaremeter, PressureUnit.TonneForcePerSquareMeter); + return new Pressure(value, PressureUnit.TonneForcePerSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromTonnesForcePerSquareMillimeter(double tonnesforcepersquaremillimeter) + public static Pressure FromTonnesForcePerSquareMillimeter(double value) { - return new Pressure(tonnesforcepersquaremillimeter, PressureUnit.TonneForcePerSquareMillimeter); + return new Pressure(value, PressureUnit.TonneForcePerSquareMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Pressure FromTorrs(double torrs) + public static Pressure FromTorrs(double value) { - return new Pressure(torrs, PressureUnit.Torr); + return new Pressure(value, PressureUnit.Torr); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.g.cs b/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.g.cs index e7db9ac5b0..8e1a30cec3 100644 --- a/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.g.cs @@ -364,162 +364,162 @@ public static string GetAbbreviation(PressureChangeRateUnit unit, IFormatProvide /// Creates a from . /// /// If value is NaN or Infinity. - public static PressureChangeRate FromAtmospheresPerSecond(double atmospherespersecond) + public static PressureChangeRate FromAtmospheresPerSecond(double value) { - return new PressureChangeRate(atmospherespersecond, PressureChangeRateUnit.AtmospherePerSecond); + return new PressureChangeRate(value, PressureChangeRateUnit.AtmospherePerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PressureChangeRate FromBarsPerMinute(double barsperminute) + public static PressureChangeRate FromBarsPerMinute(double value) { - return new PressureChangeRate(barsperminute, PressureChangeRateUnit.BarPerMinute); + return new PressureChangeRate(value, PressureChangeRateUnit.BarPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PressureChangeRate FromBarsPerSecond(double barspersecond) + public static PressureChangeRate FromBarsPerSecond(double value) { - return new PressureChangeRate(barspersecond, PressureChangeRateUnit.BarPerSecond); + return new PressureChangeRate(value, PressureChangeRateUnit.BarPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PressureChangeRate FromKilopascalsPerMinute(double kilopascalsperminute) + public static PressureChangeRate FromKilopascalsPerMinute(double value) { - return new PressureChangeRate(kilopascalsperminute, PressureChangeRateUnit.KilopascalPerMinute); + return new PressureChangeRate(value, PressureChangeRateUnit.KilopascalPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PressureChangeRate FromKilopascalsPerSecond(double kilopascalspersecond) + public static PressureChangeRate FromKilopascalsPerSecond(double value) { - return new PressureChangeRate(kilopascalspersecond, PressureChangeRateUnit.KilopascalPerSecond); + return new PressureChangeRate(value, PressureChangeRateUnit.KilopascalPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PressureChangeRate FromKilopoundsForcePerSquareInchPerMinute(double kilopoundsforcepersquareinchperminute) + public static PressureChangeRate FromKilopoundsForcePerSquareInchPerMinute(double value) { - return new PressureChangeRate(kilopoundsforcepersquareinchperminute, PressureChangeRateUnit.KilopoundForcePerSquareInchPerMinute); + return new PressureChangeRate(value, PressureChangeRateUnit.KilopoundForcePerSquareInchPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PressureChangeRate FromKilopoundsForcePerSquareInchPerSecond(double kilopoundsforcepersquareinchpersecond) + public static PressureChangeRate FromKilopoundsForcePerSquareInchPerSecond(double value) { - return new PressureChangeRate(kilopoundsforcepersquareinchpersecond, PressureChangeRateUnit.KilopoundForcePerSquareInchPerSecond); + return new PressureChangeRate(value, PressureChangeRateUnit.KilopoundForcePerSquareInchPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PressureChangeRate FromMegapascalsPerMinute(double megapascalsperminute) + public static PressureChangeRate FromMegapascalsPerMinute(double value) { - return new PressureChangeRate(megapascalsperminute, PressureChangeRateUnit.MegapascalPerMinute); + return new PressureChangeRate(value, PressureChangeRateUnit.MegapascalPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PressureChangeRate FromMegapascalsPerSecond(double megapascalspersecond) + public static PressureChangeRate FromMegapascalsPerSecond(double value) { - return new PressureChangeRate(megapascalspersecond, PressureChangeRateUnit.MegapascalPerSecond); + return new PressureChangeRate(value, PressureChangeRateUnit.MegapascalPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PressureChangeRate FromMegapoundsForcePerSquareInchPerMinute(double megapoundsforcepersquareinchperminute) + public static PressureChangeRate FromMegapoundsForcePerSquareInchPerMinute(double value) { - return new PressureChangeRate(megapoundsforcepersquareinchperminute, PressureChangeRateUnit.MegapoundForcePerSquareInchPerMinute); + return new PressureChangeRate(value, PressureChangeRateUnit.MegapoundForcePerSquareInchPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PressureChangeRate FromMegapoundsForcePerSquareInchPerSecond(double megapoundsforcepersquareinchpersecond) + public static PressureChangeRate FromMegapoundsForcePerSquareInchPerSecond(double value) { - return new PressureChangeRate(megapoundsforcepersquareinchpersecond, PressureChangeRateUnit.MegapoundForcePerSquareInchPerSecond); + return new PressureChangeRate(value, PressureChangeRateUnit.MegapoundForcePerSquareInchPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PressureChangeRate FromMillibarsPerMinute(double millibarsperminute) + public static PressureChangeRate FromMillibarsPerMinute(double value) { - return new PressureChangeRate(millibarsperminute, PressureChangeRateUnit.MillibarPerMinute); + return new PressureChangeRate(value, PressureChangeRateUnit.MillibarPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PressureChangeRate FromMillibarsPerSecond(double millibarspersecond) + public static PressureChangeRate FromMillibarsPerSecond(double value) { - return new PressureChangeRate(millibarspersecond, PressureChangeRateUnit.MillibarPerSecond); + return new PressureChangeRate(value, PressureChangeRateUnit.MillibarPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PressureChangeRate FromMillimetersOfMercuryPerSecond(double millimetersofmercurypersecond) + public static PressureChangeRate FromMillimetersOfMercuryPerSecond(double value) { - return new PressureChangeRate(millimetersofmercurypersecond, PressureChangeRateUnit.MillimeterOfMercuryPerSecond); + return new PressureChangeRate(value, PressureChangeRateUnit.MillimeterOfMercuryPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PressureChangeRate FromPascalsPerMinute(double pascalsperminute) + public static PressureChangeRate FromPascalsPerMinute(double value) { - return new PressureChangeRate(pascalsperminute, PressureChangeRateUnit.PascalPerMinute); + return new PressureChangeRate(value, PressureChangeRateUnit.PascalPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PressureChangeRate FromPascalsPerSecond(double pascalspersecond) + public static PressureChangeRate FromPascalsPerSecond(double value) { - return new PressureChangeRate(pascalspersecond, PressureChangeRateUnit.PascalPerSecond); + return new PressureChangeRate(value, PressureChangeRateUnit.PascalPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PressureChangeRate FromPoundsForcePerSquareInchPerMinute(double poundsforcepersquareinchperminute) + public static PressureChangeRate FromPoundsForcePerSquareInchPerMinute(double value) { - return new PressureChangeRate(poundsforcepersquareinchperminute, PressureChangeRateUnit.PoundForcePerSquareInchPerMinute); + return new PressureChangeRate(value, PressureChangeRateUnit.PoundForcePerSquareInchPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static PressureChangeRate FromPoundsForcePerSquareInchPerSecond(double poundsforcepersquareinchpersecond) + public static PressureChangeRate FromPoundsForcePerSquareInchPerSecond(double value) { - return new PressureChangeRate(poundsforcepersquareinchpersecond, PressureChangeRateUnit.PoundForcePerSquareInchPerSecond); + return new PressureChangeRate(value, PressureChangeRateUnit.PoundForcePerSquareInchPerSecond); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/RadiationExposure.g.cs b/UnitsNet/GeneratedCode/Quantities/RadiationExposure.g.cs index f611c99e5e..c59e62f5aa 100644 --- a/UnitsNet/GeneratedCode/Quantities/RadiationExposure.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RadiationExposure.g.cs @@ -277,72 +277,72 @@ public static string GetAbbreviation(RadiationExposureUnit unit, IFormatProvider /// Creates a from . /// /// If value is NaN or Infinity. - public static RadiationExposure FromCoulombsPerKilogram(double coulombsperkilogram) + public static RadiationExposure FromCoulombsPerKilogram(double value) { - return new RadiationExposure(coulombsperkilogram, RadiationExposureUnit.CoulombPerKilogram); + return new RadiationExposure(value, RadiationExposureUnit.CoulombPerKilogram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RadiationExposure FromMicrocoulombsPerKilogram(double microcoulombsperkilogram) + public static RadiationExposure FromMicrocoulombsPerKilogram(double value) { - return new RadiationExposure(microcoulombsperkilogram, RadiationExposureUnit.MicrocoulombPerKilogram); + return new RadiationExposure(value, RadiationExposureUnit.MicrocoulombPerKilogram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RadiationExposure FromMicroroentgens(double microroentgens) + public static RadiationExposure FromMicroroentgens(double value) { - return new RadiationExposure(microroentgens, RadiationExposureUnit.Microroentgen); + return new RadiationExposure(value, RadiationExposureUnit.Microroentgen); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RadiationExposure FromMillicoulombsPerKilogram(double millicoulombsperkilogram) + public static RadiationExposure FromMillicoulombsPerKilogram(double value) { - return new RadiationExposure(millicoulombsperkilogram, RadiationExposureUnit.MillicoulombPerKilogram); + return new RadiationExposure(value, RadiationExposureUnit.MillicoulombPerKilogram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RadiationExposure FromMilliroentgens(double milliroentgens) + public static RadiationExposure FromMilliroentgens(double value) { - return new RadiationExposure(milliroentgens, RadiationExposureUnit.Milliroentgen); + return new RadiationExposure(value, RadiationExposureUnit.Milliroentgen); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RadiationExposure FromNanocoulombsPerKilogram(double nanocoulombsperkilogram) + public static RadiationExposure FromNanocoulombsPerKilogram(double value) { - return new RadiationExposure(nanocoulombsperkilogram, RadiationExposureUnit.NanocoulombPerKilogram); + return new RadiationExposure(value, RadiationExposureUnit.NanocoulombPerKilogram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RadiationExposure FromPicocoulombsPerKilogram(double picocoulombsperkilogram) + public static RadiationExposure FromPicocoulombsPerKilogram(double value) { - return new RadiationExposure(picocoulombsperkilogram, RadiationExposureUnit.PicocoulombPerKilogram); + return new RadiationExposure(value, RadiationExposureUnit.PicocoulombPerKilogram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RadiationExposure FromRoentgens(double roentgens) + public static RadiationExposure FromRoentgens(double value) { - return new RadiationExposure(roentgens, RadiationExposureUnit.Roentgen); + return new RadiationExposure(value, RadiationExposureUnit.Roentgen); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Radioactivity.g.cs b/UnitsNet/GeneratedCode/Quantities/Radioactivity.g.cs index d44b97dd77..3352e42374 100644 --- a/UnitsNet/GeneratedCode/Quantities/Radioactivity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Radioactivity.g.cs @@ -445,261 +445,261 @@ public static string GetAbbreviation(RadioactivityUnit unit, IFormatProvider? pr /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromBecquerels(double becquerels) + public static Radioactivity FromBecquerels(double value) { - return new Radioactivity(becquerels, RadioactivityUnit.Becquerel); + return new Radioactivity(value, RadioactivityUnit.Becquerel); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromCuries(double curies) + public static Radioactivity FromCuries(double value) { - return new Radioactivity(curies, RadioactivityUnit.Curie); + return new Radioactivity(value, RadioactivityUnit.Curie); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromExabecquerels(double exabecquerels) + public static Radioactivity FromExabecquerels(double value) { - return new Radioactivity(exabecquerels, RadioactivityUnit.Exabecquerel); + return new Radioactivity(value, RadioactivityUnit.Exabecquerel); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromGigabecquerels(double gigabecquerels) + public static Radioactivity FromGigabecquerels(double value) { - return new Radioactivity(gigabecquerels, RadioactivityUnit.Gigabecquerel); + return new Radioactivity(value, RadioactivityUnit.Gigabecquerel); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromGigacuries(double gigacuries) + public static Radioactivity FromGigacuries(double value) { - return new Radioactivity(gigacuries, RadioactivityUnit.Gigacurie); + return new Radioactivity(value, RadioactivityUnit.Gigacurie); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromGigarutherfords(double gigarutherfords) + public static Radioactivity FromGigarutherfords(double value) { - return new Radioactivity(gigarutherfords, RadioactivityUnit.Gigarutherford); + return new Radioactivity(value, RadioactivityUnit.Gigarutherford); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromKilobecquerels(double kilobecquerels) + public static Radioactivity FromKilobecquerels(double value) { - return new Radioactivity(kilobecquerels, RadioactivityUnit.Kilobecquerel); + return new Radioactivity(value, RadioactivityUnit.Kilobecquerel); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromKilocuries(double kilocuries) + public static Radioactivity FromKilocuries(double value) { - return new Radioactivity(kilocuries, RadioactivityUnit.Kilocurie); + return new Radioactivity(value, RadioactivityUnit.Kilocurie); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromKilorutherfords(double kilorutherfords) + public static Radioactivity FromKilorutherfords(double value) { - return new Radioactivity(kilorutherfords, RadioactivityUnit.Kilorutherford); + return new Radioactivity(value, RadioactivityUnit.Kilorutherford); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromMegabecquerels(double megabecquerels) + public static Radioactivity FromMegabecquerels(double value) { - return new Radioactivity(megabecquerels, RadioactivityUnit.Megabecquerel); + return new Radioactivity(value, RadioactivityUnit.Megabecquerel); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromMegacuries(double megacuries) + public static Radioactivity FromMegacuries(double value) { - return new Radioactivity(megacuries, RadioactivityUnit.Megacurie); + return new Radioactivity(value, RadioactivityUnit.Megacurie); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromMegarutherfords(double megarutherfords) + public static Radioactivity FromMegarutherfords(double value) { - return new Radioactivity(megarutherfords, RadioactivityUnit.Megarutherford); + return new Radioactivity(value, RadioactivityUnit.Megarutherford); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromMicrobecquerels(double microbecquerels) + public static Radioactivity FromMicrobecquerels(double value) { - return new Radioactivity(microbecquerels, RadioactivityUnit.Microbecquerel); + return new Radioactivity(value, RadioactivityUnit.Microbecquerel); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromMicrocuries(double microcuries) + public static Radioactivity FromMicrocuries(double value) { - return new Radioactivity(microcuries, RadioactivityUnit.Microcurie); + return new Radioactivity(value, RadioactivityUnit.Microcurie); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromMicrorutherfords(double microrutherfords) + public static Radioactivity FromMicrorutherfords(double value) { - return new Radioactivity(microrutherfords, RadioactivityUnit.Microrutherford); + return new Radioactivity(value, RadioactivityUnit.Microrutherford); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromMillibecquerels(double millibecquerels) + public static Radioactivity FromMillibecquerels(double value) { - return new Radioactivity(millibecquerels, RadioactivityUnit.Millibecquerel); + return new Radioactivity(value, RadioactivityUnit.Millibecquerel); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromMillicuries(double millicuries) + public static Radioactivity FromMillicuries(double value) { - return new Radioactivity(millicuries, RadioactivityUnit.Millicurie); + return new Radioactivity(value, RadioactivityUnit.Millicurie); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromMillirutherfords(double millirutherfords) + public static Radioactivity FromMillirutherfords(double value) { - return new Radioactivity(millirutherfords, RadioactivityUnit.Millirutherford); + return new Radioactivity(value, RadioactivityUnit.Millirutherford); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromNanobecquerels(double nanobecquerels) + public static Radioactivity FromNanobecquerels(double value) { - return new Radioactivity(nanobecquerels, RadioactivityUnit.Nanobecquerel); + return new Radioactivity(value, RadioactivityUnit.Nanobecquerel); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromNanocuries(double nanocuries) + public static Radioactivity FromNanocuries(double value) { - return new Radioactivity(nanocuries, RadioactivityUnit.Nanocurie); + return new Radioactivity(value, RadioactivityUnit.Nanocurie); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromNanorutherfords(double nanorutherfords) + public static Radioactivity FromNanorutherfords(double value) { - return new Radioactivity(nanorutherfords, RadioactivityUnit.Nanorutherford); + return new Radioactivity(value, RadioactivityUnit.Nanorutherford); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromPetabecquerels(double petabecquerels) + public static Radioactivity FromPetabecquerels(double value) { - return new Radioactivity(petabecquerels, RadioactivityUnit.Petabecquerel); + return new Radioactivity(value, RadioactivityUnit.Petabecquerel); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromPicobecquerels(double picobecquerels) + public static Radioactivity FromPicobecquerels(double value) { - return new Radioactivity(picobecquerels, RadioactivityUnit.Picobecquerel); + return new Radioactivity(value, RadioactivityUnit.Picobecquerel); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromPicocuries(double picocuries) + public static Radioactivity FromPicocuries(double value) { - return new Radioactivity(picocuries, RadioactivityUnit.Picocurie); + return new Radioactivity(value, RadioactivityUnit.Picocurie); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromPicorutherfords(double picorutherfords) + public static Radioactivity FromPicorutherfords(double value) { - return new Radioactivity(picorutherfords, RadioactivityUnit.Picorutherford); + return new Radioactivity(value, RadioactivityUnit.Picorutherford); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromRutherfords(double rutherfords) + public static Radioactivity FromRutherfords(double value) { - return new Radioactivity(rutherfords, RadioactivityUnit.Rutherford); + return new Radioactivity(value, RadioactivityUnit.Rutherford); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromTerabecquerels(double terabecquerels) + public static Radioactivity FromTerabecquerels(double value) { - return new Radioactivity(terabecquerels, RadioactivityUnit.Terabecquerel); + return new Radioactivity(value, RadioactivityUnit.Terabecquerel); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromTeracuries(double teracuries) + public static Radioactivity FromTeracuries(double value) { - return new Radioactivity(teracuries, RadioactivityUnit.Teracurie); + return new Radioactivity(value, RadioactivityUnit.Teracurie); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Radioactivity FromTerarutherfords(double terarutherfords) + public static Radioactivity FromTerarutherfords(double value) { - return new Radioactivity(terarutherfords, RadioactivityUnit.Terarutherford); + return new Radioactivity(value, RadioactivityUnit.Terarutherford); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Ratio.g.cs b/UnitsNet/GeneratedCode/Quantities/Ratio.g.cs index 9ddb15bc47..1fb6bbbbcf 100644 --- a/UnitsNet/GeneratedCode/Quantities/Ratio.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Ratio.g.cs @@ -261,54 +261,54 @@ public static string GetAbbreviation(RatioUnit unit, IFormatProvider? provider) /// Creates a from . /// /// If value is NaN or Infinity. - public static Ratio FromDecimalFractions(double decimalfractions) + public static Ratio FromDecimalFractions(double value) { - return new Ratio(decimalfractions, RatioUnit.DecimalFraction); + return new Ratio(value, RatioUnit.DecimalFraction); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Ratio FromPartsPerBillion(double partsperbillion) + public static Ratio FromPartsPerBillion(double value) { - return new Ratio(partsperbillion, RatioUnit.PartPerBillion); + return new Ratio(value, RatioUnit.PartPerBillion); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Ratio FromPartsPerMillion(double partspermillion) + public static Ratio FromPartsPerMillion(double value) { - return new Ratio(partspermillion, RatioUnit.PartPerMillion); + return new Ratio(value, RatioUnit.PartPerMillion); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Ratio FromPartsPerThousand(double partsperthousand) + public static Ratio FromPartsPerThousand(double value) { - return new Ratio(partsperthousand, RatioUnit.PartPerThousand); + return new Ratio(value, RatioUnit.PartPerThousand); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Ratio FromPartsPerTrillion(double partspertrillion) + public static Ratio FromPartsPerTrillion(double value) { - return new Ratio(partspertrillion, RatioUnit.PartPerTrillion); + return new Ratio(value, RatioUnit.PartPerTrillion); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Ratio FromPercent(double percent) + public static Ratio FromPercent(double value) { - return new Ratio(percent, RatioUnit.Percent); + return new Ratio(value, RatioUnit.Percent); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/RatioChangeRate.g.cs b/UnitsNet/GeneratedCode/Quantities/RatioChangeRate.g.cs index 913a13decd..260c07aaa3 100644 --- a/UnitsNet/GeneratedCode/Quantities/RatioChangeRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RatioChangeRate.g.cs @@ -229,18 +229,18 @@ public static string GetAbbreviation(RatioChangeRateUnit unit, IFormatProvider? /// Creates a from . /// /// If value is NaN or Infinity. - public static RatioChangeRate FromDecimalFractionsPerSecond(double decimalfractionspersecond) + public static RatioChangeRate FromDecimalFractionsPerSecond(double value) { - return new RatioChangeRate(decimalfractionspersecond, RatioChangeRateUnit.DecimalFractionPerSecond); + return new RatioChangeRate(value, RatioChangeRateUnit.DecimalFractionPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RatioChangeRate FromPercentsPerSecond(double percentspersecond) + public static RatioChangeRate FromPercentsPerSecond(double value) { - return new RatioChangeRate(percentspersecond, RatioChangeRateUnit.PercentPerSecond); + return new RatioChangeRate(value, RatioChangeRateUnit.PercentPerSecond); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.g.cs b/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.g.cs index 4da15c9eb7..4bd7c1f568 100644 --- a/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.g.cs @@ -237,27 +237,27 @@ public static string GetAbbreviation(ReactiveEnergyUnit unit, IFormatProvider? p /// Creates a from . /// /// If value is NaN or Infinity. - public static ReactiveEnergy FromKilovoltampereReactiveHours(double kilovoltamperereactivehours) + public static ReactiveEnergy FromKilovoltampereReactiveHours(double value) { - return new ReactiveEnergy(kilovoltamperereactivehours, ReactiveEnergyUnit.KilovoltampereReactiveHour); + return new ReactiveEnergy(value, ReactiveEnergyUnit.KilovoltampereReactiveHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ReactiveEnergy FromMegavoltampereReactiveHours(double megavoltamperereactivehours) + public static ReactiveEnergy FromMegavoltampereReactiveHours(double value) { - return new ReactiveEnergy(megavoltamperereactivehours, ReactiveEnergyUnit.MegavoltampereReactiveHour); + return new ReactiveEnergy(value, ReactiveEnergyUnit.MegavoltampereReactiveHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ReactiveEnergy FromVoltampereReactiveHours(double voltamperereactivehours) + public static ReactiveEnergy FromVoltampereReactiveHours(double value) { - return new ReactiveEnergy(voltamperereactivehours, ReactiveEnergyUnit.VoltampereReactiveHour); + return new ReactiveEnergy(value, ReactiveEnergyUnit.VoltampereReactiveHour); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ReactivePower.g.cs b/UnitsNet/GeneratedCode/Quantities/ReactivePower.g.cs index f25c534690..d17a467580 100644 --- a/UnitsNet/GeneratedCode/Quantities/ReactivePower.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ReactivePower.g.cs @@ -245,36 +245,36 @@ public static string GetAbbreviation(ReactivePowerUnit unit, IFormatProvider? pr /// Creates a from . /// /// If value is NaN or Infinity. - public static ReactivePower FromGigavoltamperesReactive(double gigavoltamperesreactive) + public static ReactivePower FromGigavoltamperesReactive(double value) { - return new ReactivePower(gigavoltamperesreactive, ReactivePowerUnit.GigavoltampereReactive); + return new ReactivePower(value, ReactivePowerUnit.GigavoltampereReactive); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ReactivePower FromKilovoltamperesReactive(double kilovoltamperesreactive) + public static ReactivePower FromKilovoltamperesReactive(double value) { - return new ReactivePower(kilovoltamperesreactive, ReactivePowerUnit.KilovoltampereReactive); + return new ReactivePower(value, ReactivePowerUnit.KilovoltampereReactive); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ReactivePower FromMegavoltamperesReactive(double megavoltamperesreactive) + public static ReactivePower FromMegavoltamperesReactive(double value) { - return new ReactivePower(megavoltamperesreactive, ReactivePowerUnit.MegavoltampereReactive); + return new ReactivePower(value, ReactivePowerUnit.MegavoltampereReactive); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ReactivePower FromVoltamperesReactive(double voltamperesreactive) + public static ReactivePower FromVoltamperesReactive(double value) { - return new ReactivePower(voltamperesreactive, ReactivePowerUnit.VoltampereReactive); + return new ReactivePower(value, ReactivePowerUnit.VoltampereReactive); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ReciprocalArea.g.cs b/UnitsNet/GeneratedCode/Quantities/ReciprocalArea.g.cs index 4ffad89940..f199c851f3 100644 --- a/UnitsNet/GeneratedCode/Quantities/ReciprocalArea.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ReciprocalArea.g.cs @@ -312,99 +312,99 @@ public static string GetAbbreviation(ReciprocalAreaUnit unit, IFormatProvider? p /// Creates a from . /// /// If value is NaN or Infinity. - public static ReciprocalArea FromInverseSquareCentimeters(double inversesquarecentimeters) + public static ReciprocalArea FromInverseSquareCentimeters(double value) { - return new ReciprocalArea(inversesquarecentimeters, ReciprocalAreaUnit.InverseSquareCentimeter); + return new ReciprocalArea(value, ReciprocalAreaUnit.InverseSquareCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ReciprocalArea FromInverseSquareDecimeters(double inversesquaredecimeters) + public static ReciprocalArea FromInverseSquareDecimeters(double value) { - return new ReciprocalArea(inversesquaredecimeters, ReciprocalAreaUnit.InverseSquareDecimeter); + return new ReciprocalArea(value, ReciprocalAreaUnit.InverseSquareDecimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ReciprocalArea FromInverseSquareFeet(double inversesquarefeet) + public static ReciprocalArea FromInverseSquareFeet(double value) { - return new ReciprocalArea(inversesquarefeet, ReciprocalAreaUnit.InverseSquareFoot); + return new ReciprocalArea(value, ReciprocalAreaUnit.InverseSquareFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ReciprocalArea FromInverseSquareInches(double inversesquareinches) + public static ReciprocalArea FromInverseSquareInches(double value) { - return new ReciprocalArea(inversesquareinches, ReciprocalAreaUnit.InverseSquareInch); + return new ReciprocalArea(value, ReciprocalAreaUnit.InverseSquareInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ReciprocalArea FromInverseSquareKilometers(double inversesquarekilometers) + public static ReciprocalArea FromInverseSquareKilometers(double value) { - return new ReciprocalArea(inversesquarekilometers, ReciprocalAreaUnit.InverseSquareKilometer); + return new ReciprocalArea(value, ReciprocalAreaUnit.InverseSquareKilometer); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ReciprocalArea FromInverseSquareMeters(double inversesquaremeters) + public static ReciprocalArea FromInverseSquareMeters(double value) { - return new ReciprocalArea(inversesquaremeters, ReciprocalAreaUnit.InverseSquareMeter); + return new ReciprocalArea(value, ReciprocalAreaUnit.InverseSquareMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ReciprocalArea FromInverseSquareMicrometers(double inversesquaremicrometers) + public static ReciprocalArea FromInverseSquareMicrometers(double value) { - return new ReciprocalArea(inversesquaremicrometers, ReciprocalAreaUnit.InverseSquareMicrometer); + return new ReciprocalArea(value, ReciprocalAreaUnit.InverseSquareMicrometer); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ReciprocalArea FromInverseSquareMiles(double inversesquaremiles) + public static ReciprocalArea FromInverseSquareMiles(double value) { - return new ReciprocalArea(inversesquaremiles, ReciprocalAreaUnit.InverseSquareMile); + return new ReciprocalArea(value, ReciprocalAreaUnit.InverseSquareMile); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ReciprocalArea FromInverseSquareMillimeters(double inversesquaremillimeters) + public static ReciprocalArea FromInverseSquareMillimeters(double value) { - return new ReciprocalArea(inversesquaremillimeters, ReciprocalAreaUnit.InverseSquareMillimeter); + return new ReciprocalArea(value, ReciprocalAreaUnit.InverseSquareMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ReciprocalArea FromInverseSquareYards(double inversesquareyards) + public static ReciprocalArea FromInverseSquareYards(double value) { - return new ReciprocalArea(inversesquareyards, ReciprocalAreaUnit.InverseSquareYard); + return new ReciprocalArea(value, ReciprocalAreaUnit.InverseSquareYard); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ReciprocalArea FromInverseUsSurveySquareFeet(double inverseussurveysquarefeet) + public static ReciprocalArea FromInverseUsSurveySquareFeet(double value) { - return new ReciprocalArea(inverseussurveysquarefeet, ReciprocalAreaUnit.InverseUsSurveySquareFoot); + return new ReciprocalArea(value, ReciprocalAreaUnit.InverseUsSurveySquareFoot); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ReciprocalLength.g.cs b/UnitsNet/GeneratedCode/Quantities/ReciprocalLength.g.cs index e980cebee2..cd0c508f5c 100644 --- a/UnitsNet/GeneratedCode/Quantities/ReciprocalLength.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ReciprocalLength.g.cs @@ -305,90 +305,90 @@ public static string GetAbbreviation(ReciprocalLengthUnit unit, IFormatProvider? /// Creates a from . /// /// If value is NaN or Infinity. - public static ReciprocalLength FromInverseCentimeters(double inversecentimeters) + public static ReciprocalLength FromInverseCentimeters(double value) { - return new ReciprocalLength(inversecentimeters, ReciprocalLengthUnit.InverseCentimeter); + return new ReciprocalLength(value, ReciprocalLengthUnit.InverseCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ReciprocalLength FromInverseFeet(double inversefeet) + public static ReciprocalLength FromInverseFeet(double value) { - return new ReciprocalLength(inversefeet, ReciprocalLengthUnit.InverseFoot); + return new ReciprocalLength(value, ReciprocalLengthUnit.InverseFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ReciprocalLength FromInverseInches(double inverseinches) + public static ReciprocalLength FromInverseInches(double value) { - return new ReciprocalLength(inverseinches, ReciprocalLengthUnit.InverseInch); + return new ReciprocalLength(value, ReciprocalLengthUnit.InverseInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ReciprocalLength FromInverseMeters(double inversemeters) + public static ReciprocalLength FromInverseMeters(double value) { - return new ReciprocalLength(inversemeters, ReciprocalLengthUnit.InverseMeter); + return new ReciprocalLength(value, ReciprocalLengthUnit.InverseMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ReciprocalLength FromInverseMicroinches(double inversemicroinches) + public static ReciprocalLength FromInverseMicroinches(double value) { - return new ReciprocalLength(inversemicroinches, ReciprocalLengthUnit.InverseMicroinch); + return new ReciprocalLength(value, ReciprocalLengthUnit.InverseMicroinch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ReciprocalLength FromInverseMils(double inversemils) + public static ReciprocalLength FromInverseMils(double value) { - return new ReciprocalLength(inversemils, ReciprocalLengthUnit.InverseMil); + return new ReciprocalLength(value, ReciprocalLengthUnit.InverseMil); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ReciprocalLength FromInverseMiles(double inversemiles) + public static ReciprocalLength FromInverseMiles(double value) { - return new ReciprocalLength(inversemiles, ReciprocalLengthUnit.InverseMile); + return new ReciprocalLength(value, ReciprocalLengthUnit.InverseMile); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ReciprocalLength FromInverseMillimeters(double inversemillimeters) + public static ReciprocalLength FromInverseMillimeters(double value) { - return new ReciprocalLength(inversemillimeters, ReciprocalLengthUnit.InverseMillimeter); + return new ReciprocalLength(value, ReciprocalLengthUnit.InverseMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ReciprocalLength FromInverseUsSurveyFeet(double inverseussurveyfeet) + public static ReciprocalLength FromInverseUsSurveyFeet(double value) { - return new ReciprocalLength(inverseussurveyfeet, ReciprocalLengthUnit.InverseUsSurveyFoot); + return new ReciprocalLength(value, ReciprocalLengthUnit.InverseUsSurveyFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ReciprocalLength FromInverseYards(double inverseyards) + public static ReciprocalLength FromInverseYards(double value) { - return new ReciprocalLength(inverseyards, ReciprocalLengthUnit.InverseYard); + return new ReciprocalLength(value, ReciprocalLengthUnit.InverseYard); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/RelativeHumidity.g.cs b/UnitsNet/GeneratedCode/Quantities/RelativeHumidity.g.cs index c66c66a8ea..fed47ea88e 100644 --- a/UnitsNet/GeneratedCode/Quantities/RelativeHumidity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RelativeHumidity.g.cs @@ -221,9 +221,9 @@ public static string GetAbbreviation(RelativeHumidityUnit unit, IFormatProvider? /// Creates a from . /// /// If value is NaN or Infinity. - public static RelativeHumidity FromPercent(double percent) + public static RelativeHumidity FromPercent(double value) { - return new RelativeHumidity(percent, RelativeHumidityUnit.Percent); + return new RelativeHumidity(value, RelativeHumidityUnit.Percent); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.g.cs index 2131f06cbd..0e8da007b2 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.g.cs @@ -245,36 +245,36 @@ public static string GetAbbreviation(RotationalAccelerationUnit unit, IFormatPro /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalAcceleration FromDegreesPerSecondSquared(double degreespersecondsquared) + public static RotationalAcceleration FromDegreesPerSecondSquared(double value) { - return new RotationalAcceleration(degreespersecondsquared, RotationalAccelerationUnit.DegreePerSecondSquared); + return new RotationalAcceleration(value, RotationalAccelerationUnit.DegreePerSecondSquared); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalAcceleration FromRadiansPerSecondSquared(double radianspersecondsquared) + public static RotationalAcceleration FromRadiansPerSecondSquared(double value) { - return new RotationalAcceleration(radianspersecondsquared, RotationalAccelerationUnit.RadianPerSecondSquared); + return new RotationalAcceleration(value, RotationalAccelerationUnit.RadianPerSecondSquared); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalAcceleration FromRevolutionsPerMinutePerSecond(double revolutionsperminutepersecond) + public static RotationalAcceleration FromRevolutionsPerMinutePerSecond(double value) { - return new RotationalAcceleration(revolutionsperminutepersecond, RotationalAccelerationUnit.RevolutionPerMinutePerSecond); + return new RotationalAcceleration(value, RotationalAccelerationUnit.RevolutionPerMinutePerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalAcceleration FromRevolutionsPerSecondSquared(double revolutionspersecondsquared) + public static RotationalAcceleration FromRevolutionsPerSecondSquared(double value) { - return new RotationalAcceleration(revolutionspersecondsquared, RotationalAccelerationUnit.RevolutionPerSecondSquared); + return new RotationalAcceleration(value, RotationalAccelerationUnit.RevolutionPerSecondSquared); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.g.cs index 3a0bb6bc99..34aba5fcd1 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.g.cs @@ -324,117 +324,117 @@ public static string GetAbbreviation(RotationalSpeedUnit unit, IFormatProvider? /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalSpeed FromCentiradiansPerSecond(double centiradianspersecond) + public static RotationalSpeed FromCentiradiansPerSecond(double value) { - return new RotationalSpeed(centiradianspersecond, RotationalSpeedUnit.CentiradianPerSecond); + return new RotationalSpeed(value, RotationalSpeedUnit.CentiradianPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalSpeed FromDeciradiansPerSecond(double deciradianspersecond) + public static RotationalSpeed FromDeciradiansPerSecond(double value) { - return new RotationalSpeed(deciradianspersecond, RotationalSpeedUnit.DeciradianPerSecond); + return new RotationalSpeed(value, RotationalSpeedUnit.DeciradianPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalSpeed FromDegreesPerMinute(double degreesperminute) + public static RotationalSpeed FromDegreesPerMinute(double value) { - return new RotationalSpeed(degreesperminute, RotationalSpeedUnit.DegreePerMinute); + return new RotationalSpeed(value, RotationalSpeedUnit.DegreePerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalSpeed FromDegreesPerSecond(double degreespersecond) + public static RotationalSpeed FromDegreesPerSecond(double value) { - return new RotationalSpeed(degreespersecond, RotationalSpeedUnit.DegreePerSecond); + return new RotationalSpeed(value, RotationalSpeedUnit.DegreePerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalSpeed FromMicrodegreesPerSecond(double microdegreespersecond) + public static RotationalSpeed FromMicrodegreesPerSecond(double value) { - return new RotationalSpeed(microdegreespersecond, RotationalSpeedUnit.MicrodegreePerSecond); + return new RotationalSpeed(value, RotationalSpeedUnit.MicrodegreePerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalSpeed FromMicroradiansPerSecond(double microradianspersecond) + public static RotationalSpeed FromMicroradiansPerSecond(double value) { - return new RotationalSpeed(microradianspersecond, RotationalSpeedUnit.MicroradianPerSecond); + return new RotationalSpeed(value, RotationalSpeedUnit.MicroradianPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalSpeed FromMillidegreesPerSecond(double millidegreespersecond) + public static RotationalSpeed FromMillidegreesPerSecond(double value) { - return new RotationalSpeed(millidegreespersecond, RotationalSpeedUnit.MillidegreePerSecond); + return new RotationalSpeed(value, RotationalSpeedUnit.MillidegreePerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalSpeed FromMilliradiansPerSecond(double milliradianspersecond) + public static RotationalSpeed FromMilliradiansPerSecond(double value) { - return new RotationalSpeed(milliradianspersecond, RotationalSpeedUnit.MilliradianPerSecond); + return new RotationalSpeed(value, RotationalSpeedUnit.MilliradianPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalSpeed FromNanodegreesPerSecond(double nanodegreespersecond) + public static RotationalSpeed FromNanodegreesPerSecond(double value) { - return new RotationalSpeed(nanodegreespersecond, RotationalSpeedUnit.NanodegreePerSecond); + return new RotationalSpeed(value, RotationalSpeedUnit.NanodegreePerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalSpeed FromNanoradiansPerSecond(double nanoradianspersecond) + public static RotationalSpeed FromNanoradiansPerSecond(double value) { - return new RotationalSpeed(nanoradianspersecond, RotationalSpeedUnit.NanoradianPerSecond); + return new RotationalSpeed(value, RotationalSpeedUnit.NanoradianPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalSpeed FromRadiansPerSecond(double radianspersecond) + public static RotationalSpeed FromRadiansPerSecond(double value) { - return new RotationalSpeed(radianspersecond, RotationalSpeedUnit.RadianPerSecond); + return new RotationalSpeed(value, RotationalSpeedUnit.RadianPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalSpeed FromRevolutionsPerMinute(double revolutionsperminute) + public static RotationalSpeed FromRevolutionsPerMinute(double value) { - return new RotationalSpeed(revolutionsperminute, RotationalSpeedUnit.RevolutionPerMinute); + return new RotationalSpeed(value, RotationalSpeedUnit.RevolutionPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalSpeed FromRevolutionsPerSecond(double revolutionspersecond) + public static RotationalSpeed FromRevolutionsPerSecond(double value) { - return new RotationalSpeed(revolutionspersecond, RotationalSpeedUnit.RevolutionPerSecond); + return new RotationalSpeed(value, RotationalSpeedUnit.RevolutionPerSecond); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.g.cs index e6ed3b465c..1cff4a3834 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.g.cs @@ -485,297 +485,297 @@ public static string GetAbbreviation(RotationalStiffnessUnit unit, IFormatProvid /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromCentinewtonMetersPerDegree(double centinewtonmetersperdegree) + public static RotationalStiffness FromCentinewtonMetersPerDegree(double value) { - return new RotationalStiffness(centinewtonmetersperdegree, RotationalStiffnessUnit.CentinewtonMeterPerDegree); + return new RotationalStiffness(value, RotationalStiffnessUnit.CentinewtonMeterPerDegree); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromCentinewtonMillimetersPerDegree(double centinewtonmillimetersperdegree) + public static RotationalStiffness FromCentinewtonMillimetersPerDegree(double value) { - return new RotationalStiffness(centinewtonmillimetersperdegree, RotationalStiffnessUnit.CentinewtonMillimeterPerDegree); + return new RotationalStiffness(value, RotationalStiffnessUnit.CentinewtonMillimeterPerDegree); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromCentinewtonMillimetersPerRadian(double centinewtonmillimetersperradian) + public static RotationalStiffness FromCentinewtonMillimetersPerRadian(double value) { - return new RotationalStiffness(centinewtonmillimetersperradian, RotationalStiffnessUnit.CentinewtonMillimeterPerRadian); + return new RotationalStiffness(value, RotationalStiffnessUnit.CentinewtonMillimeterPerRadian); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromDecanewtonMetersPerDegree(double decanewtonmetersperdegree) + public static RotationalStiffness FromDecanewtonMetersPerDegree(double value) { - return new RotationalStiffness(decanewtonmetersperdegree, RotationalStiffnessUnit.DecanewtonMeterPerDegree); + return new RotationalStiffness(value, RotationalStiffnessUnit.DecanewtonMeterPerDegree); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromDecanewtonMillimetersPerDegree(double decanewtonmillimetersperdegree) + public static RotationalStiffness FromDecanewtonMillimetersPerDegree(double value) { - return new RotationalStiffness(decanewtonmillimetersperdegree, RotationalStiffnessUnit.DecanewtonMillimeterPerDegree); + return new RotationalStiffness(value, RotationalStiffnessUnit.DecanewtonMillimeterPerDegree); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromDecanewtonMillimetersPerRadian(double decanewtonmillimetersperradian) + public static RotationalStiffness FromDecanewtonMillimetersPerRadian(double value) { - return new RotationalStiffness(decanewtonmillimetersperradian, RotationalStiffnessUnit.DecanewtonMillimeterPerRadian); + return new RotationalStiffness(value, RotationalStiffnessUnit.DecanewtonMillimeterPerRadian); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromDecinewtonMetersPerDegree(double decinewtonmetersperdegree) + public static RotationalStiffness FromDecinewtonMetersPerDegree(double value) { - return new RotationalStiffness(decinewtonmetersperdegree, RotationalStiffnessUnit.DecinewtonMeterPerDegree); + return new RotationalStiffness(value, RotationalStiffnessUnit.DecinewtonMeterPerDegree); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromDecinewtonMillimetersPerDegree(double decinewtonmillimetersperdegree) + public static RotationalStiffness FromDecinewtonMillimetersPerDegree(double value) { - return new RotationalStiffness(decinewtonmillimetersperdegree, RotationalStiffnessUnit.DecinewtonMillimeterPerDegree); + return new RotationalStiffness(value, RotationalStiffnessUnit.DecinewtonMillimeterPerDegree); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromDecinewtonMillimetersPerRadian(double decinewtonmillimetersperradian) + public static RotationalStiffness FromDecinewtonMillimetersPerRadian(double value) { - return new RotationalStiffness(decinewtonmillimetersperradian, RotationalStiffnessUnit.DecinewtonMillimeterPerRadian); + return new RotationalStiffness(value, RotationalStiffnessUnit.DecinewtonMillimeterPerRadian); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromKilonewtonMetersPerDegree(double kilonewtonmetersperdegree) + public static RotationalStiffness FromKilonewtonMetersPerDegree(double value) { - return new RotationalStiffness(kilonewtonmetersperdegree, RotationalStiffnessUnit.KilonewtonMeterPerDegree); + return new RotationalStiffness(value, RotationalStiffnessUnit.KilonewtonMeterPerDegree); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromKilonewtonMetersPerRadian(double kilonewtonmetersperradian) + public static RotationalStiffness FromKilonewtonMetersPerRadian(double value) { - return new RotationalStiffness(kilonewtonmetersperradian, RotationalStiffnessUnit.KilonewtonMeterPerRadian); + return new RotationalStiffness(value, RotationalStiffnessUnit.KilonewtonMeterPerRadian); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromKilonewtonMillimetersPerDegree(double kilonewtonmillimetersperdegree) + public static RotationalStiffness FromKilonewtonMillimetersPerDegree(double value) { - return new RotationalStiffness(kilonewtonmillimetersperdegree, RotationalStiffnessUnit.KilonewtonMillimeterPerDegree); + return new RotationalStiffness(value, RotationalStiffnessUnit.KilonewtonMillimeterPerDegree); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromKilonewtonMillimetersPerRadian(double kilonewtonmillimetersperradian) + public static RotationalStiffness FromKilonewtonMillimetersPerRadian(double value) { - return new RotationalStiffness(kilonewtonmillimetersperradian, RotationalStiffnessUnit.KilonewtonMillimeterPerRadian); + return new RotationalStiffness(value, RotationalStiffnessUnit.KilonewtonMillimeterPerRadian); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromKilopoundForceFeetPerDegrees(double kilopoundforcefeetperdegrees) + public static RotationalStiffness FromKilopoundForceFeetPerDegrees(double value) { - return new RotationalStiffness(kilopoundforcefeetperdegrees, RotationalStiffnessUnit.KilopoundForceFootPerDegrees); + return new RotationalStiffness(value, RotationalStiffnessUnit.KilopoundForceFootPerDegrees); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromMeganewtonMetersPerDegree(double meganewtonmetersperdegree) + public static RotationalStiffness FromMeganewtonMetersPerDegree(double value) { - return new RotationalStiffness(meganewtonmetersperdegree, RotationalStiffnessUnit.MeganewtonMeterPerDegree); + return new RotationalStiffness(value, RotationalStiffnessUnit.MeganewtonMeterPerDegree); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromMeganewtonMetersPerRadian(double meganewtonmetersperradian) + public static RotationalStiffness FromMeganewtonMetersPerRadian(double value) { - return new RotationalStiffness(meganewtonmetersperradian, RotationalStiffnessUnit.MeganewtonMeterPerRadian); + return new RotationalStiffness(value, RotationalStiffnessUnit.MeganewtonMeterPerRadian); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromMeganewtonMillimetersPerDegree(double meganewtonmillimetersperdegree) + public static RotationalStiffness FromMeganewtonMillimetersPerDegree(double value) { - return new RotationalStiffness(meganewtonmillimetersperdegree, RotationalStiffnessUnit.MeganewtonMillimeterPerDegree); + return new RotationalStiffness(value, RotationalStiffnessUnit.MeganewtonMillimeterPerDegree); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromMeganewtonMillimetersPerRadian(double meganewtonmillimetersperradian) + public static RotationalStiffness FromMeganewtonMillimetersPerRadian(double value) { - return new RotationalStiffness(meganewtonmillimetersperradian, RotationalStiffnessUnit.MeganewtonMillimeterPerRadian); + return new RotationalStiffness(value, RotationalStiffnessUnit.MeganewtonMillimeterPerRadian); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromMicronewtonMetersPerDegree(double micronewtonmetersperdegree) + public static RotationalStiffness FromMicronewtonMetersPerDegree(double value) { - return new RotationalStiffness(micronewtonmetersperdegree, RotationalStiffnessUnit.MicronewtonMeterPerDegree); + return new RotationalStiffness(value, RotationalStiffnessUnit.MicronewtonMeterPerDegree); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromMicronewtonMillimetersPerDegree(double micronewtonmillimetersperdegree) + public static RotationalStiffness FromMicronewtonMillimetersPerDegree(double value) { - return new RotationalStiffness(micronewtonmillimetersperdegree, RotationalStiffnessUnit.MicronewtonMillimeterPerDegree); + return new RotationalStiffness(value, RotationalStiffnessUnit.MicronewtonMillimeterPerDegree); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromMicronewtonMillimetersPerRadian(double micronewtonmillimetersperradian) + public static RotationalStiffness FromMicronewtonMillimetersPerRadian(double value) { - return new RotationalStiffness(micronewtonmillimetersperradian, RotationalStiffnessUnit.MicronewtonMillimeterPerRadian); + return new RotationalStiffness(value, RotationalStiffnessUnit.MicronewtonMillimeterPerRadian); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromMillinewtonMetersPerDegree(double millinewtonmetersperdegree) + public static RotationalStiffness FromMillinewtonMetersPerDegree(double value) { - return new RotationalStiffness(millinewtonmetersperdegree, RotationalStiffnessUnit.MillinewtonMeterPerDegree); + return new RotationalStiffness(value, RotationalStiffnessUnit.MillinewtonMeterPerDegree); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromMillinewtonMillimetersPerDegree(double millinewtonmillimetersperdegree) + public static RotationalStiffness FromMillinewtonMillimetersPerDegree(double value) { - return new RotationalStiffness(millinewtonmillimetersperdegree, RotationalStiffnessUnit.MillinewtonMillimeterPerDegree); + return new RotationalStiffness(value, RotationalStiffnessUnit.MillinewtonMillimeterPerDegree); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromMillinewtonMillimetersPerRadian(double millinewtonmillimetersperradian) + public static RotationalStiffness FromMillinewtonMillimetersPerRadian(double value) { - return new RotationalStiffness(millinewtonmillimetersperradian, RotationalStiffnessUnit.MillinewtonMillimeterPerRadian); + return new RotationalStiffness(value, RotationalStiffnessUnit.MillinewtonMillimeterPerRadian); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromNanonewtonMetersPerDegree(double nanonewtonmetersperdegree) + public static RotationalStiffness FromNanonewtonMetersPerDegree(double value) { - return new RotationalStiffness(nanonewtonmetersperdegree, RotationalStiffnessUnit.NanonewtonMeterPerDegree); + return new RotationalStiffness(value, RotationalStiffnessUnit.NanonewtonMeterPerDegree); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromNanonewtonMillimetersPerDegree(double nanonewtonmillimetersperdegree) + public static RotationalStiffness FromNanonewtonMillimetersPerDegree(double value) { - return new RotationalStiffness(nanonewtonmillimetersperdegree, RotationalStiffnessUnit.NanonewtonMillimeterPerDegree); + return new RotationalStiffness(value, RotationalStiffnessUnit.NanonewtonMillimeterPerDegree); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromNanonewtonMillimetersPerRadian(double nanonewtonmillimetersperradian) + public static RotationalStiffness FromNanonewtonMillimetersPerRadian(double value) { - return new RotationalStiffness(nanonewtonmillimetersperradian, RotationalStiffnessUnit.NanonewtonMillimeterPerRadian); + return new RotationalStiffness(value, RotationalStiffnessUnit.NanonewtonMillimeterPerRadian); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromNewtonMetersPerDegree(double newtonmetersperdegree) + public static RotationalStiffness FromNewtonMetersPerDegree(double value) { - return new RotationalStiffness(newtonmetersperdegree, RotationalStiffnessUnit.NewtonMeterPerDegree); + return new RotationalStiffness(value, RotationalStiffnessUnit.NewtonMeterPerDegree); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromNewtonMetersPerRadian(double newtonmetersperradian) + public static RotationalStiffness FromNewtonMetersPerRadian(double value) { - return new RotationalStiffness(newtonmetersperradian, RotationalStiffnessUnit.NewtonMeterPerRadian); + return new RotationalStiffness(value, RotationalStiffnessUnit.NewtonMeterPerRadian); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromNewtonMillimetersPerDegree(double newtonmillimetersperdegree) + public static RotationalStiffness FromNewtonMillimetersPerDegree(double value) { - return new RotationalStiffness(newtonmillimetersperdegree, RotationalStiffnessUnit.NewtonMillimeterPerDegree); + return new RotationalStiffness(value, RotationalStiffnessUnit.NewtonMillimeterPerDegree); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromNewtonMillimetersPerRadian(double newtonmillimetersperradian) + public static RotationalStiffness FromNewtonMillimetersPerRadian(double value) { - return new RotationalStiffness(newtonmillimetersperradian, RotationalStiffnessUnit.NewtonMillimeterPerRadian); + return new RotationalStiffness(value, RotationalStiffnessUnit.NewtonMillimeterPerRadian); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromPoundForceFeetPerRadian(double poundforcefeetperradian) + public static RotationalStiffness FromPoundForceFeetPerRadian(double value) { - return new RotationalStiffness(poundforcefeetperradian, RotationalStiffnessUnit.PoundForceFeetPerRadian); + return new RotationalStiffness(value, RotationalStiffnessUnit.PoundForceFeetPerRadian); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffness FromPoundForceFeetPerDegrees(double poundforcefeetperdegrees) + public static RotationalStiffness FromPoundForceFeetPerDegrees(double value) { - return new RotationalStiffness(poundforcefeetperdegrees, RotationalStiffnessUnit.PoundForceFootPerDegrees); + return new RotationalStiffness(value, RotationalStiffnessUnit.PoundForceFootPerDegrees); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.g.cs index 0610388521..ca069a66c6 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.g.cs @@ -259,45 +259,45 @@ public static string GetAbbreviation(RotationalStiffnessPerLengthUnit unit, IFor /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffnessPerLength FromKilonewtonMetersPerRadianPerMeter(double kilonewtonmetersperradianpermeter) + public static RotationalStiffnessPerLength FromKilonewtonMetersPerRadianPerMeter(double value) { - return new RotationalStiffnessPerLength(kilonewtonmetersperradianpermeter, RotationalStiffnessPerLengthUnit.KilonewtonMeterPerRadianPerMeter); + return new RotationalStiffnessPerLength(value, RotationalStiffnessPerLengthUnit.KilonewtonMeterPerRadianPerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffnessPerLength FromKilopoundForceFeetPerDegreesPerFeet(double kilopoundforcefeetperdegreesperfeet) + public static RotationalStiffnessPerLength FromKilopoundForceFeetPerDegreesPerFeet(double value) { - return new RotationalStiffnessPerLength(kilopoundforcefeetperdegreesperfeet, RotationalStiffnessPerLengthUnit.KilopoundForceFootPerDegreesPerFoot); + return new RotationalStiffnessPerLength(value, RotationalStiffnessPerLengthUnit.KilopoundForceFootPerDegreesPerFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffnessPerLength FromMeganewtonMetersPerRadianPerMeter(double meganewtonmetersperradianpermeter) + public static RotationalStiffnessPerLength FromMeganewtonMetersPerRadianPerMeter(double value) { - return new RotationalStiffnessPerLength(meganewtonmetersperradianpermeter, RotationalStiffnessPerLengthUnit.MeganewtonMeterPerRadianPerMeter); + return new RotationalStiffnessPerLength(value, RotationalStiffnessPerLengthUnit.MeganewtonMeterPerRadianPerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffnessPerLength FromNewtonMetersPerRadianPerMeter(double newtonmetersperradianpermeter) + public static RotationalStiffnessPerLength FromNewtonMetersPerRadianPerMeter(double value) { - return new RotationalStiffnessPerLength(newtonmetersperradianpermeter, RotationalStiffnessPerLengthUnit.NewtonMeterPerRadianPerMeter); + return new RotationalStiffnessPerLength(value, RotationalStiffnessPerLengthUnit.NewtonMeterPerRadianPerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static RotationalStiffnessPerLength FromPoundForceFeetPerDegreesPerFeet(double poundforcefeetperdegreesperfeet) + public static RotationalStiffnessPerLength FromPoundForceFeetPerDegreesPerFeet(double value) { - return new RotationalStiffnessPerLength(poundforcefeetperdegreesperfeet, RotationalStiffnessPerLengthUnit.PoundForceFootPerDegreesPerFoot); + return new RotationalStiffnessPerLength(value, RotationalStiffnessPerLengthUnit.PoundForceFootPerDegreesPerFoot); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Scalar.g.cs b/UnitsNet/GeneratedCode/Quantities/Scalar.g.cs index 0851f5db17..5687e7fa21 100644 --- a/UnitsNet/GeneratedCode/Quantities/Scalar.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Scalar.g.cs @@ -221,9 +221,9 @@ public static string GetAbbreviation(ScalarUnit unit, IFormatProvider? provider) /// Creates a from . /// /// If value is NaN or Infinity. - public static Scalar FromAmount(double amount) + public static Scalar FromAmount(double value) { - return new Scalar(amount, ScalarUnit.Amount); + return new Scalar(value, ScalarUnit.Amount); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/SolidAngle.g.cs b/UnitsNet/GeneratedCode/Quantities/SolidAngle.g.cs index d53fbdc6b3..f6d3019ff0 100644 --- a/UnitsNet/GeneratedCode/Quantities/SolidAngle.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SolidAngle.g.cs @@ -224,9 +224,9 @@ public static string GetAbbreviation(SolidAngleUnit unit, IFormatProvider? provi /// Creates a from . /// /// If value is NaN or Infinity. - public static SolidAngle FromSteradians(double steradians) + public static SolidAngle FromSteradians(double value) { - return new SolidAngle(steradians, SolidAngleUnit.Steradian); + return new SolidAngle(value, SolidAngleUnit.Steradian); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.g.cs index 2ef4ebbb14..adedb15a0c 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.g.cs @@ -465,270 +465,270 @@ public static string GetAbbreviation(SpecificEnergyUnit unit, IFormatProvider? p /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromBtuPerPound(double btuperpound) + public static SpecificEnergy FromBtuPerPound(double value) { - return new SpecificEnergy(btuperpound, SpecificEnergyUnit.BtuPerPound); + return new SpecificEnergy(value, SpecificEnergyUnit.BtuPerPound); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromCaloriesPerGram(double caloriespergram) + public static SpecificEnergy FromCaloriesPerGram(double value) { - return new SpecificEnergy(caloriespergram, SpecificEnergyUnit.CaloriePerGram); + return new SpecificEnergy(value, SpecificEnergyUnit.CaloriePerGram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromGigawattDaysPerKilogram(double gigawattdaysperkilogram) + public static SpecificEnergy FromGigawattDaysPerKilogram(double value) { - return new SpecificEnergy(gigawattdaysperkilogram, SpecificEnergyUnit.GigawattDayPerKilogram); + return new SpecificEnergy(value, SpecificEnergyUnit.GigawattDayPerKilogram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromGigawattDaysPerShortTon(double gigawattdayspershortton) + public static SpecificEnergy FromGigawattDaysPerShortTon(double value) { - return new SpecificEnergy(gigawattdayspershortton, SpecificEnergyUnit.GigawattDayPerShortTon); + return new SpecificEnergy(value, SpecificEnergyUnit.GigawattDayPerShortTon); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromGigawattDaysPerTonne(double gigawattdayspertonne) + public static SpecificEnergy FromGigawattDaysPerTonne(double value) { - return new SpecificEnergy(gigawattdayspertonne, SpecificEnergyUnit.GigawattDayPerTonne); + return new SpecificEnergy(value, SpecificEnergyUnit.GigawattDayPerTonne); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromGigawattHoursPerKilogram(double gigawatthoursperkilogram) + public static SpecificEnergy FromGigawattHoursPerKilogram(double value) { - return new SpecificEnergy(gigawatthoursperkilogram, SpecificEnergyUnit.GigawattHourPerKilogram); + return new SpecificEnergy(value, SpecificEnergyUnit.GigawattHourPerKilogram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromGigawattHoursPerPound(double gigawatthoursperpound) + public static SpecificEnergy FromGigawattHoursPerPound(double value) { - return new SpecificEnergy(gigawatthoursperpound, SpecificEnergyUnit.GigawattHourPerPound); + return new SpecificEnergy(value, SpecificEnergyUnit.GigawattHourPerPound); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromJoulesPerKilogram(double joulesperkilogram) + public static SpecificEnergy FromJoulesPerKilogram(double value) { - return new SpecificEnergy(joulesperkilogram, SpecificEnergyUnit.JoulePerKilogram); + return new SpecificEnergy(value, SpecificEnergyUnit.JoulePerKilogram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromKilocaloriesPerGram(double kilocaloriespergram) + public static SpecificEnergy FromKilocaloriesPerGram(double value) { - return new SpecificEnergy(kilocaloriespergram, SpecificEnergyUnit.KilocaloriePerGram); + return new SpecificEnergy(value, SpecificEnergyUnit.KilocaloriePerGram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromKilojoulesPerKilogram(double kilojoulesperkilogram) + public static SpecificEnergy FromKilojoulesPerKilogram(double value) { - return new SpecificEnergy(kilojoulesperkilogram, SpecificEnergyUnit.KilojoulePerKilogram); + return new SpecificEnergy(value, SpecificEnergyUnit.KilojoulePerKilogram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromKilowattDaysPerKilogram(double kilowattdaysperkilogram) + public static SpecificEnergy FromKilowattDaysPerKilogram(double value) { - return new SpecificEnergy(kilowattdaysperkilogram, SpecificEnergyUnit.KilowattDayPerKilogram); + return new SpecificEnergy(value, SpecificEnergyUnit.KilowattDayPerKilogram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromKilowattDaysPerShortTon(double kilowattdayspershortton) + public static SpecificEnergy FromKilowattDaysPerShortTon(double value) { - return new SpecificEnergy(kilowattdayspershortton, SpecificEnergyUnit.KilowattDayPerShortTon); + return new SpecificEnergy(value, SpecificEnergyUnit.KilowattDayPerShortTon); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromKilowattDaysPerTonne(double kilowattdayspertonne) + public static SpecificEnergy FromKilowattDaysPerTonne(double value) { - return new SpecificEnergy(kilowattdayspertonne, SpecificEnergyUnit.KilowattDayPerTonne); + return new SpecificEnergy(value, SpecificEnergyUnit.KilowattDayPerTonne); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromKilowattHoursPerKilogram(double kilowatthoursperkilogram) + public static SpecificEnergy FromKilowattHoursPerKilogram(double value) { - return new SpecificEnergy(kilowatthoursperkilogram, SpecificEnergyUnit.KilowattHourPerKilogram); + return new SpecificEnergy(value, SpecificEnergyUnit.KilowattHourPerKilogram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromKilowattHoursPerPound(double kilowatthoursperpound) + public static SpecificEnergy FromKilowattHoursPerPound(double value) { - return new SpecificEnergy(kilowatthoursperpound, SpecificEnergyUnit.KilowattHourPerPound); + return new SpecificEnergy(value, SpecificEnergyUnit.KilowattHourPerPound); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromMegajoulesPerKilogram(double megajoulesperkilogram) + public static SpecificEnergy FromMegajoulesPerKilogram(double value) { - return new SpecificEnergy(megajoulesperkilogram, SpecificEnergyUnit.MegajoulePerKilogram); + return new SpecificEnergy(value, SpecificEnergyUnit.MegajoulePerKilogram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromMegaJoulesPerTonne(double megajoulespertonne) + public static SpecificEnergy FromMegaJoulesPerTonne(double value) { - return new SpecificEnergy(megajoulespertonne, SpecificEnergyUnit.MegaJoulePerTonne); + return new SpecificEnergy(value, SpecificEnergyUnit.MegaJoulePerTonne); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromMegawattDaysPerKilogram(double megawattdaysperkilogram) + public static SpecificEnergy FromMegawattDaysPerKilogram(double value) { - return new SpecificEnergy(megawattdaysperkilogram, SpecificEnergyUnit.MegawattDayPerKilogram); + return new SpecificEnergy(value, SpecificEnergyUnit.MegawattDayPerKilogram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromMegawattDaysPerShortTon(double megawattdayspershortton) + public static SpecificEnergy FromMegawattDaysPerShortTon(double value) { - return new SpecificEnergy(megawattdayspershortton, SpecificEnergyUnit.MegawattDayPerShortTon); + return new SpecificEnergy(value, SpecificEnergyUnit.MegawattDayPerShortTon); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromMegawattDaysPerTonne(double megawattdayspertonne) + public static SpecificEnergy FromMegawattDaysPerTonne(double value) { - return new SpecificEnergy(megawattdayspertonne, SpecificEnergyUnit.MegawattDayPerTonne); + return new SpecificEnergy(value, SpecificEnergyUnit.MegawattDayPerTonne); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromMegawattHoursPerKilogram(double megawatthoursperkilogram) + public static SpecificEnergy FromMegawattHoursPerKilogram(double value) { - return new SpecificEnergy(megawatthoursperkilogram, SpecificEnergyUnit.MegawattHourPerKilogram); + return new SpecificEnergy(value, SpecificEnergyUnit.MegawattHourPerKilogram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromMegawattHoursPerPound(double megawatthoursperpound) + public static SpecificEnergy FromMegawattHoursPerPound(double value) { - return new SpecificEnergy(megawatthoursperpound, SpecificEnergyUnit.MegawattHourPerPound); + return new SpecificEnergy(value, SpecificEnergyUnit.MegawattHourPerPound); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromTerawattDaysPerKilogram(double terawattdaysperkilogram) + public static SpecificEnergy FromTerawattDaysPerKilogram(double value) { - return new SpecificEnergy(terawattdaysperkilogram, SpecificEnergyUnit.TerawattDayPerKilogram); + return new SpecificEnergy(value, SpecificEnergyUnit.TerawattDayPerKilogram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromTerawattDaysPerShortTon(double terawattdayspershortton) + public static SpecificEnergy FromTerawattDaysPerShortTon(double value) { - return new SpecificEnergy(terawattdayspershortton, SpecificEnergyUnit.TerawattDayPerShortTon); + return new SpecificEnergy(value, SpecificEnergyUnit.TerawattDayPerShortTon); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromTerawattDaysPerTonne(double terawattdayspertonne) + public static SpecificEnergy FromTerawattDaysPerTonne(double value) { - return new SpecificEnergy(terawattdayspertonne, SpecificEnergyUnit.TerawattDayPerTonne); + return new SpecificEnergy(value, SpecificEnergyUnit.TerawattDayPerTonne); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromWattDaysPerKilogram(double wattdaysperkilogram) + public static SpecificEnergy FromWattDaysPerKilogram(double value) { - return new SpecificEnergy(wattdaysperkilogram, SpecificEnergyUnit.WattDayPerKilogram); + return new SpecificEnergy(value, SpecificEnergyUnit.WattDayPerKilogram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromWattDaysPerShortTon(double wattdayspershortton) + public static SpecificEnergy FromWattDaysPerShortTon(double value) { - return new SpecificEnergy(wattdayspershortton, SpecificEnergyUnit.WattDayPerShortTon); + return new SpecificEnergy(value, SpecificEnergyUnit.WattDayPerShortTon); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromWattDaysPerTonne(double wattdayspertonne) + public static SpecificEnergy FromWattDaysPerTonne(double value) { - return new SpecificEnergy(wattdayspertonne, SpecificEnergyUnit.WattDayPerTonne); + return new SpecificEnergy(value, SpecificEnergyUnit.WattDayPerTonne); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromWattHoursPerKilogram(double watthoursperkilogram) + public static SpecificEnergy FromWattHoursPerKilogram(double value) { - return new SpecificEnergy(watthoursperkilogram, SpecificEnergyUnit.WattHourPerKilogram); + return new SpecificEnergy(value, SpecificEnergyUnit.WattHourPerKilogram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEnergy FromWattHoursPerPound(double watthoursperpound) + public static SpecificEnergy FromWattHoursPerPound(double value) { - return new SpecificEnergy(watthoursperpound, SpecificEnergyUnit.WattHourPerPound); + return new SpecificEnergy(value, SpecificEnergyUnit.WattHourPerPound); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.g.cs index 7111f179f8..a992921ae0 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.g.cs @@ -292,81 +292,81 @@ public static string GetAbbreviation(SpecificEntropyUnit unit, IFormatProvider? /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEntropy FromBtusPerPoundFahrenheit(double btusperpoundfahrenheit) + public static SpecificEntropy FromBtusPerPoundFahrenheit(double value) { - return new SpecificEntropy(btusperpoundfahrenheit, SpecificEntropyUnit.BtuPerPoundFahrenheit); + return new SpecificEntropy(value, SpecificEntropyUnit.BtuPerPoundFahrenheit); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEntropy FromCaloriesPerGramKelvin(double caloriespergramkelvin) + public static SpecificEntropy FromCaloriesPerGramKelvin(double value) { - return new SpecificEntropy(caloriespergramkelvin, SpecificEntropyUnit.CaloriePerGramKelvin); + return new SpecificEntropy(value, SpecificEntropyUnit.CaloriePerGramKelvin); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEntropy FromJoulesPerKilogramDegreeCelsius(double joulesperkilogramdegreecelsius) + public static SpecificEntropy FromJoulesPerKilogramDegreeCelsius(double value) { - return new SpecificEntropy(joulesperkilogramdegreecelsius, SpecificEntropyUnit.JoulePerKilogramDegreeCelsius); + return new SpecificEntropy(value, SpecificEntropyUnit.JoulePerKilogramDegreeCelsius); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEntropy FromJoulesPerKilogramKelvin(double joulesperkilogramkelvin) + public static SpecificEntropy FromJoulesPerKilogramKelvin(double value) { - return new SpecificEntropy(joulesperkilogramkelvin, SpecificEntropyUnit.JoulePerKilogramKelvin); + return new SpecificEntropy(value, SpecificEntropyUnit.JoulePerKilogramKelvin); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEntropy FromKilocaloriesPerGramKelvin(double kilocaloriespergramkelvin) + public static SpecificEntropy FromKilocaloriesPerGramKelvin(double value) { - return new SpecificEntropy(kilocaloriespergramkelvin, SpecificEntropyUnit.KilocaloriePerGramKelvin); + return new SpecificEntropy(value, SpecificEntropyUnit.KilocaloriePerGramKelvin); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEntropy FromKilojoulesPerKilogramDegreeCelsius(double kilojoulesperkilogramdegreecelsius) + public static SpecificEntropy FromKilojoulesPerKilogramDegreeCelsius(double value) { - return new SpecificEntropy(kilojoulesperkilogramdegreecelsius, SpecificEntropyUnit.KilojoulePerKilogramDegreeCelsius); + return new SpecificEntropy(value, SpecificEntropyUnit.KilojoulePerKilogramDegreeCelsius); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEntropy FromKilojoulesPerKilogramKelvin(double kilojoulesperkilogramkelvin) + public static SpecificEntropy FromKilojoulesPerKilogramKelvin(double value) { - return new SpecificEntropy(kilojoulesperkilogramkelvin, SpecificEntropyUnit.KilojoulePerKilogramKelvin); + return new SpecificEntropy(value, SpecificEntropyUnit.KilojoulePerKilogramKelvin); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEntropy FromMegajoulesPerKilogramDegreeCelsius(double megajoulesperkilogramdegreecelsius) + public static SpecificEntropy FromMegajoulesPerKilogramDegreeCelsius(double value) { - return new SpecificEntropy(megajoulesperkilogramdegreecelsius, SpecificEntropyUnit.MegajoulePerKilogramDegreeCelsius); + return new SpecificEntropy(value, SpecificEntropyUnit.MegajoulePerKilogramDegreeCelsius); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificEntropy FromMegajoulesPerKilogramKelvin(double megajoulesperkilogramkelvin) + public static SpecificEntropy FromMegajoulesPerKilogramKelvin(double value) { - return new SpecificEntropy(megajoulesperkilogramkelvin, SpecificEntropyUnit.MegajoulePerKilogramKelvin); + return new SpecificEntropy(value, SpecificEntropyUnit.MegajoulePerKilogramKelvin); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificFuelConsumption.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificFuelConsumption.g.cs index f98426d202..9e0b0ddcb3 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificFuelConsumption.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificFuelConsumption.g.cs @@ -248,36 +248,36 @@ public static string GetAbbreviation(SpecificFuelConsumptionUnit unit, IFormatPr /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificFuelConsumption FromGramsPerKiloNewtonSecond(double gramsperkilonewtonsecond) + public static SpecificFuelConsumption FromGramsPerKiloNewtonSecond(double value) { - return new SpecificFuelConsumption(gramsperkilonewtonsecond, SpecificFuelConsumptionUnit.GramPerKiloNewtonSecond); + return new SpecificFuelConsumption(value, SpecificFuelConsumptionUnit.GramPerKiloNewtonSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificFuelConsumption FromKilogramsPerKilogramForceHour(double kilogramsperkilogramforcehour) + public static SpecificFuelConsumption FromKilogramsPerKilogramForceHour(double value) { - return new SpecificFuelConsumption(kilogramsperkilogramforcehour, SpecificFuelConsumptionUnit.KilogramPerKilogramForceHour); + return new SpecificFuelConsumption(value, SpecificFuelConsumptionUnit.KilogramPerKilogramForceHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificFuelConsumption FromKilogramsPerKiloNewtonSecond(double kilogramsperkilonewtonsecond) + public static SpecificFuelConsumption FromKilogramsPerKiloNewtonSecond(double value) { - return new SpecificFuelConsumption(kilogramsperkilonewtonsecond, SpecificFuelConsumptionUnit.KilogramPerKiloNewtonSecond); + return new SpecificFuelConsumption(value, SpecificFuelConsumptionUnit.KilogramPerKiloNewtonSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificFuelConsumption FromPoundsMassPerPoundForceHour(double poundsmassperpoundforcehour) + public static SpecificFuelConsumption FromPoundsMassPerPoundForceHour(double value) { - return new SpecificFuelConsumption(poundsmassperpoundforcehour, SpecificFuelConsumptionUnit.PoundMassPerPoundForceHour); + return new SpecificFuelConsumption(value, SpecificFuelConsumptionUnit.PoundMassPerPoundForceHour); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificVolume.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificVolume.g.cs index ec08b56d95..511ee26cc2 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificVolume.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificVolume.g.cs @@ -243,27 +243,27 @@ public static string GetAbbreviation(SpecificVolumeUnit unit, IFormatProvider? p /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificVolume FromCubicFeetPerPound(double cubicfeetperpound) + public static SpecificVolume FromCubicFeetPerPound(double value) { - return new SpecificVolume(cubicfeetperpound, SpecificVolumeUnit.CubicFootPerPound); + return new SpecificVolume(value, SpecificVolumeUnit.CubicFootPerPound); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificVolume FromCubicMetersPerKilogram(double cubicmetersperkilogram) + public static SpecificVolume FromCubicMetersPerKilogram(double value) { - return new SpecificVolume(cubicmetersperkilogram, SpecificVolumeUnit.CubicMeterPerKilogram); + return new SpecificVolume(value, SpecificVolumeUnit.CubicMeterPerKilogram); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificVolume FromMillicubicMetersPerKilogram(double millicubicmetersperkilogram) + public static SpecificVolume FromMillicubicMetersPerKilogram(double value) { - return new SpecificVolume(millicubicmetersperkilogram, SpecificVolumeUnit.MillicubicMeterPerKilogram); + return new SpecificVolume(value, SpecificVolumeUnit.MillicubicMeterPerKilogram); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificWeight.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificWeight.g.cs index 1c863125ad..df6748a31f 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificWeight.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificWeight.g.cs @@ -361,153 +361,153 @@ public static string GetAbbreviation(SpecificWeightUnit unit, IFormatProvider? p /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificWeight FromKilogramsForcePerCubicCentimeter(double kilogramsforcepercubiccentimeter) + public static SpecificWeight FromKilogramsForcePerCubicCentimeter(double value) { - return new SpecificWeight(kilogramsforcepercubiccentimeter, SpecificWeightUnit.KilogramForcePerCubicCentimeter); + return new SpecificWeight(value, SpecificWeightUnit.KilogramForcePerCubicCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificWeight FromKilogramsForcePerCubicMeter(double kilogramsforcepercubicmeter) + public static SpecificWeight FromKilogramsForcePerCubicMeter(double value) { - return new SpecificWeight(kilogramsforcepercubicmeter, SpecificWeightUnit.KilogramForcePerCubicMeter); + return new SpecificWeight(value, SpecificWeightUnit.KilogramForcePerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificWeight FromKilogramsForcePerCubicMillimeter(double kilogramsforcepercubicmillimeter) + public static SpecificWeight FromKilogramsForcePerCubicMillimeter(double value) { - return new SpecificWeight(kilogramsforcepercubicmillimeter, SpecificWeightUnit.KilogramForcePerCubicMillimeter); + return new SpecificWeight(value, SpecificWeightUnit.KilogramForcePerCubicMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificWeight FromKilonewtonsPerCubicCentimeter(double kilonewtonspercubiccentimeter) + public static SpecificWeight FromKilonewtonsPerCubicCentimeter(double value) { - return new SpecificWeight(kilonewtonspercubiccentimeter, SpecificWeightUnit.KilonewtonPerCubicCentimeter); + return new SpecificWeight(value, SpecificWeightUnit.KilonewtonPerCubicCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificWeight FromKilonewtonsPerCubicMeter(double kilonewtonspercubicmeter) + public static SpecificWeight FromKilonewtonsPerCubicMeter(double value) { - return new SpecificWeight(kilonewtonspercubicmeter, SpecificWeightUnit.KilonewtonPerCubicMeter); + return new SpecificWeight(value, SpecificWeightUnit.KilonewtonPerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificWeight FromKilonewtonsPerCubicMillimeter(double kilonewtonspercubicmillimeter) + public static SpecificWeight FromKilonewtonsPerCubicMillimeter(double value) { - return new SpecificWeight(kilonewtonspercubicmillimeter, SpecificWeightUnit.KilonewtonPerCubicMillimeter); + return new SpecificWeight(value, SpecificWeightUnit.KilonewtonPerCubicMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificWeight FromKilopoundsForcePerCubicFoot(double kilopoundsforcepercubicfoot) + public static SpecificWeight FromKilopoundsForcePerCubicFoot(double value) { - return new SpecificWeight(kilopoundsforcepercubicfoot, SpecificWeightUnit.KilopoundForcePerCubicFoot); + return new SpecificWeight(value, SpecificWeightUnit.KilopoundForcePerCubicFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificWeight FromKilopoundsForcePerCubicInch(double kilopoundsforcepercubicinch) + public static SpecificWeight FromKilopoundsForcePerCubicInch(double value) { - return new SpecificWeight(kilopoundsforcepercubicinch, SpecificWeightUnit.KilopoundForcePerCubicInch); + return new SpecificWeight(value, SpecificWeightUnit.KilopoundForcePerCubicInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificWeight FromMeganewtonsPerCubicMeter(double meganewtonspercubicmeter) + public static SpecificWeight FromMeganewtonsPerCubicMeter(double value) { - return new SpecificWeight(meganewtonspercubicmeter, SpecificWeightUnit.MeganewtonPerCubicMeter); + return new SpecificWeight(value, SpecificWeightUnit.MeganewtonPerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificWeight FromNewtonsPerCubicCentimeter(double newtonspercubiccentimeter) + public static SpecificWeight FromNewtonsPerCubicCentimeter(double value) { - return new SpecificWeight(newtonspercubiccentimeter, SpecificWeightUnit.NewtonPerCubicCentimeter); + return new SpecificWeight(value, SpecificWeightUnit.NewtonPerCubicCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificWeight FromNewtonsPerCubicMeter(double newtonspercubicmeter) + public static SpecificWeight FromNewtonsPerCubicMeter(double value) { - return new SpecificWeight(newtonspercubicmeter, SpecificWeightUnit.NewtonPerCubicMeter); + return new SpecificWeight(value, SpecificWeightUnit.NewtonPerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificWeight FromNewtonsPerCubicMillimeter(double newtonspercubicmillimeter) + public static SpecificWeight FromNewtonsPerCubicMillimeter(double value) { - return new SpecificWeight(newtonspercubicmillimeter, SpecificWeightUnit.NewtonPerCubicMillimeter); + return new SpecificWeight(value, SpecificWeightUnit.NewtonPerCubicMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificWeight FromPoundsForcePerCubicFoot(double poundsforcepercubicfoot) + public static SpecificWeight FromPoundsForcePerCubicFoot(double value) { - return new SpecificWeight(poundsforcepercubicfoot, SpecificWeightUnit.PoundForcePerCubicFoot); + return new SpecificWeight(value, SpecificWeightUnit.PoundForcePerCubicFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificWeight FromPoundsForcePerCubicInch(double poundsforcepercubicinch) + public static SpecificWeight FromPoundsForcePerCubicInch(double value) { - return new SpecificWeight(poundsforcepercubicinch, SpecificWeightUnit.PoundForcePerCubicInch); + return new SpecificWeight(value, SpecificWeightUnit.PoundForcePerCubicInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificWeight FromTonnesForcePerCubicCentimeter(double tonnesforcepercubiccentimeter) + public static SpecificWeight FromTonnesForcePerCubicCentimeter(double value) { - return new SpecificWeight(tonnesforcepercubiccentimeter, SpecificWeightUnit.TonneForcePerCubicCentimeter); + return new SpecificWeight(value, SpecificWeightUnit.TonneForcePerCubicCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificWeight FromTonnesForcePerCubicMeter(double tonnesforcepercubicmeter) + public static SpecificWeight FromTonnesForcePerCubicMeter(double value) { - return new SpecificWeight(tonnesforcepercubicmeter, SpecificWeightUnit.TonneForcePerCubicMeter); + return new SpecificWeight(value, SpecificWeightUnit.TonneForcePerCubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static SpecificWeight FromTonnesForcePerCubicMillimeter(double tonnesforcepercubicmillimeter) + public static SpecificWeight FromTonnesForcePerCubicMillimeter(double value) { - return new SpecificWeight(tonnesforcepercubicmillimeter, SpecificWeightUnit.TonneForcePerCubicMillimeter); + return new SpecificWeight(value, SpecificWeightUnit.TonneForcePerCubicMillimeter); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Speed.g.cs b/UnitsNet/GeneratedCode/Quantities/Speed.g.cs index 8bf4d96a66..be123e3c16 100644 --- a/UnitsNet/GeneratedCode/Quantities/Speed.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Speed.g.cs @@ -492,297 +492,297 @@ public static string GetAbbreviation(SpeedUnit unit, IFormatProvider? provider) /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromCentimetersPerHour(double centimetersperhour) + public static Speed FromCentimetersPerHour(double value) { - return new Speed(centimetersperhour, SpeedUnit.CentimeterPerHour); + return new Speed(value, SpeedUnit.CentimeterPerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromCentimetersPerMinute(double centimetersperminute) + public static Speed FromCentimetersPerMinute(double value) { - return new Speed(centimetersperminute, SpeedUnit.CentimeterPerMinute); + return new Speed(value, SpeedUnit.CentimeterPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromCentimetersPerSecond(double centimeterspersecond) + public static Speed FromCentimetersPerSecond(double value) { - return new Speed(centimeterspersecond, SpeedUnit.CentimeterPerSecond); + return new Speed(value, SpeedUnit.CentimeterPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromDecimetersPerMinute(double decimetersperminute) + public static Speed FromDecimetersPerMinute(double value) { - return new Speed(decimetersperminute, SpeedUnit.DecimeterPerMinute); + return new Speed(value, SpeedUnit.DecimeterPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromDecimetersPerSecond(double decimeterspersecond) + public static Speed FromDecimetersPerSecond(double value) { - return new Speed(decimeterspersecond, SpeedUnit.DecimeterPerSecond); + return new Speed(value, SpeedUnit.DecimeterPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromFeetPerHour(double feetperhour) + public static Speed FromFeetPerHour(double value) { - return new Speed(feetperhour, SpeedUnit.FootPerHour); + return new Speed(value, SpeedUnit.FootPerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromFeetPerMinute(double feetperminute) + public static Speed FromFeetPerMinute(double value) { - return new Speed(feetperminute, SpeedUnit.FootPerMinute); + return new Speed(value, SpeedUnit.FootPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromFeetPerSecond(double feetpersecond) + public static Speed FromFeetPerSecond(double value) { - return new Speed(feetpersecond, SpeedUnit.FootPerSecond); + return new Speed(value, SpeedUnit.FootPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromInchesPerHour(double inchesperhour) + public static Speed FromInchesPerHour(double value) { - return new Speed(inchesperhour, SpeedUnit.InchPerHour); + return new Speed(value, SpeedUnit.InchPerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromInchesPerMinute(double inchesperminute) + public static Speed FromInchesPerMinute(double value) { - return new Speed(inchesperminute, SpeedUnit.InchPerMinute); + return new Speed(value, SpeedUnit.InchPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromInchesPerSecond(double inchespersecond) + public static Speed FromInchesPerSecond(double value) { - return new Speed(inchespersecond, SpeedUnit.InchPerSecond); + return new Speed(value, SpeedUnit.InchPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromKilometersPerHour(double kilometersperhour) + public static Speed FromKilometersPerHour(double value) { - return new Speed(kilometersperhour, SpeedUnit.KilometerPerHour); + return new Speed(value, SpeedUnit.KilometerPerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromKilometersPerMinute(double kilometersperminute) + public static Speed FromKilometersPerMinute(double value) { - return new Speed(kilometersperminute, SpeedUnit.KilometerPerMinute); + return new Speed(value, SpeedUnit.KilometerPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromKilometersPerSecond(double kilometerspersecond) + public static Speed FromKilometersPerSecond(double value) { - return new Speed(kilometerspersecond, SpeedUnit.KilometerPerSecond); + return new Speed(value, SpeedUnit.KilometerPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromKnots(double knots) + public static Speed FromKnots(double value) { - return new Speed(knots, SpeedUnit.Knot); + return new Speed(value, SpeedUnit.Knot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromMach(double mach) + public static Speed FromMach(double value) { - return new Speed(mach, SpeedUnit.Mach); + return new Speed(value, SpeedUnit.Mach); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromMetersPerHour(double metersperhour) + public static Speed FromMetersPerHour(double value) { - return new Speed(metersperhour, SpeedUnit.MeterPerHour); + return new Speed(value, SpeedUnit.MeterPerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromMetersPerMinute(double metersperminute) + public static Speed FromMetersPerMinute(double value) { - return new Speed(metersperminute, SpeedUnit.MeterPerMinute); + return new Speed(value, SpeedUnit.MeterPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromMetersPerSecond(double meterspersecond) + public static Speed FromMetersPerSecond(double value) { - return new Speed(meterspersecond, SpeedUnit.MeterPerSecond); + return new Speed(value, SpeedUnit.MeterPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromMicrometersPerMinute(double micrometersperminute) + public static Speed FromMicrometersPerMinute(double value) { - return new Speed(micrometersperminute, SpeedUnit.MicrometerPerMinute); + return new Speed(value, SpeedUnit.MicrometerPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromMicrometersPerSecond(double micrometerspersecond) + public static Speed FromMicrometersPerSecond(double value) { - return new Speed(micrometerspersecond, SpeedUnit.MicrometerPerSecond); + return new Speed(value, SpeedUnit.MicrometerPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromMilesPerHour(double milesperhour) + public static Speed FromMilesPerHour(double value) { - return new Speed(milesperhour, SpeedUnit.MilePerHour); + return new Speed(value, SpeedUnit.MilePerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromMillimetersPerHour(double millimetersperhour) + public static Speed FromMillimetersPerHour(double value) { - return new Speed(millimetersperhour, SpeedUnit.MillimeterPerHour); + return new Speed(value, SpeedUnit.MillimeterPerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromMillimetersPerMinute(double millimetersperminute) + public static Speed FromMillimetersPerMinute(double value) { - return new Speed(millimetersperminute, SpeedUnit.MillimeterPerMinute); + return new Speed(value, SpeedUnit.MillimeterPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromMillimetersPerSecond(double millimeterspersecond) + public static Speed FromMillimetersPerSecond(double value) { - return new Speed(millimeterspersecond, SpeedUnit.MillimeterPerSecond); + return new Speed(value, SpeedUnit.MillimeterPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromNanometersPerMinute(double nanometersperminute) + public static Speed FromNanometersPerMinute(double value) { - return new Speed(nanometersperminute, SpeedUnit.NanometerPerMinute); + return new Speed(value, SpeedUnit.NanometerPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromNanometersPerSecond(double nanometerspersecond) + public static Speed FromNanometersPerSecond(double value) { - return new Speed(nanometerspersecond, SpeedUnit.NanometerPerSecond); + return new Speed(value, SpeedUnit.NanometerPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromUsSurveyFeetPerHour(double ussurveyfeetperhour) + public static Speed FromUsSurveyFeetPerHour(double value) { - return new Speed(ussurveyfeetperhour, SpeedUnit.UsSurveyFootPerHour); + return new Speed(value, SpeedUnit.UsSurveyFootPerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromUsSurveyFeetPerMinute(double ussurveyfeetperminute) + public static Speed FromUsSurveyFeetPerMinute(double value) { - return new Speed(ussurveyfeetperminute, SpeedUnit.UsSurveyFootPerMinute); + return new Speed(value, SpeedUnit.UsSurveyFootPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromUsSurveyFeetPerSecond(double ussurveyfeetpersecond) + public static Speed FromUsSurveyFeetPerSecond(double value) { - return new Speed(ussurveyfeetpersecond, SpeedUnit.UsSurveyFootPerSecond); + return new Speed(value, SpeedUnit.UsSurveyFootPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromYardsPerHour(double yardsperhour) + public static Speed FromYardsPerHour(double value) { - return new Speed(yardsperhour, SpeedUnit.YardPerHour); + return new Speed(value, SpeedUnit.YardPerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromYardsPerMinute(double yardsperminute) + public static Speed FromYardsPerMinute(double value) { - return new Speed(yardsperminute, SpeedUnit.YardPerMinute); + return new Speed(value, SpeedUnit.YardPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Speed FromYardsPerSecond(double yardspersecond) + public static Speed FromYardsPerSecond(double value) { - return new Speed(yardspersecond, SpeedUnit.YardPerSecond); + return new Speed(value, SpeedUnit.YardPerSecond); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/StandardVolumeFlow.g.cs b/UnitsNet/GeneratedCode/Quantities/StandardVolumeFlow.g.cs index b5667ffc11..556efa1c3c 100644 --- a/UnitsNet/GeneratedCode/Quantities/StandardVolumeFlow.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/StandardVolumeFlow.g.cs @@ -285,81 +285,81 @@ public static string GetAbbreviation(StandardVolumeFlowUnit unit, IFormatProvide /// Creates a from . /// /// If value is NaN or Infinity. - public static StandardVolumeFlow FromStandardCubicCentimetersPerMinute(double standardcubiccentimetersperminute) + public static StandardVolumeFlow FromStandardCubicCentimetersPerMinute(double value) { - return new StandardVolumeFlow(standardcubiccentimetersperminute, StandardVolumeFlowUnit.StandardCubicCentimeterPerMinute); + return new StandardVolumeFlow(value, StandardVolumeFlowUnit.StandardCubicCentimeterPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static StandardVolumeFlow FromStandardCubicFeetPerHour(double standardcubicfeetperhour) + public static StandardVolumeFlow FromStandardCubicFeetPerHour(double value) { - return new StandardVolumeFlow(standardcubicfeetperhour, StandardVolumeFlowUnit.StandardCubicFootPerHour); + return new StandardVolumeFlow(value, StandardVolumeFlowUnit.StandardCubicFootPerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static StandardVolumeFlow FromStandardCubicFeetPerMinute(double standardcubicfeetperminute) + public static StandardVolumeFlow FromStandardCubicFeetPerMinute(double value) { - return new StandardVolumeFlow(standardcubicfeetperminute, StandardVolumeFlowUnit.StandardCubicFootPerMinute); + return new StandardVolumeFlow(value, StandardVolumeFlowUnit.StandardCubicFootPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static StandardVolumeFlow FromStandardCubicFeetPerSecond(double standardcubicfeetpersecond) + public static StandardVolumeFlow FromStandardCubicFeetPerSecond(double value) { - return new StandardVolumeFlow(standardcubicfeetpersecond, StandardVolumeFlowUnit.StandardCubicFootPerSecond); + return new StandardVolumeFlow(value, StandardVolumeFlowUnit.StandardCubicFootPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static StandardVolumeFlow FromStandardCubicMetersPerDay(double standardcubicmetersperday) + public static StandardVolumeFlow FromStandardCubicMetersPerDay(double value) { - return new StandardVolumeFlow(standardcubicmetersperday, StandardVolumeFlowUnit.StandardCubicMeterPerDay); + return new StandardVolumeFlow(value, StandardVolumeFlowUnit.StandardCubicMeterPerDay); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static StandardVolumeFlow FromStandardCubicMetersPerHour(double standardcubicmetersperhour) + public static StandardVolumeFlow FromStandardCubicMetersPerHour(double value) { - return new StandardVolumeFlow(standardcubicmetersperhour, StandardVolumeFlowUnit.StandardCubicMeterPerHour); + return new StandardVolumeFlow(value, StandardVolumeFlowUnit.StandardCubicMeterPerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static StandardVolumeFlow FromStandardCubicMetersPerMinute(double standardcubicmetersperminute) + public static StandardVolumeFlow FromStandardCubicMetersPerMinute(double value) { - return new StandardVolumeFlow(standardcubicmetersperminute, StandardVolumeFlowUnit.StandardCubicMeterPerMinute); + return new StandardVolumeFlow(value, StandardVolumeFlowUnit.StandardCubicMeterPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static StandardVolumeFlow FromStandardCubicMetersPerSecond(double standardcubicmeterspersecond) + public static StandardVolumeFlow FromStandardCubicMetersPerSecond(double value) { - return new StandardVolumeFlow(standardcubicmeterspersecond, StandardVolumeFlowUnit.StandardCubicMeterPerSecond); + return new StandardVolumeFlow(value, StandardVolumeFlowUnit.StandardCubicMeterPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static StandardVolumeFlow FromStandardLitersPerMinute(double standardlitersperminute) + public static StandardVolumeFlow FromStandardLitersPerMinute(double value) { - return new StandardVolumeFlow(standardlitersperminute, StandardVolumeFlowUnit.StandardLiterPerMinute); + return new StandardVolumeFlow(value, StandardVolumeFlowUnit.StandardLiterPerMinute); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Temperature.g.cs b/UnitsNet/GeneratedCode/Quantities/Temperature.g.cs index c3d224ce77..4afd8ff8ca 100644 --- a/UnitsNet/GeneratedCode/Quantities/Temperature.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Temperature.g.cs @@ -290,90 +290,90 @@ public static string GetAbbreviation(TemperatureUnit unit, IFormatProvider? prov /// Creates a from . /// /// If value is NaN or Infinity. - public static Temperature FromDegreesCelsius(double degreescelsius) + public static Temperature FromDegreesCelsius(double value) { - return new Temperature(degreescelsius, TemperatureUnit.DegreeCelsius); + return new Temperature(value, TemperatureUnit.DegreeCelsius); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Temperature FromDegreesDelisle(double degreesdelisle) + public static Temperature FromDegreesDelisle(double value) { - return new Temperature(degreesdelisle, TemperatureUnit.DegreeDelisle); + return new Temperature(value, TemperatureUnit.DegreeDelisle); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Temperature FromDegreesFahrenheit(double degreesfahrenheit) + public static Temperature FromDegreesFahrenheit(double value) { - return new Temperature(degreesfahrenheit, TemperatureUnit.DegreeFahrenheit); + return new Temperature(value, TemperatureUnit.DegreeFahrenheit); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Temperature FromDegreesNewton(double degreesnewton) + public static Temperature FromDegreesNewton(double value) { - return new Temperature(degreesnewton, TemperatureUnit.DegreeNewton); + return new Temperature(value, TemperatureUnit.DegreeNewton); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Temperature FromDegreesRankine(double degreesrankine) + public static Temperature FromDegreesRankine(double value) { - return new Temperature(degreesrankine, TemperatureUnit.DegreeRankine); + return new Temperature(value, TemperatureUnit.DegreeRankine); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Temperature FromDegreesReaumur(double degreesreaumur) + public static Temperature FromDegreesReaumur(double value) { - return new Temperature(degreesreaumur, TemperatureUnit.DegreeReaumur); + return new Temperature(value, TemperatureUnit.DegreeReaumur); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Temperature FromDegreesRoemer(double degreesroemer) + public static Temperature FromDegreesRoemer(double value) { - return new Temperature(degreesroemer, TemperatureUnit.DegreeRoemer); + return new Temperature(value, TemperatureUnit.DegreeRoemer); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Temperature FromKelvins(double kelvins) + public static Temperature FromKelvins(double value) { - return new Temperature(kelvins, TemperatureUnit.Kelvin); + return new Temperature(value, TemperatureUnit.Kelvin); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Temperature FromMillidegreesCelsius(double millidegreescelsius) + public static Temperature FromMillidegreesCelsius(double value) { - return new Temperature(millidegreescelsius, TemperatureUnit.MillidegreeCelsius); + return new Temperature(value, TemperatureUnit.MillidegreeCelsius); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Temperature FromSolarTemperatures(double solartemperatures) + public static Temperature FromSolarTemperatures(double value) { - return new Temperature(solartemperatures, TemperatureUnit.SolarTemperature); + return new Temperature(value, TemperatureUnit.SolarTemperature); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.g.cs index e50c577e4d..d11a02f09f 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.g.cs @@ -300,90 +300,90 @@ public static string GetAbbreviation(TemperatureChangeRateUnit unit, IFormatProv /// Creates a from . /// /// If value is NaN or Infinity. - public static TemperatureChangeRate FromCentidegreesCelsiusPerSecond(double centidegreescelsiuspersecond) + public static TemperatureChangeRate FromCentidegreesCelsiusPerSecond(double value) { - return new TemperatureChangeRate(centidegreescelsiuspersecond, TemperatureChangeRateUnit.CentidegreeCelsiusPerSecond); + return new TemperatureChangeRate(value, TemperatureChangeRateUnit.CentidegreeCelsiusPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TemperatureChangeRate FromDecadegreesCelsiusPerSecond(double decadegreescelsiuspersecond) + public static TemperatureChangeRate FromDecadegreesCelsiusPerSecond(double value) { - return new TemperatureChangeRate(decadegreescelsiuspersecond, TemperatureChangeRateUnit.DecadegreeCelsiusPerSecond); + return new TemperatureChangeRate(value, TemperatureChangeRateUnit.DecadegreeCelsiusPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TemperatureChangeRate FromDecidegreesCelsiusPerSecond(double decidegreescelsiuspersecond) + public static TemperatureChangeRate FromDecidegreesCelsiusPerSecond(double value) { - return new TemperatureChangeRate(decidegreescelsiuspersecond, TemperatureChangeRateUnit.DecidegreeCelsiusPerSecond); + return new TemperatureChangeRate(value, TemperatureChangeRateUnit.DecidegreeCelsiusPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TemperatureChangeRate FromDegreesCelsiusPerMinute(double degreescelsiusperminute) + public static TemperatureChangeRate FromDegreesCelsiusPerMinute(double value) { - return new TemperatureChangeRate(degreescelsiusperminute, TemperatureChangeRateUnit.DegreeCelsiusPerMinute); + return new TemperatureChangeRate(value, TemperatureChangeRateUnit.DegreeCelsiusPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TemperatureChangeRate FromDegreesCelsiusPerSecond(double degreescelsiuspersecond) + public static TemperatureChangeRate FromDegreesCelsiusPerSecond(double value) { - return new TemperatureChangeRate(degreescelsiuspersecond, TemperatureChangeRateUnit.DegreeCelsiusPerSecond); + return new TemperatureChangeRate(value, TemperatureChangeRateUnit.DegreeCelsiusPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TemperatureChangeRate FromHectodegreesCelsiusPerSecond(double hectodegreescelsiuspersecond) + public static TemperatureChangeRate FromHectodegreesCelsiusPerSecond(double value) { - return new TemperatureChangeRate(hectodegreescelsiuspersecond, TemperatureChangeRateUnit.HectodegreeCelsiusPerSecond); + return new TemperatureChangeRate(value, TemperatureChangeRateUnit.HectodegreeCelsiusPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TemperatureChangeRate FromKilodegreesCelsiusPerSecond(double kilodegreescelsiuspersecond) + public static TemperatureChangeRate FromKilodegreesCelsiusPerSecond(double value) { - return new TemperatureChangeRate(kilodegreescelsiuspersecond, TemperatureChangeRateUnit.KilodegreeCelsiusPerSecond); + return new TemperatureChangeRate(value, TemperatureChangeRateUnit.KilodegreeCelsiusPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TemperatureChangeRate FromMicrodegreesCelsiusPerSecond(double microdegreescelsiuspersecond) + public static TemperatureChangeRate FromMicrodegreesCelsiusPerSecond(double value) { - return new TemperatureChangeRate(microdegreescelsiuspersecond, TemperatureChangeRateUnit.MicrodegreeCelsiusPerSecond); + return new TemperatureChangeRate(value, TemperatureChangeRateUnit.MicrodegreeCelsiusPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TemperatureChangeRate FromMillidegreesCelsiusPerSecond(double millidegreescelsiuspersecond) + public static TemperatureChangeRate FromMillidegreesCelsiusPerSecond(double value) { - return new TemperatureChangeRate(millidegreescelsiuspersecond, TemperatureChangeRateUnit.MillidegreeCelsiusPerSecond); + return new TemperatureChangeRate(value, TemperatureChangeRateUnit.MillidegreeCelsiusPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TemperatureChangeRate FromNanodegreesCelsiusPerSecond(double nanodegreescelsiuspersecond) + public static TemperatureChangeRate FromNanodegreesCelsiusPerSecond(double value) { - return new TemperatureChangeRate(nanodegreescelsiuspersecond, TemperatureChangeRateUnit.NanodegreeCelsiusPerSecond); + return new TemperatureChangeRate(value, TemperatureChangeRateUnit.NanodegreeCelsiusPerSecond); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.g.cs index ea0728ccc2..ac4bc1b2b9 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.g.cs @@ -295,81 +295,81 @@ public static string GetAbbreviation(TemperatureDeltaUnit unit, IFormatProvider? /// Creates a from . /// /// If value is NaN or Infinity. - public static TemperatureDelta FromDegreesCelsius(double degreescelsius) + public static TemperatureDelta FromDegreesCelsius(double value) { - return new TemperatureDelta(degreescelsius, TemperatureDeltaUnit.DegreeCelsius); + return new TemperatureDelta(value, TemperatureDeltaUnit.DegreeCelsius); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TemperatureDelta FromDegreesDelisle(double degreesdelisle) + public static TemperatureDelta FromDegreesDelisle(double value) { - return new TemperatureDelta(degreesdelisle, TemperatureDeltaUnit.DegreeDelisle); + return new TemperatureDelta(value, TemperatureDeltaUnit.DegreeDelisle); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TemperatureDelta FromDegreesFahrenheit(double degreesfahrenheit) + public static TemperatureDelta FromDegreesFahrenheit(double value) { - return new TemperatureDelta(degreesfahrenheit, TemperatureDeltaUnit.DegreeFahrenheit); + return new TemperatureDelta(value, TemperatureDeltaUnit.DegreeFahrenheit); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TemperatureDelta FromDegreesNewton(double degreesnewton) + public static TemperatureDelta FromDegreesNewton(double value) { - return new TemperatureDelta(degreesnewton, TemperatureDeltaUnit.DegreeNewton); + return new TemperatureDelta(value, TemperatureDeltaUnit.DegreeNewton); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TemperatureDelta FromDegreesRankine(double degreesrankine) + public static TemperatureDelta FromDegreesRankine(double value) { - return new TemperatureDelta(degreesrankine, TemperatureDeltaUnit.DegreeRankine); + return new TemperatureDelta(value, TemperatureDeltaUnit.DegreeRankine); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TemperatureDelta FromDegreesReaumur(double degreesreaumur) + public static TemperatureDelta FromDegreesReaumur(double value) { - return new TemperatureDelta(degreesreaumur, TemperatureDeltaUnit.DegreeReaumur); + return new TemperatureDelta(value, TemperatureDeltaUnit.DegreeReaumur); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TemperatureDelta FromDegreesRoemer(double degreesroemer) + public static TemperatureDelta FromDegreesRoemer(double value) { - return new TemperatureDelta(degreesroemer, TemperatureDeltaUnit.DegreeRoemer); + return new TemperatureDelta(value, TemperatureDeltaUnit.DegreeRoemer); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TemperatureDelta FromKelvins(double kelvins) + public static TemperatureDelta FromKelvins(double value) { - return new TemperatureDelta(kelvins, TemperatureDeltaUnit.Kelvin); + return new TemperatureDelta(value, TemperatureDeltaUnit.Kelvin); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TemperatureDelta FromMillidegreesCelsius(double millidegreescelsius) + public static TemperatureDelta FromMillidegreesCelsius(double value) { - return new TemperatureDelta(millidegreescelsius, TemperatureDeltaUnit.MillidegreeCelsius); + return new TemperatureDelta(value, TemperatureDeltaUnit.MillidegreeCelsius); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureGradient.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureGradient.g.cs index bd3d6405be..887514b5c0 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureGradient.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureGradient.g.cs @@ -251,36 +251,36 @@ public static string GetAbbreviation(TemperatureGradientUnit unit, IFormatProvid /// Creates a from . /// /// If value is NaN or Infinity. - public static TemperatureGradient FromDegreesCelsiusPerKilometer(double degreescelsiusperkilometer) + public static TemperatureGradient FromDegreesCelsiusPerKilometer(double value) { - return new TemperatureGradient(degreescelsiusperkilometer, TemperatureGradientUnit.DegreeCelsiusPerKilometer); + return new TemperatureGradient(value, TemperatureGradientUnit.DegreeCelsiusPerKilometer); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TemperatureGradient FromDegreesCelsiusPerMeter(double degreescelsiuspermeter) + public static TemperatureGradient FromDegreesCelsiusPerMeter(double value) { - return new TemperatureGradient(degreescelsiuspermeter, TemperatureGradientUnit.DegreeCelsiusPerMeter); + return new TemperatureGradient(value, TemperatureGradientUnit.DegreeCelsiusPerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TemperatureGradient FromDegreesFahrenheitPerFoot(double degreesfahrenheitperfoot) + public static TemperatureGradient FromDegreesFahrenheitPerFoot(double value) { - return new TemperatureGradient(degreesfahrenheitperfoot, TemperatureGradientUnit.DegreeFahrenheitPerFoot); + return new TemperatureGradient(value, TemperatureGradientUnit.DegreeFahrenheitPerFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TemperatureGradient FromKelvinsPerMeter(double kelvinspermeter) + public static TemperatureGradient FromKelvinsPerMeter(double value) { - return new TemperatureGradient(kelvinspermeter, TemperatureGradientUnit.KelvinPerMeter); + return new TemperatureGradient(value, TemperatureGradientUnit.KelvinPerMeter); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.g.cs b/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.g.cs index 7d523f9769..b3f9368f74 100644 --- a/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.g.cs @@ -232,18 +232,18 @@ public static string GetAbbreviation(ThermalConductivityUnit unit, IFormatProvid /// Creates a from . /// /// If value is NaN or Infinity. - public static ThermalConductivity FromBtusPerHourFootFahrenheit(double btusperhourfootfahrenheit) + public static ThermalConductivity FromBtusPerHourFootFahrenheit(double value) { - return new ThermalConductivity(btusperhourfootfahrenheit, ThermalConductivityUnit.BtuPerHourFootFahrenheit); + return new ThermalConductivity(value, ThermalConductivityUnit.BtuPerHourFootFahrenheit); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ThermalConductivity FromWattsPerMeterKelvin(double wattspermeterkelvin) + public static ThermalConductivity FromWattsPerMeterKelvin(double value) { - return new ThermalConductivity(wattspermeterkelvin, ThermalConductivityUnit.WattPerMeterKelvin); + return new ThermalConductivity(value, ThermalConductivityUnit.WattPerMeterKelvin); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ThermalResistance.g.cs b/UnitsNet/GeneratedCode/Quantities/ThermalResistance.g.cs index d22876e53d..83fd1625b9 100644 --- a/UnitsNet/GeneratedCode/Quantities/ThermalResistance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ThermalResistance.g.cs @@ -261,54 +261,54 @@ public static string GetAbbreviation(ThermalResistanceUnit unit, IFormatProvider /// Creates a from . /// /// If value is NaN or Infinity. - public static ThermalResistance FromHourSquareFeetDegreesFahrenheitPerBtu(double hoursquarefeetdegreesfahrenheitperbtu) + public static ThermalResistance FromHourSquareFeetDegreesFahrenheitPerBtu(double value) { - return new ThermalResistance(hoursquarefeetdegreesfahrenheitperbtu, ThermalResistanceUnit.HourSquareFeetDegreeFahrenheitPerBtu); + return new ThermalResistance(value, ThermalResistanceUnit.HourSquareFeetDegreeFahrenheitPerBtu); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ThermalResistance FromSquareCentimeterHourDegreesCelsiusPerKilocalorie(double squarecentimeterhourdegreescelsiusperkilocalorie) + public static ThermalResistance FromSquareCentimeterHourDegreesCelsiusPerKilocalorie(double value) { - return new ThermalResistance(squarecentimeterhourdegreescelsiusperkilocalorie, ThermalResistanceUnit.SquareCentimeterHourDegreeCelsiusPerKilocalorie); + return new ThermalResistance(value, ThermalResistanceUnit.SquareCentimeterHourDegreeCelsiusPerKilocalorie); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ThermalResistance FromSquareCentimeterKelvinsPerWatt(double squarecentimeterkelvinsperwatt) + public static ThermalResistance FromSquareCentimeterKelvinsPerWatt(double value) { - return new ThermalResistance(squarecentimeterkelvinsperwatt, ThermalResistanceUnit.SquareCentimeterKelvinPerWatt); + return new ThermalResistance(value, ThermalResistanceUnit.SquareCentimeterKelvinPerWatt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ThermalResistance FromSquareMeterDegreesCelsiusPerWatt(double squaremeterdegreescelsiusperwatt) + public static ThermalResistance FromSquareMeterDegreesCelsiusPerWatt(double value) { - return new ThermalResistance(squaremeterdegreescelsiusperwatt, ThermalResistanceUnit.SquareMeterDegreeCelsiusPerWatt); + return new ThermalResistance(value, ThermalResistanceUnit.SquareMeterDegreeCelsiusPerWatt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ThermalResistance FromSquareMeterKelvinsPerKilowatt(double squaremeterkelvinsperkilowatt) + public static ThermalResistance FromSquareMeterKelvinsPerKilowatt(double value) { - return new ThermalResistance(squaremeterkelvinsperkilowatt, ThermalResistanceUnit.SquareMeterKelvinPerKilowatt); + return new ThermalResistance(value, ThermalResistanceUnit.SquareMeterKelvinPerKilowatt); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static ThermalResistance FromSquareMeterKelvinsPerWatt(double squaremeterkelvinsperwatt) + public static ThermalResistance FromSquareMeterKelvinsPerWatt(double value) { - return new ThermalResistance(squaremeterkelvinsperwatt, ThermalResistanceUnit.SquareMeterKelvinPerWatt); + return new ThermalResistance(value, ThermalResistanceUnit.SquareMeterKelvinPerWatt); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Torque.g.cs b/UnitsNet/GeneratedCode/Quantities/Torque.g.cs index 1541850784..c03eb9fc7f 100644 --- a/UnitsNet/GeneratedCode/Quantities/Torque.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Torque.g.cs @@ -422,225 +422,225 @@ public static string GetAbbreviation(TorqueUnit unit, IFormatProvider? provider) /// Creates a from . /// /// If value is NaN or Infinity. - public static Torque FromGramForceCentimeters(double gramforcecentimeters) + public static Torque FromGramForceCentimeters(double value) { - return new Torque(gramforcecentimeters, TorqueUnit.GramForceCentimeter); + return new Torque(value, TorqueUnit.GramForceCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Torque FromGramForceMeters(double gramforcemeters) + public static Torque FromGramForceMeters(double value) { - return new Torque(gramforcemeters, TorqueUnit.GramForceMeter); + return new Torque(value, TorqueUnit.GramForceMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Torque FromGramForceMillimeters(double gramforcemillimeters) + public static Torque FromGramForceMillimeters(double value) { - return new Torque(gramforcemillimeters, TorqueUnit.GramForceMillimeter); + return new Torque(value, TorqueUnit.GramForceMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Torque FromKilogramForceCentimeters(double kilogramforcecentimeters) + public static Torque FromKilogramForceCentimeters(double value) { - return new Torque(kilogramforcecentimeters, TorqueUnit.KilogramForceCentimeter); + return new Torque(value, TorqueUnit.KilogramForceCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Torque FromKilogramForceMeters(double kilogramforcemeters) + public static Torque FromKilogramForceMeters(double value) { - return new Torque(kilogramforcemeters, TorqueUnit.KilogramForceMeter); + return new Torque(value, TorqueUnit.KilogramForceMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Torque FromKilogramForceMillimeters(double kilogramforcemillimeters) + public static Torque FromKilogramForceMillimeters(double value) { - return new Torque(kilogramforcemillimeters, TorqueUnit.KilogramForceMillimeter); + return new Torque(value, TorqueUnit.KilogramForceMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Torque FromKilonewtonCentimeters(double kilonewtoncentimeters) + public static Torque FromKilonewtonCentimeters(double value) { - return new Torque(kilonewtoncentimeters, TorqueUnit.KilonewtonCentimeter); + return new Torque(value, TorqueUnit.KilonewtonCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Torque FromKilonewtonMeters(double kilonewtonmeters) + public static Torque FromKilonewtonMeters(double value) { - return new Torque(kilonewtonmeters, TorqueUnit.KilonewtonMeter); + return new Torque(value, TorqueUnit.KilonewtonMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Torque FromKilonewtonMillimeters(double kilonewtonmillimeters) + public static Torque FromKilonewtonMillimeters(double value) { - return new Torque(kilonewtonmillimeters, TorqueUnit.KilonewtonMillimeter); + return new Torque(value, TorqueUnit.KilonewtonMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Torque FromKilopoundForceFeet(double kilopoundforcefeet) + public static Torque FromKilopoundForceFeet(double value) { - return new Torque(kilopoundforcefeet, TorqueUnit.KilopoundForceFoot); + return new Torque(value, TorqueUnit.KilopoundForceFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Torque FromKilopoundForceInches(double kilopoundforceinches) + public static Torque FromKilopoundForceInches(double value) { - return new Torque(kilopoundforceinches, TorqueUnit.KilopoundForceInch); + return new Torque(value, TorqueUnit.KilopoundForceInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Torque FromMeganewtonCentimeters(double meganewtoncentimeters) + public static Torque FromMeganewtonCentimeters(double value) { - return new Torque(meganewtoncentimeters, TorqueUnit.MeganewtonCentimeter); + return new Torque(value, TorqueUnit.MeganewtonCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Torque FromMeganewtonMeters(double meganewtonmeters) + public static Torque FromMeganewtonMeters(double value) { - return new Torque(meganewtonmeters, TorqueUnit.MeganewtonMeter); + return new Torque(value, TorqueUnit.MeganewtonMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Torque FromMeganewtonMillimeters(double meganewtonmillimeters) + public static Torque FromMeganewtonMillimeters(double value) { - return new Torque(meganewtonmillimeters, TorqueUnit.MeganewtonMillimeter); + return new Torque(value, TorqueUnit.MeganewtonMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Torque FromMegapoundForceFeet(double megapoundforcefeet) + public static Torque FromMegapoundForceFeet(double value) { - return new Torque(megapoundforcefeet, TorqueUnit.MegapoundForceFoot); + return new Torque(value, TorqueUnit.MegapoundForceFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Torque FromMegapoundForceInches(double megapoundforceinches) + public static Torque FromMegapoundForceInches(double value) { - return new Torque(megapoundforceinches, TorqueUnit.MegapoundForceInch); + return new Torque(value, TorqueUnit.MegapoundForceInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Torque FromNewtonCentimeters(double newtoncentimeters) + public static Torque FromNewtonCentimeters(double value) { - return new Torque(newtoncentimeters, TorqueUnit.NewtonCentimeter); + return new Torque(value, TorqueUnit.NewtonCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Torque FromNewtonMeters(double newtonmeters) + public static Torque FromNewtonMeters(double value) { - return new Torque(newtonmeters, TorqueUnit.NewtonMeter); + return new Torque(value, TorqueUnit.NewtonMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Torque FromNewtonMillimeters(double newtonmillimeters) + public static Torque FromNewtonMillimeters(double value) { - return new Torque(newtonmillimeters, TorqueUnit.NewtonMillimeter); + return new Torque(value, TorqueUnit.NewtonMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Torque FromPoundalFeet(double poundalfeet) + public static Torque FromPoundalFeet(double value) { - return new Torque(poundalfeet, TorqueUnit.PoundalFoot); + return new Torque(value, TorqueUnit.PoundalFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Torque FromPoundForceFeet(double poundforcefeet) + public static Torque FromPoundForceFeet(double value) { - return new Torque(poundforcefeet, TorqueUnit.PoundForceFoot); + return new Torque(value, TorqueUnit.PoundForceFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Torque FromPoundForceInches(double poundforceinches) + public static Torque FromPoundForceInches(double value) { - return new Torque(poundforceinches, TorqueUnit.PoundForceInch); + return new Torque(value, TorqueUnit.PoundForceInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Torque FromTonneForceCentimeters(double tonneforcecentimeters) + public static Torque FromTonneForceCentimeters(double value) { - return new Torque(tonneforcecentimeters, TorqueUnit.TonneForceCentimeter); + return new Torque(value, TorqueUnit.TonneForceCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Torque FromTonneForceMeters(double tonneforcemeters) + public static Torque FromTonneForceMeters(double value) { - return new Torque(tonneforcemeters, TorqueUnit.TonneForceMeter); + return new Torque(value, TorqueUnit.TonneForceMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Torque FromTonneForceMillimeters(double tonneforcemillimeters) + public static Torque FromTonneForceMillimeters(double value) { - return new Torque(tonneforcemillimeters, TorqueUnit.TonneForceMillimeter); + return new Torque(value, TorqueUnit.TonneForceMillimeter); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/TorquePerLength.g.cs b/UnitsNet/GeneratedCode/Quantities/TorquePerLength.g.cs index 3324414983..2f9e92a03d 100644 --- a/UnitsNet/GeneratedCode/Quantities/TorquePerLength.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TorquePerLength.g.cs @@ -381,189 +381,189 @@ public static string GetAbbreviation(TorquePerLengthUnit unit, IFormatProvider? /// Creates a from . /// /// If value is NaN or Infinity. - public static TorquePerLength FromKilogramForceCentimetersPerMeter(double kilogramforcecentimeterspermeter) + public static TorquePerLength FromKilogramForceCentimetersPerMeter(double value) { - return new TorquePerLength(kilogramforcecentimeterspermeter, TorquePerLengthUnit.KilogramForceCentimeterPerMeter); + return new TorquePerLength(value, TorquePerLengthUnit.KilogramForceCentimeterPerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TorquePerLength FromKilogramForceMetersPerMeter(double kilogramforcemeterspermeter) + public static TorquePerLength FromKilogramForceMetersPerMeter(double value) { - return new TorquePerLength(kilogramforcemeterspermeter, TorquePerLengthUnit.KilogramForceMeterPerMeter); + return new TorquePerLength(value, TorquePerLengthUnit.KilogramForceMeterPerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TorquePerLength FromKilogramForceMillimetersPerMeter(double kilogramforcemillimeterspermeter) + public static TorquePerLength FromKilogramForceMillimetersPerMeter(double value) { - return new TorquePerLength(kilogramforcemillimeterspermeter, TorquePerLengthUnit.KilogramForceMillimeterPerMeter); + return new TorquePerLength(value, TorquePerLengthUnit.KilogramForceMillimeterPerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TorquePerLength FromKilonewtonCentimetersPerMeter(double kilonewtoncentimeterspermeter) + public static TorquePerLength FromKilonewtonCentimetersPerMeter(double value) { - return new TorquePerLength(kilonewtoncentimeterspermeter, TorquePerLengthUnit.KilonewtonCentimeterPerMeter); + return new TorquePerLength(value, TorquePerLengthUnit.KilonewtonCentimeterPerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TorquePerLength FromKilonewtonMetersPerMeter(double kilonewtonmeterspermeter) + public static TorquePerLength FromKilonewtonMetersPerMeter(double value) { - return new TorquePerLength(kilonewtonmeterspermeter, TorquePerLengthUnit.KilonewtonMeterPerMeter); + return new TorquePerLength(value, TorquePerLengthUnit.KilonewtonMeterPerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TorquePerLength FromKilonewtonMillimetersPerMeter(double kilonewtonmillimeterspermeter) + public static TorquePerLength FromKilonewtonMillimetersPerMeter(double value) { - return new TorquePerLength(kilonewtonmillimeterspermeter, TorquePerLengthUnit.KilonewtonMillimeterPerMeter); + return new TorquePerLength(value, TorquePerLengthUnit.KilonewtonMillimeterPerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TorquePerLength FromKilopoundForceFeetPerFoot(double kilopoundforcefeetperfoot) + public static TorquePerLength FromKilopoundForceFeetPerFoot(double value) { - return new TorquePerLength(kilopoundforcefeetperfoot, TorquePerLengthUnit.KilopoundForceFootPerFoot); + return new TorquePerLength(value, TorquePerLengthUnit.KilopoundForceFootPerFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TorquePerLength FromKilopoundForceInchesPerFoot(double kilopoundforceinchesperfoot) + public static TorquePerLength FromKilopoundForceInchesPerFoot(double value) { - return new TorquePerLength(kilopoundforceinchesperfoot, TorquePerLengthUnit.KilopoundForceInchPerFoot); + return new TorquePerLength(value, TorquePerLengthUnit.KilopoundForceInchPerFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TorquePerLength FromMeganewtonCentimetersPerMeter(double meganewtoncentimeterspermeter) + public static TorquePerLength FromMeganewtonCentimetersPerMeter(double value) { - return new TorquePerLength(meganewtoncentimeterspermeter, TorquePerLengthUnit.MeganewtonCentimeterPerMeter); + return new TorquePerLength(value, TorquePerLengthUnit.MeganewtonCentimeterPerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TorquePerLength FromMeganewtonMetersPerMeter(double meganewtonmeterspermeter) + public static TorquePerLength FromMeganewtonMetersPerMeter(double value) { - return new TorquePerLength(meganewtonmeterspermeter, TorquePerLengthUnit.MeganewtonMeterPerMeter); + return new TorquePerLength(value, TorquePerLengthUnit.MeganewtonMeterPerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TorquePerLength FromMeganewtonMillimetersPerMeter(double meganewtonmillimeterspermeter) + public static TorquePerLength FromMeganewtonMillimetersPerMeter(double value) { - return new TorquePerLength(meganewtonmillimeterspermeter, TorquePerLengthUnit.MeganewtonMillimeterPerMeter); + return new TorquePerLength(value, TorquePerLengthUnit.MeganewtonMillimeterPerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TorquePerLength FromMegapoundForceFeetPerFoot(double megapoundforcefeetperfoot) + public static TorquePerLength FromMegapoundForceFeetPerFoot(double value) { - return new TorquePerLength(megapoundforcefeetperfoot, TorquePerLengthUnit.MegapoundForceFootPerFoot); + return new TorquePerLength(value, TorquePerLengthUnit.MegapoundForceFootPerFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TorquePerLength FromMegapoundForceInchesPerFoot(double megapoundforceinchesperfoot) + public static TorquePerLength FromMegapoundForceInchesPerFoot(double value) { - return new TorquePerLength(megapoundforceinchesperfoot, TorquePerLengthUnit.MegapoundForceInchPerFoot); + return new TorquePerLength(value, TorquePerLengthUnit.MegapoundForceInchPerFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TorquePerLength FromNewtonCentimetersPerMeter(double newtoncentimeterspermeter) + public static TorquePerLength FromNewtonCentimetersPerMeter(double value) { - return new TorquePerLength(newtoncentimeterspermeter, TorquePerLengthUnit.NewtonCentimeterPerMeter); + return new TorquePerLength(value, TorquePerLengthUnit.NewtonCentimeterPerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TorquePerLength FromNewtonMetersPerMeter(double newtonmeterspermeter) + public static TorquePerLength FromNewtonMetersPerMeter(double value) { - return new TorquePerLength(newtonmeterspermeter, TorquePerLengthUnit.NewtonMeterPerMeter); + return new TorquePerLength(value, TorquePerLengthUnit.NewtonMeterPerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TorquePerLength FromNewtonMillimetersPerMeter(double newtonmillimeterspermeter) + public static TorquePerLength FromNewtonMillimetersPerMeter(double value) { - return new TorquePerLength(newtonmillimeterspermeter, TorquePerLengthUnit.NewtonMillimeterPerMeter); + return new TorquePerLength(value, TorquePerLengthUnit.NewtonMillimeterPerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TorquePerLength FromPoundForceFeetPerFoot(double poundforcefeetperfoot) + public static TorquePerLength FromPoundForceFeetPerFoot(double value) { - return new TorquePerLength(poundforcefeetperfoot, TorquePerLengthUnit.PoundForceFootPerFoot); + return new TorquePerLength(value, TorquePerLengthUnit.PoundForceFootPerFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TorquePerLength FromPoundForceInchesPerFoot(double poundforceinchesperfoot) + public static TorquePerLength FromPoundForceInchesPerFoot(double value) { - return new TorquePerLength(poundforceinchesperfoot, TorquePerLengthUnit.PoundForceInchPerFoot); + return new TorquePerLength(value, TorquePerLengthUnit.PoundForceInchPerFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TorquePerLength FromTonneForceCentimetersPerMeter(double tonneforcecentimeterspermeter) + public static TorquePerLength FromTonneForceCentimetersPerMeter(double value) { - return new TorquePerLength(tonneforcecentimeterspermeter, TorquePerLengthUnit.TonneForceCentimeterPerMeter); + return new TorquePerLength(value, TorquePerLengthUnit.TonneForceCentimeterPerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TorquePerLength FromTonneForceMetersPerMeter(double tonneforcemeterspermeter) + public static TorquePerLength FromTonneForceMetersPerMeter(double value) { - return new TorquePerLength(tonneforcemeterspermeter, TorquePerLengthUnit.TonneForceMeterPerMeter); + return new TorquePerLength(value, TorquePerLengthUnit.TonneForceMeterPerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static TorquePerLength FromTonneForceMillimetersPerMeter(double tonneforcemillimeterspermeter) + public static TorquePerLength FromTonneForceMillimetersPerMeter(double value) { - return new TorquePerLength(tonneforcemillimeterspermeter, TorquePerLengthUnit.TonneForceMillimeterPerMeter); + return new TorquePerLength(value, TorquePerLengthUnit.TonneForceMillimeterPerMeter); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Turbidity.g.cs b/UnitsNet/GeneratedCode/Quantities/Turbidity.g.cs index ab02056d19..429be531e2 100644 --- a/UnitsNet/GeneratedCode/Quantities/Turbidity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Turbidity.g.cs @@ -224,9 +224,9 @@ public static string GetAbbreviation(TurbidityUnit unit, IFormatProvider? provid /// Creates a from . /// /// If value is NaN or Infinity. - public static Turbidity FromNTU(double ntu) + public static Turbidity FromNTU(double value) { - return new Turbidity(ntu, TurbidityUnit.NTU); + return new Turbidity(value, TurbidityUnit.NTU); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/VitaminA.g.cs b/UnitsNet/GeneratedCode/Quantities/VitaminA.g.cs index dbfacd2822..21481bfd60 100644 --- a/UnitsNet/GeneratedCode/Quantities/VitaminA.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VitaminA.g.cs @@ -221,9 +221,9 @@ public static string GetAbbreviation(VitaminAUnit unit, IFormatProvider? provide /// Creates a from . /// /// If value is NaN or Infinity. - public static VitaminA FromInternationalUnits(double internationalunits) + public static VitaminA FromInternationalUnits(double value) { - return new VitaminA(internationalunits, VitaminAUnit.InternationalUnit); + return new VitaminA(value, VitaminAUnit.InternationalUnit); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Volume.g.cs b/UnitsNet/GeneratedCode/Quantities/Volume.g.cs index 130cbc626b..ed7177bf43 100644 --- a/UnitsNet/GeneratedCode/Quantities/Volume.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Volume.g.cs @@ -657,486 +657,486 @@ public static string GetAbbreviation(VolumeUnit unit, IFormatProvider? provider) /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromAcreFeet(double acrefeet) + public static Volume FromAcreFeet(double value) { - return new Volume(acrefeet, VolumeUnit.AcreFoot); + return new Volume(value, VolumeUnit.AcreFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromAuTablespoons(double autablespoons) + public static Volume FromAuTablespoons(double value) { - return new Volume(autablespoons, VolumeUnit.AuTablespoon); + return new Volume(value, VolumeUnit.AuTablespoon); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromBoardFeet(double boardfeet) + public static Volume FromBoardFeet(double value) { - return new Volume(boardfeet, VolumeUnit.BoardFoot); + return new Volume(value, VolumeUnit.BoardFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromCentiliters(double centiliters) + public static Volume FromCentiliters(double value) { - return new Volume(centiliters, VolumeUnit.Centiliter); + return new Volume(value, VolumeUnit.Centiliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromCubicCentimeters(double cubiccentimeters) + public static Volume FromCubicCentimeters(double value) { - return new Volume(cubiccentimeters, VolumeUnit.CubicCentimeter); + return new Volume(value, VolumeUnit.CubicCentimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromCubicDecimeters(double cubicdecimeters) + public static Volume FromCubicDecimeters(double value) { - return new Volume(cubicdecimeters, VolumeUnit.CubicDecimeter); + return new Volume(value, VolumeUnit.CubicDecimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromCubicFeet(double cubicfeet) + public static Volume FromCubicFeet(double value) { - return new Volume(cubicfeet, VolumeUnit.CubicFoot); + return new Volume(value, VolumeUnit.CubicFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromCubicHectometers(double cubichectometers) + public static Volume FromCubicHectometers(double value) { - return new Volume(cubichectometers, VolumeUnit.CubicHectometer); + return new Volume(value, VolumeUnit.CubicHectometer); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromCubicInches(double cubicinches) + public static Volume FromCubicInches(double value) { - return new Volume(cubicinches, VolumeUnit.CubicInch); + return new Volume(value, VolumeUnit.CubicInch); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromCubicKilometers(double cubickilometers) + public static Volume FromCubicKilometers(double value) { - return new Volume(cubickilometers, VolumeUnit.CubicKilometer); + return new Volume(value, VolumeUnit.CubicKilometer); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromCubicMeters(double cubicmeters) + public static Volume FromCubicMeters(double value) { - return new Volume(cubicmeters, VolumeUnit.CubicMeter); + return new Volume(value, VolumeUnit.CubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromCubicMicrometers(double cubicmicrometers) + public static Volume FromCubicMicrometers(double value) { - return new Volume(cubicmicrometers, VolumeUnit.CubicMicrometer); + return new Volume(value, VolumeUnit.CubicMicrometer); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromCubicMiles(double cubicmiles) + public static Volume FromCubicMiles(double value) { - return new Volume(cubicmiles, VolumeUnit.CubicMile); + return new Volume(value, VolumeUnit.CubicMile); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromCubicMillimeters(double cubicmillimeters) + public static Volume FromCubicMillimeters(double value) { - return new Volume(cubicmillimeters, VolumeUnit.CubicMillimeter); + return new Volume(value, VolumeUnit.CubicMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromCubicYards(double cubicyards) + public static Volume FromCubicYards(double value) { - return new Volume(cubicyards, VolumeUnit.CubicYard); + return new Volume(value, VolumeUnit.CubicYard); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromDecaliters(double decaliters) + public static Volume FromDecaliters(double value) { - return new Volume(decaliters, VolumeUnit.Decaliter); + return new Volume(value, VolumeUnit.Decaliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromDecausGallons(double decausgallons) + public static Volume FromDecausGallons(double value) { - return new Volume(decausgallons, VolumeUnit.DecausGallon); + return new Volume(value, VolumeUnit.DecausGallon); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromDeciliters(double deciliters) + public static Volume FromDeciliters(double value) { - return new Volume(deciliters, VolumeUnit.Deciliter); + return new Volume(value, VolumeUnit.Deciliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromDeciusGallons(double deciusgallons) + public static Volume FromDeciusGallons(double value) { - return new Volume(deciusgallons, VolumeUnit.DeciusGallon); + return new Volume(value, VolumeUnit.DeciusGallon); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromHectocubicFeet(double hectocubicfeet) + public static Volume FromHectocubicFeet(double value) { - return new Volume(hectocubicfeet, VolumeUnit.HectocubicFoot); + return new Volume(value, VolumeUnit.HectocubicFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromHectocubicMeters(double hectocubicmeters) + public static Volume FromHectocubicMeters(double value) { - return new Volume(hectocubicmeters, VolumeUnit.HectocubicMeter); + return new Volume(value, VolumeUnit.HectocubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromHectoliters(double hectoliters) + public static Volume FromHectoliters(double value) { - return new Volume(hectoliters, VolumeUnit.Hectoliter); + return new Volume(value, VolumeUnit.Hectoliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromHectousGallons(double hectousgallons) + public static Volume FromHectousGallons(double value) { - return new Volume(hectousgallons, VolumeUnit.HectousGallon); + return new Volume(value, VolumeUnit.HectousGallon); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromImperialBeerBarrels(double imperialbeerbarrels) + public static Volume FromImperialBeerBarrels(double value) { - return new Volume(imperialbeerbarrels, VolumeUnit.ImperialBeerBarrel); + return new Volume(value, VolumeUnit.ImperialBeerBarrel); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromImperialGallons(double imperialgallons) + public static Volume FromImperialGallons(double value) { - return new Volume(imperialgallons, VolumeUnit.ImperialGallon); + return new Volume(value, VolumeUnit.ImperialGallon); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromImperialOunces(double imperialounces) + public static Volume FromImperialOunces(double value) { - return new Volume(imperialounces, VolumeUnit.ImperialOunce); + return new Volume(value, VolumeUnit.ImperialOunce); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromImperialPints(double imperialpints) + public static Volume FromImperialPints(double value) { - return new Volume(imperialpints, VolumeUnit.ImperialPint); + return new Volume(value, VolumeUnit.ImperialPint); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromImperialQuarts(double imperialquarts) + public static Volume FromImperialQuarts(double value) { - return new Volume(imperialquarts, VolumeUnit.ImperialQuart); + return new Volume(value, VolumeUnit.ImperialQuart); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromKilocubicFeet(double kilocubicfeet) + public static Volume FromKilocubicFeet(double value) { - return new Volume(kilocubicfeet, VolumeUnit.KilocubicFoot); + return new Volume(value, VolumeUnit.KilocubicFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromKilocubicMeters(double kilocubicmeters) + public static Volume FromKilocubicMeters(double value) { - return new Volume(kilocubicmeters, VolumeUnit.KilocubicMeter); + return new Volume(value, VolumeUnit.KilocubicMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromKiloimperialGallons(double kiloimperialgallons) + public static Volume FromKiloimperialGallons(double value) { - return new Volume(kiloimperialgallons, VolumeUnit.KiloimperialGallon); + return new Volume(value, VolumeUnit.KiloimperialGallon); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromKiloliters(double kiloliters) + public static Volume FromKiloliters(double value) { - return new Volume(kiloliters, VolumeUnit.Kiloliter); + return new Volume(value, VolumeUnit.Kiloliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromKilousGallons(double kilousgallons) + public static Volume FromKilousGallons(double value) { - return new Volume(kilousgallons, VolumeUnit.KilousGallon); + return new Volume(value, VolumeUnit.KilousGallon); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromLiters(double liters) + public static Volume FromLiters(double value) { - return new Volume(liters, VolumeUnit.Liter); + return new Volume(value, VolumeUnit.Liter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromMegacubicFeet(double megacubicfeet) + public static Volume FromMegacubicFeet(double value) { - return new Volume(megacubicfeet, VolumeUnit.MegacubicFoot); + return new Volume(value, VolumeUnit.MegacubicFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromMegaimperialGallons(double megaimperialgallons) + public static Volume FromMegaimperialGallons(double value) { - return new Volume(megaimperialgallons, VolumeUnit.MegaimperialGallon); + return new Volume(value, VolumeUnit.MegaimperialGallon); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromMegaliters(double megaliters) + public static Volume FromMegaliters(double value) { - return new Volume(megaliters, VolumeUnit.Megaliter); + return new Volume(value, VolumeUnit.Megaliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromMegausGallons(double megausgallons) + public static Volume FromMegausGallons(double value) { - return new Volume(megausgallons, VolumeUnit.MegausGallon); + return new Volume(value, VolumeUnit.MegausGallon); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromMetricCups(double metriccups) + public static Volume FromMetricCups(double value) { - return new Volume(metriccups, VolumeUnit.MetricCup); + return new Volume(value, VolumeUnit.MetricCup); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromMetricTeaspoons(double metricteaspoons) + public static Volume FromMetricTeaspoons(double value) { - return new Volume(metricteaspoons, VolumeUnit.MetricTeaspoon); + return new Volume(value, VolumeUnit.MetricTeaspoon); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromMicroliters(double microliters) + public static Volume FromMicroliters(double value) { - return new Volume(microliters, VolumeUnit.Microliter); + return new Volume(value, VolumeUnit.Microliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromMilliliters(double milliliters) + public static Volume FromMilliliters(double value) { - return new Volume(milliliters, VolumeUnit.Milliliter); + return new Volume(value, VolumeUnit.Milliliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromNanoliters(double nanoliters) + public static Volume FromNanoliters(double value) { - return new Volume(nanoliters, VolumeUnit.Nanoliter); + return new Volume(value, VolumeUnit.Nanoliter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromOilBarrels(double oilbarrels) + public static Volume FromOilBarrels(double value) { - return new Volume(oilbarrels, VolumeUnit.OilBarrel); + return new Volume(value, VolumeUnit.OilBarrel); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromUkTablespoons(double uktablespoons) + public static Volume FromUkTablespoons(double value) { - return new Volume(uktablespoons, VolumeUnit.UkTablespoon); + return new Volume(value, VolumeUnit.UkTablespoon); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromUsBeerBarrels(double usbeerbarrels) + public static Volume FromUsBeerBarrels(double value) { - return new Volume(usbeerbarrels, VolumeUnit.UsBeerBarrel); + return new Volume(value, VolumeUnit.UsBeerBarrel); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromUsCustomaryCups(double uscustomarycups) + public static Volume FromUsCustomaryCups(double value) { - return new Volume(uscustomarycups, VolumeUnit.UsCustomaryCup); + return new Volume(value, VolumeUnit.UsCustomaryCup); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromUsGallons(double usgallons) + public static Volume FromUsGallons(double value) { - return new Volume(usgallons, VolumeUnit.UsGallon); + return new Volume(value, VolumeUnit.UsGallon); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromUsLegalCups(double uslegalcups) + public static Volume FromUsLegalCups(double value) { - return new Volume(uslegalcups, VolumeUnit.UsLegalCup); + return new Volume(value, VolumeUnit.UsLegalCup); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromUsOunces(double usounces) + public static Volume FromUsOunces(double value) { - return new Volume(usounces, VolumeUnit.UsOunce); + return new Volume(value, VolumeUnit.UsOunce); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromUsPints(double uspints) + public static Volume FromUsPints(double value) { - return new Volume(uspints, VolumeUnit.UsPint); + return new Volume(value, VolumeUnit.UsPint); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromUsQuarts(double usquarts) + public static Volume FromUsQuarts(double value) { - return new Volume(usquarts, VolumeUnit.UsQuart); + return new Volume(value, VolumeUnit.UsQuart); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromUsTablespoons(double ustablespoons) + public static Volume FromUsTablespoons(double value) { - return new Volume(ustablespoons, VolumeUnit.UsTablespoon); + return new Volume(value, VolumeUnit.UsTablespoon); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static Volume FromUsTeaspoons(double usteaspoons) + public static Volume FromUsTeaspoons(double value) { - return new Volume(usteaspoons, VolumeUnit.UsTeaspoon); + return new Volume(value, VolumeUnit.UsTeaspoon); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/VolumeConcentration.g.cs b/UnitsNet/GeneratedCode/Quantities/VolumeConcentration.g.cs index af7057eac6..4cdee12390 100644 --- a/UnitsNet/GeneratedCode/Quantities/VolumeConcentration.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VolumeConcentration.g.cs @@ -383,180 +383,180 @@ public static string GetAbbreviation(VolumeConcentrationUnit unit, IFormatProvid /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeConcentration FromCentilitersPerLiter(double centilitersperliter) + public static VolumeConcentration FromCentilitersPerLiter(double value) { - return new VolumeConcentration(centilitersperliter, VolumeConcentrationUnit.CentilitersPerLiter); + return new VolumeConcentration(value, VolumeConcentrationUnit.CentilitersPerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeConcentration FromCentilitersPerMililiter(double centiliterspermililiter) + public static VolumeConcentration FromCentilitersPerMililiter(double value) { - return new VolumeConcentration(centiliterspermililiter, VolumeConcentrationUnit.CentilitersPerMililiter); + return new VolumeConcentration(value, VolumeConcentrationUnit.CentilitersPerMililiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeConcentration FromDecilitersPerLiter(double decilitersperliter) + public static VolumeConcentration FromDecilitersPerLiter(double value) { - return new VolumeConcentration(decilitersperliter, VolumeConcentrationUnit.DecilitersPerLiter); + return new VolumeConcentration(value, VolumeConcentrationUnit.DecilitersPerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeConcentration FromDecilitersPerMililiter(double deciliterspermililiter) + public static VolumeConcentration FromDecilitersPerMililiter(double value) { - return new VolumeConcentration(deciliterspermililiter, VolumeConcentrationUnit.DecilitersPerMililiter); + return new VolumeConcentration(value, VolumeConcentrationUnit.DecilitersPerMililiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeConcentration FromDecimalFractions(double decimalfractions) + public static VolumeConcentration FromDecimalFractions(double value) { - return new VolumeConcentration(decimalfractions, VolumeConcentrationUnit.DecimalFraction); + return new VolumeConcentration(value, VolumeConcentrationUnit.DecimalFraction); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeConcentration FromLitersPerLiter(double litersperliter) + public static VolumeConcentration FromLitersPerLiter(double value) { - return new VolumeConcentration(litersperliter, VolumeConcentrationUnit.LitersPerLiter); + return new VolumeConcentration(value, VolumeConcentrationUnit.LitersPerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeConcentration FromLitersPerMililiter(double literspermililiter) + public static VolumeConcentration FromLitersPerMililiter(double value) { - return new VolumeConcentration(literspermililiter, VolumeConcentrationUnit.LitersPerMililiter); + return new VolumeConcentration(value, VolumeConcentrationUnit.LitersPerMililiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeConcentration FromMicrolitersPerLiter(double microlitersperliter) + public static VolumeConcentration FromMicrolitersPerLiter(double value) { - return new VolumeConcentration(microlitersperliter, VolumeConcentrationUnit.MicrolitersPerLiter); + return new VolumeConcentration(value, VolumeConcentrationUnit.MicrolitersPerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeConcentration FromMicrolitersPerMililiter(double microliterspermililiter) + public static VolumeConcentration FromMicrolitersPerMililiter(double value) { - return new VolumeConcentration(microliterspermililiter, VolumeConcentrationUnit.MicrolitersPerMililiter); + return new VolumeConcentration(value, VolumeConcentrationUnit.MicrolitersPerMililiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeConcentration FromMillilitersPerLiter(double millilitersperliter) + public static VolumeConcentration FromMillilitersPerLiter(double value) { - return new VolumeConcentration(millilitersperliter, VolumeConcentrationUnit.MillilitersPerLiter); + return new VolumeConcentration(value, VolumeConcentrationUnit.MillilitersPerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeConcentration FromMillilitersPerMililiter(double milliliterspermililiter) + public static VolumeConcentration FromMillilitersPerMililiter(double value) { - return new VolumeConcentration(milliliterspermililiter, VolumeConcentrationUnit.MillilitersPerMililiter); + return new VolumeConcentration(value, VolumeConcentrationUnit.MillilitersPerMililiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeConcentration FromNanolitersPerLiter(double nanolitersperliter) + public static VolumeConcentration FromNanolitersPerLiter(double value) { - return new VolumeConcentration(nanolitersperliter, VolumeConcentrationUnit.NanolitersPerLiter); + return new VolumeConcentration(value, VolumeConcentrationUnit.NanolitersPerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeConcentration FromNanolitersPerMililiter(double nanoliterspermililiter) + public static VolumeConcentration FromNanolitersPerMililiter(double value) { - return new VolumeConcentration(nanoliterspermililiter, VolumeConcentrationUnit.NanolitersPerMililiter); + return new VolumeConcentration(value, VolumeConcentrationUnit.NanolitersPerMililiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeConcentration FromPartsPerBillion(double partsperbillion) + public static VolumeConcentration FromPartsPerBillion(double value) { - return new VolumeConcentration(partsperbillion, VolumeConcentrationUnit.PartPerBillion); + return new VolumeConcentration(value, VolumeConcentrationUnit.PartPerBillion); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeConcentration FromPartsPerMillion(double partspermillion) + public static VolumeConcentration FromPartsPerMillion(double value) { - return new VolumeConcentration(partspermillion, VolumeConcentrationUnit.PartPerMillion); + return new VolumeConcentration(value, VolumeConcentrationUnit.PartPerMillion); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeConcentration FromPartsPerThousand(double partsperthousand) + public static VolumeConcentration FromPartsPerThousand(double value) { - return new VolumeConcentration(partsperthousand, VolumeConcentrationUnit.PartPerThousand); + return new VolumeConcentration(value, VolumeConcentrationUnit.PartPerThousand); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeConcentration FromPartsPerTrillion(double partspertrillion) + public static VolumeConcentration FromPartsPerTrillion(double value) { - return new VolumeConcentration(partspertrillion, VolumeConcentrationUnit.PartPerTrillion); + return new VolumeConcentration(value, VolumeConcentrationUnit.PartPerTrillion); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeConcentration FromPercent(double percent) + public static VolumeConcentration FromPercent(double value) { - return new VolumeConcentration(percent, VolumeConcentrationUnit.Percent); + return new VolumeConcentration(value, VolumeConcentrationUnit.Percent); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeConcentration FromPicolitersPerLiter(double picolitersperliter) + public static VolumeConcentration FromPicolitersPerLiter(double value) { - return new VolumeConcentration(picolitersperliter, VolumeConcentrationUnit.PicolitersPerLiter); + return new VolumeConcentration(value, VolumeConcentrationUnit.PicolitersPerLiter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeConcentration FromPicolitersPerMililiter(double picoliterspermililiter) + public static VolumeConcentration FromPicolitersPerMililiter(double value) { - return new VolumeConcentration(picoliterspermililiter, VolumeConcentrationUnit.PicolitersPerMililiter); + return new VolumeConcentration(value, VolumeConcentrationUnit.PicolitersPerMililiter); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/VolumeFlow.g.cs b/UnitsNet/GeneratedCode/Quantities/VolumeFlow.g.cs index 9431de6549..9f224a0c95 100644 --- a/UnitsNet/GeneratedCode/Quantities/VolumeFlow.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VolumeFlow.g.cs @@ -759,603 +759,603 @@ public static string GetAbbreviation(VolumeFlowUnit unit, IFormatProvider? provi /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromAcreFeetPerDay(double acrefeetperday) + public static VolumeFlow FromAcreFeetPerDay(double value) { - return new VolumeFlow(acrefeetperday, VolumeFlowUnit.AcreFootPerDay); + return new VolumeFlow(value, VolumeFlowUnit.AcreFootPerDay); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromAcreFeetPerHour(double acrefeetperhour) + public static VolumeFlow FromAcreFeetPerHour(double value) { - return new VolumeFlow(acrefeetperhour, VolumeFlowUnit.AcreFootPerHour); + return new VolumeFlow(value, VolumeFlowUnit.AcreFootPerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromAcreFeetPerMinute(double acrefeetperminute) + public static VolumeFlow FromAcreFeetPerMinute(double value) { - return new VolumeFlow(acrefeetperminute, VolumeFlowUnit.AcreFootPerMinute); + return new VolumeFlow(value, VolumeFlowUnit.AcreFootPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromAcreFeetPerSecond(double acrefeetpersecond) + public static VolumeFlow FromAcreFeetPerSecond(double value) { - return new VolumeFlow(acrefeetpersecond, VolumeFlowUnit.AcreFootPerSecond); + return new VolumeFlow(value, VolumeFlowUnit.AcreFootPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromCentilitersPerDay(double centilitersperday) + public static VolumeFlow FromCentilitersPerDay(double value) { - return new VolumeFlow(centilitersperday, VolumeFlowUnit.CentiliterPerDay); + return new VolumeFlow(value, VolumeFlowUnit.CentiliterPerDay); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromCentilitersPerHour(double centilitersperhour) + public static VolumeFlow FromCentilitersPerHour(double value) { - return new VolumeFlow(centilitersperhour, VolumeFlowUnit.CentiliterPerHour); + return new VolumeFlow(value, VolumeFlowUnit.CentiliterPerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromCentilitersPerMinute(double centilitersperminute) + public static VolumeFlow FromCentilitersPerMinute(double value) { - return new VolumeFlow(centilitersperminute, VolumeFlowUnit.CentiliterPerMinute); + return new VolumeFlow(value, VolumeFlowUnit.CentiliterPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromCentilitersPerSecond(double centiliterspersecond) + public static VolumeFlow FromCentilitersPerSecond(double value) { - return new VolumeFlow(centiliterspersecond, VolumeFlowUnit.CentiliterPerSecond); + return new VolumeFlow(value, VolumeFlowUnit.CentiliterPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromCubicCentimetersPerMinute(double cubiccentimetersperminute) + public static VolumeFlow FromCubicCentimetersPerMinute(double value) { - return new VolumeFlow(cubiccentimetersperminute, VolumeFlowUnit.CubicCentimeterPerMinute); + return new VolumeFlow(value, VolumeFlowUnit.CubicCentimeterPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromCubicDecimetersPerMinute(double cubicdecimetersperminute) + public static VolumeFlow FromCubicDecimetersPerMinute(double value) { - return new VolumeFlow(cubicdecimetersperminute, VolumeFlowUnit.CubicDecimeterPerMinute); + return new VolumeFlow(value, VolumeFlowUnit.CubicDecimeterPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromCubicFeetPerHour(double cubicfeetperhour) + public static VolumeFlow FromCubicFeetPerHour(double value) { - return new VolumeFlow(cubicfeetperhour, VolumeFlowUnit.CubicFootPerHour); + return new VolumeFlow(value, VolumeFlowUnit.CubicFootPerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromCubicFeetPerMinute(double cubicfeetperminute) + public static VolumeFlow FromCubicFeetPerMinute(double value) { - return new VolumeFlow(cubicfeetperminute, VolumeFlowUnit.CubicFootPerMinute); + return new VolumeFlow(value, VolumeFlowUnit.CubicFootPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromCubicFeetPerSecond(double cubicfeetpersecond) + public static VolumeFlow FromCubicFeetPerSecond(double value) { - return new VolumeFlow(cubicfeetpersecond, VolumeFlowUnit.CubicFootPerSecond); + return new VolumeFlow(value, VolumeFlowUnit.CubicFootPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromCubicMetersPerDay(double cubicmetersperday) + public static VolumeFlow FromCubicMetersPerDay(double value) { - return new VolumeFlow(cubicmetersperday, VolumeFlowUnit.CubicMeterPerDay); + return new VolumeFlow(value, VolumeFlowUnit.CubicMeterPerDay); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromCubicMetersPerHour(double cubicmetersperhour) + public static VolumeFlow FromCubicMetersPerHour(double value) { - return new VolumeFlow(cubicmetersperhour, VolumeFlowUnit.CubicMeterPerHour); + return new VolumeFlow(value, VolumeFlowUnit.CubicMeterPerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromCubicMetersPerMinute(double cubicmetersperminute) + public static VolumeFlow FromCubicMetersPerMinute(double value) { - return new VolumeFlow(cubicmetersperminute, VolumeFlowUnit.CubicMeterPerMinute); + return new VolumeFlow(value, VolumeFlowUnit.CubicMeterPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromCubicMetersPerSecond(double cubicmeterspersecond) + public static VolumeFlow FromCubicMetersPerSecond(double value) { - return new VolumeFlow(cubicmeterspersecond, VolumeFlowUnit.CubicMeterPerSecond); + return new VolumeFlow(value, VolumeFlowUnit.CubicMeterPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromCubicMillimetersPerSecond(double cubicmillimeterspersecond) + public static VolumeFlow FromCubicMillimetersPerSecond(double value) { - return new VolumeFlow(cubicmillimeterspersecond, VolumeFlowUnit.CubicMillimeterPerSecond); + return new VolumeFlow(value, VolumeFlowUnit.CubicMillimeterPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromCubicYardsPerDay(double cubicyardsperday) + public static VolumeFlow FromCubicYardsPerDay(double value) { - return new VolumeFlow(cubicyardsperday, VolumeFlowUnit.CubicYardPerDay); + return new VolumeFlow(value, VolumeFlowUnit.CubicYardPerDay); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromCubicYardsPerHour(double cubicyardsperhour) + public static VolumeFlow FromCubicYardsPerHour(double value) { - return new VolumeFlow(cubicyardsperhour, VolumeFlowUnit.CubicYardPerHour); + return new VolumeFlow(value, VolumeFlowUnit.CubicYardPerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromCubicYardsPerMinute(double cubicyardsperminute) + public static VolumeFlow FromCubicYardsPerMinute(double value) { - return new VolumeFlow(cubicyardsperminute, VolumeFlowUnit.CubicYardPerMinute); + return new VolumeFlow(value, VolumeFlowUnit.CubicYardPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromCubicYardsPerSecond(double cubicyardspersecond) + public static VolumeFlow FromCubicYardsPerSecond(double value) { - return new VolumeFlow(cubicyardspersecond, VolumeFlowUnit.CubicYardPerSecond); + return new VolumeFlow(value, VolumeFlowUnit.CubicYardPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromDecilitersPerDay(double decilitersperday) + public static VolumeFlow FromDecilitersPerDay(double value) { - return new VolumeFlow(decilitersperday, VolumeFlowUnit.DeciliterPerDay); + return new VolumeFlow(value, VolumeFlowUnit.DeciliterPerDay); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromDecilitersPerHour(double decilitersperhour) + public static VolumeFlow FromDecilitersPerHour(double value) { - return new VolumeFlow(decilitersperhour, VolumeFlowUnit.DeciliterPerHour); + return new VolumeFlow(value, VolumeFlowUnit.DeciliterPerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromDecilitersPerMinute(double decilitersperminute) + public static VolumeFlow FromDecilitersPerMinute(double value) { - return new VolumeFlow(decilitersperminute, VolumeFlowUnit.DeciliterPerMinute); + return new VolumeFlow(value, VolumeFlowUnit.DeciliterPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromDecilitersPerSecond(double deciliterspersecond) + public static VolumeFlow FromDecilitersPerSecond(double value) { - return new VolumeFlow(deciliterspersecond, VolumeFlowUnit.DeciliterPerSecond); + return new VolumeFlow(value, VolumeFlowUnit.DeciliterPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromKilolitersPerDay(double kilolitersperday) + public static VolumeFlow FromKilolitersPerDay(double value) { - return new VolumeFlow(kilolitersperday, VolumeFlowUnit.KiloliterPerDay); + return new VolumeFlow(value, VolumeFlowUnit.KiloliterPerDay); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromKilolitersPerHour(double kilolitersperhour) + public static VolumeFlow FromKilolitersPerHour(double value) { - return new VolumeFlow(kilolitersperhour, VolumeFlowUnit.KiloliterPerHour); + return new VolumeFlow(value, VolumeFlowUnit.KiloliterPerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromKilolitersPerMinute(double kilolitersperminute) + public static VolumeFlow FromKilolitersPerMinute(double value) { - return new VolumeFlow(kilolitersperminute, VolumeFlowUnit.KiloliterPerMinute); + return new VolumeFlow(value, VolumeFlowUnit.KiloliterPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromKilolitersPerSecond(double kiloliterspersecond) + public static VolumeFlow FromKilolitersPerSecond(double value) { - return new VolumeFlow(kiloliterspersecond, VolumeFlowUnit.KiloliterPerSecond); + return new VolumeFlow(value, VolumeFlowUnit.KiloliterPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromKilousGallonsPerMinute(double kilousgallonsperminute) + public static VolumeFlow FromKilousGallonsPerMinute(double value) { - return new VolumeFlow(kilousgallonsperminute, VolumeFlowUnit.KilousGallonPerMinute); + return new VolumeFlow(value, VolumeFlowUnit.KilousGallonPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromLitersPerDay(double litersperday) + public static VolumeFlow FromLitersPerDay(double value) { - return new VolumeFlow(litersperday, VolumeFlowUnit.LiterPerDay); + return new VolumeFlow(value, VolumeFlowUnit.LiterPerDay); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromLitersPerHour(double litersperhour) + public static VolumeFlow FromLitersPerHour(double value) { - return new VolumeFlow(litersperhour, VolumeFlowUnit.LiterPerHour); + return new VolumeFlow(value, VolumeFlowUnit.LiterPerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromLitersPerMinute(double litersperminute) + public static VolumeFlow FromLitersPerMinute(double value) { - return new VolumeFlow(litersperminute, VolumeFlowUnit.LiterPerMinute); + return new VolumeFlow(value, VolumeFlowUnit.LiterPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromLitersPerSecond(double literspersecond) + public static VolumeFlow FromLitersPerSecond(double value) { - return new VolumeFlow(literspersecond, VolumeFlowUnit.LiterPerSecond); + return new VolumeFlow(value, VolumeFlowUnit.LiterPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromMegalitersPerDay(double megalitersperday) + public static VolumeFlow FromMegalitersPerDay(double value) { - return new VolumeFlow(megalitersperday, VolumeFlowUnit.MegaliterPerDay); + return new VolumeFlow(value, VolumeFlowUnit.MegaliterPerDay); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromMegalitersPerHour(double megalitersperhour) + public static VolumeFlow FromMegalitersPerHour(double value) { - return new VolumeFlow(megalitersperhour, VolumeFlowUnit.MegaliterPerHour); + return new VolumeFlow(value, VolumeFlowUnit.MegaliterPerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromMegalitersPerMinute(double megalitersperminute) + public static VolumeFlow FromMegalitersPerMinute(double value) { - return new VolumeFlow(megalitersperminute, VolumeFlowUnit.MegaliterPerMinute); + return new VolumeFlow(value, VolumeFlowUnit.MegaliterPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromMegalitersPerSecond(double megaliterspersecond) + public static VolumeFlow FromMegalitersPerSecond(double value) { - return new VolumeFlow(megaliterspersecond, VolumeFlowUnit.MegaliterPerSecond); + return new VolumeFlow(value, VolumeFlowUnit.MegaliterPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromMegaukGallonsPerDay(double megaukgallonsperday) + public static VolumeFlow FromMegaukGallonsPerDay(double value) { - return new VolumeFlow(megaukgallonsperday, VolumeFlowUnit.MegaukGallonPerDay); + return new VolumeFlow(value, VolumeFlowUnit.MegaukGallonPerDay); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromMegaukGallonsPerSecond(double megaukgallonspersecond) + public static VolumeFlow FromMegaukGallonsPerSecond(double value) { - return new VolumeFlow(megaukgallonspersecond, VolumeFlowUnit.MegaukGallonPerSecond); + return new VolumeFlow(value, VolumeFlowUnit.MegaukGallonPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromMegausGallonsPerDay(double megausgallonsperday) + public static VolumeFlow FromMegausGallonsPerDay(double value) { - return new VolumeFlow(megausgallonsperday, VolumeFlowUnit.MegausGallonPerDay); + return new VolumeFlow(value, VolumeFlowUnit.MegausGallonPerDay); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromMicrolitersPerDay(double microlitersperday) + public static VolumeFlow FromMicrolitersPerDay(double value) { - return new VolumeFlow(microlitersperday, VolumeFlowUnit.MicroliterPerDay); + return new VolumeFlow(value, VolumeFlowUnit.MicroliterPerDay); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromMicrolitersPerHour(double microlitersperhour) + public static VolumeFlow FromMicrolitersPerHour(double value) { - return new VolumeFlow(microlitersperhour, VolumeFlowUnit.MicroliterPerHour); + return new VolumeFlow(value, VolumeFlowUnit.MicroliterPerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromMicrolitersPerMinute(double microlitersperminute) + public static VolumeFlow FromMicrolitersPerMinute(double value) { - return new VolumeFlow(microlitersperminute, VolumeFlowUnit.MicroliterPerMinute); + return new VolumeFlow(value, VolumeFlowUnit.MicroliterPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromMicrolitersPerSecond(double microliterspersecond) + public static VolumeFlow FromMicrolitersPerSecond(double value) { - return new VolumeFlow(microliterspersecond, VolumeFlowUnit.MicroliterPerSecond); + return new VolumeFlow(value, VolumeFlowUnit.MicroliterPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromMillilitersPerDay(double millilitersperday) + public static VolumeFlow FromMillilitersPerDay(double value) { - return new VolumeFlow(millilitersperday, VolumeFlowUnit.MilliliterPerDay); + return new VolumeFlow(value, VolumeFlowUnit.MilliliterPerDay); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromMillilitersPerHour(double millilitersperhour) + public static VolumeFlow FromMillilitersPerHour(double value) { - return new VolumeFlow(millilitersperhour, VolumeFlowUnit.MilliliterPerHour); + return new VolumeFlow(value, VolumeFlowUnit.MilliliterPerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromMillilitersPerMinute(double millilitersperminute) + public static VolumeFlow FromMillilitersPerMinute(double value) { - return new VolumeFlow(millilitersperminute, VolumeFlowUnit.MilliliterPerMinute); + return new VolumeFlow(value, VolumeFlowUnit.MilliliterPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromMillilitersPerSecond(double milliliterspersecond) + public static VolumeFlow FromMillilitersPerSecond(double value) { - return new VolumeFlow(milliliterspersecond, VolumeFlowUnit.MilliliterPerSecond); + return new VolumeFlow(value, VolumeFlowUnit.MilliliterPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromMillionUsGallonsPerDay(double millionusgallonsperday) + public static VolumeFlow FromMillionUsGallonsPerDay(double value) { - return new VolumeFlow(millionusgallonsperday, VolumeFlowUnit.MillionUsGallonPerDay); + return new VolumeFlow(value, VolumeFlowUnit.MillionUsGallonPerDay); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromNanolitersPerDay(double nanolitersperday) + public static VolumeFlow FromNanolitersPerDay(double value) { - return new VolumeFlow(nanolitersperday, VolumeFlowUnit.NanoliterPerDay); + return new VolumeFlow(value, VolumeFlowUnit.NanoliterPerDay); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromNanolitersPerHour(double nanolitersperhour) + public static VolumeFlow FromNanolitersPerHour(double value) { - return new VolumeFlow(nanolitersperhour, VolumeFlowUnit.NanoliterPerHour); + return new VolumeFlow(value, VolumeFlowUnit.NanoliterPerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromNanolitersPerMinute(double nanolitersperminute) + public static VolumeFlow FromNanolitersPerMinute(double value) { - return new VolumeFlow(nanolitersperminute, VolumeFlowUnit.NanoliterPerMinute); + return new VolumeFlow(value, VolumeFlowUnit.NanoliterPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromNanolitersPerSecond(double nanoliterspersecond) + public static VolumeFlow FromNanolitersPerSecond(double value) { - return new VolumeFlow(nanoliterspersecond, VolumeFlowUnit.NanoliterPerSecond); + return new VolumeFlow(value, VolumeFlowUnit.NanoliterPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromOilBarrelsPerDay(double oilbarrelsperday) + public static VolumeFlow FromOilBarrelsPerDay(double value) { - return new VolumeFlow(oilbarrelsperday, VolumeFlowUnit.OilBarrelPerDay); + return new VolumeFlow(value, VolumeFlowUnit.OilBarrelPerDay); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromOilBarrelsPerHour(double oilbarrelsperhour) + public static VolumeFlow FromOilBarrelsPerHour(double value) { - return new VolumeFlow(oilbarrelsperhour, VolumeFlowUnit.OilBarrelPerHour); + return new VolumeFlow(value, VolumeFlowUnit.OilBarrelPerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromOilBarrelsPerMinute(double oilbarrelsperminute) + public static VolumeFlow FromOilBarrelsPerMinute(double value) { - return new VolumeFlow(oilbarrelsperminute, VolumeFlowUnit.OilBarrelPerMinute); + return new VolumeFlow(value, VolumeFlowUnit.OilBarrelPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromOilBarrelsPerSecond(double oilbarrelspersecond) + public static VolumeFlow FromOilBarrelsPerSecond(double value) { - return new VolumeFlow(oilbarrelspersecond, VolumeFlowUnit.OilBarrelPerSecond); + return new VolumeFlow(value, VolumeFlowUnit.OilBarrelPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromUkGallonsPerDay(double ukgallonsperday) + public static VolumeFlow FromUkGallonsPerDay(double value) { - return new VolumeFlow(ukgallonsperday, VolumeFlowUnit.UkGallonPerDay); + return new VolumeFlow(value, VolumeFlowUnit.UkGallonPerDay); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromUkGallonsPerHour(double ukgallonsperhour) + public static VolumeFlow FromUkGallonsPerHour(double value) { - return new VolumeFlow(ukgallonsperhour, VolumeFlowUnit.UkGallonPerHour); + return new VolumeFlow(value, VolumeFlowUnit.UkGallonPerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromUkGallonsPerMinute(double ukgallonsperminute) + public static VolumeFlow FromUkGallonsPerMinute(double value) { - return new VolumeFlow(ukgallonsperminute, VolumeFlowUnit.UkGallonPerMinute); + return new VolumeFlow(value, VolumeFlowUnit.UkGallonPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromUkGallonsPerSecond(double ukgallonspersecond) + public static VolumeFlow FromUkGallonsPerSecond(double value) { - return new VolumeFlow(ukgallonspersecond, VolumeFlowUnit.UkGallonPerSecond); + return new VolumeFlow(value, VolumeFlowUnit.UkGallonPerSecond); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromUsGallonsPerDay(double usgallonsperday) + public static VolumeFlow FromUsGallonsPerDay(double value) { - return new VolumeFlow(usgallonsperday, VolumeFlowUnit.UsGallonPerDay); + return new VolumeFlow(value, VolumeFlowUnit.UsGallonPerDay); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromUsGallonsPerHour(double usgallonsperhour) + public static VolumeFlow FromUsGallonsPerHour(double value) { - return new VolumeFlow(usgallonsperhour, VolumeFlowUnit.UsGallonPerHour); + return new VolumeFlow(value, VolumeFlowUnit.UsGallonPerHour); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromUsGallonsPerMinute(double usgallonsperminute) + public static VolumeFlow FromUsGallonsPerMinute(double value) { - return new VolumeFlow(usgallonsperminute, VolumeFlowUnit.UsGallonPerMinute); + return new VolumeFlow(value, VolumeFlowUnit.UsGallonPerMinute); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlow FromUsGallonsPerSecond(double usgallonspersecond) + public static VolumeFlow FromUsGallonsPerSecond(double value) { - return new VolumeFlow(usgallonspersecond, VolumeFlowUnit.UsGallonPerSecond); + return new VolumeFlow(value, VolumeFlowUnit.UsGallonPerSecond); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/VolumeFlowPerArea.g.cs b/UnitsNet/GeneratedCode/Quantities/VolumeFlowPerArea.g.cs index 1c902215c3..e157221bd3 100644 --- a/UnitsNet/GeneratedCode/Quantities/VolumeFlowPerArea.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VolumeFlowPerArea.g.cs @@ -229,18 +229,18 @@ public static string GetAbbreviation(VolumeFlowPerAreaUnit unit, IFormatProvider /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlowPerArea FromCubicFeetPerMinutePerSquareFoot(double cubicfeetperminutepersquarefoot) + public static VolumeFlowPerArea FromCubicFeetPerMinutePerSquareFoot(double value) { - return new VolumeFlowPerArea(cubicfeetperminutepersquarefoot, VolumeFlowPerAreaUnit.CubicFootPerMinutePerSquareFoot); + return new VolumeFlowPerArea(value, VolumeFlowPerAreaUnit.CubicFootPerMinutePerSquareFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumeFlowPerArea FromCubicMetersPerSecondPerSquareMeter(double cubicmeterspersecondpersquaremeter) + public static VolumeFlowPerArea FromCubicMetersPerSecondPerSquareMeter(double value) { - return new VolumeFlowPerArea(cubicmeterspersecondpersquaremeter, VolumeFlowPerAreaUnit.CubicMeterPerSecondPerSquareMeter); + return new VolumeFlowPerArea(value, VolumeFlowPerAreaUnit.CubicMeterPerSecondPerSquareMeter); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/VolumePerLength.g.cs b/UnitsNet/GeneratedCode/Quantities/VolumePerLength.g.cs index dab420b6c8..99c89dcbe3 100644 --- a/UnitsNet/GeneratedCode/Quantities/VolumePerLength.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VolumePerLength.g.cs @@ -285,81 +285,81 @@ public static string GetAbbreviation(VolumePerLengthUnit unit, IFormatProvider? /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumePerLength FromCubicMetersPerMeter(double cubicmeterspermeter) + public static VolumePerLength FromCubicMetersPerMeter(double value) { - return new VolumePerLength(cubicmeterspermeter, VolumePerLengthUnit.CubicMeterPerMeter); + return new VolumePerLength(value, VolumePerLengthUnit.CubicMeterPerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumePerLength FromCubicYardsPerFoot(double cubicyardsperfoot) + public static VolumePerLength FromCubicYardsPerFoot(double value) { - return new VolumePerLength(cubicyardsperfoot, VolumePerLengthUnit.CubicYardPerFoot); + return new VolumePerLength(value, VolumePerLengthUnit.CubicYardPerFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumePerLength FromCubicYardsPerUsSurveyFoot(double cubicyardsperussurveyfoot) + public static VolumePerLength FromCubicYardsPerUsSurveyFoot(double value) { - return new VolumePerLength(cubicyardsperussurveyfoot, VolumePerLengthUnit.CubicYardPerUsSurveyFoot); + return new VolumePerLength(value, VolumePerLengthUnit.CubicYardPerUsSurveyFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumePerLength FromImperialGallonsPerMile(double imperialgallonspermile) + public static VolumePerLength FromImperialGallonsPerMile(double value) { - return new VolumePerLength(imperialgallonspermile, VolumePerLengthUnit.ImperialGallonPerMile); + return new VolumePerLength(value, VolumePerLengthUnit.ImperialGallonPerMile); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumePerLength FromLitersPerKilometer(double litersperkilometer) + public static VolumePerLength FromLitersPerKilometer(double value) { - return new VolumePerLength(litersperkilometer, VolumePerLengthUnit.LiterPerKilometer); + return new VolumePerLength(value, VolumePerLengthUnit.LiterPerKilometer); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumePerLength FromLitersPerMeter(double literspermeter) + public static VolumePerLength FromLitersPerMeter(double value) { - return new VolumePerLength(literspermeter, VolumePerLengthUnit.LiterPerMeter); + return new VolumePerLength(value, VolumePerLengthUnit.LiterPerMeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumePerLength FromLitersPerMillimeter(double literspermillimeter) + public static VolumePerLength FromLitersPerMillimeter(double value) { - return new VolumePerLength(literspermillimeter, VolumePerLengthUnit.LiterPerMillimeter); + return new VolumePerLength(value, VolumePerLengthUnit.LiterPerMillimeter); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumePerLength FromOilBarrelsPerFoot(double oilbarrelsperfoot) + public static VolumePerLength FromOilBarrelsPerFoot(double value) { - return new VolumePerLength(oilbarrelsperfoot, VolumePerLengthUnit.OilBarrelPerFoot); + return new VolumePerLength(value, VolumePerLengthUnit.OilBarrelPerFoot); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumePerLength FromUsGallonsPerMile(double usgallonspermile) + public static VolumePerLength FromUsGallonsPerMile(double value) { - return new VolumePerLength(usgallonspermile, VolumePerLengthUnit.UsGallonPerMile); + return new VolumePerLength(value, VolumePerLengthUnit.UsGallonPerMile); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/VolumetricHeatCapacity.g.cs b/UnitsNet/GeneratedCode/Quantities/VolumetricHeatCapacity.g.cs index ebd63a3c3b..f78bf80fca 100644 --- a/UnitsNet/GeneratedCode/Quantities/VolumetricHeatCapacity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VolumetricHeatCapacity.g.cs @@ -288,81 +288,81 @@ public static string GetAbbreviation(VolumetricHeatCapacityUnit unit, IFormatPro /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumetricHeatCapacity FromBtusPerCubicFootDegreeFahrenheit(double btuspercubicfootdegreefahrenheit) + public static VolumetricHeatCapacity FromBtusPerCubicFootDegreeFahrenheit(double value) { - return new VolumetricHeatCapacity(btuspercubicfootdegreefahrenheit, VolumetricHeatCapacityUnit.BtuPerCubicFootDegreeFahrenheit); + return new VolumetricHeatCapacity(value, VolumetricHeatCapacityUnit.BtuPerCubicFootDegreeFahrenheit); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumetricHeatCapacity FromCaloriesPerCubicCentimeterDegreeCelsius(double caloriespercubiccentimeterdegreecelsius) + public static VolumetricHeatCapacity FromCaloriesPerCubicCentimeterDegreeCelsius(double value) { - return new VolumetricHeatCapacity(caloriespercubiccentimeterdegreecelsius, VolumetricHeatCapacityUnit.CaloriePerCubicCentimeterDegreeCelsius); + return new VolumetricHeatCapacity(value, VolumetricHeatCapacityUnit.CaloriePerCubicCentimeterDegreeCelsius); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumetricHeatCapacity FromJoulesPerCubicMeterDegreeCelsius(double joulespercubicmeterdegreecelsius) + public static VolumetricHeatCapacity FromJoulesPerCubicMeterDegreeCelsius(double value) { - return new VolumetricHeatCapacity(joulespercubicmeterdegreecelsius, VolumetricHeatCapacityUnit.JoulePerCubicMeterDegreeCelsius); + return new VolumetricHeatCapacity(value, VolumetricHeatCapacityUnit.JoulePerCubicMeterDegreeCelsius); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumetricHeatCapacity FromJoulesPerCubicMeterKelvin(double joulespercubicmeterkelvin) + public static VolumetricHeatCapacity FromJoulesPerCubicMeterKelvin(double value) { - return new VolumetricHeatCapacity(joulespercubicmeterkelvin, VolumetricHeatCapacityUnit.JoulePerCubicMeterKelvin); + return new VolumetricHeatCapacity(value, VolumetricHeatCapacityUnit.JoulePerCubicMeterKelvin); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumetricHeatCapacity FromKilocaloriesPerCubicCentimeterDegreeCelsius(double kilocaloriespercubiccentimeterdegreecelsius) + public static VolumetricHeatCapacity FromKilocaloriesPerCubicCentimeterDegreeCelsius(double value) { - return new VolumetricHeatCapacity(kilocaloriespercubiccentimeterdegreecelsius, VolumetricHeatCapacityUnit.KilocaloriePerCubicCentimeterDegreeCelsius); + return new VolumetricHeatCapacity(value, VolumetricHeatCapacityUnit.KilocaloriePerCubicCentimeterDegreeCelsius); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumetricHeatCapacity FromKilojoulesPerCubicMeterDegreeCelsius(double kilojoulespercubicmeterdegreecelsius) + public static VolumetricHeatCapacity FromKilojoulesPerCubicMeterDegreeCelsius(double value) { - return new VolumetricHeatCapacity(kilojoulespercubicmeterdegreecelsius, VolumetricHeatCapacityUnit.KilojoulePerCubicMeterDegreeCelsius); + return new VolumetricHeatCapacity(value, VolumetricHeatCapacityUnit.KilojoulePerCubicMeterDegreeCelsius); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumetricHeatCapacity FromKilojoulesPerCubicMeterKelvin(double kilojoulespercubicmeterkelvin) + public static VolumetricHeatCapacity FromKilojoulesPerCubicMeterKelvin(double value) { - return new VolumetricHeatCapacity(kilojoulespercubicmeterkelvin, VolumetricHeatCapacityUnit.KilojoulePerCubicMeterKelvin); + return new VolumetricHeatCapacity(value, VolumetricHeatCapacityUnit.KilojoulePerCubicMeterKelvin); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumetricHeatCapacity FromMegajoulesPerCubicMeterDegreeCelsius(double megajoulespercubicmeterdegreecelsius) + public static VolumetricHeatCapacity FromMegajoulesPerCubicMeterDegreeCelsius(double value) { - return new VolumetricHeatCapacity(megajoulespercubicmeterdegreecelsius, VolumetricHeatCapacityUnit.MegajoulePerCubicMeterDegreeCelsius); + return new VolumetricHeatCapacity(value, VolumetricHeatCapacityUnit.MegajoulePerCubicMeterDegreeCelsius); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static VolumetricHeatCapacity FromMegajoulesPerCubicMeterKelvin(double megajoulespercubicmeterkelvin) + public static VolumetricHeatCapacity FromMegajoulesPerCubicMeterKelvin(double value) { - return new VolumetricHeatCapacity(megajoulespercubicmeterkelvin, VolumetricHeatCapacityUnit.MegajoulePerCubicMeterKelvin); + return new VolumetricHeatCapacity(value, VolumetricHeatCapacityUnit.MegajoulePerCubicMeterKelvin); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/WarpingMomentOfInertia.g.cs b/UnitsNet/GeneratedCode/Quantities/WarpingMomentOfInertia.g.cs index cad17c0388..6a7397b701 100644 --- a/UnitsNet/GeneratedCode/Quantities/WarpingMomentOfInertia.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/WarpingMomentOfInertia.g.cs @@ -261,54 +261,54 @@ public static string GetAbbreviation(WarpingMomentOfInertiaUnit unit, IFormatPro /// Creates a from . /// /// If value is NaN or Infinity. - public static WarpingMomentOfInertia FromCentimetersToTheSixth(double centimeterstothesixth) + public static WarpingMomentOfInertia FromCentimetersToTheSixth(double value) { - return new WarpingMomentOfInertia(centimeterstothesixth, WarpingMomentOfInertiaUnit.CentimeterToTheSixth); + return new WarpingMomentOfInertia(value, WarpingMomentOfInertiaUnit.CentimeterToTheSixth); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static WarpingMomentOfInertia FromDecimetersToTheSixth(double decimeterstothesixth) + public static WarpingMomentOfInertia FromDecimetersToTheSixth(double value) { - return new WarpingMomentOfInertia(decimeterstothesixth, WarpingMomentOfInertiaUnit.DecimeterToTheSixth); + return new WarpingMomentOfInertia(value, WarpingMomentOfInertiaUnit.DecimeterToTheSixth); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static WarpingMomentOfInertia FromFeetToTheSixth(double feettothesixth) + public static WarpingMomentOfInertia FromFeetToTheSixth(double value) { - return new WarpingMomentOfInertia(feettothesixth, WarpingMomentOfInertiaUnit.FootToTheSixth); + return new WarpingMomentOfInertia(value, WarpingMomentOfInertiaUnit.FootToTheSixth); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static WarpingMomentOfInertia FromInchesToTheSixth(double inchestothesixth) + public static WarpingMomentOfInertia FromInchesToTheSixth(double value) { - return new WarpingMomentOfInertia(inchestothesixth, WarpingMomentOfInertiaUnit.InchToTheSixth); + return new WarpingMomentOfInertia(value, WarpingMomentOfInertiaUnit.InchToTheSixth); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static WarpingMomentOfInertia FromMetersToTheSixth(double meterstothesixth) + public static WarpingMomentOfInertia FromMetersToTheSixth(double value) { - return new WarpingMomentOfInertia(meterstothesixth, WarpingMomentOfInertiaUnit.MeterToTheSixth); + return new WarpingMomentOfInertia(value, WarpingMomentOfInertiaUnit.MeterToTheSixth); } /// /// Creates a from . /// /// If value is NaN or Infinity. - public static WarpingMomentOfInertia FromMillimetersToTheSixth(double millimeterstothesixth) + public static WarpingMomentOfInertia FromMillimetersToTheSixth(double value) { - return new WarpingMomentOfInertia(millimeterstothesixth, WarpingMomentOfInertiaUnit.MillimeterToTheSixth); + return new WarpingMomentOfInertia(value, WarpingMomentOfInertiaUnit.MillimeterToTheSixth); } /// From d387748930760650e7d6c85cdf9595a8c04260c6 Mon Sep 17 00:00:00 2001 From: Andreas Gullberg Larsen Date: Fri, 23 Feb 2024 21:57:16 +0100 Subject: [PATCH 10/11] Minor fixes --- UnitsNet.Tests/CustomCode/PowerRatioTests.cs | 1 - UnitsNet/UnitMath.cs | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) 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/UnitMath.cs b/UnitsNet/UnitMath.cs index a38184033d..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 >= 0.0 ? 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)); From 44d31d7dbfbf31ec187c3ea2314ef294874cb86d Mon Sep 17 00:00:00 2001 From: Andreas Gullberg Larsen Date: Fri, 23 Feb 2024 22:16:33 +0100 Subject: [PATCH 11/11] Remove test case --- .../UnitsNetBaseJsonConverterTest.cs | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/UnitsNet.Serialization.JsonNet.Tests/UnitsNetBaseJsonConverterTest.cs b/UnitsNet.Serialization.JsonNet.Tests/UnitsNetBaseJsonConverterTest.cs index f6f6707788..c438447b5f 100644 --- a/UnitsNet.Serialization.JsonNet.Tests/UnitsNetBaseJsonConverterTest.cs +++ b/UnitsNet.Serialization.JsonNet.Tests/UnitsNetBaseJsonConverterTest.cs @@ -138,16 +138,6 @@ public void UnitsNetBaseJsonConverter_ReadValueUnit_returns_null_when_value_is_a 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_ReadDoubleValueUnit(token); - - Assert.Null(result); - } - [Fact] public void UnitsNetBaseJsonConverter_ReadDoubleValueUnit_works_with_empty_token() {