Base solution for your next web application

Activities of "PhilWynn"

Prerequisites

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

  • v4.0
  • MVC
  • .Net

If issue related with ABP Framework

  • 5.14

Hi, I have recently upgraded from ABP v4.3 to v5.14. I am now finding that I am getting the following discrepencies on GetHashCode for my Enity objects:

` // 10171594 var empdet = (await _employeeDetailManager.EmployeeDetails.SingleAsync(e => e.Id == 42)).GetHashCode();

// 59790523 var empdet5 = (await _employeeDetailManager .EmployeeDetails .AsNoTracking() .FirstAsync(e => e.Id == 42)).GetHashCode();

` This is causing me many issues, as it has broken all code that performs comarrisons between entities. All my entities inherit from base class FullAuditedEntity

Please can you advise as to why I am not getting consistent hash codes, and what I can do to rectify this..?

Many thanks

Answer

Thank you.

Can you point me in the direction of any documentation that would help me to implement a custom filter for this purpose. I have found a link for adding a custom data filter in Entity Framework Core, but we are using EF6.

Many thanks

Question

Prerequisites

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

  • What is your product version? v4
  • What is your product type MVC
  • What is product framework type .net framework

If issue related with ABP Framework

  • What is ABP Framework version? v5.14

Hi,

We have a requirement for a "Provider" user to be able to access a sub-set of tenancies. We would configure the included tenancies via the Host user.

Is there any support for this arrangement in ASP.net Zero? If not, do you have any recommendations as to how I could best go about achieving this?

Many thanks.

@peopleteq

Sorry, I have no solution to offer. I refactored my code so that I no longer needed to perform db access within module initialisation.

However, there was never an issue with this, just an unwanted warning message.

Phil

Hi,

I have re-structured my code and this is no longer an issue.

Thank you for your help

Hi,

I had already tried it that way. Unfortunately still the same result.

Hi,

I have modified my code as follows:

public IEnumerable<IdpConfiguration> GetAllActiveIdps()
        {
            using (UnitOfWorkManager.Begin(new UnitOfWorkOptions {IsTransactional = false}))
            {
                UnitOfWorkManager.Current.SetTenantId(null);

                return IdpConfigurations.AsNoTracking().Where(idp => idp.IsActive).ToList();
            }
        }

However I am still getting the following warnings (3 warnings everytime the method executes):

System.Web.HttpException (0x80004005): Request is not available in this context at System.Web.HttpContext.get_Request() at Abp.Web.MultiTenancy.DomainTenantResolveContributor.ResolveTenantId() in D:\Github\aspnetboilerplate\src\Abp.Web\Web\MultiTenancy\DomainTenantResolveContributor.cs:line 34 at Abp.MultiTenancy.TenantResolver.GetTenantIdFromContributors() in D:\Github\aspnetboilerplate\src\Abp\MultiTenancy\TenantResolver.cs:line 75

Note that I am running ABP v4.5

Hi,

Sorry, but this does not answer my question.

Because I am querying in module code, there is no UOW currently running, hence the need for me to call:

using (UnitOfWorkManager.Begin(new UnitOfWorkOptions {IsTransactional = false})){
..
}

The query is on the Host data, so no switching to a tenancy is required.

My questions are:

Is it acceptable to code in this way (i.e. querying from the module code)? How can I rid myself of the warning I am getting (the warning appears 3 times when the GetAllIdps method runs)

Thank you

Hi,

I have a requirement to perform a database query withing the web module. I have implemented this within PostInitialize as follows:

    public override void PostInitialize()
   {
            ...
            
            var idpConfigurationManager = IocManager.Resolve<IdpConfigurationManager>();

            var idps = idpConfigurationManager.GetAllIdps();
            ...
            
   }
        
    public class IdpConfigurationManager : IppexCloudDomainServiceBase
    {
        private readonly IRepository<IdpConfiguration> _idpConfigRepository;

        public IdpConfigurationManager(IRepository<IdpConfiguration> idpConfigRepository)
        {
            _idpConfigRepository = idpConfigRepository;
        }

        public IQueryable<IdpConfiguration> IdpConfigurations => _idpConfigRepository.GetAll();

        public IEnumerable<IdpConfiguration> GetAllIdps()
        {
            using (UnitOfWorkManager.Begin(new UnitOfWorkOptions {IsTransactional = false}))
            {
                    return IdpConfigurations.AsNoTracking().ToList();
            }
        }
    }
}
        

The code is working, however I am getting the following warning logged:

System.Web.HttpException (0x80004005): Request is not available in this context at System.Web.HttpContext.get_Request() at Abp.Web.MultiTenancy.HttpCookieTenantResolveContributor.ResolveTenantId() in D:\Github\aspnetboilerplate\src\Abp.Web\Web\MultiTenancy\HttpCookieTenantResolveContributor.cs:line 20 at Abp.MultiTenancy.TenantResolver.GetTenantIdFromContributors() in D:\Github\aspnetboilerplate\src\Abp\MultiTenancy\TenantResolver.cs:line 75

Please could you advise me as to whether or not this is an acceptible approach, and how to rid myself of the warning.

I am using Aspnet Zero MVC with ABP v4.5.0

Many thanks

Question

Hi,

I have a requirement to add SSO SAML2 support to my Aspnet Zero application. I am running the MVC5 version.

I have decided to go with the Api provided by Sustainsys.Saml2 (formerly Kentor).

I have imported the library and set it up to run via the OWIN pipeline. This is easily done with the following line of code in StartUp:

app.UseSaml2Authentication(new Saml2AuthenticationOptions(true));

The return URL is set to AccountController.ExternalLoginCallback. I have the following code:

            // returns null
            var loginInfo = await _authenticationManager.GetExternalLoginInfoAsync();

            if (User.Identity.IsAuthenticated)
            {
                // returns valid claims
                var claims = ClaimsPrincipal.Current.Claims;
            }

What I am finding is that the authentication succeeds. I am getting a user identity and claims are coming across from the Identity Provider.

The problem is that the call to GetExternalLoginInfoAsync returns NULL, and I am therefore unable to sign the user in.

I am assuming that further work is required in plumbing the authenticated user into the pipeline. Please could you provide some assistance as to how I can proceed.

Many thanks.

Showing 11 to 20 of 111 entries