private static async Task ValidateDataFields(SearchAccountsReq request)
 {
     try
     {
         PaginationEntity.Validate(request.Pagination);
     }
     catch (Exception)
     {
         throw;
     }
 }
Beispiel #2
0
 public async Task <AccountList> Execute(SearchAccountsReq request)
 {
     try
     {
         throw new NotImplementedException("SearchAccounts");
     }
     catch (Exception)
     {
         throw;
     }
 }
 public static async Task ValidateSearch(SearchAccountsReq request)
 {
     try
     {
         await ValidateDataFields(request);
     }
     catch (Exception)
     {
         throw;
     }
 }
        public async Task <IActionResult> SearchAccounts(SearchAccountsReq request)
        {
            try
            {
                var grpcRequest  = SearchAccountsReqAdapter.AdaptToGrpc(request);
                var grpcResponse = await MercadoLivreClient.SearchAccounts(grpcRequest);

                return(new ContentResult()
                {
                    Content = GrpcAccountListAdapter.AdaptSerialized(grpcResponse),
                    ContentType = "application/json",
                    StatusCode = 200
                });
            }
            catch (Exception)
            {
                throw;
            }
        }
 public static GrpcSearchAccountsReq AdaptToGrpc(SearchAccountsReq request)
 {
     try
     {
         return(new GrpcSearchAccountsReq()
         {
             Name = request.Name,
             Owner = request.Owner,
             Pagination = new GrpcPaginationIn()
             {
                 Limit = request.Pagination.Limit,
                 Offset = request.Pagination.Offset
             }
         });
     }
     catch (Exception)
     {
         throw;
     }
 }
 public Search Search(SearchAccountsReq req) => new Search(req);
Beispiel #7
0
 public Search(SearchAccountsReq req) => Request = req;