public static Task <IActionResult> GetAsync([HttpTrigger(AuthorizationLevel.Function, "get", Route = "GetBuildChangesByBuildId/{buildId}")] HttpRequest req, ILogger logger, long buildId)
 {
     FunctionsInitializationService.Initialize();
     return(AzureFunctionExecutionContext.ExecuteAsync <IBuildChangeDtoDataService>(
                async service =>
     {
         var result = await service.LoadByBuildIdAsync(buildId);
         return new OkObjectResult(result);
     }));
 }
Esempio n. 2
0
 public static Task <IActionResult> ExecuteAsync([HttpTrigger(AuthorizationLevel.Function, "post", Route = null)] HttpRequest req, ILogger logger)
 {
     FunctionsInitializationService.Initialize();
     return(AzureFunctionExecutionContext.ExecuteAsync <IReleaseCreationService>(
                async service =>
     {
         var requestBody = new StreamReader(req.Body).ReadToEnd();
         var patchWorkItemDto = JsonConvert.DeserializeObject <ReleaseConfigurationDto>(requestBody);
         await service.CreateReleaseAsync(patchWorkItemDto);
         return new OkResult();
     }));
 }
Esempio n. 3
0
        public static Task <IActionResult> PostAsync([HttpTrigger(AuthorizationLevel.Function, "post", Route = null)] HttpRequest req, ILogger logger)
        {
            FunctionsInitializationService.Initialize();

            return(AzureFunctionExecutionContext.ExecuteAsync <IWorkItemDtoDataService>(
                       req,
                       async(service, httpRequestProxy) =>
            {
                var postWorkItemDto = httpRequestProxy.ReadBody <PostWorkItemDto>();
                var result = await service.PostAsync(postWorkItemDto);
                return new OkObjectResult(result);
            }));
        }
Esempio n. 4
0
        public static Task <IActionResult> GetAsync([HttpTrigger(AuthorizationLevel.Function, "get")] HttpRequest req, ILogger logger)
        {
            FunctionsInitializationService.Initialize();

            return(AzureFunctionExecutionContext.ExecuteAsync <IWorkItemDtoDataService>(
                       req,
                       async(service, httpRequestProxy) =>
            {
                var workItemIds = httpRequestProxy.QueryParameters["workItemIds"];

                var workitemIdsSplitted = workItemIds
                                          .Split(new[] { "," }, StringSplitOptions.RemoveEmptyEntries)
                                          .Select(int.Parse)
                                          .ToArray();

                var result = await service.LoadByIdsAsync(workitemIdsSplitted);
                return new OkObjectResult(result);
            }));
        }