Guest User

Untitled

a guest
Apr 20th, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. public class Repository<T> where T : class
  2. {
  3. private readonly LibraryContext context;
  4. private IDbSet<T> entities;
  5.  
  6. public Repository(LibraryContext context)
  7. {
  8. this.context = context;
  9. }
  10.  
  11. public class BookService
  12. {
  13. LibraryContext context = new LibraryContext();
  14.  
  15. private Repository<Book> bookRepository;
  16. private Repository<PublicationHouse> publicationHouseRepository;
  17.  
  18. public BookService()
  19. {
  20. bookRepository = new Repository<Book>(context);
  21. publicationHouseRepository = new Repository<PublicationHouse>(context);
  22. }
Add Comment
Please, Sign In to add comment