public GetAppsResponse GetAll() { var response = new GetAppsResponse(); var apps = _appRepository.GetAll(); response.Apps = apps.ToDataContract(); return(response); }
/// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { GetAppsResponse response = new GetAppsResponse(); var unmarshaller = ApplicationsResponseUnmarshaller.Instance; response.ApplicationsResponse = unmarshaller.Unmarshall(context); return(response); }
public IActionResult GetBatchById([FromBody, MinLength(1)] int[] appIds) { if (appIds.Any(appId => appId == 401)) { return(Unauthorized()); } else if (appIds.Any(appId => appId == 403)) { return(StatusCode(403, new MessageResponse("Not allowed to view app(s)."))); } var apps = appIds.Select(GetAppForTest); var response = new GetAppsResponse(); response.Items.AddRange(apps); return(Ok(response)); }