// GET api/challenge public ActionResult <IEnumerable <ChallengeDTO> > GetAll(int?accelerationId = null, int?userId = null) { if (accelerationId == null && userId == null) { return(StatusCode(204)); } List <Models.Challenge> list; list = _service.FindByAccelerationIdAndUserId((int)accelerationId, (int)userId).ToList(); return(Ok(_serviceConvertToListDTO.Execute(list))); }
public ActionResult <IEnumerable <SubmissionDTO> > GetAll(int?accelerationId = null, int?challengeId = null) { if (accelerationId == null && challengeId == null) { return(StatusCode(204)); } List <Submission> list; list = (List <Submission>)_service.FindByChallengeIdAndAccelerationId((int)challengeId, (int)accelerationId); return(Ok(_serviceConvertToListDTO.Execute(list))); }
public ActionResult <IEnumerable <AccelerationDTO> > GetAll(int?companyId = null) { if (companyId == null) { return(StatusCode(204)); } List <Acceleration> list; list = _service.FindByCompanyId((int)companyId).ToList(); return(Ok(_serviceConvertToListDTO.Execute(list))); }
// GET api/company public ActionResult <IEnumerable <CompanyDTO> > GetAll(int?accelerationId = null, int?userId = null) { if ((accelerationId == null && userId == null) || (accelerationId != null && userId != null)) { return(StatusCode(204)); } List <Company> list; if (accelerationId != null) { list = _service.FindByAccelerationId((int)accelerationId).ToList(); } else { list = _service.FindByUserId((int)userId).ToList(); } return(Ok(_serviceConvertToListDTO.Execute(list))); }
public ActionResult <IEnumerable <UserDTO> > GetAll(string accelerationName = null, int?companyId = null) { if ((accelerationName == null && companyId == null) || (accelerationName != null && companyId != null)) { return(StatusCode(204)); } List <User> list; if (accelerationName != null) { list = _service.FindByAccelerationName(accelerationName).ToList(); } else { list = _service.FindByCompanyId((int)companyId).ToList(); } return(Ok(_serviceConvertToListDTO.Execute(list))); }