Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static Account getAccounts(string usernames)
- {
- if (accounts.Any(x => x.username == usernames))
- {
- return accounts.Where(x => x.username == usernames).First();
- }
- using (IDbConnection connection = Databases.GetConnection())
- {
- var results = connection.Query<Account>(
- "SELECT * FROM accounts WHERE username = @username",
- new { username = usernames });
- if (results.Count() > 0)
- {
- foreach (var data in results)
- {
- accounts.Add(data);
- }
- var resultats = results.First();
- return resultats;
- }
- else
- {
- return null;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement