public AdUser(LdapEntry entry) { Firstname = entry.TryGetAttribute("givenName")?.StringValue ?? ""; Lastname = entry.TryGetAttribute("sn")?.StringValue ?? ""; Email = entry.TryGetAttribute("mail")?.StringValue ?? ""; Cn = entry.TryGetAttribute("cn")?.StringValue ?? ""; Dn = entry.Dn; PupilId = entry.TryGetAttribute("employeeid")?.StringValue; TeacherId = entry.TryGetAttribute("description")?.StringValue; GroupMemberhips = entry.TryGetAttribute("memberof")?.StringValueArray ?? Array.Empty <string>(); }