private void TryAddUser(Profiler.User user) { if (UserKey.IsInvalid(user)) { return; } User.Add(new UserKey(user)); }
public UserKey(Profiler.User user) { LastName = user.LastName ?? string.Empty; FirstName = user.FirstName ?? string.Empty; EmailAddress = user.EmailAddress; PhoneNumber = user.PhoneNumber; _hashCode = LastName.ToLowerInvariant().GetHashCode() ^ FirstName.ToLowerInvariant().GetHashCode(); }
private Entity.tUser TryGetUser(Profiler.User user) { if (UserKey.IsInvalid(user)) { return(null); } var result = _baseData.User[new UserKey(user)]; return(result); }
public static bool IsInvalid(Profiler.User user) { if (user == null) { return(true); } else if (string.IsNullOrEmpty(user.LastName) && string.IsNullOrEmpty(user.FirstName)) { return(true); } else { return(false); } }
public static bool IsValid(Profiler.User user) => !IsInvalid(user);