Hi,
Thanks for the response, I'm getting Module name: app is invalid
executing it inside my wpf root folder or on the host folder. There's no update after executing abp generate-proxy -t csharp -u https://localhost:44361/
.
Hi,
I found out that I sort the wrong field, the Name
sorting is causing the issue. The data I have has multiple products that has the same Name
, so for example I have 5 names which is "A A" then query with
{"skip": 0, "limit": 1, "sort": { "Name": 1 }}
{"skip": 1, "limit": 1, "sort": { "Name": 1 }}
{"skip": 2, "limit": 1, "sort": { "Name": 1 }}
will show the same result which if queried by sort of Name
.
So instead I used the CreationTime
field to sort.
Hi,
We will check it.
Hi,
How's it going on?
hi
Add
MyMultiTenantConnectionStringResolver
to yourCMVPoint.IdentityService.MongoDB
project, I will fix this in 5.3 patch version.using System; using System.Threading.Tasks; using Microsoft.Extensions.Options; using Volo.Abp.Data; using Volo.Abp.DependencyInjection; using Volo.Abp.MultiTenancy; namespace CMVPoint.IdentityService.MongoDb; [Dependency(ReplaceServices = true)] public class MyMultiTenantConnectionStringResolver : MultiTenantConnectionStringResolver { public MyMultiTenantConnectionStringResolver( IOptionsMonitor<AbpDbConnectionOptions> options, ICurrentTenant currentTenant, IServiceProvider serviceProvider) : base(options, currentTenant, serviceProvider) { } public override Task<string> ResolveAsync(string connectionStringName = null) { if (connectionStringName == "Volo.Abp.Identity.MongoDB.IdentityProMongoDbContext") { return base.ResolveAsync("AbpIdentity"); } return base.ResolveAsync(connectionStringName); } public override string Resolve(string connectionStringName = null) { if (connectionStringName == "Volo.Abp.Identity.MongoDB.IdentityProMongoDbContext") { return base.Resolve("AbpIdentity"); } return base.Resolve(connectionStringName); } }
Hi, thanks issue has been resolved.
hi
Can you share the source code with me? liming.ma@volosoft.com
I invited you to a private github repo.
On Identity Mongo interface:
public interface IIdentityProMongoDbContext : IAbpIdentityMongoDbContext, IAbpMongoDbContext
{
}
public interface IAbpIdentityMongoDbContext : IAbpMongoDbContext
{
IMongoCollection<IdentityUser> Users { get; }
IMongoCollection<IdentityRole> Roles { get; }
IMongoCollection<IdentityClaimType> ClaimTypes { get; }
IMongoCollection<OrganizationUnit> OrganizationUnits { get; }
IMongoCollection<IdentitySecurityLog> SecurityLogs { get; }
IMongoCollection<IdentityLinkUser> LinkUsers { get; }
}
Identity Efcore Interface
public interface IIdentityServerDbContext : IEfCoreDbContext
{
#region ApiResource
DbSet<ApiResource> ApiResources { get; }
DbSet<ApiResourceSecret> ApiResourceSecrets { get; }
DbSet<ApiResourceClaim> ApiResourceClaims { get; }
DbSet<ApiResourceScope> ApiResourceScopes { get; }
DbSet<ApiResourceProperty> ApiResourceProperties { get; }
#endregion
#region ApiScope
DbSet<ApiScope> ApiScopes { get; }
DbSet<ApiScopeClaim> ApiScopeClaims { get; }
DbSet<ApiScopeProperty> ApiScopeProperties { get; }
#endregion
#region IdentityResource
DbSet<IdentityResource> IdentityResources { get; }
DbSet<IdentityResourceClaim> IdentityClaims { get; }
DbSet<IdentityResourceProperty> IdentityResourceProperties { get; }
#endregion
#region Client
DbSet<Client> Clients { get; }
DbSet<ClientGrantType> ClientGrantTypes { get; }
DbSet<ClientRedirectUri> ClientRedirectUris { get; }
DbSet<ClientPostLogoutRedirectUri> ClientPostLogoutRedirectUris { get; }
DbSet<ClientScope> ClientScopes { get; }
DbSet<ClientSecret> ClientSecrets { get; }
DbSet<ClientClaim> ClientClaims { get; }
DbSet<ClientIdPRestriction> ClientIdPRestrictions { get; }
DbSet<ClientCorsOrigin> ClientCorsOrigins { get; }
DbSet<ClientProperty> ClientProperties { get; }
#endregion
DbSet<PersistedGrant> PersistedGrants { get; }
DbSet<DeviceFlowCodes> DeviceFlowCodes { get; }
}
Why are some of those collections missing on the mongo interface?
For example the IdentityService: *.MongoDb based from your example:
//using ...
namespace ProjectName.IdentityService.MongoDb;
[ConnectionStringName(IdentityServiceDbProperties.ConnectionStringName)]
public class IdentityServiceDbContext : AbpMongoDbContext,
IIdentityServiceDbContext,
IIdentityProMongoDbContext,
IAbpIdentityServerMongoDbContext
{
public IMongoCollection<IdentityUser> Users { get; }
public IMongoCollection<IdentityRole> Roles { get; }
public IMongoCollection<IdentityClaimType> ClaimTypes { get; }
public IMongoCollection<OrganizationUnit> OrganizationUnits { get; }
public IMongoCollection<IdentitySecurityLog> SecurityLogs { get; }
public IMongoCollection<IdentityLinkUser> LinkUsers { get; }
public IMongoCollection<ApiResource> ApiResources { get; }
public IMongoCollection<ApiScope> ApiScopes { get; }
public IMongoCollection<Client> Clients { get; }
public IMongoCollection<IdentityResource> IdentityResources { get; }
public IMongoCollection<PersistedGrant> PersistedGrants { get; }
public IMongoCollection<DeviceFlowCodes> DeviceFlowCodes { get; }
//Create Model
}
On EFCore:
//using ...
namespace ProjectName.IdentityService.EntityFramework;
[ConnectionStringName(IdentityServiceDbProperties.ConnectionStringName)]
public class IdentityServiceDbContext : AbpDbContext<IdentityServiceDbContext>, IIdentityDbContext, IIdentityServerDbContext
{
public DbSet<IdentityUser> Users { get; set; }
public DbSet<IdentityRole> Roles { get; set; }
public DbSet<IdentityClaimType> ClaimTypes { get; set; }
public DbSet<OrganizationUnit> OrganizationUnits { get; set; }
public DbSet<IdentitySecurityLog> SecurityLogs { get; set; }
public DbSet<IdentityLinkUser> LinkUsers { get; set; }
public DbSet<ApiResource> ApiResources { get; set; }
public DbSet<ApiResourceSecret> ApiResourceSecrets { get; set; }
public DbSet<ApiResourceClaim> ApiResourceClaims { get; set; }
public DbSet<ApiResourceScope> ApiResourceScopes { get; set; }
public DbSet<ApiResourceProperty> ApiResourceProperties { get; set; }
public DbSet<ApiScope> ApiScopes { get; set; }
public DbSet<ApiScopeClaim> ApiScopeClaims { get; set; }
public DbSet<ApiScopeProperty> ApiScopeProperties { get; set; }
public DbSet<IdentityResource> IdentityResources { get; set; }
public DbSet<IdentityResourceClaim> IdentityClaims { get; set; }
public DbSet<IdentityResourceProperty> IdentityResourceProperties { get; set; }
public DbSet<Client> Clients { get; set; }
public DbSet<ClientGrantType> ClientGrantTypes { get; set; }
public DbSet<ClientRedirectUri> ClientRedirectUris { get; set; }
public DbSet<ClientPostLogoutRedirectUri> ClientPostLogoutRedirectUris { get; set; }
public DbSet<ClientScope> ClientScopes { get; set; }
public DbSet<ClientSecret> ClientSecrets { get; set; }
public DbSet<ClientClaim> ClientClaims { get; set; }
public DbSet<ClientIdPRestriction> ClientIdPRestrictions { get; set; }
public DbSet<ClientCorsOrigin> ClientCorsOrigins { get; set; }
public DbSet<ClientProperty> ClientProperties { get; set; }
public DbSet<PersistedGrant> PersistedGrants { get; set; }
public DbSet<DeviceFlowCodes> DeviceFlowCodes { get; set; }
// Constructor
// OnModelCreating
}
You can see there are collections that are not on the mongodbcontext. I can't seem to find interface for mongo that has the same required collections from Volo.Abp.IdentityServer.EntityFrameworkCore.IIdentityServerDbContext
One more related question, why do there are some collections missing on mongodb interface over efcore? e.g. IPaymentDbContext
has DbSet<GatewayPlan> GatewayPlans { get; }
but GatewayPlans
mongo collection is not present on IPaymentMongoDbContext
?
Same with some interface collections on IdentityServiceDbContext
over IdentityServiceDbContext
.