Advertisement
Guest User

Untitled

a guest
Nov 4th, 2016
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. //performance Impact : high
  2. //EntityFramwork.account account = conn.accounts.Where(x => x.Username == username)
  3. //.FirstOrDefault();
  4.  
  5. //performance Impact : low
  6. var query = from c in conn.accounts
  7. where c.Username == username
  8. select c;
  9. EntityFramwork.account account = query.FirstOrDefault();
  10. if (account != null)
  11. {
  12. exists = true;
  13. this.Password = account.Password;
  14. this.IP = account.IP;
  15. this.EntityID = (uint)account.EntityID;
  16. this.State = (AccountState)account.State;
  17. this.Email = account.Email;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement