Beispiel #1
0
        public async Task <IActionResult> Update([BindRequired] long?tagId)
        {
            if (!ModelState.IsValid)
            {
                return(View());
            }

            var readTagRequest = new ReadTagRequest
            {
                TagId = tagId.Value
            };
            var response = await _tagApplicationService.Handle(readTagRequest);

            var viewModel = response.Adapt <UpdateTagViewModel>();

            return(View(viewModel));
        }
        public async Task <TagResponse> Handle(ReadTagRequest request)
        {
            var tag = await _tagRepository.ReadById(request.TagId);

            return(tag.Adapt <TagResponse>());
        }