これを使用して、テーブル内の既存のemailIdをチェックし、挿入します...ユーザーが既存のmailIdに登録しようとしたときにメッセージを表示する方法は問題ありません...。
if (!taxidb.Registrations.Where(u => u.EmailId == reg.EmailId).Any())
{
taxidb.Registrations.InsertOnSubmit(reg);
taxidb.SubmitChanges();
}
私のコントローラーにはこれがあります
RegistrationBO reg = new RegistrationBO();
reg.UserName = collection["UserName"];
reg.OrgName = collection["OrgName"];
reg.Address = collection["Address"];
reg.EmailId = collection["EmailId"];
reg.Password = collection["Password"];
reg.CreatedDate = System.DateTime.Now;
reg.IsDeleted = Convert.ToByte(0);
regrep.registerUser(reg);
「EmailID」を表示する方法についての推測は、asp.netmvcを使用するユーザーにすでに存在します。