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); })); }
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(); })); }
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); })); }
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); })); }