コード例 #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
                });
            }
        }
コード例 #2
0
        public AlbumServiceTests()
        {
            var mock = new Mock <IAlbumRepository>();


            _albumRepository = mock.Object;
        }
コード例 #3
0
        public AlbumEditDialogViewModel(IAlbumRepository albumRepository, AlbumEditViewModel albumEditViewModel)
        {
            _albumRepository = albumRepository;
            AlbumEditViewModel = albumEditViewModel;

            InitializeCommands();
        }
コード例 #4
0
 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();
        }
コード例 #6
0
 /// <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));

        }
コード例 #8
0
        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
ファイル: PhotoController.cs プロジェクト: CashmereBob/MVC
 public PhotoController()
 {
     userRepository    = new UserRepository();
     photoRepository   = new PhotoRepository();
     albumRepository   = new AlbumRepository();
     commentRepository = new CommentRepository();
 }
コード例 #13
0
 /// <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;

        }
コード例 #15
0
 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;
 }
コード例 #20
0
        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;
 }
コード例 #24
0
 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
ファイル: AlbumManager.cs プロジェクト: yasinfmd/musicApi
 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
ファイル: AlbumService.cs プロジェクト: zobe123/Lidarr
 public AlbumService(IAlbumRepository albumRepository,
                     IEventAggregator eventAggregator,
                     Logger logger)
 {
     _albumRepository = albumRepository;
     _eventAggregator = eventAggregator;
     _logger          = logger;
 }
コード例 #41
0
ファイル: GalleryService.cs プロジェクト: MrWangzhaoyang/Blog
 public GalleryService(IAlbumRepository albumRepository,
                       IImageRepository imageRepository,
                       IGalleryCacheService galleryCacheService)
 {
     _albumRepository     = albumRepository;
     _imageRepository     = imageRepository;
     _galleryCacheService = galleryCacheService;
 }
コード例 #42
0
 /// <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;
 }
コード例 #43
0
 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
ファイル: MediaLogic.cs プロジェクト: jsnmgpnty/Blogness2.0
 public MediaLogic(IMediaRepository mediaRepository, IAlbumRepository albumRepository, 
     IImageHelper imageHelper, IConfigurationHelper configurationHelper, IFileHelper fileHelper)
 {
     _mediaRepository = mediaRepository;
     _albumRepository = albumRepository;
     _imageHelper = imageHelper;
     _configurationHelper = configurationHelper;
     _fileHelper = fileHelper;
 }
コード例 #45
0
 public PopulateSidebarView(IRecentRepository recentRepository, 
     ITagRepository tagRepository,
     IAlbumRepository albumRepository,
     IFriendRepository friendRepository)
 {
     _recentRepository = recentRepository;
     _friendRepository = friendRepository;
     _albumRepository = albumRepository;
     _tagRepository = tagRepository;
 }
コード例 #46
0
        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;
        }
コード例 #48
0
 /// <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;
 }
コード例 #49
0
 /// <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;
 }
コード例 #50
0
 /// <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
ファイル: BaseController.cs プロジェクト: hmnzr/PSAEC-Website
 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
ファイル: ControllerData.cs プロジェクト: hmnzr/PSAEC-Website
 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;
 }
コード例 #54
0
 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;
 }
コード例 #60
0
 public AlbumsController(IAlbumRepository albumRepository)
 {
     this.albumRepository = albumRepository;
 }