Exemple #1
0
        public async Task <IActionResult> GetAll(int RecordLimit)
        {
            ResponseHelper objHelper = new ResponseHelper();

            try
            {
                var vList = await Email_ConRepo.GetAll(RecordLimit);

                if (vList == null)
                {
                    objHelper.Status  = StatusCodes.Status200OK;
                    objHelper.Message = "Get Empty Data";
                }
                else
                {
                    objHelper.Status  = StatusCodes.Status200OK;
                    objHelper.Message = "Get Successfully";
                    objHelper.Data    = vList;
                }
                return(Ok(objHelper));
            }
            catch
            {
                objHelper.Status  = StatusCodes.Status500InternalServerError;
                objHelper.Message = "Get Unsuccessful";
                return(StatusCode(StatusCodes.Status500InternalServerError, objHelper));
            }
        }
        public async Task <IActionResult> GetAll(int RecordLimit)
        {
            ResponseHelper objHelper = new ResponseHelper();

            try
            {
                var vList = await Email_ConRepo.GetAll(RecordLimit);

                objHelper.Status  = StatusCodes.Status200OK;
                objHelper.Message = "Get Successfully";
                objHelper.Data    = vList;

                return(Ok(objHelper));
            }
            catch (Exception ex)
            {
                objHelper.Status  = StatusCodes.Status500InternalServerError;
                objHelper.Message = ex.Message;
                return(StatusCode(StatusCodes.Status500InternalServerError, objHelper));
            }
        }