Refactoring, database structure changed

This commit is contained in:
2025-03-03 00:56:32 +01:00
Unverified
parent d3805ef3db
commit c603c41c0b
913 changed files with 21764 additions and 32775 deletions

View File

@@ -0,0 +1,21 @@
using WatchIt.Database.Model.Photos;
using WatchIt.DTO.Models.Controllers.Photos.Photo;
using WatchIt.DTO.Query;
namespace WatchIt.WebAPI.Repositories.Photos;
public interface IPhotosRepository : IRepository<Photo>
{
Task<bool> ExistsAsync(Guid id);
Task<Photo?> GetAsync(Guid id, Func<IQueryable<Photo>, IQueryable<Photo>>? additionalIncludes = null);
Task<IEnumerable<Photo>> GetAllAsync(PhotoFilterQuery filterQuery, OrderQuery orderQuery, PagingQuery pagingQuery, Func<IQueryable<Photo>, IQueryable<Photo>>? additionalIncludes = null);
Task<Photo?> GetPhotoRandomBackgroundAsync(Func<IQueryable<Photo>, IQueryable<Photo>>? additionalIncludes = null);
Task<bool> UpdateAsync(Guid id, Action<Photo> updateFunc);
Task DeleteAsync(Guid id);
Task AddPhotoBackgroundAsync(PhotoBackground photoBackground);
Task<PhotoBackground> UpdateOrAddPhotoBackgroundAsync(Guid photoId, Func<PhotoBackground> addFunc, Action<PhotoBackground> updateFunc);
Task DeletePhotoBackgroundAsync(Guid photoId);
Task<Photo> GetPhotoRandomBackgroundByMediumAsync(long mediumId, Func<IQueryable<Photo>, IQueryable<Photo>>? additionalIncludes = null);
}