Base solution for your next web application

Activities of "daws"

  • What is your product version? 10.3
  • What is your product type (Angular or MVC)? Angular
  • What is product framework type (.net framework or .net core)? ?Net Core
  • What is ABP Framework version? 6.3.1

Hi,

I want to embed my angular aspnetzero application in an iframe on a customer website. To be able for them to access the data, I match my angular routes with tenant and language parameters. Example here

If you open the console, you see the tenancy and language (parsed from the url) and the user id (a public user is automatically created and logged in to store user preferences).

However, when I embed this page in an iframe on a website which is on a different URL, I can't get the user id with SessionService or abp.session.userId. Without a user id, my code will keep trying to login a new public user and reload the page in an infinite loop.

How can I get the user id when the page is embedded in an iframe ?

Ok thank you. Your 2nd solution works...except for the language.

How can I also set the language in the session ?

So in the frontend I'm replacing this code :

        abp.utils.setCookieValue(
            'Abp.Localization.CultureName',
            language.name,
            new Date(new Date().getTime() + 5 * 365 * 86400000), // 5 year
            abp.appPath
        );

by this :

localStorage.setItem('Abp.Localization.CultureName', language);

But then, I can't find where the language is retrieved. I tried to change request headers in AppPreBootstrap but it didn't work.

Shall I change the backend culture provider ? If yes how so ?

Seems to work fine. Thank you very much !

.net core, angular, aspnetzero 8.8

We have a full audited entity :

[Audited]
public class MyEntity : FullAuditedEntity<short>, IExtendableObject, IPassivable, IValidityRange

When we load it like this in a manager :

[UnitOfWork]
public async Task<List<MyEntity>> GetAllActiveAsync(Expression<Func<MyEntity, bool>> predicate)
{
    return await _MyEntityRepository.GetAll().Where(x => x.IsActive).Where(predicate).ToListAsync();
}

Soft deleted entities are also loaded whereas they should not. We did not override GetAll in the repository.

We currently have a workaround but it's not clean :

public class MyDbContext : AbpZeroDbContext<Tenant, Role, User, MyDbContext>, IAbpPersistedGrantDbContext
{
    ...
    modelBuilder.Entity<MyEntity>().HasQueryFilter(p =>
        !p.IsDeleted
    );
}

How can we solve this ?

hi @ismcagdas,

Abp version is 6.3.1 (aspnetzero 8.8). We plan to migrate to anz 13.3 in september.

Hi there, since i have no time to produce a sample project, i will continue with my workaround.

thanks

Showing 121 to 126 of 126 entries