private bool CheckUniqueUsername(string username, bool forUpdate, Guid?userId) { var corpUsers = _corporationUserRepository.GetUsers(null, username); if (corpUsers != null && corpUsers.Count > 0) { if (!forUpdate || (forUpdate && corpUsers[0].UserId != userId)) { return(false); } } var persUsers = _personalUserRepository.GetUsers(null, username); if (persUsers != null && persUsers.Count > 0) { if (!forUpdate || (forUpdate && persUsers[0].UserId != userId)) { return(false); } } return(true); }
public List <PersonalUser> GetUsers(string city = null, string username = null) { return(_personalUserRepository.GetUsers(city, username)); }