コード例 #1
0
        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);
        }
コード例 #2
0
 public IActionResult Add([FromBody][FromServices] AddRequest request) => request.Handle();