hi
This link comes from App:SelfUrl of appsettings.json
I'm not familiar with the AKS. You can check the configuration.
private void ConfigureUrls(IConfiguration configuration)
{
Configure<AppUrlOptions>(options =>
{
options.Applications["MVC"].RootUrl = configuration["App:SelfUrl"];
options.Applications["Angular"].RootUrl = configuration["App:AngularUrl"];
});
}```
hi
ID(guid)
It's the value of the primary key. You just need to store it in the Tenant_Admin Database and then query some entities based on it.
Microservice A, table: Customers , database: DB1 | Guid | Name | | --- | --- | | 3ce8f395-2f9b-4531-b02f-ae702c2f4dbf | C1 | | 886446c2-a5b1-4f3c-ac54-c81d02e5fe71 | C2 |
Microservice B, table: BusinessUnits , database: DB2 | BusinessUnits Guid | BusinessUnits Code | --- | --- | | bd749c47-d05f-4cd7-a705-a4c27dddfd07 | 00001 | | 8ce29410-6ed1-4fc7-910f-5046a311ce07 | 00002 |
Microservice B, table: BusinessUnitsAndCustomer , database: DB2 | Customers Guid | BusinessUnits Guid | --- | --- | | 3ce8f395-2f9b-4531-b02f-ae702c2f4dbf | bd749c47-d05f-4cd7-a705-a4c27dddfd07 | | 886446c2-a5b1-4f3c-ac54-c81d02e5fe71 | 8ce29410-6ed1-4fc7-910f-5046a311ce07 |
hi
Now, I want to read the custom setting in another microservice so I have created custom setting value provider in my another microservice and I registered value provider in app module.
You only need to add this to the administration microservice once.
I have registered custom setting definition and provider in AdministrationServiceApplicationModule
You can try to move this to Domain module layer.
hi
. I need a list of roles in my custom module.
If you want to get roles list in your module then you need add Identity module to your module. If you wan to get roles list inyour main project you don't need to do this.
hi zhongfang
Can you?
hi
https://docs.abp.io/en/abp/latest/Best-Practices/Module-Architecture
| Your Module | operator | Identity Module | | --- | --- | --- | .Application | Add reference & Depends on| Identity.Application | .Application.Contracts |Add reference & Depends on|Identity.Application.Contracts| .Domain | Add reference & Depends on| Identity.Domain| .Domain.Shared | Add reference & Depends on| Identity.Domain.Shared| .EntityFrameworkCore | Add reference & Depends on| Identity.EntityFrameworkCore| .HttpApi | Add reference & Depends on|Identity.HttpApi| .HttpApi.Client | Add reference & Depends on| Identity.HttpApi.Client| .Web | Add reference & Depends on| Identity.Web |
hi
https://github.com/abpframework/abp/issues/15816 https://github.com/abpframework/abp/issues/10568
hi
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddOpenIddict()
.AddCore(builder =>
{
builder
.AddApplicationStore<MyAbpOpenIddictApplicationStore>()
.AddAuthorizationStore<MyAbpOpenIddictAuthorizationStore>()
.AddTokenStore<MyAbpOpenIddictTokenStore>();
});
}
public class MyAbpOpenIddictApplicationStore : AbpOpenIddictApplicationStore
{
public MyAbpOpenIddictApplicationStore(IOpenIddictApplicationRepository repository,
IUnitOfWorkManager unitOfWorkManager, IOpenIddictTokenRepository tokenRepository, IGuidGenerator guidGenerator,
AbpOpenIddictIdentifierConverter identifierConverter,
IOpenIddictDbConcurrencyExceptionHandler concurrencyExceptionHandler) : base(repository, unitOfWorkManager,
tokenRepository, guidGenerator, identifierConverter, concurrencyExceptionHandler)
{
}
public async override ValueTask DeleteAsync(OpenIddictApplicationModel application, CancellationToken cancellationToken)
{
Check.NotNull(application, nameof(application));
try
{
using (var uow = UnitOfWorkManager.Begin(requiresNew: true, isTransactional: true, isolationLevel: IsolationLevel.ReadCommitted))
{
await TokenRepository.DeleteManyByApplicationIdAsync(application.Id, cancellationToken: cancellationToken);
await Repository.DeleteAsync(application.Id, cancellationToken: cancellationToken);
await uow.CompleteAsync(cancellationToken);
}
}
catch (AbpDbConcurrencyException e)
{
Logger.LogException(e);
await ConcurrencyExceptionHandler.HandleAsync(e);
throw new OpenIddictExceptions.ConcurrencyException(e.Message, e.InnerException);
}
}
}
public class MyAbpOpenIddictAuthorizationStore : AbpOpenIddictAuthorizationStore
{
public MyAbpOpenIddictAuthorizationStore(IOpenIddictAuthorizationRepository repository,
IUnitOfWorkManager unitOfWorkManager, IGuidGenerator guidGenerator,
IOpenIddictApplicationRepository applicationRepository, IOpenIddictTokenRepository tokenRepository,
AbpOpenIddictIdentifierConverter identifierConverter,
IOpenIddictDbConcurrencyExceptionHandler concurrencyExceptionHandler) : base(repository, unitOfWorkManager,
guidGenerator, applicationRepository, tokenRepository, identifierConverter, concurrencyExceptionHandler)
{
}
public async override ValueTask DeleteAsync(OpenIddictAuthorizationModel authorization, CancellationToken cancellationToken)
{
Check.NotNull(authorization, nameof(authorization));
try
{
using (var uow = UnitOfWorkManager.Begin(requiresNew: true, isTransactional: true, isolationLevel: IsolationLevel.ReadCommitted))
{
await TokenRepository.DeleteManyByAuthorizationIdAsync(authorization.Id, cancellationToken: cancellationToken);
await Repository.DeleteAsync(authorization.Id, cancellationToken: cancellationToken);
await uow.CompleteAsync(cancellationToken);
}
}
catch (AbpDbConcurrencyException e)
{
Logger.LogException(e);
await ConcurrencyExceptionHandler.HandleAsync(e);
throw new OpenIddictExceptions.ConcurrencyException(e.Message, e.InnerException);
}
}
public async override ValueTask<long> PruneAsync(DateTimeOffset threshold, CancellationToken cancellationToken)
{
using (var uow = UnitOfWorkManager.Begin(requiresNew: true, isTransactional: true, isolationLevel: IsolationLevel.ReadCommitted))
{
var date = threshold.UtcDateTime;
var count = await Repository.PruneAsync(date, cancellationToken: cancellationToken);
await uow.CompleteAsync(cancellationToken);
return count;
}
}
}
public class MyAbpOpenIddictTokenStore : AbpOpenIddictTokenStore
{
public MyAbpOpenIddictTokenStore(IOpenIddictTokenRepository repository, IUnitOfWorkManager unitOfWorkManager,
IGuidGenerator guidGenerator, IOpenIddictApplicationRepository applicationRepository,
IOpenIddictAuthorizationRepository authorizationRepository,
AbpOpenIddictIdentifierConverter identifierConverter,
IOpenIddictDbConcurrencyExceptionHandler concurrencyExceptionHandler) : base(repository, unitOfWorkManager,
guidGenerator, applicationRepository, authorizationRepository, identifierConverter, concurrencyExceptionHandler)
{
}
public async override ValueTask<long> PruneAsync(DateTimeOffset threshold, CancellationToken cancellationToken)
{
using (var uow = UnitOfWorkManager.Begin(requiresNew: true, isTransactional: true, isolationLevel: IsolationLevel.ReadCommitted))
{
var date = threshold.UtcDateTime;
var count = await Repository.PruneAsync(date, cancellationToken: cancellationToken);
await uow.CompleteAsync(cancellationToken);
return count;
}
}
}
hi
Can you try to remove the app.UseUnitOfWork(); from your asp net core pipeline?
hi
You can override these methods to use another IsolationLevel, I will make it configurable in the next version.
Your question credit has been refunded.