public override async Task <GrpcAccount> GetAccountByMarketplaceId(GrpcGetByIdReq request, ServerCallContext context) { try { return(await MainController.GetAccountByMarketplaceId(request)); } catch (Exception e) { throw HandleException(e); } }
public static async Task <GrpcAccount> GetAccountByMarketplaceId(GrpcGetByIdReq request) { try { return(await Client.GetAccountByMarketplaceIdAsync(request)); } catch (Exception) { throw; } }
public override async Task <GrpcVoid> RefreshAccountTokens(GrpcGetByIdReq request, ServerCallContext context) { try { await TokensUseCases.Refresh.Execute(request.Id); return(new GrpcVoid()); } catch (Exception e) { throw HandleException(e); } }
public static async Task <GrpcAccount> GetAccountByMarketplaceId(GrpcGetByIdReq grpcRequest) { try { var id = GrpcGetByIdReqAdapter.Adapt(grpcRequest); var parsedId = Int64.Parse(id); var account = await AccountUseCases.Get.ByMercadoLivreId(parsedId); return(AccountPresenter.Present(account)); } catch (Exception) { throw; } }
public async Task <IActionResult> GetAccountByMarketplaceId(long id) { try { var grpcReq = new GrpcGetByIdReq() { Id = id.ToString() }; var grpcResp = await MercadoLivreClient.GetAccountByMarketplaceId(grpcReq); var json = JsonSerializer.Serialize(grpcResp); return(new ContentResult() { ContentType = "application/json", Content = json, StatusCode = 200 }); } catch (Exception) { throw; } }
public static string Adapt(GrpcGetByIdReq req) { return(req.Id); }