private async Task DoAdd() { var name = await AddRequest.Handle(Unit.Default); if (string.IsNullOrWhiteSpace(name)) { return; } var category = new Category { Title = name }; await _categoryManager.Insert(category); var viewModel = _factory(category); _lookup[viewModel] = category; Items.Add(viewModel); }
public IActionResult Add([FromBody][FromServices] AddRequest request) => request.Handle();