maliming 6 years ago
parent
commit
77ce57ce97
  1. 1
      modules/audit-logging/src/Volo.Abp.AuditLogging.EntityFrameworkCore/Volo/Abp/AuditLogging/AbpAuditLoggingEfCoreQueryableExtensions.cs
  2. 2
      modules/audit-logging/src/Volo.Abp.AuditLogging.EntityFrameworkCore/Volo/Abp/AuditLogging/EntityFrameworkCore/EfCoreAuditLogRepository.cs
  3. 10
      modules/identity/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/EfCoreIdentityUserRepository.cs
  4. 5
      modules/identity/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/IdentityEfCoreQueryableExtensions.cs
  5. 4
      modules/identityserver/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/AbpIdentityServerEfCoreQueryableExtensions.cs
  6. 3
      modules/identityserver/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/ApiResources/ApiResourceRepository.cs
  7. 1
      modules/identityserver/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/Clients/ClientRepository.cs

1
modules/audit-logging/src/Volo.Abp.AuditLogging.EntityFrameworkCore/Volo/Abp/AuditLogging/AbpAuditLoggingEfCoreQueryableExtensions.cs

@ -15,6 +15,7 @@ namespace Volo.Abp.AuditLogging
}
return queryable
.AsSplitQuery()
.Include(x => x.Actions)
.Include(x => x.EntityChanges).ThenInclude(ec=>ec.PropertyChanges);
}

2
modules/audit-logging/src/Volo.Abp.AuditLogging.EntityFrameworkCore/Volo/Abp/AuditLogging/EntityFrameworkCore/EfCoreAuditLogRepository.cs

@ -143,7 +143,7 @@ namespace Volo.Abp.AuditLogging.EntityFrameworkCore
public Task<EntityChange> GetEntityChange(Guid entityChangeId)
{
return DbContext.Set<EntityChange>().AsNoTracking().IncludeDetails().Where(x => x.Id == entityChangeId).FirstAsync();
return DbContext.Set<EntityChange>().AsNoTracking().IncludeDetails().OrderBy(x => x.Id).Where(x => x.Id == entityChangeId).FirstAsync();
}
public virtual async Task<List<EntityChange>> GetEntityChangeListAsync(

10
modules/identity/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/EfCoreIdentityUserRepository.cs

@ -26,6 +26,7 @@ namespace Volo.Abp.Identity.EntityFrameworkCore
{
return await DbSet
.IncludeDetails(includeDetails)
.OrderBy(x => x.NormalizedUserName)
.FirstOrDefaultAsync(
u => u.NormalizedUserName == normalizedUserName,
GetCancellationToken(cancellationToken)
@ -41,14 +42,14 @@ namespace Volo.Abp.Identity.EntityFrameworkCore
where userRole.UserId == id
select role.Name;
var organizationUnitIds = DbContext.Set<IdentityUserOrganizationUnit>().Where(q => q.UserId == id).Select(q => q.OrganizationUnitId).ToArray();
var organizationRoleIds = await (
from ouRole in DbContext.Set<OrganizationUnitRole>()
join ou in DbContext.Set<OrganizationUnit>() on ouRole.OrganizationUnitId equals ou.Id
join ou in DbContext.Set<OrganizationUnit>() on ouRole.OrganizationUnitId equals ou.Id
where organizationUnitIds.Contains(ouRole.OrganizationUnitId)
select ouRole.RoleId
).ToListAsync(GetCancellationToken(cancellationToken));
var orgUnitRoleNameQuery = DbContext.Roles.Where(r => organizationRoleIds.Contains(r.Id)).Select(n => n.Name);
var resultQuery = query.Union(orgUnitRoleNameQuery);
return await resultQuery.ToListAsync(GetCancellationToken(cancellationToken));
@ -60,7 +61,7 @@ namespace Volo.Abp.Identity.EntityFrameworkCore
{
var query = from userOu in DbContext.Set<IdentityUserOrganizationUnit>()
join roleOu in DbContext.Set<OrganizationUnitRole>() on userOu.OrganizationUnitId equals roleOu.OrganizationUnitId
join ou in DbContext.Set<OrganizationUnit>() on roleOu.OrganizationUnitId equals ou.Id
join ou in DbContext.Set<OrganizationUnit>() on roleOu.OrganizationUnitId equals ou.Id
join userOuRoles in DbContext.Roles on roleOu.RoleId equals userOuRoles.Id
where userOu.UserId == id
select userOuRoles.Name;
@ -89,6 +90,7 @@ namespace Volo.Abp.Identity.EntityFrameworkCore
{
return await DbSet
.IncludeDetails(includeDetails)
.OrderBy(x => x.NormalizedEmail)
.FirstOrDefaultAsync(u => u.NormalizedEmail == normalizedEmail, GetCancellationToken(cancellationToken));
}

5
modules/identity/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/IdentityEfCoreQueryableExtensions.cs

@ -1,4 +1,4 @@
using System.Linq;
using System.Linq;
using Microsoft.EntityFrameworkCore;
namespace Volo.Abp.Identity.EntityFrameworkCore
@ -13,6 +13,7 @@ namespace Volo.Abp.Identity.EntityFrameworkCore
}
return queryable
.AsSplitQuery()
.Include(x => x.Roles)
.Include(x => x.Logins)
.Include(x => x.Claims)
@ -42,4 +43,4 @@ namespace Volo.Abp.Identity.EntityFrameworkCore
.Include(x => x.Roles);
}
}
}
}

4
modules/identityserver/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/AbpIdentityServerEfCoreQueryableExtensions.cs

@ -16,6 +16,7 @@ namespace Volo.Abp.IdentityServer
}
return queryable
.AsSplitQuery()
.Include(x => x.Secrets)
.Include(x => x.UserClaims)
.Include(x => x.Scopes)
@ -41,6 +42,7 @@ namespace Volo.Abp.IdentityServer
}
return queryable
.AsSplitQuery()
.Include(x => x.AllowedGrantTypes)
.Include(x => x.RedirectUris)
.Include(x => x.PostLogoutRedirectUris)
@ -52,4 +54,4 @@ namespace Volo.Abp.IdentityServer
.Include(x => x.Properties);
}
}
}
}

3
modules/identityserver/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/ApiResources/ApiResourceRepository.cs

@ -26,6 +26,7 @@ namespace Volo.Abp.IdentityServer.ApiResources
{
var query = from apiResource in DbSet.IncludeDetails(includeDetails)
where apiResource.Name == name
orderby apiResource.Name
select apiResource;
return await query
@ -96,4 +97,4 @@ namespace Volo.Abp.IdentityServer.ApiResources
return GetQueryable().IncludeDetails();
}
}
}
}

1
modules/identityserver/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/Clients/ClientRepository.cs

@ -25,6 +25,7 @@ namespace Volo.Abp.IdentityServer.Clients
{
return await DbSet
.IncludeDetails(includeDetails)
.OrderBy(x => x.ClientId)
.FirstOrDefaultAsync(x => x.ClientId == clientId, GetCancellationToken(cancellationToken));
}

Loading…
Cancel
Save