public ActionResult EditExitStrategy(EditExitStrategyViewModel model) { ExitStrategy exitStrategy = _strategiesService.GetExitStrategy(model.ID); exitStrategy.Name = model.ExitStrategyName; exitStrategy.Description = model.ExitStrategyDescription; _exitStrategyStore.Update(exitStrategy); return(Ok(exitStrategy)); }
public IActionResult EditExitStrategy(Guid id) { var userId = User.FindFirst(System.Security.Claims.ClaimTypes.NameIdentifier).Value; var currentUser = _traderStore.GetAll().FirstOrDefault(u => u.TraderId == Guid.Parse(userId)); var exitStrategy = _strategiesService.GetExitStrategy(id); ViewBag.id = id; if (exitStrategy == null) { } EditExitStrategyViewModel editStrategy = new EditExitStrategyViewModel() { ID = exitStrategy.ExitStrategyId, SimpleStrategyName = exitStrategy.Name, SimpleStrategyDescription = exitStrategy.Description, TraderID = currentUser.TraderId }; return(View(editStrategy)); }