Exemple #1
0
        public ResponseList <PersonDto> Get([FromUri] SearchRequest <PersonCriteriaDto> request)
        {
            ResponseList <PersonDto> response = new ResponseList <PersonDto>();

            try
            {
                if (request == null)
                {
                    // Configure the Error response.
                    response.Code = OperationCode.ResponseCode.ERROR;
                    response.ErrorList.Add(MessageResource.GetInstance().GetText("SchoolAsIL_GetListNull", MESSAGE_RESOURCE));
                }
                else
                {
                    using (PersonContext context = new PersonContext())
                    {
                        response = context.GetPeople(request);
                    }
                }
            }
            catch (Exception ex)
            {
                string message = MessageResource.GetInstance().GetText("SchoolAsIL_GetListException", MESSAGE_RESOURCE);

                // Configure the Exception response.
                response.Code = OperationCode.ResponseCode.EXCEPTION;
                response.ExceptionMessageList.Add(message);
                response.ExceptionList.Add(ex);

                //CIALogger.LogException(message, string.Format(MODULE, "Get"), ex);
            }

            return(response);
        }