Ouvert Fermé

Database calls in AbpModule #7413


User avatar
0
derek créé

How can I make database calls inside this AbpModule?

I want to be able to save records to my database in this event OnAuthorizationCodeReceived. This event happens after logging into an external provider.


1 Réponse (s)
  • User Avatar
    0
    liangshiwei créé
    Équipe d'assistance Fullstack Developer

    Hi,

    You can try:

    options.Events.OnAuthorizationCodeReceived = async receivedContext =>
    {
        var userRepository = receivedContext.HttpContext.RequestServices
            .GetRequiredService<IIdentityUserRepository>();
    
        var users = await userRepository.GetListAsync();
    };
    
Made with ❤️ on ABP v8.2.0-preview Updated on mars 25, 2024, 15:11