public async Task <ActionResult <DictDto> > GetAsync([FromRoute] long id) { var cfg = await _dictAppService.GetAsync(id); if (cfg != null) { return(cfg); } return(NoContent()); }
public override async Task <GrpcResponse> GetDict(DictRequest request, ServerCallContext context) { var grpcResponse = new GrpcResponse(); var dict = await _dictAppService.GetAsync(request.Id); if (dict is not null) { var replyDict = _mapper.Map <DictReply>(dict); grpcResponse.Content = Any.Pack(replyDict); } grpcResponse.IsSuccessStatusCode = true; return(grpcResponse); }
public async Task <ActionResult <DictDto> > GetAsync([FromRoute] long id) { return(Result(await _dictAppService.GetAsync(id))); }