Пример #1
0
        public ActionResult AddProduct()
        {
            var p = new ElasticSearchProduct
            {
                Id = Guid.NewGuid(),
                Format = "E-book"
            };
            this.Search.IndexProduct( p );

            this.TempData.Add( "Post", "Product added." );
            return Redirect( "index" );
        }
Пример #2
0
 public void IndexProduct( ElasticSearchProduct p )
 {
     this.ElasticSearch.Map<ElasticSearchProduct>();
     this.ElasticSearch.Index<ElasticSearchProduct>( p );
 }