private static CountyUser GetUserByEmployeeId(PrincipalContext context, string id) { var userSearch = new CountyUser(context) { EmployeeId = id }; var searcher = new PrincipalSearcher(userSearch); return(searcher.FindOne() as CountyUser); }
private static CountyUser GetUserBySamAccountName(PrincipalContext context, string username) { return(CountyUser.FindByIdentity(context, IdentityType.SamAccountName, username)); }