Exemplo n.º 1
0
 public void update(Models.Book book)
 {
     using (BookLibrary dc = new BookLibrary(connectionString, mapping))
     {
         var original = from b in dc.GetTable<Models.Book>() where b.id == book.id select b;
         dc.updateBook(book.id, book.name, book.authorId, book.categoryId);
     }
 }
Exemplo n.º 2
0
 public void update(Models.Author author)
 {
     using (BookLibrary dc = new BookLibrary(connectionString, mapping))
     {
         var original = from a in dc.GetTable<Models.Author>() where a.Id == author.Id select a;
         dc.updateAuthor(author.Id, author.name);
     }
 }
Exemplo n.º 3
0
 public void update(Models.Category category)
 {
     using (BookLibrary dc = new BookLibrary(connectionString, mapping))
     {
         var original = from c in dc.GetTable<Models.Category>() where c.Id == category.Id select c;
         dc.updateCategory(category.Id, category.name, category.description);
     }
 }
Exemplo n.º 4
0
 public Models.Author get(Guid id)
 {
     Models.Author author = null;
     using (BookLibrary dc = new BookLibrary(connectionString, mapping))
     {
         IEnumerable<Models.Author> allAuthors = from a in dc.GetTable<Models.Author>() where a.Id == id select a;
         author = allAuthors.FirstOrDefault();
     }
     return author;
 }
Exemplo n.º 5
0
 public Models.Book get(Guid id)
 {
     Models.Book book = null;
     using (BookLibrary dc = new BookLibrary(connectionString, mapping))
     {
         IEnumerable<Models.Book> allBooks = from b in dc.GetTable<Models.Book>() where b.id == id select b;
         book = allBooks.FirstOrDefault();
     }
     return book;
 }
Exemplo n.º 6
0
 public Models.Category get(Guid id)
 {
     Models.Category category = null;
     using (BookLibrary dc = new BookLibrary(connectionString, mapping))
     {
         IEnumerable<Models.Category> allCategories = from c in dc.GetTable<Models.Category>() where c.Id == id select c;
         category = allCategories.FirstOrDefault();
     }
     return category;
 }
Exemplo n.º 7
0
 public List<Models.Author> get()
 {
     List<Models.Author> authors = new List<Models.Author>();
     using (BookLibrary dc = new BookLibrary(connectionString, mapping))
     {
         IEnumerable<Models.Author> allAuthors = from a in dc.GetTable<Models.Author>() select a;
         foreach (var author in allAuthors)
         {
             authors.Add(author);
         }
     }
     return authors;
 }
Exemplo n.º 8
0
 public List<Models.Book> get()
 {
     List < Models.Book > books = new List<Models.Book>();
     using (BookLibrary dc = new BookLibrary(connectionString, mapping))
     {
         IEnumerable<Models.Book> allBooks = from b in dc.GetTable<Models.Book>() select b;
         foreach (var book in allBooks)
         {
             books.Add(book);
         }
     }
     return books;
 }
Exemplo n.º 9
0
 public List<Models.Category> get()
 {
     List<Models.Category> categories = new List<Models.Category>();
     using (BookLibrary dc = new BookLibrary(connectionString, mapping))
     {
         IEnumerable<Models.Category> allCategories = from c in dc.GetTable<Models.Category>() select c;
         foreach (var category in allCategories)
         {
             categories.Add(category);
         }
     }
     return categories;
 }