-
Notifications
You must be signed in to change notification settings - Fork 382
Upgrading from 4.x to 5.x
Andreas Gullberg Larsen edited this page Feb 17, 2023
·
12 revisions
Most of the removed code was marked as obsolete for a long time in v4 before removed in v5 with details on what to replace the usage with.
- Localization is based on
CultureInfo.CurrentCulture
instead ofCurrentUICulture
(#795, #986) -
IQuantity
returnsQuantityValue
instead ofdouble
(#1074) - Decimal based quantities return
decimal
instead ofdouble
(Power
,BitRate
andInformation
) (#1074) - Equality changed to strict equality so BOTH unit and value must match exactly. 100 cm != 1 m. Read more on why. Fix: Use
Equals(other, tolerance, comparisonType)
.
-
QuantityValue
: Implement IEquality, IComparable, IFormattable -
QuantityValue
: 16 bytes instead of 40 bytes (#1084) - Add
[DataContract]
annotations (#972)
- Remove targets: net40, net47, Windows Runtime Component. Fix: Use netstandard2.0.
- Remove
Undefined
enum value for all unit enum types. Fix: Usenull
. - Remove
QuantityType
enum. Fix: Use strings. - Remove
IQuantity.Units
and.UnitNames
. Fix: Use QuantityInfo. - Remove
GlobalConfiguration
. Fix: Change CultureInfo.CurrentCulture. - Remove
Molarity
ctor and operator overloads. Fix: Use MassConcentration.FromMolarity(), ToMolarity(). - Remove
MinValue
,MaxValue
per quantity due to ambiguity. Fix: Define your own min/max quantity values. - Remove string format specifiers: "v", "s". Fix: Use
Value
property and standard .NET numeric format strings. - json: Remove UnitsNetJsonConverter. Fix: Use UnitsNetIQuantityJsonConverter or AbbreviatedUnitsConverter.
Rename BaseType
to ValueType
, for values "double" and "decimal".
Rename XmlDoc
to XmlDocSummary
.