public async Task DeleteAsync(IUserCategory category, TaskContext context) { var authentication = context.Authentication; if (context.AllowException == false) { if (await category.Dispatcher.InvokeAsync(() => category.Parent) == null) { return; } if (await category.Dispatcher.InvokeAsync(() => EnumerableUtility.Descendants <IUserItem, IUser>(category as IUserItem, item => item.Childs).Any()) == true) { return; } } await category.DeleteAsync(authentication); context.Complete(category); }