public string Update(Mission mission, string CurrentUsername) { if (FindById(mission.Id, CurrentUsername) != null) { return(MissionRepository.Update(mission) ? null : Messages.IssueInDatabase); } else { return(Messages.NotFound); } }
public void UpdatingMission() { Response response = new Response(); var MissionToUpdate = MISSION1; missionRepo.Insert(MissionToUpdate); MissionToUpdate.CodeName = "Ghost"; response = missionRepo.Update(MissionToUpdate); Assert.IsTrue(response.Success); }
public void MissionUpdate() { using (IUnitOfWork uow = UnitOfWorkFactory.Create()) { MissionRepository missionRepository = new MissionRepository(uow); var missions = missionRepository.GetAll(); if (missions.Count > 0) { Mission myMission = missions.FirstOrDefault(); myMission.Description += " (desc)"; myMission.StartDate = myMission.StartDate.Value.AddDays(7); missionRepository.Update(myMission); } } }
public async Task <IActionResult> Edit(IFormFile upload, Mission mission) { if (upload != null) { var path = Path.Combine(_environment.WebRootPath, "İcon", upload.FileName); var stream = new FileStream(path, FileMode.Create); upload.CopyTo(stream); mission.Projectİcon = upload.FileName; } mission.UpdateDate = DateTime.Now; mission.CreatedBy = User.Identity.Name; mission.User = await _userManager.GetUserAsync(User); _missonRepository.Update(mission); return(RedirectToAction("Index", "Mission")); }