Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion UnitsNet/IQuantity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,13 @@ public interface IQuantityOfType<out TQuantity> : IQuantity
where TQuantity : IQuantity
{
#if NET
internal static abstract TQuantity Create(double value, UnitKey unit);
/// <summary>
/// Creates an instance of the quantity from a specified value and unit.
/// </summary>
/// <param name="value">The numerical value of the quantity.</param>
/// <param name="unit">The unit of the quantity.</param>
/// <returns>An instance of the quantity with the specified value and unit.</returns>
public static abstract TQuantity Create(double value, UnitKey unit);
#else
/// <inheritdoc cref="IQuantity.QuantityInfo"/>
new IQuantityInstanceInfo<TQuantity> QuantityInfo { get; }
Expand Down
10 changes: 8 additions & 2 deletions UnitsNet/IQuantityInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,12 @@ interface IQuantityInstanceInfo<out TQuantity> : IQuantityInfo
{
/// <inheritdoc cref="IQuantityInfo.Zero" />
new TQuantity Zero { get; }

internal TQuantity Create(double value, UnitKey unitKey);

/// <summary>
/// Creates an instance of the quantity from a specified value and unit.
/// </summary>
/// <param name="value">The numerical value of the quantity.</param>
/// <param name="unitKey">The unit key of the quantity.</param>
/// <returns>An instance of the quantity with the specified value and unit.</returns>
public TQuantity Create(double value, UnitKey unitKey);
}