public void createDummyData(string dbName) { using (var dataContext = new SampleDBContext(dbName)) { Console.WriteLine("db created..."); } }
public LibraryPasage getLibraryData(int id) { using (var dataContext = new SampleDBContext("ceit436DB")) { LibraryPasage ptx = dataContext.Categories.Where(x => x.id == id).First(); return(ptx); } }
public void remove(LibraryPasage passage) { using (var dataContext = new SampleDBContext("ceit436DB")) { dataContext.Categories.Remove(passage); dataContext.SaveChanges(); } }
// 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()); } }