Exemplo n.º 1
0
        public GetAllInstituteResponse GetAll(GetAllInstituteRequest request)
        {
            try
            {
                request.Validate();

                var institutes = this._unitOfWork.instituteRepository.GetAll();
                var result     = institutes.Convert();
                return(new GetAllInstituteResponse(true, "دریافت اطلاعات با موفقیت انجام شد")
                {
                    Institutes = result
                });
            }
            catch (BusinessException e)
            {
                this._logger.Warning("Course Management-Institute Service-GetAll Institute ", e.Message);
                return(new GetAllInstituteResponse(false, "دریافت اطلاعات با مشکل مواجه شد.", e.Message.ToString()));
            }
            catch (Exception e)
            {
                this._logger.Error("Course Management-Institute Service-GetAll Institute ", e.Message);
                return(new GetAllInstituteResponse(false, "دریافت اطلاعات با مشکل مواجه شد.", e.Message.ToString()));
            }
        }
Exemplo n.º 2
0
        public ActionResult <GetAllInstituteResponse> GetAll([FromBody] GetAllInstituteRequest request)
        {
            var result = _instituteService.GetAll(request);

            return(result);
        }