Tangara G

Tangara G

  • NA
  • 298
  • 93.5k

can someone tells me what is .First ?

Sep 14 2016 5:36 AM
Hi experts,
 
 
I have this rather stupid question yet I duno the answer.  Hope someone can let me know the answer :
 
  1. public AzolaDL.Account getAccount(string userName, string type){  
  2. AzolaDL.Account account = new AzolaDL.Account();  
  3. try{  
  4.      account = db.Accounts.First(e => e.userName == userName && e.type == type);  
  5. }catch (Exception e){ 
  6. return null;
  7. }
  8. return account;
  9. }
 Can I know why do we need to put .First ?
 
 

Answers (6)