コード例 #1
0
 public void createDummyData(string dbName)
 {
     using (var dataContext = new SampleDBContext(dbName))
     {
         Console.WriteLine("db created...");
     }
 }
コード例 #2
0
 public LibraryPasage getLibraryData(int id)
 {
     using (var dataContext = new SampleDBContext("ceit436DB"))
     {
         LibraryPasage ptx = dataContext.Categories.Where(x => x.id == id).First();
         return(ptx);
     }
 }
コード例 #3
0
 public void remove(LibraryPasage passage)
 {
     using (var dataContext = new SampleDBContext("ceit436DB"))
     {
         dataContext.Categories.Remove(passage);
         dataContext.SaveChanges();
     }
 }
コード例 #4
0
 // Object orianted katili class  :))))))
 public List <LibraryPasage> getAll()
 {
     using (var dataContext = new SampleDBContext("ceit436DB"))
     {
         var ptx = (from r in dataContext.Categories select r);
         return(ptx.ToList());
     }
 }