public void TestMethod1() { Invoker o = new Invoker(); Command command = new AddRequirementCommand(); o.SetCommand(command); o.Action(); //Debug Trace: //Requirement Find //Code Find //Requirement Add //Code delete //Requirement Plan o.SetCommand(new CancelDeletePageCommand()); o.Action(); //根据日志,取消操作 }
public async Task <IActionResult> AddRequirement(RequirementCreateModel model) { if (ModelState.IsValid) { var cmd = new AddRequirementCommand(model.VacancyId, model.ClientId, model.SkillType, model.RequirementType, model.Content); var result = await _mediator.Send(cmd); if (result.IsFailure) { ViewBag.Notify = result.Error; // todo: toastr } } if (model.VacancyId != Guid.Empty) { return(RedirectToAction(nameof(ClientController.Requirements), new { client = model.ClientId, vacancy = model.VacancyId })); } else { return(RedirectToAction(nameof(ClientController.Index))); } }