backporting imediaservice changes
This commit is contained in:
@@ -9,6 +9,8 @@ namespace Umbraco.Core.Services
|
||||
/// </summary>
|
||||
public interface IMediaService : IService
|
||||
{
|
||||
IEnumerable<IMedia> GetByIds(IEnumerable<int> ids);
|
||||
|
||||
/// <summary>
|
||||
/// Creates an <see cref="IMedia"/> object using the alias of the <see cref="IMediaType"/>
|
||||
/// that this Media should based on.
|
||||
@@ -193,7 +195,7 @@ namespace Umbraco.Core.Services
|
||||
/// </summary>
|
||||
/// <param name="mediaPath">Path of the media item to retreive (for example: /media/1024/koala_403x328.jpg)</param>
|
||||
/// <returns><see cref="IMedia"/></returns>
|
||||
IMedia GetMediaByPath(string mediaPath);
|
||||
IMedia GetMediaByPath(string mediaPath);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a collection of <see cref="IMedia"/> objects, which are ancestors of the current media.
|
||||
|
||||
@@ -206,6 +206,19 @@ namespace Umbraco.Core.Services
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets an <see cref="IMedia"/> object by Id
|
||||
/// </summary>
|
||||
/// <param name="ids">Ids of the Media to retrieve</param>
|
||||
/// <returns><see cref="IMedia"/></returns>
|
||||
public IEnumerable<IMedia> GetByIds(IEnumerable<int> ids)
|
||||
{
|
||||
using (var repository = _repositoryFactory.CreateMediaRepository(_uowProvider.GetUnitOfWork()))
|
||||
{
|
||||
return repository.GetAll(ids.ToArray());
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets an <see cref="IMedia"/> object by its 'UniqueId'
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user