Exemplo n.º 1
0
        /// <summary>
        ///     Initialize the AutoMapper mappings for the solution.
        ///     http://automapper.codeplex.com/
        /// </summary>
        public static void CreateAutoMapperMaps()
        {
            AutofacRegistrations.RegisterDaoFactory();
            ILifetimeScope scope      = AutofacRegistrations.Container.BeginLifetimeScope();
            var            daoFactory = scope.Resolve <IDaoFactory>();

            Mapper.CreateMap <Error, ErrorDto>()
            .ReverseMap();

            IPlaylistDao playlistDao = daoFactory.GetPlaylistDao();
            IUserDao     userDao     = daoFactory.GetUserDao();

            Mapper.CreateMap <Playlist, PlaylistDto>();
            Mapper.CreateMap <PlaylistDto, Playlist>()
            .ForMember(playlist => playlist.User, opt => opt.MapFrom(playlistDto => userDao.Get(playlistDto.UserId)));

            Mapper.CreateMap <PlaylistItem, PlaylistItemDto>();
            Mapper.CreateMap <PlaylistItemDto, PlaylistItem>()
            .ForMember(playlistItem => playlistItem.Playlist, opt => opt.MapFrom(playlistItemDto => playlistDao.Get(playlistItemDto.PlaylistId)));

            Mapper.CreateMap <ShareCode, ShareCodeDto>().ReverseMap();

            Mapper.CreateMap <User, UserDto>().ReverseMap();
            Mapper.CreateMap <Video, VideoDto>().ReverseMap();

            Mapper.AssertConfigurationIsValid();
        }
Exemplo n.º 2
0
 public PlaylistService(IPlaylistDao <DataAccess.Firestore.Model.Playlist> dao,
                        IPlaylistMapper <DataAccess.Firestore.Model.Playlist> mapper,
                        ISongService songService,
                        SpotifyService spotify)
 {
     this._dao         = dao;
     this._mapper      = mapper;
     this._songService = songService;
     this.spotify      = spotify;
 }
 public new void TestFixtureSetUp()
 {
     try
     {
         PlaylistDao = DaoFactory.GetPlaylistDao();
     }
     catch (TypeInitializationException exception)
     {
         throw exception.InnerException;
     }
 }
 public new void TestFixtureSetUp()
 {
     try
     {
         PlaylistDao = DaoFactory.GetPlaylistDao();
     }
     catch (TypeInitializationException exception)
     {
         throw exception.InnerException;
     }
 }
Exemplo n.º 5
0
 public PlaylistController()
 {
     try
     {
         PlaylistDao = new PlaylistDao();
         FolderDao = new FolderDao();
         ShareCodeDao = new ShareCodeDao();
     }
     catch (TypeInitializationException exception)
     {
         Logger.Error(exception.InnerException);
         throw exception.InnerException;
     }
 }
Exemplo n.º 6
0
 public PlaylistController()
 {
     try
     {
         PlaylistDao  = new PlaylistDao();
         FolderDao    = new FolderDao();
         ShareCodeDao = new ShareCodeDao();
     }
     catch (TypeInitializationException exception)
     {
         Logger.Error(exception.InnerException);
         throw exception.InnerException;
     }
 }
Exemplo n.º 7
0
 public PlaylistManager(ILog logger, IPlaylistDao playlistDao)
     : base(logger)
 {
     PlaylistDao = playlistDao;
 }
Exemplo n.º 8
0
 public PlaylistManager(ILog logger, IPlaylistDao playlistDao)
     : base(logger)
 {
     PlaylistDao = playlistDao;
 }
Exemplo n.º 9
0
 public PlaylistManager(ILog logger, IPlaylistDao playlistDao, IVideoDao videoDao)
     : base(logger)
 {
     PlaylistDao = playlistDao;
     VideoDao    = videoDao;
 }
Exemplo n.º 10
0
 public IPlaylistDao GetPlaylistDao(ISession session)
 {
     return PlaylistDao ?? (PlaylistDao = new PlaylistDao(session));
 }
Exemplo n.º 11
0
 public PlaylistManager(ILog logger, IPlaylistDao playlistDao, IVideoDao videoDao)
     : base(logger)
 {
     PlaylistDao = playlistDao;
     VideoDao = videoDao;
 }
 public override void fixtureSetUp()
 {
     base.fixtureSetUp();
     this.dao = daoFactory.getPlaylistDao();
 }
Exemplo n.º 13
0
 public IPlaylistDao GetPlaylistDao(ISession session)
 {
     return(PlaylistDao ?? (PlaylistDao = new PlaylistDao(session)));
 }
Exemplo n.º 14
0
 public IPlaylistDao GetPlaylistDao()
 {
     return PlaylistDao ?? (PlaylistDao = new PlaylistDao(Session));
 }
Exemplo n.º 15
0
 public PlaylistService(List <ISongServicePlaylistSaver> services,
                        IPlaylistDao playlistDao)
 {
     _playlistDao  = playlistDao;
     this.Services = services;
 }
Exemplo n.º 16
0
 public IPlaylistDao GetPlaylistDao()
 {
     return(PlaylistDao ?? (PlaylistDao = new PlaylistDao(Session)));
 }
 public override void setUp()
 {
     pdao = daoFactory.getPlaylistDao();
     adao = daoFactory.getAirplayDao();
     p1 = pdao.GetById(1L, false);
     p2 = pdao.GetById(2L, false);
     ap1 = adao.GetById(1L, false);
     ap2 = adao.GetById(2L, false);
     base.setUp();
 }