public async Task <IActionResult> CreateMainCategory(CreateMainCategoryCommand command) { var id = 0; _eventListener.Subscribe(new ActionHandler <EntityCreated>(a => { id = a.Id; })); await _bus.Dispatch(command); return(Ok(id)); }
internal async Task <int> CreateMainCategory(CreateMainCategoryCommand command) { var response = await _httpClient.Post <CreateMainCategoryCommand, int>("api/MainCategories", command); return(response); }