public BookRisultatiViewModel(Book libro)
 {
     Repository repo = new Repository();
     __book = libro;
     books = repo.FindByTitle(libro.Title).ToList();
     booksAutori = repo.FindByAuthor(libro.Author).ToList();
 }
Beispiel #2
0
 public BookController()
 {
     _repo = new Repository();
     string connectionString = "mongodb://localhost:27017/";
     var mongoClientSettings = new MongoClientSettings();
     mongoClientSettings.Server = new MongoServerAddress(connectionString);
     var client = new MongoClient();
     var db = client.GetDatabase("BookMVC");
     var collection = db.GetCollection<Book>("Book");
 }
Beispiel #3
0
 public BookViewModel(IEnumerable<Book> libri )
 {
     repo = new Repository(_mongoDatabase);
     _libri = repo.FindByTitle(Titolo) as List<Book>;
 }