public async Task OnValidSubmit(EditContext editContext) { if (IsAddInProgress) { await OnItemAdded.InvokeAsync(CurrentEditItem); } else { await OnItemEdited.InvokeAsync(CurrentEditItem); } await CloseEdit(); }