Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

15: Convert pagesize properly to skip and take #18069

Merged
merged 2 commits into from
Jan 22, 2025
Merged

Conversation

Zeegaan
Copy link
Member

@Zeegaan Zeegaan commented Jan 22, 2025

Fixes #17046

How to test

  • Follow steps in original issue
  • You can use this code to create 500 members, I personally threw it in a media saving notification just because i had one lying around 😅
        for (int i = 0; i < 550; i++)
        {
            var member = _memberService.CreateMember($"Test{i}", $"test{i}@gmail.com", $"TestName{i}", Constants.Security.DefaultMemberTypeAlias);
            _memberService.Save(member);
        }
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Composing;
using Umbraco.Cms.Core.Events;
using Umbraco.Cms.Core.Notifications;
using Umbraco.Cms.Core.Services;

public class MyComposer : IComposer
{
    public void Compose(IUmbracoBuilder builder)
    {
        builder.AddNotificationHandler<MediaSavingNotification, MyNotificationHandler>();
    }
}

public class MyNotificationHandler : INotificationHandler<MediaSavingNotification>
{
    private readonly IMemberService _memberService;

    public MyNotificationHandler(IMemberService memberService)
    {
        _memberService = memberService;
    }
    public void Handle(MediaSavingNotification notification)
    {
        for (int i = 0; i < 550; i++)
        {
            var member = _memberService.CreateMember($"Test{i}", $"test{i}@gmail.com", $"TestName{i}", Constants.Security.DefaultMemberTypeAlias);
            _memberService.Save(member);
        }
    }
}

@Zeegaan Zeegaan requested a review from kjac January 22, 2025 08:30
Copy link
Contributor

@kjac kjac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 💪

@Zeegaan Zeegaan merged commit c847a11 into v15/dev Jan 22, 2025
27 checks passed
@Zeegaan Zeegaan deleted the v15/bugfix/fix-#17046 branch January 22, 2025 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants