2014-12-09 41 views

回答

-1

有沒有可能使用ASP身份API做這樣的檢查,你必須直接檢查數據庫,這裏是使用實體框架的例子。

protected bool EmailAlreadyExists(string aEmail) 
{   
    using(Baza pB = new Baza()) 
    { 
     if(pB.Memberships.Where(z => z.Email == aEmail).Count() > 0) 
     { 
      return true; 
     } 
     else 
     { 
      return false; 
     } 
    } 
} 
相關問題