From 56b970552bc5249a804018890c6c37f5612bb415 Mon Sep 17 00:00:00 2001 From: lipchev Date: Tue, 19 Aug 2025 14:44:22 +0300 Subject: [PATCH] making the TQuantity Create(double, UnitKey) method public (IQuantityOfType / IQuantityInstanceInfo) --- UnitsNet/IQuantity.cs | 8 +++++++- UnitsNet/IQuantityInfo.cs | 10 ++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/UnitsNet/IQuantity.cs b/UnitsNet/IQuantity.cs index 7dd7e7b232..0fa1229301 100644 --- a/UnitsNet/IQuantity.cs +++ b/UnitsNet/IQuantity.cs @@ -134,7 +134,13 @@ public interface IQuantityOfType : IQuantity where TQuantity : IQuantity { #if NET - internal static abstract TQuantity Create(double value, UnitKey unit); + /// + /// Creates an instance of the quantity from a specified value and unit. + /// + /// The numerical value of the quantity. + /// The unit of the quantity. + /// An instance of the quantity with the specified value and unit. + public static abstract TQuantity Create(double value, UnitKey unit); #else /// new IQuantityInstanceInfo QuantityInfo { get; } diff --git a/UnitsNet/IQuantityInfo.cs b/UnitsNet/IQuantityInfo.cs index 79928c6f49..308df868e1 100644 --- a/UnitsNet/IQuantityInfo.cs +++ b/UnitsNet/IQuantityInfo.cs @@ -121,6 +121,12 @@ interface IQuantityInstanceInfo : IQuantityInfo { /// new TQuantity Zero { get; } - - internal TQuantity Create(double value, UnitKey unitKey); + + /// + /// Creates an instance of the quantity from a specified value and unit. + /// + /// The numerical value of the quantity. + /// The unit key of the quantity. + /// An instance of the quantity with the specified value and unit. + public TQuantity Create(double value, UnitKey unitKey); }