public List <T> ReadChildren <T>() where T : Parent { List <T> tts = new List <T>(); using (var context = new MovieDBEntities()) { tts = context.Parents.OfType <T>().ToList(); } return(tts); }
public void AddChild <T>(T rr) where T : Parent { using (var context = new MovieDBEntities()) { context.Parents.Add(rr); try { context.SaveChanges(); } catch (Exception ex) { throw ex; } } }