"cala" की गतिविधियाँ

उत्तर

main project - Pages/Test.razor

@page "/test"

<h3>Test</h3>

@code {
	private Lazy<IJSObjectReference> _module = new();
	private Lazy<IJSObjectReference> _moduleInstance = new();
	private DotNetObjectReference<Test>? _reference;
	
	[Inject]
	private IJSRuntime _js { get; set; } = null!;

	protected override async Task OnAfterRenderAsync( bool firstRender )
	{
		if( !firstRender )
		{
			return;
		}
		
		IJSObjectReference jsModule = await _js.InvokeAsync<IJSObjectReference>( "import", "./Pages/Test.razor.js" );
		_reference      = DotNetObjectReference.Create( this );
		_module         = new Lazy<IJSObjectReference>( jsModule );
		_moduleInstance = new Lazy<IJSObjectReference>( await _module.Value.InvokeAsync<IJSObjectReference>( "GetExample" ) );
	}
}

main project - Pages/Test.razor.js

class Example
{
	
}

let instance = new Example();

export function GetExample()
{
	return instance;
}

module project - Pages/ModuleTest.razor

@page "/module/test"

@using Microsoft.JSInterop

<h3>Test</h3>

@code {
	private Lazy<IJSObjectReference> _module = new();
	private Lazy<IJSObjectReference> _moduleInstance = new();
	private DotNetObjectReference<ModuleTest>? _reference;
	
	[Inject]
	private IJSRuntime _js { get; set; } = null!;

	protected override async Task OnAfterRenderAsync( bool firstRender )
	{
		if( !firstRender )
		{
			return;
		}
		
		IJSObjectReference jsModule = await _js.InvokeAsync<IJSObjectReference>( "import", "./Pages/ModuleTest.razor.js" );
		_reference      = DotNetObjectReference.Create( this );
		_module         = new Lazy<IJSObjectReference>( jsModule );
		_moduleInstance = new Lazy<IJSObjectReference>( await _module.Value.InvokeAsync<IJSObjectReference>( "GetExample" ) );
	}
}

module project - Pages/ModuleTest.razor.js

class Example
{
	
}

let instance = new Example();

export function GetExample()
{
	return instance;
}
सवाल

Javascript isolation works very well ( in main/base project ) - but we cant get it to work in modules. it looks like the file is not copied to wwwroot ( this works automaticly for main/base project ) ( ref microsoft )

  • ABP Framework version: v6.0.1
  • UI type: Blazor
उत्तर

ok, thanks

उत्तर

Blazor (server) - project was created with suite 6.0.0

उत्तर

oh, we didnt enabled it for the host :/ makes sense that it doesnt show up.

but it looks like one localization is missing ( v6.0.1 ):

Hi, we would like to test LDAP authentification but it looks like there is no LDAP tab in the Identity Management settings anymore

is your documentation still correct for OpenIddict ? https://docs.abp.io/en/commercial/latest/modules/identity/ldap

उत्तर

i belive there are two bugs that should be fixed:

  1. AddDefaultRepository on an entity which is part of an context with ReplaceDbContext prevents this entity from being part of the target context
  2. injected default repositories like IReadOnlyRepository in application services for entities with IMultiTenant get the host context instead of the tenant context when they do not have a custom repository
उत्तर

Found the last problem: you need a custom repository, it looks like MultiTenant doesnt work with default genrated repository

With custom repository and multi-tenant, all entities are on the same context, finally.

उत्तर

Found one problem: options.AddDefaultRepository<TEntity> prevents ReplaceDbContext to work But ExampleEntity still in host context and user in tenant context

उत्तर

im not sure what you mean.

So how do i get both entities in the same context ? I thought that is the purpose of ReplaceDbContext ( tried to add IMultiTenant to exampleEntity, but same result )

58 प्रविष्टियों में 31 से 40 दिखा रहा है
Made with ❤️ on ABP v8.2.0-preview Updated on मार्च 25, 2024, 15:11