public IActionResult GetAllAuthByProfileIdWhichIsNotIncluded([FromQuery] GetAllAuthByProfileIdWhichIsNotIncludedRequestModel requestModel, [FromHeader] string displayLanguage) { var responseModel = new ApiResponseModel <List <Data.Entity.Auth> >() { DisplayLanguage = displayLanguage }; if (requestModel.ProfileId <= 0) { responseModel.ResultStatusCode = ResultStatusCodeStatic.Error; responseModel.ResultStatusMessage = "Profile Id Must Be Entered"; return(BadRequest(responseModel)); } try { responseModel.Data = _profileDetailService.GetAllAuthByProfileIdWhichIsNotIncluded(requestModel.ProfileId); responseModel.ResultStatusCode = ResultStatusCodeStatic.Success; responseModel.ResultStatusMessage = "Success"; return(Ok(responseModel)); } catch (Exception ex) { responseModel.ResultStatusCode = ResultStatusCodeStatic.Error; responseModel.ResultStatusMessage = ex.Message; responseModel.Data = null; return(StatusCode(StatusCodes.Status500InternalServerError, responseModel)); } }
public IActionResult GetAllAuthByProfileIdWhichIsNotIncluded([FromQuery] GetAllAuthByProfileIdWhichIsNotIncludedRequestModel requestModel, [FromHeader] string displayLanguage) { var responseModel = new Return <List <Data.Entity.Auth> >() { DisplayLanguage = displayLanguage }; if (requestModel.ProfileId <= 0) { responseModel.Status = ResultStatusCodeStatic.BadRequest; responseModel.Message = "Profile Id Must Be Entered"; responseModel.Success = false; ReturnError error = new ReturnError(); error.Key = "500"; error.Message = "Profile Id Must Be Entered"; error.Code = 500; responseModel.Errors = new List <ReturnError>(); responseModel.Errors.Add(error); responseModel.Data = null; //hata oluştugundan dolayı Data null olarak dönülür. return(BadRequest(responseModel)); } try { responseModel.Data = _profileDetailService.GetAllAuthByProfileIdWhichIsNotIncluded(requestModel.ProfileId); responseModel.Status = ResultStatusCodeStatic.Success; responseModel.Message = "Success"; responseModel.Success = true; return(Ok(responseModel)); } catch (Exception ex) { responseModel.Status = ResultStatusCodeStatic.InternalServerError; responseModel.Message = "An error occurred"; responseModel.Success = false; ReturnError error = new ReturnError(); error.Key = "500"; error.Message = ex.Message; error.Code = 500; responseModel.Errors = new List <ReturnError>(); responseModel.Errors.Add(error); responseModel.Data = null; //hata oluştugundan dolayı Data null olarak dönülür. return(StatusCode(StatusCodes.Status500InternalServerError, responseModel)); } }
public ApiResponseModel <List <Data.Entity.Auth> > GetAllAuthByProfileIdWhichIsNotIncluded([FromBody] GetAllAuthByProfileIdWhichIsNotIncludedRequestModel requestModel) { var responseModel = new ApiResponseModel <List <Data.Entity.Auth> >(); if (requestModel.ProfileId <= 0) { responseModel.ResultStatusCode = ResultStatusCodeStatic.Error; responseModel.ResultStatusMessage = "Profile Must Be Entered"; return(responseModel); } try { responseModel.Data = _profileDetailService.GetAllAuthByProfileIdWhichIsNotIncluded(requestModel.ProfileId); responseModel.ResultStatusCode = ResultStatusCodeStatic.Success; responseModel.ResultStatusMessage = "Success"; } catch (Exception ex) { responseModel.ResultStatusCode = ResultStatusCodeStatic.Error; responseModel.ResultStatusMessage = ex.Message; } return(responseModel); }