public async Task UpdateQueryAsync() { var raw = await DatabaseAccessService.GetVirtualfolderImagesWithGroupsAndTags(DatabaseId); var currentIds = AllImages.Select(i => i.DatabaseId).ToList(); var rawCount = raw.Count; for (int i = rawCount - 1; i >= 0; i--) { for (int j = currentIds.Count - 1; j >= 0; j--) { if (raw[i].Id == currentIds[j]) { raw.RemoveAt(i); currentIds.RemoveAt(j); break; } } } AllImages.RemoveAll(i => currentIds.Contains(i.DatabaseId)); foreach (var item in raw) { AllImages.Add(await ImageItem.FromDatabaseImage(item, viewMode: ImageItem.Options.None)); } ReorderImages(); }
public SectionModel ToModel() { return(new SectionModel() { Title = Title, TextContent = TextContent, ListItems = ListItems.GetModel(), Type = SectionType, AllImages = AllImages.Select(i => i.ToModel()).ToArray() }); }