public void SaveDocType(Shtoda_docTypes item) { try { _db.SaveDocType(item); } catch (Exception ex) { _debug(ex, new { item }, ""); } }
public Shtoda_docTypes GetDocType(int id) { var res = new Shtoda_docTypes(); try { res = _db.GetDocTypes().FirstOrDefault(x => x.id == id); } catch (Exception ex) { _debug(ex, new { id }, ""); } return(res); }
public int SaveDocType(Shtoda_docTypes element, bool withSave = true) { if (element.id == 0) { db.Shtoda_docTypes.Add(element); } else { db.Entry(element).State = EntityState.Modified; } if (withSave) { Save(); } return(element.id); }