public static bool Eliminar(Categorias peliculaNueva) { bool interruptor = false; using (var conec = new CategoriasPeliculasDb()) { try { conec.Entry(peliculaNueva).State = EntityState.Deleted; conec.SaveChanges(); interruptor = true; } catch (Exception) { throw; } } return(interruptor); }
public static bool Guardar(Categorias peliculaNueva) { bool interruptor = false; using (var conec = new CategoriasPeliculasDb()) { try { conec.categorias.Add(peliculaNueva); conec.SaveChanges(); interruptor = true; } catch (Exception) { throw; } } return(interruptor); }