public virtual IUserClient Login(string username, string password) { IUserClient user; if (!string.IsNullOrWhiteSpace(username)) { if (accounts.TryGetValue(username.ToLowerInvariant(), out user)) { return(user); } if (AutoCreateAccounts) { var newAccount = new FeenAccount(username.ToLowerInvariant(), textInfo.ToTitleCase(username)); accounts.Add(newAccount.Username, newAccount); return(newAccount); } } return(null); }
public virtual IUserClient Login(string username, string password) { IUserClient user; if (!string.IsNullOrWhiteSpace(username)) { if (accounts.TryGetValue(username.ToLowerInvariant(), out user)) return user; if (AutoCreateAccounts) { var newAccount = new FeenAccount(username.ToLowerInvariant(), textInfo.ToTitleCase(username)); accounts.Add(newAccount.Username, newAccount); return newAccount; } } return null; }