public ValidateUserEmail(AssociationUserEmail email) { _email = email; }
public void RemoveAdditionalEmail(int id) { using (var db = new LomsContext()) { var email = new AssociationUserEmail() { Id = id }; db.AssociationUserEmails.Attach(email); db.AssociationUserEmails.DeleteObject(email); db.SaveChanges(); } }
public bool Equals(AssociationUserEmail other) { if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; if (other.Id == 0 && Id == 0) return false; else return other.Id == Id; }
public AssociationUserEmail SaveAdditionalEmail(AssociationUserEmail email) { using (var db = new LomsContext()) { db.AssociationUserEmails.ApplyChanges(email); db.SaveChanges(); return db.AssociationUserEmails.FirstOrDefault(a => a.Id == email.Id); } }