Closed Chef904 closed 2 months ago
I cannot set the QuantiyName for a custom Unit because the constructor is internal.
This is the code exampe in this repo:
public QuantityInfo QuantityInfo => new( nameof(HowMuch), typeof(HowMuchUnit), new UnitInfo[] { new UnitInfo<HowMuchUnit>(HowMuchUnit.Some, "Some", BaseUnits.Undefined, nameof(HowMuch)), new UnitInfo<HowMuchUnit>(HowMuchUnit.ATon, "Tons", BaseUnits.Undefined, nameof(HowMuch)), new UnitInfo<HowMuchUnit>(HowMuchUnit.AShitTon, "ShitTons", BaseUnits.Undefined, nameof(HowMuch)), }, HowMuchUnit.Some, Zero, BaseDimensions.Dimensionless);
But in an other Assembly where i have my custom units, i cannot add the quantity Name to my UnitInfo:
Hi, thanks for reporting. This seems like an oversight, now fixed.
Release UnitsNet/5.58.0 · angularsen/UnitsNet
I cannot set the QuantiyName for a custom Unit because the constructor is internal.
This is the code exampe in this repo:
But in an other Assembly where i have my custom units, i cannot add the quantity Name to my UnitInfo: