-
Notifications
You must be signed in to change notification settings - Fork 217
Closed
Labels
area: model 📐Related to the core SDK modelsRelated to the core SDK modelsquestionFurther information is requestedFurther information is requested
Description
Category
- Bug
Describe the bug
I am trying to get the Page LikedByInformation as below,
var pageLikeInformation = clientSidePage.GetLikedByInformationAsync().GetAwaiter().GetResult();
But i get no results when using this.
I also used GetCommentsAsync() to get the comment collection which works fine.
var commentsCollection = clientSidePage.GetCommentsAsync().GetAwaiter().GetResult();
Below code is working and getting likedByInformation as well.
`
var pageNew = await pnpContext.Web.NewPageAsync();
// Save the page
await pageNew.SaveAsync("Pageb.aspx");
// Publish the page, required before it can be liked
await pageNew.PublishAsync();
// Like the page
await pageNew.LikeAsync();
var pageLikeInformation = await pageNew.GetLikedByInformationAsync();
bool pageLikedByCurrentUser = pageLikeInformation.IsLikedByUser;
foreach (var likedByUser in pageLikeInformation.LikedBy.AsRequested())
{
// do something with the information about the user who liked this page
}
`
Below code is not working,
`
var mypages = await pnpContext.Web.GetPagesAsync("TestingLikeInfo.aspx");
var pageABC = mypages.First();
await pageABC.PublishAsync();
ILikedByInformation likeInfo2 = await pageABC.GetLikedByInformationAsync();
bool pageLikedByCurrentUser2 = likeInfo2.IsLikedByUser;
`
Expected behavior
await pageABC.GetLikedByInformationAsync(); should get LikedByInformation
Library
PnP.Core - 1.11.69-nightly
Thanks,
Nishkalank
Metadata
Metadata
Assignees
Labels
area: model 📐Related to the core SDK modelsRelated to the core SDK modelsquestionFurther information is requestedFurther information is requested