public async void LoadBookPosts() { var specification = DataContainer.Specification; if (specification.MinimumPrice is null) { specification.MinimumPrice = Specification.DefaultMinimumPrice; } if (specification.MaximumPrice is null) { specification.MaximumPrice = Specification.DefaultMaximumPrice; } var searchResult = await _postsService.GetBooksWithSpecificationAsync(specification); PostsCount = searchResult.PostsCount; BookPosts.Clear(); foreach (var bookPost in searchResult.BookPosts) { BookPosts.Add(bookPost); } PageSize = Specification.PageSize; CurrentPage = specification.PageNumber; FormatPaginationInfo(); }
public async Task <bool> DeletePostAsync(BookPost bookPost) { await _postsService.DeletePostAsync(bookPost); BookPosts.Remove(bookPost); return(true); }