public static void alterar(tb_Animal oNovoanimal) { using (SmartFarmEntities oDb = Helper.DataBaseHelper.getDataContext()) { oDb.Entry(oNovoanimal).State = System.Data.Entity.EntityState.Modified; oDb.SaveChanges(); } }
public static void incluir(tb_Animal oNovoAnimal) { using (SmartFarmEntities oDb = Helper.DataBaseHelper.getDataContext()) { oDb.tb_Animal.Add(oNovoAnimal); oDb.SaveChanges(); } }
public static void Excluir(tb_Animal oNovoanimal) { using (SmartFarmEntities oDb = Helper.DataBaseHelper.getDataContext()) { oDb.tb_Animal.Attach(oNovoanimal); // Anexa o cliente que eu quero com base nos atributos oDb.tb_Animal.Remove(oNovoanimal); oDb.SaveChanges(); } }