Ejemplo n.º 1
0
 public static List <MasterView> GetMasterView()
 {
     using (var context = new ScrapeDbContext())
     {
         var cData = (from g in context.MasterView
                      select g);
         return(cData.ToList());
     }
 }
Ejemplo n.º 2
0
 public static List <Game_Doc> GetDocs()
 {
     using (var context = new ScrapeDbContext())
     {
         var cData = (from g in context.Game_Doc
                      select g).ToList();
         return(cData);
     }
 }
Ejemplo n.º 3
0
 public static List <Game_Doc> ReturnDocEntriesByGid(int gid)
 {
     using (var context = new ScrapeDbContext())
     {
         var cData = (from g in context.Game_Doc
                      where g.gid == gid
                      select g).ToList();
         return(cData);
     }
 }
Ejemplo n.º 4
0
 public static Game_Doc ReturnDocEntry(int id)
 {
     using (var context = new ScrapeDbContext())
     {
         var cData = (from g in context.Game_Doc
                      where g.id == id
                      select g).FirstOrDefault();
         return(cData);
     }
 }
Ejemplo n.º 5
0
        public static void AddDoc(Game_Doc doc)
        {
            using (var aG = new ScrapeDbContext())
            {
                // check whether doc url already exists
                List <Game_Doc> docs = (from a in aG.Game_Doc
                                        where a.downloadUrl == doc.downloadUrl
                                        select a).ToList();

                if (docs.Count == 0)
                {
                    aG.Game_Doc.Add(doc);
                    aG.SaveChanges();
                    aG.Dispose();
                }
            }
        }