protected override async Task OnInitializedAsync() { tagId = base.Options; tagEntity = await tagService.FindAsync(tagId); await base.OnInitializedAsync(); }
private async Task ValidatorByName(EditContext editContext) { BTagEntity other = await this.tagService.FindByNameAsync(tagEntity.Name); if (other != null && StringUtils.IsNotEqual(tagEntity.Id, other.Id)) { // _times += 1; 跟踪同一个页面的验证次数 // messageStore.Add(editContext.Field("Name"), "名字重复了 [第" + _times + "次验证]"); messageStore.Add(editContext.Field("Name"), "名字重复了"); // StateHasChanged(); } }
protected override async Task OnInitializedAsync() { tagId = base.Options ?? null; if (StringUtils.IsBlank(tagId)) { tagEntity = new BTagEntity(); } else { tagEntity = await tagService.FindCloneAsync(tagId); } await base.OnInitializedAsync(); }