internal static int AmountInYear(this TimeUnit timeUnit) { var amountInYearAttribute = timeUnit.GetAttributes()?.Get <AmountInYearAttribute>(); if (amountInYearAttribute is null) { throw new InvalidOperationException(); } return(amountInYearAttribute.AmountInYear); }