예제 #1
0
        public ActionResult List()
        {
            try
            {
                //Listing the existing contracts.
                List <ContractViewModel> contractsViewModel = _contractAppService.List();

                //Checking result.
                if (contractsViewModel?.Count() > 0)
                {
                    return(Ok(contractsViewModel));
                }
                else
                {
                    return(NotFound("No contracts were found."));
                }
            }
            catch (Exception ex)
            {
                return(BadRequest(SetTrace(ex)));
            }
        }