Ejemplo n.º 1
0
        public async Task <ActionResult <DictDto> > GetAsync([FromRoute] long id)
        {
            var cfg = await _dictAppService.GetAsync(id);

            if (cfg != null)
            {
                return(cfg);
            }

            return(NoContent());
        }
Ejemplo n.º 2
0
    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);
    }
Ejemplo n.º 3
0
 public async Task <ActionResult <DictDto> > GetAsync([FromRoute] long id)
 {
     return(Result(await _dictAppService.GetAsync(id)));
 }