Skip to content

Commit

Permalink
Fixed types
Browse files Browse the repository at this point in the history
  • Loading branch information
strivitech committed Jan 10, 2022
1 parent 770a252 commit 3999e81
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -305,10 +305,10 @@ public async Task<OperationResult> UploadImageAsync(Guid entityId, IFormFile ima
public async Task<OperationResult> RemoveImageAsync(Guid entityId, string imageId) =>
await workshopImagesService.RemoveImageAsync(entityId, imageId).ConfigureAwait(false);

public async Task<MultipleKeyValueOperationResult> UploadManyImagesAsync(Guid entityId, List<IFormFile> images) =>
public async Task<MultipleKeyValueOperationResult> UploadManyImagesAsync(Guid entityId, IList<IFormFile> images) =>
await workshopImagesService.UploadManyImagesAsync(entityId, images).ConfigureAwait(false);

public async Task<MultipleKeyValueOperationResult> RemoveManyImagesAsync(Guid entityId, List<string> imageIds) =>
public async Task<MultipleKeyValueOperationResult> RemoveManyImagesAsync(Guid entityId, IList<string> imageIds) =>
await workshopImagesService.RemoveManyImagesAsync(entityId, imageIds).ConfigureAwait(false);

public async Task<ImageChangingResult> ChangeImagesAsync(WorkshopUpdateDto dto) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ public interface IImageInteractionService<in TKey>
/// <param name="entityId">Entity id.</param>
/// <param name="images">Represents an image file.</param>
/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="MultipleKeyValueOperationResult"/> of the operation.</returns>
Task<MultipleKeyValueOperationResult> UploadManyImagesAsync(TKey entityId, List<IFormFile> images);
Task<MultipleKeyValueOperationResult> UploadManyImagesAsync(TKey entityId, IList<IFormFile> images);

/// <summary>
/// Removes some images from the entity with a specific id.
/// </summary>
/// <param name="entityId">Entity id.</param>
/// <param name="imageIds">Represents an image file.</param>
/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="MultipleKeyValueOperationResult"/> of the operation.</returns>
Task<MultipleKeyValueOperationResult> RemoveManyImagesAsync(TKey entityId, List<string> imageIds);
Task<MultipleKeyValueOperationResult> RemoveManyImagesAsync(TKey entityId, IList<string> imageIds);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public interface IImageService
/// <typeparam name="TEntity">The entity you wanna validate image specs.</typeparam>
/// <param name="images">Contains images to upload.</param>
/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="ImageUploadingResult"/> of the operation.</returns>
Task<ImageUploadingResult> UploadManyImagesAsync<TEntity>(List<IFormFile> images);
Task<ImageUploadingResult> UploadManyImagesAsync<TEntity>(IList<IFormFile> images);

/// <summary>
/// Uploads the given image into a storage.
Expand All @@ -43,7 +43,7 @@ public interface IImageService
/// </summary>
/// <param name="imageIds">Image Ids.</param>
/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="ImageRemovingResult"/> of the operation.</returns>
Task<ImageRemovingResult> RemoveManyImagesAsync(List<string> imageIds);
Task<ImageRemovingResult> RemoveManyImagesAsync(IList<string> imageIds);

/// <summary>
/// Uploads the given image into a storage.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public async Task<Result<ImageDto>> GetByIdAsync(string imageId)
}

/// <inheritdoc/>
public async Task<ImageUploadingResult> UploadManyImagesAsync<TEntity>(List<IFormFile> images)
public async Task<ImageUploadingResult> UploadManyImagesAsync<TEntity>(IList<IFormFile> images)
{
if (images == null || images.Count <= 0)
{
Expand Down Expand Up @@ -171,7 +171,7 @@ public async Task<Result<string>> UploadImageAsync<TEntity>(IFormFile image)
}

/// <inheritdoc/>
public async Task<ImageRemovingResult> RemoveManyImagesAsync(List<string> imageIds)
public async Task<ImageRemovingResult> RemoveManyImagesAsync(IList<string> imageIds)
{
if (imageIds == null || imageIds.Count == 0)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public async Task<OperationResult> RemoveImageAsync(Guid entityId, string imageI
}

/// <inheritdoc/>
public async Task<MultipleKeyValueOperationResult> UploadManyImagesAsync(Guid entityId, List<IFormFile> images)
public async Task<MultipleKeyValueOperationResult> UploadManyImagesAsync(Guid entityId, IList<IFormFile> images)
{
if (images == null || images.Count <= 0)
{
Expand All @@ -128,7 +128,7 @@ public async Task<MultipleKeyValueOperationResult> UploadManyImagesAsync(Guid en
}

/// <inheritdoc/>
public async Task<MultipleKeyValueOperationResult> RemoveManyImagesAsync(Guid entityId, List<string> imageIds)
public async Task<MultipleKeyValueOperationResult> RemoveManyImagesAsync(Guid entityId, IList<string> imageIds)
{
if (imageIds == null || imageIds.Count <= 0)
{
Expand Down Expand Up @@ -190,7 +190,7 @@ private async Task<OperationResult> WorkshopUpdateAsync(Workshop workshop)

private async Task<MultipleKeyValueOperationResult> UploadManyImagesProcessAsync(
Workshop workshop,
List<IFormFile> images)
IList<IFormFile> images)
{
if (!AllowedToUploadGivenAmountOfFiles(workshop, images.Count))
{
Expand Down Expand Up @@ -220,7 +220,7 @@ private async Task<MultipleKeyValueOperationResult> UploadManyImagesProcessAsync

private async Task<MultipleKeyValueOperationResult> RemoveManyImagesProcessAsync(
Workshop workshop,
List<string> imageIds)
IList<string> imageIds)
{
var ableToRemove = !imageIds.Except(workshop.WorkshopImages.Select(x => x.ExternalStorageId)).Any();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,10 @@ public async Task<OperationResult> UploadImageAsync(Guid entityId, IFormFile ima
public async Task<OperationResult> RemoveImageAsync(Guid entityId, string imageId) =>
await workshopService.RemoveImageAsync(entityId, imageId).ConfigureAwait(false);

public async Task<MultipleKeyValueOperationResult> UploadManyImagesAsync(Guid entityId, List<IFormFile> images) =>
public async Task<MultipleKeyValueOperationResult> UploadManyImagesAsync(Guid entityId, IList<IFormFile> images) =>
await workshopService.UploadManyImagesAsync(entityId, images).ConfigureAwait(false);

public async Task<MultipleKeyValueOperationResult> RemoveManyImagesAsync(Guid entityId, List<string> imageIds) =>
public async Task<MultipleKeyValueOperationResult> RemoveManyImagesAsync(Guid entityId, IList<string> imageIds) =>
await workshopService.RemoveManyImagesAsync(entityId, imageIds).ConfigureAwait(false);

public async Task<ImageChangingResult> ChangeImagesAsync(WorkshopUpdateDto dto) =>
Expand Down

0 comments on commit 3999e81

Please sign in to comment.