public async Task Update() { // declare id variable / id diye bir degisken tanimla int id = 0; // create await CreateFirst(); var firstData = await inMemoryContext.BazaarLists.FirstAsync(); // set id variable / id yi ayarla id = firstData.Id; // update / update i calistir UpdateBazaarList input = new UpdateBazaarList { CreatorUserId = Guid.NewGuid().ToString(), Description = "Test_Aciklama_Guncel", Title = "Test_Baslik_Guncel", Id = id }; await service.Update(input); // get ile datayi cek var getResponse = await service.Get(id); // asserts Assert.Equal("Test_Baslik_Guncel", getResponse.Title); Assert.Equal("Test_Aciklama_Guncel", getResponse.Description); await CleanAll(); }
public async Task <ActionResult> Update(int id) { var model = await _bazaarListService.Get(id); UpdateBazaarList updateModel = new UpdateBazaarList { Id = model.Id, CreatorUserId = model.CreatorUserId, Description = model.Description, Title = model.Title }; return(View(updateModel)); }
public async Task <ActionResult> Update(UpdateBazaarList model) { if (ModelState.IsValid) { var updatedBazaarList = await _bazaarListService.Update(model); UpdateBazaarList updateModel = new UpdateBazaarList { Id = updatedBazaarList.Id, CreatorUserId = updatedBazaarList.CreatorUserId, Description = updatedBazaarList.Description, Title = updatedBazaarList.Title }; return(View(updateModel)); } return(View(model)); }
public async Task <ActionResult <BazaarList> > Update(UpdateBazaarList input) { return(await _bazaarListService.Update(input)); }