public List <RequestDtoo> GetByClient(RequestByClient requestByClient)
        {
            List <RequestDtoo> requests = new List <RequestDtoo>();

            using (IDbConnection dbConnection = new NpgsqlConnection(ConnectionString))
            {
                requests = dbConnection.Query <RequestDtoo>(SqlToGetByClient(requestByClient.Id, requestByClient.DepartmentAddress)).ToList();
            }

            return(requests);
        }
Ejemplo n.º 2
0
        public ActionResult <RequestDto> GetRequestByClient(int clientId, string departmentAddress)
        {
            RequestByClient requestByClient = new RequestByClient()
            {
                Id = clientId,
                DepartmentAddress = departmentAddress
            };

            var result = _requestSender.CallAsync(requestByClient).Result;

            _requestSender.Close();
            return(Ok(result));
        }