Skip to content

Commit 8f8c0e6

Browse files
authored
making the TQuantity Create(double, UnitKey) function public (#1611)
making the `TQuantity Create(double, UnitKey)` function public (`IQuantityOfType` / `IQuantityInstanceInfo`)
1 parent 1c95be6 commit 8f8c0e6

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

UnitsNet/IQuantity.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,13 @@ public interface IQuantityOfType<out TQuantity> : IQuantity
134134
where TQuantity : IQuantity
135135
{
136136
#if NET
137-
internal static abstract TQuantity Create(double value, UnitKey unit);
137+
/// <summary>
138+
/// Creates an instance of the quantity from a specified value and unit.
139+
/// </summary>
140+
/// <param name="value">The numerical value of the quantity.</param>
141+
/// <param name="unit">The unit of the quantity.</param>
142+
/// <returns>An instance of the quantity with the specified value and unit.</returns>
143+
public static abstract TQuantity Create(double value, UnitKey unit);
138144
#else
139145
/// <inheritdoc cref="IQuantity.QuantityInfo"/>
140146
new IQuantityInstanceInfo<TQuantity> QuantityInfo { get; }

UnitsNet/IQuantityInfo.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,12 @@ interface IQuantityInstanceInfo<out TQuantity> : IQuantityInfo
121121
{
122122
/// <inheritdoc cref="IQuantityInfo.Zero" />
123123
new TQuantity Zero { get; }
124-
125-
internal TQuantity Create(double value, UnitKey unitKey);
124+
125+
/// <summary>
126+
/// Creates an instance of the quantity from a specified value and unit.
127+
/// </summary>
128+
/// <param name="value">The numerical value of the quantity.</param>
129+
/// <param name="unitKey">The unit key of the quantity.</param>
130+
/// <returns>An instance of the quantity with the specified value and unit.</returns>
131+
public TQuantity Create(double value, UnitKey unitKey);
126132
}

0 commit comments

Comments
 (0)