Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC

Activities of "SorenRomer"

We are at the latest version of AspNetZero and I am having trouble adding Ukrainian as a language for localization in the solution.

I have followed this guide (and successfully added other languages): https://aspnetboilerplate.com/Pages/Documents/Zero/Language-Management

I get this error when I try to select the language to be used:

Prerequisites

  • What is your product version? V11.0.0
  • What is your product type (Angular or MVC)? Angular
  • What is product framework type (.net framework or .net core)? .Net 6

If issue is about UI

I get this error message when I run npm run publish after I have updated to ANZ V11 from 10.5.0

If I upgrade Angular manually to 13.2.2 (latest) I get this error:

Is there any way I can get more details on this error?

Prerequisites

  • What is your product version? 10.5.0
  • What is your product type (Angular or MVC)? Angular
  • What is product framework type (.net framework or .net core)? .Net 5

If issue related with ABP Framework

  • What is ABP Framework version? 6.5.0

If issue is about UI

  • Which theme are you using? Default

Question

After the latest update to Asp.Net Zero 10.5.0 some events (maybe lazyload events) are not fired when the angular solution is deployed to a environment. It works locally when running angular in debug on localhost.

It is not a backend issue because if I connect the debug localhost instance of angular to the deployed backend it works perfectly.

The example in question is the Tenant impersonation. (We did not make any changes to this. ) It uses the CommonLookupModal and I have put some console log statements to reveal how it is called:

When run locally the getRecords method is called twice upon opening the modal. When run on the environment the getRecords method are only called once with the event value being null.

Hope you have some suggestions

Prerequisites

Please answer the following questions before submitting an issue. YOU MAY DELETE THE PREREQUISITES SECTION.

  • 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

If issue related with ABP Framework

  • What is ABP Framework version?
    • 6.3

Multitenancy ENABLED

Question

I have a strange issue in the UserAppService class.

I have added a new custom property to the User class that needs to get set during update and creation of users. The issue is that in order to assign the right values for the custom property I need to get some data from the database created by the host. To avoid too much polution of the create and update user methods I have extracted the functionality to a private async method inside the UserAppService class.

While entering UpdateUserAsync() _unitOfWorkManager.Current.GetTenantId() returns the correct tenantId but after my private method is called the same statement returns null.

This is what I have done inside the private method: Attempt #1 Assuming tenant ID will be reset to AbpSession.GetTenantId() value after using is complete (it is not)

private async Task DoCustomStuffAsync(CreateOrUpdateUserInput input, User user)
{
    if(user.CustomProp == null)
        return;
        
     using (_unitOfWorkManager.Current.SetTenantId(null))
    {
        // Getting host data *** WORKS
    }
}

Attempt #2 forcing new UOW

private async Task DoCustomStuffAsync(CreateOrUpdateUserInput input, User user)
{
    if(user.CustomProp == null)
        return;
    
    using(var uow = _unitOfWorkManager.Begin())
    using (_unitOfWorkManager.Current.SetTenantId(null))
    {
        // Getting host data *** WORKS
        
        uow.Complete();
    }
}

Attempt #2 Forcing new transaction scope

private async Task DoCustomStuffAsync(CreateOrUpdateUserInput input, User user)
{
    if(user.CustomProp == null)
        return;
    
    using(var uow = _unitOfWorkManager.Begin(RequiresNew))
    using (_unitOfWorkManager.Current.SetTenantId(null))
    {
        // Getting host data *** WORKS
        
        uow.Complete();
    }
}

Attempt #3 Manual dispose of uow scope

private async Task DoCustomStuffAsync(CreateOrUpdateUserInput input, User user)
{
    if(user.CustomProp == null)
        return;
    
    using(_unitOfWorkManager.Begin())
    using (var uow = _unitOfWorkManager.Current.SetTenantId(null))
    {
        // Getting host data *** WORKS
        
        uow.Dispose(); //Should not be nessesary
    }
}

Attempt #4 Marking methods (and class) with UOW

[UnitOfWork]
public async Task UpdateUserAsync(....)

[UnitOfWork]
private async Task DoCustomStuffAsync(CreateOrUpdateUserInput input, User user)
{
    if(user.CustomProp == null)
        return;
    
    using (var uow = _unitOfWorkManager.Current.SetTenantId(null))
    {
        // Getting host data *** WORKS
    }
}

What am I doing wrong here? I can obviously set the tenantID again in the UpdateUserAsync method but that is not a good way IMO.

Best regards

Showing 1 to 4 of 4 entries