private async Task CleanupAllApplications()
        {
            foreach (var application in _applicationTestSet)
            {
                var applicationModelList = await _applicationsDatabase.ListApplicationAsync(application.Model.ApplicationUri);

                Assert.NotNull(applicationModelList);
                foreach (var response in applicationModelList)
                {
                    try
                    {
                        await _applicationsDatabase.DeleteApplicationAsync(response.ApplicationId.ToString(), true);
                    }
                    catch { }
                }
            }
            _fixture.RegistrationOk = false;
        }
        public async Task <QueryApplicationsResponseApiModel> ListApplicationsAsync(
            string applicationUri,
            [FromQuery] string nextPageLink,
            [FromQuery] int?pageSize)
        {
            var modelResult = new List <ApplicationRecordApiModel>();

            foreach (var record in await _applicationDatabase.ListApplicationAsync(applicationUri))
            {
                modelResult.Add(new ApplicationRecordApiModel(record));
            }
            return(new QueryApplicationsResponseApiModel(modelResult, null));
        }