Example #1
0
        public static void CheckExistsAndInsert(GorevAddDto gorevAdd)
        {
            elasticClient.Indices.DeleteAsync("gorev");


            if (!elasticClient.Indices.Exists("gorev").Exists)
            {
                var indexSettings = new IndexSettings();
                indexSettings.NumberOfReplicas = 1;
                indexSettings.NumberOfShards   = 3;


                var createIndexDescriptor = new CreateIndexDescriptor("change_history")
                                            .Mappings(ms => ms
                                                      .Map <GorevAddDto>(m => m.AutoMap())
                                                      )
                                            .InitializeUsing(new IndexState()
                {
                    Settings = indexSettings
                })
                                            .Aliases(a => a.Alias("change_log"));

                var response = elasticClient.Indices.Create(createIndexDescriptor);  // değiştirdin
            }
            elasticClient.Index <GorevAddDto>(gorevAdd, idx => idx.Index("change_history"));
        }
 public IActionResult EkleGorev(GorevAddDto model)
 {
     if (ModelState.IsValid)
     {
         _gorevService.Kaydet(new Gorev {
             Aciklama   = model.Aciklama,
             Ad         = model.Ad,
             AciliyetId = model.AciliyetId
         });
         return(RedirectToAction("Index"));
     }
     ViewBag.Aciliyetler = new SelectList(_aciliyetService.GetirHepsi(), "Id", "Tanim");
     return(View(model));
 }
Example #3
0
 public IActionResult EkleGorev(GorevAddDto model)
 {
     if (ModelState.IsValid)
     {
         _gorevService.Kaydet(new Gorev
         {
             Ad         = model.Ad,
             Aciklama   = model.Aciklama,
             AciliyetId = model.AciliyetId
         });
         return(RedirectToAction("Index"));
     }
     return(View(model));
 }
Example #4
0
 public IActionResult EkleGorev(GorevAddDto model)
 {
     TempData["Active"] = "gorev";
     if (ModelState.IsValid)
     {
         _gorevService.Kaydet(new Gorev()
         {
             Aciklama   = model.Aciklama,
             Ad         = model.Ad,
             AciliyetId = model.AciliyetId,
             UrunId     = model.UrunId
         });
         return(RedirectToAction("Index"));
     }
     ViewBag.Aciliyetler = new SelectList(_aciliyetService.GetirHepsi(), "Id", "Tanim");
     ViewBag.Urun        = new SelectList(_urunService.GetirHepsi(), "Id", "UrunAdi");
     return(View(model));
 }