backporting imediaservice changes

This commit is contained in:
Shannon
2013-12-16 16:04:37 +11:00
parent 0f25029ff6
commit af86a5d7b1
2 changed files with 16 additions and 1 deletions

View File

@@ -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.

View File

@@ -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>