-
Notifications
You must be signed in to change notification settings - Fork 403
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.CurrentCultureinstead ofCurrentUICulture(#795, #986) -
IQuantityreturnsQuantityValueinstead ofdouble(#1074) - Decimal based quantities return
decimalinstead ofdouble(Power,BitRateandInformation) (#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
Undefinedenum value for all unit enum types. Fix: Usenull. - Remove
QuantityTypeenum. Fix: Use strings. - Remove
IQuantity.Unitsand.UnitNames. Fix: Use QuantityInfo. - Remove
GlobalConfiguration. Fix: Change CultureInfo.CurrentCulture. - Remove
Molarityctor and operator overloads. Fix: Use MassConcentration.FromMolarity(), ToMolarity(). - Remove
MinValue,MaxValueper quantity due to ambiguity. Fix: Define your own min/max quantity values. - Remove string format specifiers: "v", "s". Fix: Use
Valueproperty 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.