public void AddCategoryToLibrary() { var library = new LibraryDataService(); try { library.CreateSession(); library.BeginTransaction(); library.dbConnection.Categories.Add(new AngularJSDataModels.Category() { Name = "CSS" }); library.CommitTransaction(true); } catch (Exception e) { throw; } finally { library.CloseSession(); } }
public void AddBookToLibrary() { var library = new LibraryDataService(); try { library.CreateSession(); library.BeginTransaction(); library.dbConnection.Books.Add(new AngularJSDataModels.Book() { CategoryId = 1, Name = "Book from Test", }); library.CommitTransaction(true); } catch (Exception e) { throw; } finally { library.CloseSession(); } }