public static string ToAttribute(this TelephonesEnum value) { switch (value) { case TelephonesEnum.HOME: return("homePhone"); case TelephonesEnum.OTHER_HOME_PHONE_NUMBERS: return("otherHomePhone"); case TelephonesEnum.PAGER: return("pager"); case TelephonesEnum.OTHER_PAGER_NUMBERS: return("otherPager"); case TelephonesEnum.MOBILE: return("mobile"); case TelephonesEnum.OTHER_MOBILE_NUMBERS: return("otherMobile"); case TelephonesEnum.FAX: return("facsimileTelephoneNumber"); case TelephonesEnum.OTHER_FAX_NUMBERS: return("otherFacsimileTelephoneNumber"); case TelephonesEnum.IP_PHONE: return("ipPhone"); case TelephonesEnum.OTHER_IP_PHONE_NUMBERS: return("otherIpPhone"); case TelephonesEnum.NOTES: return("info"); default: throw new ArgumentException($"Invalid Enum:{value.ToString()}"); } }
internal static string getAttribute(this LdapEntry entry, TelephonesEnum value) { var attr = value.ToAttribute(); return(entry.getAttribute(attr)?.ToString()); }