public T Obter(int id) { try { using (var db = new DataContext.DataContext()) { var result = db.Set <T>().Find(id); return(result); } } catch (Exception ex) { throw new Exception(ex.Message); } }
public Repository() { _context = new DataContext.DataContext(); _db = _context.Set <T>(); }