Advertisement
Guest User

Untitled

a guest
Dec 17th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.53 KB | None | 0 0
  1. interface IDBcontext
  2. {
  3.     List<Student> GetAllStudents();
  4.     List<Klass> GetAllKlasses();
  5.  
  6.     Student FindStudentById(int studentID);
  7.     void RemoveStudent(Student);
  8.     void SaveStudent(Student);
  9.     // Other methods if needed
  10.  
  11.     // The same for klass....
  12.     Klass FindKlassById(int klassID);
  13. }
  14.  
  15. class XmlDBContext : IDBContext
  16. {
  17.     XmlDBContext(string filename) {}
  18. }
  19.  
  20. class Program
  21. {
  22.     public static void Main(string[] args)
  23.     {
  24.         IDBContext dbContext = new XmlDBContext("file.xml");
  25.  
  26.         // ...
  27.        
  28.         dbContext.SaveStudent(...);
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement