Example #1
0
        public FindAllItemReponse <PhotoModel> GetPhotoByAlbum(string AlbumActionURL, int pageSize, int pageIndex)
        {
            try
            {
                IPhotoRepository photoRepository = RepositoryClassFactory.GetInstance().GetPhotoRepository();

                IAlbumRepository albumRepository = RepositoryClassFactory.GetInstance().GetAlbumRepository();

                var album   = albumRepository.FindByActionURL(AlbumActionURL);
                var result  = photoRepository.FindByAlbum(album.AlbumID, pageSize, pageIndex);
                var _photos = result.Item2.Select(n => MapperUtil.CreateMapper().Mapper.Map <Photo, PhotoModel>(n)).ToList();
                return(new FindAllItemReponse <PhotoModel>
                {
                    Count = result.Item1,
                    Items = _photos,
                    ErrorCode = (int)ErrorCode.None,
                    Message = string.Empty
                });
            }
            catch (Exception ex)
            {
                return(new FindAllItemReponse <PhotoModel>
                {
                    ErrorCode = (int)ErrorCode.Error,
                    Message = ex.Message
                });
            }
        }
        public AlbumServiceTests()
        {
            var mock = new Mock <IAlbumRepository>();


            _albumRepository = mock.Object;
        }
        public AlbumEditDialogViewModel(IAlbumRepository albumRepository, AlbumEditViewModel albumEditViewModel)
        {
            _albumRepository = albumRepository;
            AlbumEditViewModel = albumEditViewModel;

            InitializeCommands();
        }
 public MusicLibraryService(IArtistRepository artists, IAlbumRepository albums, ISongRepository songs, IGenreRepository genres)
 {
     Artists = artists;
     Albums = albums;
     Songs = songs;
     Genres = genres;
 }
        /// <summary>
        /// Constructor which allows Dependency Injection. This can be useful for Unit Testing.
        /// </summary>
        /// <param name="albumrepository"></param>
        /// <remarks></remarks>
        public CommonAlbumsViewModel(IAlbumRepository albumrepository) : base()
        {
            // Repositories
            this.albumRepository = albumrepository;

            this.Initialize();
        }
 /// <summary>
 /// Crot:
 /// </summary>
 /// <param name="MusicFileService">Instance of the MusicFileService</param>
 /// <param name="LastFMService">Instance of the LastFMService</param>
 /// <param name="AlbumRepository">Instance of the AlbumRepository</param>
 /// <param name="AlbumFactory">Instance of the AlbumFactory</param>
 /// <param name="TrackFactory">Instance of the TrackFactory</param>
 /// <param name="ArtistFactory">Instance of the ArtistFactory</param>
 /// <param name="GenreFactory">Instance of the GenreFactory</param>
 public MusicFileDataService(IMusicFileService MusicFileService,
                             ILastFMService LastFMService,
                             IAlbumRepository AlbumRepository, 
                             AbstractFactory<Album> AlbumFactory,
                             AbstractFactory<Track> TrackFactory,
                             AbstractFactory<Artist> ArtistFactory,
                             AbstractFactory<Genre> GenreFactory)
 {
     if (MusicFileService == null)
         throw new ArgumentNullException("MusicFileService", "No valid MusicFile service supplied");
     _musicFileService = MusicFileService;
     if (LastFMService == null)
         throw new ArgumentNullException("LastFMService", "No valid LastFM service supplied");
     _lastFMService = LastFMService;
     if (AlbumRepository == null)
         throw new ArgumentNullException("AlbumRepository", "No valid Album Repository supplied");
     _albumRepository = AlbumRepository;
     if (AlbumFactory == null)
         throw new ArgumentNullException("AlbumFactory", "No valid Album Factory supplied");
     _albumFactory = AlbumFactory;
     if (TrackFactory == null)
         throw new ArgumentNullException("TrackFactory", "No valid Track Factory supplied");
     _trackFactory = TrackFactory;
     if (ArtistFactory == null)
         throw new ArgumentNullException("ArtistFactory", "No valid Artist Factory supplied");
     _artistFactory = ArtistFactory;
     if (GenreFactory == null)
         throw new ArgumentNullException("GenreFactory", "No valid Genre Factory supplied");
     _genreFactory = GenreFactory;
 }
Example #7
0
        public ActionResult Illustration()
        {
            imageRepository = new ImageRepository();
            albumRepository = new AlbumRepository();
            return View(albumRepository.AllIncluding(m => m.Images).OrderBy(m => m.OrderNumber));

        }
        public AlbumsController(IAlbumRepository albumRepository, IMapper mapper)
        {
            _albumRepository = albumRepository;

            includeProperties = Expressions.LoadAlbumNavigations();
            _mapper           = mapper;
        }
Example #9
0
        private IEnumerable <Photo> searchedPhotos; // リストビュー上のフォトのリスト

        /// <summary>
        /// コンストラクタ
        /// </summary>
        public Form1()
        {
            InitializeComponent();

            // 各テストごとにデータベースファイルを削除
            // (35-42をコメントアウトしても動きます)
            if (System.IO.File.Exists("_Photo.csv"))
            {
                System.IO.File.Delete("_Photo.csv");
            }
            if (System.IO.File.Exists("_Album.csv"))
            {
                System.IO.File.Delete("_Album.csv");
            }

            // リポジトリ生成
            var repos = new RepositoryFactory(PhotoFrame.Persistence.Type.Csv);

            photoRepository = repos.PhotoRepository;
            albumRepository = repos.AlbumRepository;

            // 全アルバム名を取得し、アルバム変更リストをセット
            IEnumerable <Album> allAlbums = albumRepository.Find((IQueryable <Album> albums) => albums);

            if (allAlbums != null)
            {
                foreach (Album album in allAlbums)
                {
                    comboBox_ChangeAlbum.Items.Add(album.Name);
                }
            }
        }
 public CreateAlbumHandler(
     IValidationService validationService,
     IAlbumRepository albumRepository)
 {
     _validationService = validationService;
     _albumRepository   = albumRepository;
 }
Example #11
0
        public AddAlbumViewModel(ISongRepository songRepository,
                                 IAlbumRepository albumRepository)
        {
            this.UploadAlbumCommand = new DelegateCommand(this.UploadAlbum_Execute, this.UploadAlbum_CanExecute);
            this.AddSongCommand     = new DelegateCommand(this.AddSong_Execute);
            this.RemoveSongCommand  = new DelegateCommand(this.RemoveSong_Execute, this.RemoveSong_CanExecute);

            _songRepository  = songRepository;
            _albumRepository = albumRepository;

            this.Album = new AlbumWrapper(new Album());
            // this is what notifies the upload button to toggle on whenever a property of album changes
            this.Album.PropertyChanged += (s, e) => {
                if (e.PropertyName == nameof(Album.HasErrors))
                {
                    ((DelegateCommand)UploadAlbumCommand).RaiseCanExecuteChanged();
                }
            };
            base._imageWrapper = this.Album;

            #region a trick to trigger validation
            this.Album.Title = "";
            this.Album.Price = 0;
            #endregion
            this.Songs.Add(new Song {
                Title    = "Soul Lady",
                Duration = new TimeSpan(0, 3, 24),
                Composer = "Jinbae Park",
                Lyricist = "Oreo",
                Ratings  = 5
            });
        }
Example #12
0
 public PhotoController()
 {
     userRepository    = new UserRepository();
     photoRepository   = new PhotoRepository();
     albumRepository   = new AlbumRepository();
     commentRepository = new CommentRepository();
 }
 /// <summary>
 /// ctor;
 /// </summary>
 /// <param name="AlbumRepository">Instance of the AlbumRepository</param>
 /// <param name="AlbumFactory">Instance of the AlbumFactory</param>
 /// <param name="ImageFactory">Instance of the ImageFactore</param>
 /// <param name="TrackFactory">Instance of the TrackFactory</param>
 /// <param name="ArtistFactory">Instance of the ArtistFactory</param>
 /// <param name="GenreFactory">Instance of thenGenreFactory</param>
 /// <param name="WikiFactory">Instance of the WikiFactory</param>
 /// <param name="LastFMService">Instance of the LastFMService</param>
 public LastFMModelDataService(IAlbumRepository AlbumRepository, 
     AbstractFactory<Album> AlbumFactory, 
     AbstractFactory<Image> ImageFactory,
     AbstractFactory<Track> TrackFactory,
     AbstractFactory<Artist> ArtistFactory,
     AbstractFactory<Genre> GenreFactory,
     AbstractFactory<Wiki> WikiFactory,
     ILastFMService LastFMService)
 {
     if (AlbumRepository == null)
         throw new ArgumentNullException("AlbumRepository", "No valid Album Repository supplied");
     _albumRepository = AlbumRepository;
     if (AlbumFactory == null)
         throw new ArgumentNullException("AlbumFactory", "No valid Album factory supplied");
     _albumFactory = AlbumFactory;
     if (ImageFactory == null)
         throw new ArgumentNullException("ImageFactory", "No valid Image factory supplied");
     _imageFactory = ImageFactory;
     if (TrackFactory == null)
         throw new ArgumentNullException("TrackFactory", "No valid Track factory supplied");
     _trackFactory = TrackFactory;
     if (ImageFactory == null)
         throw new ArgumentNullException("ArtistFactory", "No valid Artist factory supplied");
     _artistFactory = ArtistFactory;
     if (ImageFactory == null)
         throw new ArgumentNullException("GenreFactory", "No valid Genre factory supplied");
     _genreFactory = GenreFactory;
     if (WikiFactory == null)
         throw new ArgumentNullException("WikiFactory", "No valid Wiki factory supplied");
     _wikiFactory = WikiFactory;
     if (LastFMService == null)
         throw new ArgumentNullException("LastFMService", "No valid Service for LastFM supplied");
     _lastFMService = LastFMService;
 }
        public AlbumsController(ICategoryRepository categoryRepository, IAlbumRepository albumRepository, ImageRepository imageRepository)
        {
            this.categoryRepository = categoryRepository;
            this.albumRepository = albumRepository;
            this.imageRepository = imageRepository;

        }
 public HomeController(
     IAuthorizationService authorizationService,
     IAlbumRepository albumRepository)
 {
     _authorizationService = authorizationService;
     _albumRepository = albumRepository;
 }
Example #16
0
        public MetadataService(ICacheService cacheService, IPlaybackService playbackService, ITrackRepository trackRepository,
                               ITrackStatisticRepository trackStatisticRepository, IAlbumRepository albumRepository, IGenreRepository genreRepository,
                               IArtistRepository artistRepository, IFileMetadataFactory metadataFactory)
        {
            this.cacheService    = cacheService;
            this.playbackService = playbackService;

            this.trackStatisticRepository = trackStatisticRepository;
            this.trackRepository          = trackRepository;
            this.albumRepository          = albumRepository;
            this.genreRepository          = genreRepository;
            this.artistRepository         = artistRepository;
            this.metadataFactory          = metadataFactory;

            this.fileMetadataDictionary = new Dictionary <string, IFileMetadata>();

            this.updateFileMetadataTimer          = new Timer();
            this.updateFileMetadataTimer.Interval = this.updateFileMetadataLongTimeout;
            this.updateFileMetadataTimer.Elapsed += async(_, __) => await this.UpdateFileMetadataAsync();

            this.playbackService.PlaybackStopped += async(_, __) => await this.UpdateFileMetadataAsync();

            this.playbackService.PlaybackFailed += async(_, __) => await this.UpdateFileMetadataAsync();

            this.playbackService.PlaybackSuccess += async(_, __) => await this.UpdateFileMetadataAsync();
        }
Example #17
0
 public AlbumController(IAlbumRepository AlbumRepository, ICategoryRepository categoryRepository, IAlbumReviewRepository AlbumReviewRepository, HtmlEncoder htmlEncoder)
 {
     _categoryRepository    = categoryRepository;
     _AlbumReviewRepository = AlbumReviewRepository;
     _htmlEncoder           = htmlEncoder;
     _AlbumRepository       = AlbumRepository;
 }
Example #18
0
 public ShoppingCartController(IAlbumRepository albumRepository, IShippingDetailsRepository shippingDetailsRepository, IOrderRepository orderRepository, IOrderAlbumRepository orderAlbumRepository)
 {
     this.albumRepository           = albumRepository;
     this.shippingDetailsRepository = shippingDetailsRepository;
     this.orderRepository           = orderRepository;
     this.orderAlbumRepository      = orderAlbumRepository;
 }
 /// <summary>
 /// Inject repository in controller
 /// </summary>
 /// <param name="photoRepository">injected object</param>
 /// <param name="albumRepository">injected object</param>
 public PhotoController(
     IPhotoRepository photoRepository,
     IAlbumRepository albumRepository)
 {
     this.photoRepository = photoRepository;
     this.albumRepository = albumRepository;
 }
        public AlbumEditDialogViewModel(IAlbumRepository albumRepository, AlbumEditViewModel albumEditViewModel)
        {
            _albumRepository   = albumRepository;
            AlbumEditViewModel = albumEditViewModel;

            InitializeCommands();
        }
Example #21
0
 public AlbumService(IUsersRepository usersRepository, IAlbumRepository albumRepository, IPhotoRepository photoRepository, ITagRepository tagRepository)
 {
     this.mUserRepository = usersRepository;
     this.mAlbumRepository = albumRepository;
     this.mPhotoRepository = photoRepository;
     this.mTagRepository = tagRepository;
 }
Example #22
0
 private FormUtil(IActionRepository Actionrepository, IAlbumRepository Albumrepository, IPersonneRepository Personnerepository)
 {
     InitializeComponent();
     _actionrepo = Actionrepository;
     _albrepo    = Albumrepository;
     _persrepo   = Personnerepository;
 }
 public AlbumsController(IAuthorizationService authorizationService,
                         IAlbumRepository albumRepository,
                         ILoggingRepository loggingRepository)
 {
     _authorizationService = authorizationService;
     _albumRepository = albumRepository;
     _loggingRepository = loggingRepository;
 }
 public UnitOfWork(RdioContext context)
 {
     _context = context;
     Musics   = new MusicRepository(_context);
     Generos  = new GeneroRepository(_context);
     Artistas = new ArtistaRepository(_context);
     Albums   = new AlbumRepository(_context);
 }
Example #25
0
 public InventoryService(IGenreRepository genreRepository, IArtistRepository artistRepository, IAlbumRepository albumRepository, ISongRepository songRepository, IUserRepository userRepository)
 {
     _genreRepository  = genreRepository;
     _artistRepository = artistRepository;
     _albumRepository  = albumRepository;
     _songRepository   = songRepository;
     _userRepository   = userRepository;
 }
Example #26
0
 public TrackService(ITrackRepository trackRepository, IArtistRepository artistRepository, IAlbumRepository albumRepository, IGenreRepository genreRepository, IMapper mapper)
 {
     TrackRepository  = trackRepository;
     ArtistRepository = artistRepository;
     GenreRepository  = genreRepository;
     AlbumRepository  = albumRepository;
     Mapper           = mapper;
 }
Example #27
0
 public AlbumsController(IAuthorizationService authorizationService,
                         IAlbumRepository albumRepository,
                         ILoggingRepository loggingRepository)
 {
     this.authorizationService = authorizationService;
     this.albumRepo            = albumRepository;
     this.loggingRepo          = loggingRepository;
 }
Example #28
0
 public PhotoFrameApplication(IAlbumRepository albumRepository, IPhotoRepository photoRepository)
 {
     this.createAlbum   = new CreateAlbum(albumRepository);
     this.findDirectory = new FindDirectory(albumRepository, photoRepository);
     this.findAlbums    = new FindAlbums(albumRepository);
     this.findPhotos    = new FindPhotos(photoRepository);
     this.changeAlbum   = new ChangeAlbum(albumRepository, photoRepository);
 }
 public RatingService(ISongRepository songRepository, IArtistRepository artistRepository, IGenreRepository genreRepository, IAlbumRepository albumRepository, IUserRepository userRepository)
 {
     _songRepository   = songRepository;
     _artistRepository = artistRepository;
     _genreRepository  = genreRepository;
     _albumRepository  = albumRepository;
     _userRepository   = userRepository;
 }
Example #30
0
 public AlbumManager(IAlbumRepository albumRepository, IMapper mapper, IFilesService filesService, IConfiguration configuration, IHelper helper)
 {
     _albumRepository = albumRepository;
     _mapper          = mapper;
     _filesService    = filesService;
     _configuration   = configuration;
     _helper          = helper;
 }
Example #31
0
        public AlbumListViewModel(IAlbumRepository albumRepository, IViewFactory viewFactory)
        {
            _albumRepository = albumRepository;
            _viewFactory     = viewFactory;
            Albums           = albumRepository.GetAlbums();

            InitializeCommands();
        }
Example #32
0
 public PresenterConnexion(IAlbumRepository albumRepository, IUtilisateurRepository utilisateurRepository, IAdministrateurRepository administrateurRepository, IViewConnexion viewConnexion)
 {
     _utilisateurRepository            = utilisateurRepository;
     _albumRepository                  = albumRepository;
     _administrateurRepository         = administrateurRepository;
     _viewConnexion                    = viewConnexion;
     _viewConnexion.PresenterConnexion = this;
 }
Example #33
0
 public AlbumsController(IMapper mapper, IAlbumRepository albumRepository, IUserRepository userRepository, IUnitOfWork unitOfWork)
 {
     this.userRepository   = userRepository;
     this.unitOfWork       = unitOfWork;
     this.mapper           = mapper;
     this.albumRepository  = albumRepository;
     this.uploadsFolderUrl = "/uploads";
 }
Example #34
0
 public AlbumService(IAlbumRepository albumRepository, IArtistRepository artistRepository, IGenreRepository genreRepository,
     IUnitOfWork uow)
 {
     _albumRepository = albumRepository;
     _artistRepository = artistRepository;
     _genreRepository = genreRepository;
     _uow = uow;
 }
Example #35
0
 public AlbumController(IAlbumRepository albumrepository, IArtistAlbumRepository artistalbumrepository, IArtistRepository artistrepository, ISongRepository songrepository, ISongAlbumRepository songalbumrepository)
 {
     IAlbumRepository       = albumrepository;
     IArtistAlbumRepository = artistalbumrepository;
     ISongAlbumRepository   = songalbumrepository;
     ISongRepository        = songrepository;
     IArtistRepository      = artistrepository;
 }
 public AlbumsController(IAuthorizationService authorizationService,
                         IAlbumRepository albumRepository,
                         ILoggingRepository loggingRepository)
 {
     _authorizationService = authorizationService;
     _albumRepository = albumRepository;
     _loggingRepository = loggingRepository;
 }
Example #37
0
        public UnitOfWork(ApplicationContext context)
        {
            _context = context;

            _artistRepository = new ArtistRepository(_context);
            _albumRepository  = new AlbumRepository(_context);
            _trackRepository  = new TrackRepository(_context);
        }
Example #38
0
 public PhotoFrameApplication(IAlbumRepository albumRepository, IPhotoRepository photoRepository, IPhotoFileService photoFileService)
 {
     this.createAlbum     = new CreateAlbum(albumRepository);
     this.searchAlbum     = new SearchAlbum(photoRepository);
     this.searchDirectory = new SearchDirectory(photoRepository, photoFileService);
     this.toggleFavorite  = new ToggleFavorite(photoRepository);
     this.changeAlbum     = new ChangeAlbum(albumRepository, photoRepository);
 }
Example #39
0
 public AlbumsController(IAlbumRepository albumRepository, IGenderRepository genderRepository, ICategoryRepository categoryRepository, ISongRepository songRepository)
 {
     this._albumRepository    = albumRepository;
     this._genderRepository   = genderRepository;
     this._categoryRepository = categoryRepository;
     this._songRepository     = songRepository;
     this._handler            = new AlbumHandler(_albumRepository, _genderRepository, _categoryRepository);
 }
Example #40
0
 public AlbumService(IAlbumRepository albumRepository,
                     IEventAggregator eventAggregator,
                     Logger logger)
 {
     _albumRepository = albumRepository;
     _eventAggregator = eventAggregator;
     _logger          = logger;
 }
