예제 #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;
 }
예제 #5
0
        /// <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;
 }
예제 #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;
        }
예제 #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);
                }
            }
        }
예제 #10
0
 public CreateAlbumHandler(
     IValidationService validationService,
     IAlbumRepository albumRepository)
 {
     _validationService = validationService;
     _albumRepository   = albumRepository;
 }
예제 #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
            });
        }
예제 #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;
 }
예제 #14
0
        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;
 }
예제 #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();
        }
예제 #17
0
 public AlbumController(IAlbumRepository AlbumRepository, ICategoryRepository categoryRepository, IAlbumReviewRepository AlbumReviewRepository, HtmlEncoder htmlEncoder)
 {
     _categoryRepository    = categoryRepository;
     _AlbumReviewRepository = AlbumReviewRepository;
     _htmlEncoder           = htmlEncoder;
     _AlbumRepository       = AlbumRepository;
 }
예제 #18
0
 public ShoppingCartController(IAlbumRepository albumRepository, IShippingDetailsRepository shippingDetailsRepository, IOrderRepository orderRepository, IOrderAlbumRepository orderAlbumRepository)
 {
     this.albumRepository           = albumRepository;
     this.shippingDetailsRepository = shippingDetailsRepository;
     this.orderRepository           = orderRepository;
     this.orderAlbumRepository      = orderAlbumRepository;
 }
예제 #19
0
 /// <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();
        }
예제 #21
0
 public AlbumService(IUsersRepository usersRepository, IAlbumRepository albumRepository, IPhotoRepository photoRepository, ITagRepository tagRepository)
 {
     this.mUserRepository = usersRepository;
     this.mAlbumRepository = albumRepository;
     this.mPhotoRepository = photoRepository;
     this.mTagRepository = tagRepository;
 }
예제 #22
0
 private FormUtil(IActionRepository Actionrepository, IAlbumRepository Albumrepository, IPersonneRepository Personnerepository)
 {
     InitializeComponent();
     _actionrepo = Actionrepository;
     _albrepo    = Albumrepository;
     _persrepo   = Personnerepository;
 }
예제 #23
0
 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);
 }
예제 #25
0
 public InventoryService(IGenreRepository genreRepository, IArtistRepository artistRepository, IAlbumRepository albumRepository, ISongRepository songRepository, IUserRepository userRepository)
 {
     _genreRepository  = genreRepository;
     _artistRepository = artistRepository;
     _albumRepository  = albumRepository;
     _songRepository   = songRepository;
     _userRepository   = userRepository;
 }
예제 #26
0
 public TrackService(ITrackRepository trackRepository, IArtistRepository artistRepository, IAlbumRepository albumRepository, IGenreRepository genreRepository, IMapper mapper)
 {
     TrackRepository  = trackRepository;
     ArtistRepository = artistRepository;
     GenreRepository  = genreRepository;
     AlbumRepository  = albumRepository;
     Mapper           = mapper;
 }
예제 #27
0
 public AlbumsController(IAuthorizationService authorizationService,
                         IAlbumRepository albumRepository,
                         ILoggingRepository loggingRepository)
 {
     this.authorizationService = authorizationService;
     this.albumRepo            = albumRepository;
     this.loggingRepo          = loggingRepository;
 }
예제 #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;
 }
예제 #30
0
 public AlbumManager(IAlbumRepository albumRepository, IMapper mapper, IFilesService filesService, IConfiguration configuration, IHelper helper)
 {
     _albumRepository = albumRepository;
     _mapper          = mapper;
     _filesService    = filesService;
     _configuration   = configuration;
     _helper          = helper;
 }
예제 #31
0
        public AlbumListViewModel(IAlbumRepository albumRepository, IViewFactory viewFactory)
        {
            _albumRepository = albumRepository;
            _viewFactory     = viewFactory;
            Albums           = albumRepository.GetAlbums();

            InitializeCommands();
        }
예제 #32
0
 public PresenterConnexion(IAlbumRepository albumRepository, IUtilisateurRepository utilisateurRepository, IAdministrateurRepository administrateurRepository, IViewConnexion viewConnexion)
 {
     _utilisateurRepository            = utilisateurRepository;
     _albumRepository                  = albumRepository;
     _administrateurRepository         = administrateurRepository;
     _viewConnexion                    = viewConnexion;
     _viewConnexion.PresenterConnexion = this;
 }
예제 #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";
 }
예제 #34
0
 public AlbumService(IAlbumRepository albumRepository, IArtistRepository artistRepository, IGenreRepository genreRepository,
     IUnitOfWork uow)
 {
     _albumRepository = albumRepository;
     _artistRepository = artistRepository;
     _genreRepository = genreRepository;
     _uow = uow;
 }
예제 #35
0
 public AlbumController(IAlbumRepository albumrepository, IArtistAlbumRepository artistalbumrepository, IArtistRepository artistrepository, ISongRepository songrepository, ISongAlbumRepository songalbumrepository)
 {
     IAlbumRepository       = albumrepository;
     IArtistAlbumRepository = artistalbumrepository;
     ISongAlbumRepository   = songalbumrepository;
     ISongRepository        = songrepository;
     IArtistRepository      = artistrepository;
 }
예제 #36
0
 public AlbumsController(IAuthorizationService authorizationService,
                         IAlbumRepository albumRepository,
                         ILoggingRepository loggingRepository)
 {
     _authorizationService = authorizationService;
     _albumRepository = albumRepository;
     _loggingRepository = loggingRepository;
 }
예제 #37
0
        public UnitOfWork(ApplicationContext context)
        {
            _context = context;

            _artistRepository = new ArtistRepository(_context);
            _albumRepository  = new AlbumRepository(_context);
            _trackRepository  = new TrackRepository(_context);
        }
예제 #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);
 }
예제 #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);
 }
예제 #40
0
 public AlbumService(IAlbumRepository albumRepository,
                     IEventAggregator eventAggregator,
                     Logger logger)
 {
     _albumRepository = albumRepository;
     _eventAggregator = eventAggregator;
     _logger          = logger;
 }
예제 #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;
 }
예제 #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();
        }
예제 #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;
 }
예제 #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;
        }
예제 #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;
 }
예제 #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;
 }
예제 #55
0
 public void AlbumTestFixtureSetup()
 {
     _connection = new SqlConnection(ConfigurationManager.ConnectionStrings["default"].ConnectionString);
     _trackRepository = new TrackRepository(_connection);
     _albumRepository = new AlbumRepository(_connection, _trackRepository);
 }
예제 #56
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AlbumsController"/> class.
 /// </summary>
 /// <param name="repository">The repository.</param>
 public AlbumsController(IAlbumRepository repository)
 {
     _repository = repository;
 }
예제 #57
0
        public ImagesController(IAlbumRepository albumRepository, IImageRepository imageRepository)
        {
			this.albumRepository = albumRepository;
			this.imageRepository = imageRepository;
        }
예제 #58
0
 /// <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;
 }
예제 #59
0
 public AlbumService(IAlbumRepository albumRepository, IArtistRepository artistRepository, IGenreRepository genreRepository)
 {
     _albumRepository = albumRepository;
     _artistRepository = artistRepository;
     _genreRepository = genreRepository;
 }
 public AlbumsController(IAlbumRepository albumRepository)
 {
     this.albumRepository = albumRepository;
 }