public bool Edit(Cotegoria categoria) { try { db.Entry(categoria).State = EntityState.Modified; db.SaveChanges(); return(true); } catch (Exception) { return(false); } }
public bool Add(Cotegoria categoria) { try { db.Cotegoria.Add(categoria); db.SaveChanges(); return(true); } catch (Exception) { return(false); } }