예제 #1
0
        public string Insert(BookViewModel model)
        {
            model.Book.Author = _productCatalogMongoRepository.GetOptionById<Author, DenormalizedReference>(model.Book.Author.DenormalizedId);
            model.Book.Category = _productCatalogMongoRepository.GetOptionById<BookCategory, DenormalizedReference>(model.Book.Category.DenormalizedId);

            //call the overriden Insert method as it uses queuing first into MongoDB and then to ElasticSearch
            return this.QueueInsert(model.Book);
        }
예제 #2
0
        public ActionResult Create(BookViewModel model)
        {
            if (ModelState.IsValid)
            {
                _bookRepository.Insert(model);

                return RedirectToAction("Index");
            }
            else
            {
                return View();
            }
        }