//protected AddTaskDialog AddTaskDialog { get; set; } protected override async Task OnInitializedAsync() { try { Tasks = (await TaskDataService.GetAllTasks()).ToList(); } catch (Exception exception) { Logger.LogError("Exception occurred in on initialised async Task Data Service", exception); _loadFailed = true; } }
private async Task ApplyFilter() { if (!string.IsNullOrEmpty(SearchTerm)) { Tasks = Tasks.Where(v => v.Title.ToLower().Contains(SearchTerm.Trim().ToLower()) || v.Description.ToLower().Contains(SearchTerm.Trim().ToLower())).ToList(); title = $"Tasks With {SearchTerm} Contained within the Title/description"; } else { Tasks = (await TaskDataService.GetAllTasks()).ToList(); title = "All Tasks"; } }
protected override async Task OnInitializedAsync() { var result = await TaskDataService.GetAllTasks(); var resultMember = await MemberDataService.GetAllMembers(); if (result != null && result.Payload != null && result.Payload.Any()) { foreach (var item in result.Payload) { var member = resultMember.Payload.Where(x => x.Id == item.AssignedToId).FirstOrDefault(); taskModels.Add(new TaskModel() { id = item.Id, text = item.Subject, isDone = item.IsComplete, member = member != null ? new FamilyMember { id = member.Id, firstname = member.FirstName, lastname = member.LastName, email = member.Email, avtar = member.Avatar, role = member.Roles }:null, });; } } for (int i = 0; i < taskModels.Count; i++) { //leftMenuItem.Add(new MenuItem //{ // iconColor = taskModels[i].member, // label = taskModels[i].firstname, // referenceId = taskModels[i].id //}); } showCreator = true; isLoaded = true; }