Activities of "riley.trevillion"

@muhammedaltug I have been able to solve the problem using your provided code sample. Thank you!

Check the docs before asking a question: https://docs.abp.io/en/commercial/latest/ Check the samples, to see the basic tasks: https://docs.abp.io/en/commercial/latest/samples/index The exact solution to your question may have been answered before, please use the search on the homepage.

If you're creating a bug/problem report, please include followings:

  • ABP Framework version: v5.2.2
  • UI type: Angular
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no

Hello

I have been developing dynamic theming functionality for our application so that tenants can select their own colour schemes, logo and background images at runtime with only minimal Lepton Theme sourcecode integration to achieve it (allowing for easier Abp Framework version upgrades). I've been weighing up whether to write a community article sharing how it can be done (time permitting!). To give a brief summary of how it works -

  • Certain Lepton Theme styles / colours have been overriden with CSS var() values to allow changing of colours are runtime (not build time)
  • These var() values are set on application startup during the APP_INITIALIZE phase of the Angular client from a custom branding endpoint I have set up on the server side
  • The Identity Server login / registration / confirmation etc etc pages utilise the Javascript API functionality to call this endpoint as well to set the var() values for the server side
  • The var() values are stored as settings strings (HEX format) using the built in ABP setting management functionality
  • The app is multi tenant so that when the tenant is swapped, the branding values specific to the tenant are loaded and applied in realtime

Everything works really well and is close to feature completeness, but there is one issue presenting 'bug-like' behaviour that I would like to resolve before calling it 100% complete.

When a users swaps to a different tenant on an Identity Server page, the new tenants branding is loaded and all the colours update correctly. When you log in and are redirected back to the Angular client, the Angular client will be loaded with the previous tenants branding information instead of the new tenant.

It appears as though the branding information is being retrieved before the tenant cookie is being updated to use the new tenant id on the Angular side. If I refresh the page, the correct branding is loaded as the tenant cookie is now set with the new tenant id.

Is there a way within the APP_INITIALIZE phase to have the tenant cookie update first before my branding loading function is called? I don't know how to define this kind of relationship during app startup.

I have attached screenshots that I hope will clarify the issue

Old tenant id sent to branding endpoint

New tenant id requested after branding request in APP_INITIALIZE

Thankyou

@albert @hikalkan

I see. Thankyou for clarifying what needs to be done. It is a shame that I can't define a navigation property on the IdentityUser entity given how much it would simplify things. Perhaps it could be a future feature or enhancement? Nevertheless, I have manually created the joining entity based on the code provided to solve my problem.

Thankyou again

Hi @albert

I've generated a sample TestEntity -> IdentityUser many to many relationship using the latest version of ABP Suite (5.2) and observed the outputed code. It appears to be setting up the relationship using the more traditional method of manually defining the joining entity, joining properties, database configuration etc.

EFCore 6 allows us to define many to many relationships between 2 entities directly in Fluent API without needing to manually define all the boilerplate code that the ABP Suite is creating to faciliate a many to many relationship. For reference please see Microsoft documentation here

  • https://docs.microsoft.com/en-us/ef/core/modeling/relationships?tabs=fluent-api%2Cfluent-api-simple-key%2Csimple-key#many-to-many

In my situation the ABP Suite generated code in the screenshot above would simply be a 'HasMany()' -> 'WithMany()' definition i.e 2-3 lines of code without needing any joining entity defined. I'm trying to utilise this by defining the joins like you can see in this Microsoft documentation link and in the screenshots in my comment when first opening this issue.

  • https://docs.microsoft.com/en-us/ef/core/modeling/relationships?tabs=fluent-api%2Cfluent-api-simple-key%2Csimple-key#join-entity-type-configuration

The error when defining the join property using the EfCoreEntityExtensionMappings feature on the IdentityUser entity is what appears to be causing my issue.

I'd like to not have to manually define the join entities and all the boilerplate that goes with that when there's a supported feature of EFCore 6 that lets us do many to many in a very simple and clean way.

Additionally (and quite importantly for our requirements), using the ABP Suite to generate the code doesn't seem to allow me to pull a list of users out the database and access the associated entities on the join property (TestEntities) as it doesn't exist in this implementation. The way I'm trying to do it (theoretically) should allow me to do this.

Should EfCoreEntityExtensionMappings support the ability to define a navigation property on IdentityUser (i.e my issue is a bug), or is this an enhancement that could be made to support this?

Thankyou

The service bot automatically closed this issue. Bumping to reopen it.

Has there been any further progress on this one since last week?

Thankyou

Hello

Just checking in to see if there are any updates on this one?

Thankyou

  • ABP Framework version: v5.2.0
  • UI type: Angular
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no

Hi

I'm attempting to add a many-to-many relationship between my aggregate root and the built in IdentityUser class using the EF Core Fluent API. I'm am having trouble defining this relationship.

Once the relationship is defined it is my intention to be able to pull a user out of the database and '.Include()' the navigation property defined on the IdentityUser to get a list of ActivityInstances they are part of (and vice versa).

Could you please advise on what I am doing wrong and whether I need to approach this differently to have a many-to-many with IdentityUser or whether this is a bug and that I should be able to reference the navigation property defined via the EntityExtensionMapping in the Fluent API?

ActivityInstance (my aggregate root)

  • AssociatedBookings is the navigation property

SchedulerEfCoreEntityExtensionMappings

  • This is to add the navigation property to the IdentityUser
  • The const string value is "AssociatedInstances"

SchedulerDbContextModelCreatingExtensions

  • The configuration block gives me an error (see screenshot) if I attempt to configure the relationship with a string value

  • I am unable to select the property defined in the SchedulerEfCoreEntityExtensionMappings file if I attempt to use the typical lambda method of selecting the property instead

My understanding is that EF Core will automatically produce the joining table with the appropriate foreign keys configured. This works as intended with other many-to-many relationships I have defined between my other entities where I have direct control over the navigation properties defined in those classes as shown here

I'm aware that the property definition in the SchedulerEfCoreEntityExtensionMappings file might interfer with how EF Core automatically configures the joining table with the appropriate foreign keys but I'm not sure.

Thankyou

Check the docs before asking a question: https://docs.abp.io/en/commercial/latest/ Check the samples, to see the basic tasks: https://docs.abp.io/en/commercial/latest/samples/index The exact solution to your question may have been answered before, please use the search on the homepage.

If you're creating a bug/problem report, please include followings:

  • ABP Framework version: v4.4.3
  • UI type: Angular
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no
  • Exception message and stack trace:
  • Steps to reproduce the issue:"

<br> Hello I was taking a look at integrating the commercial Forms Module (https://commercial.abp.io/modules/Volo.Forms) into my application but I saw it was only supported in the MVC UI framework and not Angular. <br>

  1. Is there a roadmap or ETA available as to when the Forms Module will support Angular?
  2. Could we install the forms module on the server side (which I assume would set up the database tables and services) and build the Angular UI components ourselves to connect to the module endpoints?
    1. Do you see any problems with this or issues that we may encounter?
    2. Are there any things we need to consider when building the Angular components that might trip us up?
    3. Do you know of a better approach or pattern we could use instead if this isn't the right approach?

Thank you

@albert

Yes, all of our clients are currently on 4.3.X

If the fix is small, perhaps I can apply it manually until we schedule the work in to perform the upgrades to 4.4.X

What do you think?

Hi @albert

Are you able to tell me which of the releases the fix will be available in? 4.3-patch, 4.4-patch or 5.0?

Thankyou

Showing 1 to 10 of 34 entries
Made with ❤️ on ABP v9.1.0-preview. Updated on December 26, 2024, 06:07