protected override async Task OnInitializedAsync() { cryptoId = base.Options; cryptoEntity = await cryptoService.FindAsync(cryptoId); await base.OnInitializedAsync(); }
private async Task ValidatorByName(EditContext editContext) { BCryptoEntity other = await this.cryptoService.FindBySecretAsync(cryptoEntity.Secret); if (other != null && StringUtils.IsNotEqual(cryptoEntity.Id, other.Id)) { messageStore.Add(editContext.Field(nameof(BCryptoEntity.Secret)), "密码重复了"); } }
protected override async Task OnInitializedAsync() { cryptoId = base.Options ?? null; if (StringUtils.IsBlank(cryptoId)) { cryptoEntity = new BCryptoEntity(); } else { cryptoEntity = await cryptoService.FindCloneAsync(cryptoId); } await base.OnInitializedAsync(); }