/// <summary> /// Initializes a new instance of the <see cref="MediaItemMapper"/> class. /// </summary> public MediaItemMapper(IPlaylistContext context, ILocalizationService translator, ISequenceProvider sequenceProvider, IMapleLog log, IValidator <MediaItem> validator) : base(translator, sequenceProvider, log, validator) { _context = context ?? throw new ArgumentNullException(nameof(context)); InitializeMapper(); }
public UserController() { userContext = new UserSQLContext(); userRepository = new UserRepository(userContext); playlistContext = new PlaylistSQLContext(); playlistRepository = new PlaylistRepository(playlistContext); }
public MusicController() { _userViewModel = new UserViewModel(); playlistContext = new PlaylistSQLContext(); userContext = new UserSQLContext(); playlistRepository = new PlaylistRepository(playlistContext); userRepository = new UserRepository(userContext); }
public void SetUp() { _iUserContext = new UserMemoryContext(); _mediaContext = new MediaMemoryContext(); _ratingContext = new RatingMemoryContext(); _playlistContext = new PlaylistMemoryContext(); _playlistLogic = new PlaylistLogic(_playlistContext, _mediaContext); _mediaLogic = new MediaLogic(_mediaContext); _ratingLogic = new RatingLogic(_ratingContext, _mediaLogic); _userLogic = new UserLogic(_iUserContext, _playlistLogic, _ratingLogic); }
public MediaRepository(IPlaylistMapper playlistMapper, IMediaItemMapper mediaItemMapper, IMediaPlayerMapper mediaPlayerMapper, IPlaylistContext context) { _context = context ?? throw new ArgumentNullException(nameof(context)); _mediaItemMapper = mediaItemMapper ?? throw new ArgumentNullException(nameof(mediaItemMapper)); _playlistMapper = playlistMapper ?? throw new ArgumentNullException(nameof(playlistMapper)); _mediaPlayerMapper = mediaPlayerMapper ?? throw new ArgumentNullException(nameof(mediaPlayerMapper)); _busyStack = new BusyStack(); _busyStack.OnChanged += (hasItems) => { IsBusy = hasItems; }; }
public void Setup() { _iMovieContext = new MovieMemoryContext(); _iGenreContext = new GenreMemoryContext(); _iPlaylistContext = new PlaylistMemoryContext(); _iMediaContext = new MediaMemoryContext(); _iRatingContext = new RatingMemoryContext(); _genreLogic = new GenreLogic(_iGenreContext); _searchLogic = new SearchLogic(_genreLogic); _playlistLogic = new PlaylistLogic(_iPlaylistContext, _iMediaContext); _mediaLogic = new MediaLogic(_iMediaContext); _ratingLogic = new RatingLogic(_iRatingContext, _mediaLogic); _movieLogic = new MovieLogic(_iMovieContext, _genreLogic, _searchLogic, _playlistLogic, _mediaLogic, _ratingLogic); _testGenre1 = new GenreModel("test1", 1); }
/// <summary> /// Initializes a new instance of the <see cref="MediaItem"/> class. /// </summary> /// <param name="model">The model.</param> public MediaItem(Data.MediaItem model, IValidator <MediaItem> validator, IPlaylistContext context) : base(model, validator) { _id = model.Id; _playlistId = model.PlaylistId; _location = model.Location; _description = model.Description; _title = model.Title; _sequence = model.Sequence; _duration = TimeSpan.FromTicks(model.Duration); _privacyStatus = (PrivacyStatus)model.PrivacyStatus; _createdBy = model.CreatedBy; _createdOn = model.CreatedOn; _updatedBy = model.UpdatedBy; _updatedOn = model.UpdatedOn; _context = context ?? throw new ArgumentNullException(nameof(context)); Validate(); }
public TestController() { playlistContext = new PlaylistSQLContext(); playlistRepository = new PlaylistRepository(playlistContext); }
public PlaylistLogic(IPlaylistContext iPlaylistContext, IMediaContext iMediaContext) { _iPlaylistContext = iPlaylistContext; _iMediaContext = iMediaContext; }
public Uploadlogic(IPodcastContext podcastContext, IPlaylistContext playlistContext) { PodcastRepository = new PodcastRepository(podcastContext); PlaylistRepository = new PlaylistRepository(playlistContext); }
public PlaylistRepository(IPlaylistContext context) { _context = context; }
public ManageController(IPodcastContext podcastContext, IPlaylistContext playlistContext) { _podcastContext = podcastContext; _playlistContext = playlistContext; }
public UploadController(IPodcastContext podcastContext, IPlaylistContext playlistContext) { _podcastContext = podcastContext; _playlistContext = playlistContext; }
public PlaylistRepository(IPlaylistContext _playlistContext) { playlistContext = _playlistContext; }
// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.Configure <CookiePolicyOptions>(options => { // This lambda determines whether user consent for non-essential cookies is needed for a given request. options.CheckConsentNeeded = context => true; options.MinimumSameSitePolicy = SameSiteMode.None; }); services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1); services.AddSingleton(Configuration); services.AddTransient <IMovieContext, MovieSQLContext>(m => { string c = Configuration.GetConnectionString("DefaultConnection"); return(new MovieSQLContext(c)); }); services.AddTransient <IGenreContext, GenreSQLContext>(g => { string c = Configuration.GetConnectionString("DefaultConnection"); return(new GenreSQLContext(c)); }); services.AddTransient <IUserContext, UserSQLContext>(u => { string c = Configuration.GetConnectionString("DefaultConnection"); return(new UserSQLContext(c)); }); services.AddTransient <IPlaylistContext, PlaylistSQLContext>(p => { string c = Configuration.GetConnectionString("DefaultConnection"); return(new PlaylistSQLContext(c)); }); services.AddTransient <IMediaContext, MediaSQLContext>(m => { string c = Configuration.GetConnectionString("DefaultConnection"); return(new MediaSQLContext(c)); }); services.AddTransient <IRatingContext, RatingSQLContext>(r => { string c = Configuration.GetConnectionString("DefaultConnection"); return(new RatingSQLContext(c)); }); services.AddTransient(m => { IMovieContext mc = m.GetService <IMovieContext>(); GenreLogic gl = m.GetService <GenreLogic>(); SearchLogic sl = m.GetService <SearchLogic>(); PlaylistLogic p = m.GetService <PlaylistLogic>(); MediaLogic me = m.GetService <MediaLogic>(); RatingLogic rl = m.GetService <RatingLogic>(); return(new MovieLogic(mc, gl, sl, p, me, rl)); }); services.AddTransient(g => { IGenreContext gc = g.GetService <IGenreContext>(); return(new GenreLogic(gc)); }); services.AddTransient(s => { GenreLogic gl = s.GetService <GenreLogic>(); return(new SearchLogic(gl)); }); services.AddTransient(s => { IUserContext uc = s.GetService <IUserContext>(); PlaylistLogic pl = s.GetService <PlaylistLogic>(); RatingLogic rl = s.GetService <RatingLogic>(); return(new UserLogic(uc, pl, rl)); }); services.AddTransient(p => { IPlaylistContext pl = p.GetService <IPlaylistContext>(); IMediaContext m = p.GetService <IMediaContext>(); return(new PlaylistLogic(pl, m)); }); services.AddTransient(me => { IMediaContext m = me.GetService <IMediaContext>(); return(new MediaLogic(m)); }); services.AddTransient(r => { IRatingContext rc = r.GetService <IRatingContext>(); MediaLogic m = r.GetService <MediaLogic>(); return(new RatingLogic(rc, m)); }); services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme) .AddCookie(options => { options.LoginPath = "/User/Login"; }); services.AddAuthorization(options => { options.AddPolicy("Admin", p => p.RequireAuthenticatedUser().RequireRole("Admin")); options.AddPolicy("User", p => p.RequireAuthenticatedUser().RequireRole("User")); }); }
public void SetUp() { _iPlaylistContext = new PlaylistMemoryContext(); _iMediaContext = new MediaMemoryContext(); _playlistLogic = new PlaylistLogic(_iPlaylistContext, _iMediaContext); }