public Shtoda_statuses_mails GetStatusMail(int id) { var res = new Shtoda_statuses_mails(); try { res = _db.GetStatusesMail().FirstOrDefault(x => x.id == id); } catch (Exception ex) { _debug(ex, new { }, ""); } return(res); }
public int SaveStatusMail(Shtoda_statuses_mails element, bool withSave = true) { if (element.id == 0) { db.Shtoda_statuses_mails.Add(element); } else { db.Entry(element).State = EntityState.Modified; } if (withSave) { Save(); } return(element.id); }