Example #1
0
        public async Task UpdateTenant(TenantEditDto input)
        {
            Tenant byIdAsync = await this.TenantManager.GetByIdAsync(input.Id);

            input.MapTo <TenantEditDto, Tenant>(byIdAsync);
            this.CheckErrors(await this.TenantManager.UpdateAsync(byIdAsync));
        }
Example #2
0
        public async Task UpdateTenant(TenantEditDto input)
        {
            var tenant = await TenantManager.GetByIdAsync(input.Id);

            input.MapTo(tenant);
            CheckErrors(await TenantManager.UpdateAsync(tenant));
        }
Example #3
0
        public async Task UpdateTenant(TenantEditDto input)
        {
            input.ConnectionString = SimpleStringCipher.Instance.Encrypt(input.ConnectionString);
            var tenant = await TenantManager.GetByIdAsync(input.Id);

            input.MapTo(tenant);
            await TenantManager.UpdateAsync(tenant);
        }
Example #4
0
        public async Task UpdateTenant(TenantEditDto input)
        {
            if (await _repository.FirstOrDefaultAsync(t => t.TenancyName == input.TenancyName && t.Id != input.Id) != null)
            {
                throw new UserFriendlyException(string.Format(L("TenancyNameIsAlreadyTaken"), input.TenancyName));
            }

            var tenant = await _repository.FirstOrDefaultAsync(input.Id);
            if (tenant == null)
            {
                throw new AbpException("There is no tenant with id: " + input.Id);
            }

            input.MapTo(tenant);

            await _repository.UpdateAsync(tenant);
        }
Example #5
0
        public async Task UpdateTenant(TenantEditDto input)
        {
            if (await _repository.FirstOrDefaultAsync(t => t.TenancyName == input.TenancyName && t.Id != input.Id) != null)
            {
                throw new UserFriendlyException(string.Format(L("TenancyNameIsAlreadyTaken"), input.TenancyName));
            }

            var tenant = await _repository.FirstOrDefaultAsync(input.Id);

            if (tenant == null)
            {
                throw new AbpException("There is no tenant with id: " + input.Id);
            }

            input.MapTo(tenant);

            await _repository.UpdateAsync(tenant);
        }