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); } }
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); } }
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); } }
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; }
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; }
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; }
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; }
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; }
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; }