mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
#20728: Optimizing query.
This commit is contained in:
@@ -53,6 +53,8 @@ namespace Orchard.MediaLibrary.Services {
|
||||
public IEnumerable<MediaPart> GetMediaContentItems(string folderPath, int skip, int count, string order, string mediaType, VersionOptions versionOptions = null) {
|
||||
var query = _orchardServices.ContentManager.Query<MediaPart>(versionOptions);
|
||||
|
||||
query = query.Join<MediaPartRecord>();
|
||||
|
||||
if (!String.IsNullOrEmpty(mediaType)) {
|
||||
query = query.ForType(new[] { mediaType });
|
||||
}
|
||||
@@ -95,6 +97,8 @@ namespace Orchard.MediaLibrary.Services {
|
||||
public int GetMediaContentItemsCount(string folderPath, string mediaType, VersionOptions versionOptions = null) {
|
||||
var query = _orchardServices.ContentManager.Query<MediaPart>(versionOptions);
|
||||
|
||||
query = query.Join<MediaPartRecord>();
|
||||
|
||||
if (!String.IsNullOrEmpty(mediaType)) {
|
||||
query = query.ForType(new[] { mediaType });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user