Abrir Fechadas

Database calls in AbpModule #7413


User avatar
0
derek criada

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 resposta (s)
  • User Avatar
    0
    liangshiwei criada
    Equipe de Apoio 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 março 25, 2024, 15:11