示例#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);
        }
示例#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;
         }
     }
 }