protected virtual async Task OnAfterUpdate(GridUpdateComponent <T> component) { if (AfterUpdate != null) { await AfterUpdate.Invoke(component, _item); } }
protected virtual async Task <bool> OnBeforeUpdate(GridUpdateComponent <T> component) { if (BeforeUpdate != null) { return(await BeforeUpdate.Invoke(component, _item)); } return(true); }
public async Task UpdateItem(GridUpdateComponent <T> component) { try { bool isValid = await OnBeforeUpdate(component); if (isValid) { await((CGrid <T>)Grid).CrudDataService.Update(_item); ((CGrid <T>)Grid).Mode = GridMode.Grid; CrudRender = null; _fromCrud = true; await UpdateGrid(); } } catch (Exception e) { Console.WriteLine(e.Message); throw; } }