public bool Save(Permissoes p) { try { if (db.Find(p.Id) == null) { p.Id = db.NextId(e => e.Id); db.Save(p); } else { db.Update(p); } db.Commit(); return(true); } catch { return(false); } }