/// <summary> /// Registers the units in the specified assembly. /// </summary> /// <param name="unitProvider"> /// The unit provider. /// </param> /// <param name="assembly"> /// The assembly. /// </param> public static void RegisterUnits(this IUnitProvider unitProvider, Assembly assembly) { foreach (var t in assembly.ExportedTypes) { if (typeof(IQuantity).GetTypeInfo().IsAssignableFrom(t.GetTypeInfo())) { unitProvider.RegisterUnits(t); } } }