예제 #1
0
        public async Task <HttpResponseMessage> Get()
        {
            var functions = await FunctionsProvider
                            .List()
                            .ConfigureAwait(continueOnCapturedContext: false);

            return(this.Request.CreateResponse(
                       value: functions.Select(function => function.ToModel()),
                       statusCode: HttpStatusCode.OK));
        }
예제 #2
0
        public async Task <HttpResponseMessage> Delete()
        {
            var functions = await FunctionsProvider
                            .List()
                            .ConfigureAwait(continueOnCapturedContext: false);

            await Task
            .WhenAll(functions.Select(async function =>
            {
                await FunctionsProvider
                .Delete(functionId: function.Id)
                .ConfigureAwait(continueOnCapturedContext: false);

                await QueueProvider
                .DeleteQueue(queueName: function.Id)
                .ConfigureAwait(continueOnCapturedContext: false);
            }))
            .ConfigureAwait(continueOnCapturedContext: false);

            return(this.Request.CreateResponse(statusCode: HttpStatusCode.NoContent));
        }