Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
 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;
         }
     }
 }