private async Task RegisterAllApplications()
        {
            foreach (var application in _applicationTestSet)
            {
                Assert.Null(application.Model.CreateTime);
                Assert.Null(application.Model.ApproveTime);
                Assert.Null(application.Model.UpdateTime);
                Assert.Null(application.Model.DeleteTime);
                var applicationModel = await _applicationsDatabase.RegisterApplicationAsync(application.Model);

                Assert.NotNull(applicationModel);
                Assert.NotEqual(applicationModel.ApplicationId, Guid.Empty);
                ApplicationTestData.AssertEqualApplicationModelData(applicationModel, application.Model);
                application.Model = applicationModel;
                Assert.NotNull(applicationModel);
            }
            _fixture.RegistrationOk = true;
        }
        public async Task <ApplicationRecordApiModel> RegisterApplicationAsync([FromBody] ApplicationRecordApiModel application)
        {
            if (application == null)
            {
                throw new ArgumentNullException(nameof(application));
            }
            var applicationServiceModel = application.ToServiceModel();

            applicationServiceModel.AuthorityId = User.Identity.Name;
            return(new ApplicationRecordApiModel(await _applicationDatabase.RegisterApplicationAsync(applicationServiceModel)));
        }