2022-11-20 03:06:41 +01:00
|
|
|
using System.Reflection;
|
|
|
|
|
2022-11-26 13:23:58 +01:00
|
|
|
namespace zotanpw.Backend;
|
2022-11-20 03:06:41 +01:00
|
|
|
|
|
|
|
public static class Utils {
|
|
|
|
public static readonly string Version =
|
|
|
|
((AssemblyInformationalVersionAttribute)Assembly.GetEntryAssembly()!.GetCustomAttributes(typeof(AssemblyInformationalVersionAttribute), false)[0])
|
|
|
|
.InformationalVersion[6..];
|
|
|
|
|
|
|
|
public static readonly string LinkVersion = Version[..8];
|
|
|
|
|
|
|
|
// Works up to 79, doubt i'll have >=80 minute read time blog posts
|
|
|
|
public static string a_an(int number) {
|
|
|
|
if (number >= 80)
|
|
|
|
throw new ArgumentOutOfRangeException();
|
|
|
|
|
|
|
|
return number switch {
|
|
|
|
8 => "an",
|
|
|
|
11 => "an",
|
|
|
|
18 => "an",
|
|
|
|
_ => "a"
|
|
|
|
};
|
|
|
|
}
|
2022-11-20 17:00:51 +01:00
|
|
|
}
|