Example #41
0
 public GalleryService(IAlbumRepository albumRepository,
                       IImageRepository imageRepository,
                       IGalleryCacheService galleryCacheService)
 {
     _albumRepository     = albumRepository;
     _imageRepository     = imageRepository;
     _galleryCacheService = galleryCacheService;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="AlbumsController"/> class.
 /// </summary>
 /// <param name="albumRepository">The album repository.</param>
 /// <param name="mediaRepository">The media repository.</param>
 /// <param name="paginationService">The pagination service.</param>
 /// <param name="persistentCollectionService">The persistent collection service.</param>
 public AlbumsController(IAlbumRepository albumRepository, 
     IMediaRepository mediaRepository,
     IPaginationService<Media> paginationService, IPersistentCollectionService persistentCollectionService)
 {
     _albumRepository = albumRepository;
     _persistentCollectionService = persistentCollectionService;
     _paginationService = paginationService;
     _mediaRepository = mediaRepository;
 }
 public ProductService(IGenreRepository genreRepository, IPictureService pictureService, IPictureRepository pictureRepository, IArtistRepository artistRepository, IAlbumRepository albumRepository, IPurchaseRepository purchaseRepository)
 {
     this.GenreRepository = genreRepository;
     this.PictureRepository = pictureRepository;
     this.PictureService = pictureService;
     this.ArtistRepository = artistRepository;
     this.AlbumRepository = albumRepository;
     this.PurchaseRepository = purchaseRepository;
 }
Example #44
0
 public MediaLogic(IMediaRepository mediaRepository, IAlbumRepository albumRepository, 
     IImageHelper imageHelper, IConfigurationHelper configurationHelper, IFileHelper fileHelper)
 {
     _mediaRepository = mediaRepository;
     _albumRepository = albumRepository;
     _imageHelper = imageHelper;
     _configurationHelper = configurationHelper;
     _fileHelper = fileHelper;
 }
 public PopulateSidebarView(IRecentRepository recentRepository, 
     ITagRepository tagRepository,
     IAlbumRepository albumRepository,
     IFriendRepository friendRepository)
 {
     _recentRepository = recentRepository;
     _friendRepository = friendRepository;
     _albumRepository = albumRepository;
     _tagRepository = tagRepository;
 }
        public AlbumListViewModel(IAlbumRepository albumRepository, IViewFactory viewFactory, IPowerShellConsoleLauncher powerShellConsoleLauncher)
        {
            _albumRepository = albumRepository;
            _viewFactory = viewFactory;
            _powerShellConsoleLauncher = powerShellConsoleLauncher;

            Albums = albumRepository.GetAlbums();

            InitializeCommands();
        }
Example #47
0
        public FavoriteRepository(IDatabase database, IAlbumArtistRepository albumArtistRepository, IAlbumRepository albumRepository, IArtistRepository artistRepository, IFolderRepository folderRepository, IGenreRepository genreRepository, IPlaylistRepository playlistRepository, ISongRepository songRepository, IVideoRepository videoRepository, IItemRepository itemRepository)
        {
            if (database == null)
            {
                throw new ArgumentNullException("database");
            }
            if (albumRepository == null)
            {
                throw new ArgumentNullException("albumRepository");
            }
            if (albumArtistRepository == null)
            {
                throw new ArgumentNullException("albumArtistRepository");
            }
            if (artistRepository == null)
            {
                throw new ArgumentNullException("artistRepository");
            }
            if (folderRepository == null)
            {
                throw new ArgumentNullException("folderRepository");
            }
            if (genreRepository == null)
            {
                throw new ArgumentNullException("genreRepository");
            }
            if (playlistRepository == null)
            {
                throw new ArgumentNullException("playlistRepository");
            }
            if (songRepository == null)
            {
                throw new ArgumentNullException("songRepository");
            }
            if (videoRepository == null)
            {
                throw new ArgumentNullException("videoRepository");
            }
            if (itemRepository == null)
            {
                throw new ArgumentNullException("itemRepository");
            }

            this.database = database;
            this.albumArtistRepository = albumArtistRepository;
            this.albumRepository = albumRepository;
            this.artistRepository = artistRepository;
            this.folderRepository = folderRepository;
            this.genreRepository = genreRepository;
            this.playlistRepository = playlistRepository;
            this.songRepository = songRepository;
            this.videoRepository = videoRepository;
            this.itemRepository = itemRepository;
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="MediaBatchService"/> class.
 /// </summary>
 /// <param name="albumRepository">The album repository.</param>
 /// <param name="locationRepository">The location repository.</param>
 /// <param name="mediaQueueRepository">The media queue repository.</param>
 /// <param name="mediaRepository">The media repository.</param>
 /// <param name="uploaderMediaRepository">The uploader media repository.</param>
 public MediaBatchService(IAlbumRepository albumRepository, 
     ILocationRepository locationRepository,
     IMediaQueueRepository mediaQueueRepository,
     IMediaRepository mediaRepository,
     IUploaderMediaRepository uploaderMediaRepository)
 {
     _albumRepository = albumRepository;
     _uploaderMediaRepository = uploaderMediaRepository;
     _mediaRepository = mediaRepository;
     _mediaQueueRepository = mediaQueueRepository;
     _locationRepository = locationRepository;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="PhotosController"/> class.
 /// </summary>
 /// <param name="mediaRepository">The media repository.</param>
 /// <param name="tagRepository">The tag repository.</param>
 /// <param name="rotateService">The rotate service.</param>
 /// <param name="managePhotoService">The manage photo service.</param>
 /// <param name="mediaFileService">The media file service.</param>
 /// <param name="locationRepository">The location repository.</param>
 /// <param name="albumRepository">The album repository.</param>
 /// <param name="persistentCollectionService">The persistent collection service.</param>
 public PhotosController(IMediaRepository mediaRepository,
     ITagRepository tagRepository,
     IImageService rotateService,
     IManagePhotoFactory managePhotoService,
     IMediaFileService mediaFileService, ILocationRepository locationRepository, IAlbumRepository albumRepository, IPersistentCollectionService persistentCollectionService)
     : base(managePhotoService, persistentCollectionService)
 {
     _mediaRepository = mediaRepository;
     _albumRepository = albumRepository;
     _locationRepository = locationRepository;
     _mediaFileService = mediaFileService;
     _rotateService = rotateService;
     _tagRepository = tagRepository;
 }
 /// <summary>
 /// ctor: Initialise the AlbumModelDataService
 /// </summary>
 /// <param name="AlbumRepository">Instance of the AlbumRepository</param>
 /// <param name="ArtistRepository">Instance of the ArtistRepository</param>
 /// <param name="GenreRepository">Instance of the GenreRepository</param>
 /// <param name="PlaylistRepository">Instance of the PlaylistRepository</param>
 public AlbumModelDataService(IAlbumRepository AlbumRepository, IArtistRepository ArtistRepository, IGenreRepository GenreRepository, IPlaylistRepository PlaylistRepository)
 {
     if (AlbumRepository == null)
         throw new ArgumentNullException("AlbumRepository", "No valid Repository supplied");
     _albumRepository = AlbumRepository;
     if (ArtistRepository == null)
         throw new ArgumentNullException("ArtistRepository", "No valid Repository supplied");
     _artistRepository = ArtistRepository;
     if (GenreRepository == null)
         throw new ArgumentNullException("GenreRepository", "No valid Repository supplied");
     _genreRepository = GenreRepository;
     if (PlaylistRepository == null)
         throw new ArgumentNullException("PlaylistRepository", "No valid Repository supplied");
     _playlistRepository = PlaylistRepository;
 }
Example #51
0
        public AlbumServiceTests()
        {
            var mockAlbumRepo = new Mock<IAlbumRepository>();
            mockAlbumRepo.Setup(p => p.GetById(ValidId)).Returns(new Album()
                                                                     {
                                                                        ID = ValidId,
                                                                        CreatedDate = DateTime.Now.AddDays(-1),
                                                                        Name = "My Album with ID 1",
                                                                        ModifiedDate = DateTime.Now.AddMinutes(-30)
                                                                     });
            mockAlbumRepo.Setup(p => p.GetById(InvalidId)).Returns((Album)null);
            mockAlbumRepo.Setup(p => p.GetById(ExceptionId)).Throws(new Exception("Repo exception"));

            _albums = new List<Album>();

            for (int i = 1; i <= 100; i++ )
            {
                var album = new Album()
                                {
                                    ID = i,
                                    CreatedDate = DateTime.Now.AddDays(-i),
                                    ModifiedDate = DateTime.Now.AddSeconds(-i),
                                    Name = "Album #" + i,
                                    Photos = new List<Photo>()
                                };

                for (int j = 0; j < 51; j++)
                {
                    var photo = new Photo()
                                    {
                                        Album = album,
                                        CreatedDate = DateTime.Now.AddMinutes(-i),
                                        ModifiedDate = DateTime.Now.AddMinutes(-i),
                                        Description = "Album #" + i +" Photo #" + j,
                                        Filename = "album" + i + "photo" + j + ".jpg",
                                        ID = j
                                    };

                    album.Photos.Add(photo);
                }

                _albums.Add(album);
            }

            mockAlbumRepo.Setup(p => p.GetAll()).Returns(_albums);

            _albumRepository = mockAlbumRepo.Object;
        }
Example #52
0
 protected BaseController(IControllerData data)
 {
     this.accountRepository = data.AccountRepository;
     this.formsAuthentication = data.FormsAuthentication;
     this.articlesRepository = data.ArticlesRepository;
     this.staticPagesRepository = data.StaticPagesRepository;
     this.filesRepository = data.FilesRepository;
     this.lecturersRepository = data.LecturersRepository;
     this.eventsRepository = data.EventsRepository;
     this.settingsRepository = data.SettingsRepository;
     this.committeeRepository = data.CommitteeRepository;
     this.slideshowRepository = data.SlideshowRepository;
     this.albumRepository = data.AlbumRepository;
     this.galleryRepository = data.GalleryRepository;
     this.feedbackRepository = data.FeedbackRepository;
     this.sessionsRepository = data.SessionsRepository;
     this.bannersRepository = data.BannersRepository;
 }
Example #53
0
 public ControllerData(IFormsAuthentication formsAuthentication, IAccountRepository accountRepository, IArticlesRepository articlesRepository,
     IStaticPagesRepository staticPagesRepository, IFilesRepository filesRepository, ILecturersRepository lecturersRepository,
     IEventsRepository eventsRepository, ISettingsRepository settingsRepository, ICommitteeRepository committeeRepository,
     ISlideshowRepository slideshowRepository, IAlbumRepository albumRepository, IGalleryRepository galleryRepository,
     IFeedbackRepository feedbackRepository, ISessionsRepository sessionsRepository, IBannersRepository bannersRepository)
 {
     this.FormsAuthentication = formsAuthentication;
     this.AccountRepository = accountRepository;
     this.ArticlesRepository = articlesRepository;
     this.StaticPagesRepository = staticPagesRepository;
     this.FilesRepository = filesRepository;
     this.LecturersRepository = lecturersRepository;
     this.EventsRepository = eventsRepository;
     this.SettingsRepository = settingsRepository;
     this.CommitteeRepository = committeeRepository;
     this.SlideshowRepository = slideshowRepository;
     this.AlbumRepository = albumRepository;
     this.GalleryRepository = galleryRepository;
     this.FeedbackRepository = feedbackRepository;
     this.SessionsRepository = sessionsRepository;
     this.BannersRepository = bannersRepository;
 }
 public PowerShellConsoleLauncher(IAlbumRepository albumRepository, MefHelper mefHelper)
 {
     _albumRepository = albumRepository;
     _mefHelper = mefHelper;
 }
 public void AlbumTestFixtureSetup()
 {
     _connection = new SqlConnection(ConfigurationManager.ConnectionStrings["default"].ConnectionString);
     _trackRepository = new TrackRepository(_connection);
     _albumRepository = new AlbumRepository(_connection, _trackRepository);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="AlbumsController"/> class.
 /// </summary>
 /// <param name="repository">The repository.</param>
 public AlbumsController(IAlbumRepository repository)
 {
     _repository = repository;
 }
        public ImagesController(IAlbumRepository albumRepository, IImageRepository imageRepository)
        {
			this.albumRepository = albumRepository;
			this.imageRepository = imageRepository;
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="ScrollController" /> class.
 /// </summary>
 /// <param name="albumRepository">The album repository.</param>
 public ScrollController(IAlbumRepository albumRepository, IMomentoRepository momentoRepository)
 {
     _albumRepository = albumRepository;
     _momentoRepository = momentoRepository;
 }
Example #59
0
 public AlbumService(IAlbumRepository albumRepository, IArtistRepository artistRepository, IGenreRepository genreRepository)
 {
     _albumRepository = albumRepository;
     _artistRepository = artistRepository;
     _genreRepository = genreRepository;
 }
 public AlbumsController(IAlbumRepository albumRepository)
 {
     this.albumRepository = albumRepository;
 }