public bool GetEmail(Guid Id) { try { using (var context = new EmailContext()) { Email email = context.Emails.Where(x => x.EmailId == Id).First(); } return(true); } catch (Exception e) { throw new System.Exception("Unable to retrieve Email" + e.StackTrace); } }
public bool Save() { try { using (var context = new EmailContext()) { context.Emails.Add(this); context.SaveChanges(); } return(true); } catch (Exception e) { throw new System.Exception("Unable to save Email" + e.StackTrace); } }