public Serie ObterPorNome(string n) { Serie s; using (SerieContext ctx = new SerieContext()) { s = ctx.Series.Select(x => x).Where(x => x.SerieNome == n).FirstOrDefault(); } return(s); }
public Serie ObterPorId(int i) { Serie s; using (SerieContext ctx = new SerieContext()) { s = ctx.Series.Find(i); } return(s); }
public bool Alterar(Serie item) { bool retorno = true; using (SerieContext ctx = new SerieContext()) { try { ctx.Series.Update(item); ctx.SaveChanges(); } catch (Exception) { retorno = false; } } return(retorno); }