using System; namespace Kreta.BusinessLogic.Classes { public static class Hacks { /// /// Not a proper extension, just a hack. /// /// T or F from db /// true if string is "T" public static bool AsBool(this string str) { return str == "T"; } /// /// Not a proper extension, just a hack. /// /// /// Oracle compatiblr boolean. public static string AsString(this bool value) { return value ? "T" : "F"; } /// /// Next level hack. /// /// Any enum you need to persist. /// Value of the given enum.Integer public static int AsInt(this Enum value) { return Convert.ToInt32(value); } } }