public async Task <HttpResponseMessage> GetProjectStates()
        {
            try
            {
                var repository = new CrowdFundingTransactions();
                var result     = await repository.ReadProjectStates();

                return(Request.CreateResponse(HttpStatusCode.OK, result));
            }
            catch (Exception e) { return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, e.Message)); }
        }
Ejemplo n.º 2
0
        public async Task <HttpResponseMessage> GetProjectStates()
        {
            try
            {
                using (var repository = new CrowdFundingTransactions())
                {
                    var transaction = await repository.ReadProjectStates();

                    if (transaction.Result == TransResult.Success)
                    {
                        return(Request.CreateResponse(HttpStatusCode.OK, transaction.ReturnObject));
                    }
                    else
                    {
                        return(Request.CreateResponse(HttpStatusCode.OK, transaction.Message));
                    }
                }
            }
            catch (Exception e) { return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, e.Message)); }
        }