From 5b65a11250b72ebf7930cfd3cff36ee57cb4d0a9 Mon Sep 17 00:00:00 2001 From: Andreas Gullberg Larsen Date: Fri, 17 Jul 2026 18:09:39 +0200 Subject: [PATCH] Mark Scalar obsolete --- Common/UnitDefinitions/Scalar.json | 1 + UnitsNet.NanoFramework/GeneratedCode/Quantities/Scalar.g.cs | 1 + .../GeneratedCode/NumberToScalarExtensions.g.cs | 2 ++ UnitsNet/GeneratedCode/Quantities/Scalar.g.cs | 1 + 4 files changed, 5 insertions(+) diff --git a/Common/UnitDefinitions/Scalar.json b/Common/UnitDefinitions/Scalar.json index 8c8a5ebea4..1bebf4758f 100644 --- a/Common/UnitDefinitions/Scalar.json +++ b/Common/UnitDefinitions/Scalar.json @@ -2,6 +2,7 @@ "Name": "Scalar", "BaseUnit": "Amount", "XmlDocSummary": "A way of representing a number of items.", + "ObsoleteText": "Scalar is a unitless value wrapper rather than a physical quantity and will be removed in UnitsNet v6. Use a plain numeric value, QuantityValue, or a semantic dimensionless quantity such as Ratio where appropriate.", "Units": [ { "SingularName": "Amount", diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Scalar.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Scalar.g.cs index 3b38192b98..ea94507bd5 100644 --- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Scalar.g.cs +++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Scalar.g.cs @@ -26,6 +26,7 @@ namespace UnitsNet /// /// A way of representing a number of items. /// + [Obsolete("Scalar is a unitless value wrapper rather than a physical quantity and will be removed in UnitsNet v6. Use a plain numeric value, QuantityValue, or a semantic dimensionless quantity such as Ratio where appropriate.")] public struct Scalar { /// diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToScalarExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToScalarExtensions.g.cs index d5a54edf99..eb9eecfd27 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToScalarExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToScalarExtensions.g.cs @@ -30,9 +30,11 @@ namespace UnitsNet.NumberExtensions.NumberToScalar /// /// A number to Scalar Extensions /// + [Obsolete("Scalar is a unitless value wrapper rather than a physical quantity and will be removed in UnitsNet v6. Use a plain numeric value, QuantityValue, or a semantic dimensionless quantity such as Ratio where appropriate.")] public static class NumberToScalarExtensions { /// + [Obsolete("Scalar is a unitless value wrapper rather than a physical quantity and will be removed in UnitsNet v6. Use a plain numeric value, QuantityValue, or a semantic dimensionless quantity such as Ratio where appropriate.")] public static Scalar Amount(this T value) where T : notnull #if NET7_0_OR_GREATER diff --git a/UnitsNet/GeneratedCode/Quantities/Scalar.g.cs b/UnitsNet/GeneratedCode/Quantities/Scalar.g.cs index 83554ff187..c752da1244 100644 --- a/UnitsNet/GeneratedCode/Quantities/Scalar.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Scalar.g.cs @@ -36,6 +36,7 @@ namespace UnitsNet /// /// A way of representing a number of items. /// + [Obsolete("Scalar is a unitless value wrapper rather than a physical quantity and will be removed in UnitsNet v6. Use a plain numeric value, QuantityValue, or a semantic dimensionless quantity such as Ratio where appropriate.")] [DataContract] [DebuggerTypeProxy(typeof(QuantityDisplay))] public readonly partial struct Scalar :