public async Task <ActionResult> Create(CreateBazaarList model) { if (ModelState.IsValid) { model.CreatorUserId = User.FindFirst(ClaimTypes.NameIdentifier).Value; var newItem = await _bazaarListService.Create(model); return(RedirectToAction("Index", "BazaarList")); } return(View()); }
private async Task CreateFirst() { var count = await inMemoryContext.BazaarLists.CountAsync(); // Parametresini olusturalim if (count > 1) { await CleanAll(); await CreateFirst(); } if (count == 0) { CreateBazaarList testInput = new CreateBazaarList { CreatorUserId = Guid.NewGuid().ToString(), Description = "Test_Aciklama", Title = "Test_Baslik" }; // fake data ile metodu calistir. await service.Create(testInput); } }
// Yeni kayit olusturur public async Task <ActionResult <BazaarList> > Create(CreateBazaarList input) { return(await _bazaarListService.Create(input)); }