using skydiveLogs_api.Domain; using skydiveLogs_api.DomainBusiness.Interfaces; using skydiveLogs_api.DomainService.Repositories; using System; using System.Collections.Generic; namespace skydiveLogs_api.DomainBusiness { public class UserImageService : IUserImageService { #region Public Constructors public UserImageService(IUserImageRepository imageRepository, IIdentityService identityService) { _imageRepository = imageRepository; _identityService = identityService; } #endregion Public Constructors #region Public Methods /// /// Adds a new image to the system. /// /// The UserImage entity containing the new image data. public void AddNewImage(UserImage newImage) { newImage.User = _identityService.ConnectedUser; _imageRepository.Add(newImage); } /// /// Deletes an image by its ID. /// /// The image ID to delete. public void DeleteImageById(int id) { throw new NotImplementedException(); } /// /// Retrieves all images. /// /// A collection of UserImage entities containing all images. public IEnumerable GetAllImages() { return _imageRepository.GetAll(_identityService.ConnectedUser); } /// /// Retrieves an image by its ID. /// /// The image ID to retrieve. /// A UserImage entity containing the image details. public UserImage GetImageById(int id) { return _imageRepository.GetById(id); } /// /// Updates an existing image. /// /// The image ID to update. /// UserImage entity containing the updated image data. public void UpdateImage(int id, UserImage Image) { throw new NotImplementedException(); } #endregion Public Methods #region Private Fields private readonly IIdentityService _identityService; private readonly IUserImageRepository _imageRepository; #endregion Private Fields } }