public ActionResult Create(ClientCreateCommand clientCreateCommand) { if (!ModelState.IsValid) { return(this.RedirectToAction(f => f.New())); } _commandDispatcher.Handle(clientCreateCommand); return(this.RedirectToAction <HomeController>(f => f.Index())); }
public async Task CreateClient(ClientCreateCommand command) { var content = new StringContent( JsonSerializer.Serialize(command), Encoding.UTF8, "application/json" ); var request = await _httpClient.PostAsync($"{_apiUrls.CustomerUrl}v1/clients", content); request.EnsureSuccessStatusCode(); }
public async Task <IActionResult> Create(ClientCreateCommand command) { try { await mediator.Publish(command); return(Ok()); } catch (Exception ex) { return(StatusCode(500, ex)); } }
public async Task <IActionResult> Create(ClientCreateCommand command) { await _mediator.Publish(command); return(Ok()); }
public async Task <IActionResult> Create(ClientCreateCommand notification) { await _mediator.Publish(notification); return(Ok()); }
public async Task <ActionResult> Create(ClientCreateCommand command) { await _customerProxy.CreateClient(command); return(Ok()); }
public ActionResult Create(ClientCreateCommand clientCreateCommand) { _createClientCommandHandler.Handle(clientCreateCommand); return(this.RedirectToAction <ClientListController>(f => f.Index())); }