Activities of "liangshiwei"

Hi,

Do not throw exceptions, this may cause the lock to not be released

We need to use it in all entities in our project as create and update, which causes code repetition. I wonder if you have a solution for this?

You can create a generic domain service:

public class LockEntityManager<TEntity> where TEntity: .... , ITransientDependency
{
    private readonly IRepository<TEntity> _reopsitory;
    private readonly IAbpDistributedLock _distributedLock;
    private readonly IEntityCheck<TEntity> _entityCheck;
    
    ...
    
    public async Task<TEntity> CreateAsync(TEntity entity, string lockName)
    {
       await using (var handle = 
                         await _distributedLock.TryAcquireAsync(lockName))
        {
            if (handle != null)
            {
               await _entityCheck.CreateValidAsync(entity);
               .....
            }
        }   
    }
    
    public async Task<TEntity> UpdateAsync(TEntity entity, string lockName)
    {
       .....
    }
    
}

public interface IEntityCheck<TEntity> where TEntity: ....
{
     Task CreateValidAsync(Tentity entity);
     
     Task UpdateValidAsync(Tentity entity);
}

public class TestEntityCheck : IEntityCheck<Test>, ITransientDependency
{
      .....
}



public class TestAppService : ...
{
      private readonly LockEntityManager<Test> _testEntityManager;
      
      ....
}

Hi,

You can try

[ExposeServices(typeof(LoginModel))]
public class MyLoginModel : LoginModel
{
    protected virtual async Task<IdentityUser> CreateExternalUserAsync(ExternalLoginInfo info)
    {
        var email = loginInfo.Principal.FindFirstValue(AbpClaimTypes.Email) ?? loginInfo.Principal.FindFirstValue(ClaimTypes.Email);
        var user = await UserManager.FindByEmailAsync(email);
        // just a demo, You can check if the user exists using any way
        
        if(user == null)
        {
            user = await base.CreateExternalUserAsync(info);
        }
    }
}
[ExposeServices(typeof(RegisterModel))]
public class MyRegisterModel : RegisterModel
{
    protected virtual async Task<IdentityUser> RegisterExternalUserAsync(ExternalLoginInfo externalLoginInfo, string emailAddress)
    {
        var email = loginInfo.Principal.FindFirstValue(AbpClaimTypes.Email) ?? loginInfo.Principal.FindFirstValue(ClaimTypes.Email);
        var user = await UserManager.FindByEmailAsync(email);
        // just a demo, You can check if the user exists using any way
        
        if(user == null)
        {
            user = await base.RegisterExternalUserAsync(externalLoginInfo, emailAddress);
        }
        //.. first login
    }
}

You can check this: https://docs.abp.io/en/commercial/latest/modules/account#local-login

2.

You can override the login and register page, for example:

[ExposeServices(typeof(LoginModel))]
public class MyLoginModel : LoginModel
{
    protected virtual async Task<IdentityUser> CreateExternalUserAsync(ExternalLoginInfo info)
    {
        var user = await base.CreateExternalUserAsync(info);
        //.. first login
    }
}
[ExposeServices(typeof(RegisterModel))]
public class MyRegisterModel : RegisterModel
{
    protected virtual async Task<IdentityUser> RegisterExternalUserAsync(ExternalLoginInfo externalLoginInfo, string emailAddress)
    {
        var user = await base.RegisterExternalUserAsync(externalLoginInfo, emailAddress);
    //.. first login
    }
}

Hi,

@balessi75

No, it's Blazor UI.

Unlock this ticket as requested by DEKUKDEV

Hi,

For some reason, this issue was moved to version 3.1.

You can try this temporary solution:

public class MyBundleContributor : BundleContributor
{
    public override void ConfigureBundle(BundleConfigurationContext context)
    {
        context.Files.Add("/_content/Volo.Abp.AspNetCore.Components.Web.LeptonXTheme/side-menu/css/layout-bundle.css");
        context.Files.Add("/_content/Volo.Abp.AspNetCore.Components.Web.LeptonXTheme/side-menu/css/abp-bundle.css");
        context.Files.Add("/_content/Volo.Abp.AspNetCore.Components.Web.LeptonXTheme/side-menu/css/blazor-bundle.css");
        context.Files.Add("/_content/Volo.Abp.AspNetCore.Components.Web.LeptonXTheme/side-menu/css/font-bundle.css");
        context.Files.Add("/_content/Volo.Abp.AspNetCore.Components.Web.LeptonXTheme/side-menu/css/bootstrap-light.css");
        context.Files.Add("/_content/Volo.Abp.AspNetCore.Components.Web.LeptonXTheme/side-menu/css/light.css");
    }
}

Configure<AbpBundlingOptions>(options =>
{
    options.StyleBundles.Configure(
        BlazorLeptonXThemeBundles.Styles.Global,
        bundle =>
        {
            bundle.AddContributors(new MyBundleContributor());
        }
    );
});

Hi,

Will it work if you install the StackExchange.Redis version 2.7.4 to the HttpApi.Host project?

Hi,

Thanks, we will consider it in the next version. your ticket was refunded.

Hi,

I'm available now.

Hi,

Yes, you shouldn't validate on the Dto.

We recommend validating on domain service: https://docs.abp.io/en/abp/latest/Domain-Services#application-services-vs-domain-services

Showing 2971 to 2980 of 6693 entries
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.1.0-preview. Updated on December 17, 2025, 07:08
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.