34 lines
1018 B
C#
34 lines
1018 B
C#
using Core.Blueprint.DAL.Infrastructure.Contracts;
|
|
using Core.Blueprint.Domain.Dtos;
|
|
|
|
namespace Core.Blueprint.DAL.Infrastructure.Repository
|
|
{
|
|
public class SampleImageRepository : ISampleImageRepository
|
|
{
|
|
private readonly IProxyBlobStorage _proxyBlobStorage;
|
|
public SampleImageRepository(IProxyBlobStorage proxyBlobStorage)
|
|
{
|
|
_proxyBlobStorage = proxyBlobStorage;
|
|
}
|
|
|
|
public async IAsyncEnumerable<ImageUrlDto> GetAllImagesUrls()
|
|
{
|
|
await using (var images = _proxyBlobStorage.ListAllItemsAsync().GetAsyncEnumerator())
|
|
{
|
|
await images.MoveNextAsync();
|
|
yield return images.Current;
|
|
}
|
|
}
|
|
|
|
public async Task<ImageUrlDto> GetFirstImageUrl()
|
|
{
|
|
return await _proxyBlobStorage.GetFirstImageUrlAsync();
|
|
}
|
|
|
|
public async Task<ImageUrlDto> GetUploadUrl()
|
|
{
|
|
return await _proxyBlobStorage.GetUploadUrl();
|
|
}
|
|
}
|
|
}
|