wp-net / WordPressPCL

This is a portable library for consuimg the WordPress REST-API in (almost) any C# application
MIT License
335 stars 131 forks source link

Specified cast is not valid exception. #320

Closed nicomara closed 1 year ago

nicomara commented 1 year ago

Hi, why occur "invalid cast" exception here: client = new WordPressClient(UriString); //fix casting exception var listOfNews = (IEnumerable<Post>)InitPosts(); listOfPosts = new ObservableCollection<Post>(listOfNews); } public async Task<IEnumerable<Post>> InitPosts() { var posts = await client.Posts.GetAllAsync(); return await Task.FromResult(posts); } What's wrong with post type? This code come from .Net MAUI app. Thanks.

ThomasPe commented 1 year ago

this seems like not an issue with this library.