Exemplo n.º 1
0
 private MakePost(Event ev)
 {
     InitializeComponent();
     _event = ev;
     _logicMedia = new MediaOracleContext();
     _logicPost = new PostLogic(new PostOracleContext());
 }
Exemplo n.º 2
0
 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);
 }
Exemplo n.º 3
0
 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);
 }
Exemplo n.º 4
0
 public MediaLogic(IMediaContext context)
 {
     _context = context;
 }
Exemplo n.º 5
0
 public MediaLogic(IMediaContext context)
 {
     _context = context;
 }
 /// <summary>
 /// MediaApplication Constructor
 /// </summary>
 /// <param name="mediaContext">MediaContext Interface</param>
 public MediaApplication(IMediaContext mediaContext)
 {
     _mediaContext = mediaContext;
 }
Exemplo n.º 7
0
 public PlaylistLogic(IPlaylistContext iPlaylistContext, IMediaContext iMediaContext)
 {
     _iPlaylistContext = iPlaylistContext;
     _iMediaContext    = iMediaContext;
 }
Exemplo n.º 8
0
 public MediaLogic()
 {
     _context = new MediaOracleContext();
 }
Exemplo n.º 9
0
        // 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"));
            });
        }
Exemplo n.º 10
0
 public UserReadRepository(IMediaContext mediaContext)
 {
     this.mediaContext = mediaContext;
 }
Exemplo n.º 11
0
 public MediaLogic()
 {
     _context = new MediaOracleContext();
 }
Exemplo n.º 12
0
 public LibraryWriteRepository(IMediaContext mediaContext)
 {
     this.mediaContext = mediaContext;
 }
Exemplo n.º 13
0
 public CategoryReadRepository(IMediaContext mediaContext)
 {
     this.mediaContext = mediaContext;
 }
Exemplo n.º 14
0
 public Repository(IMediaContext context)
 {
     this.context = context ?? throw new ArgumentNullException("Context can not be null.");
     dbSet        = context.Set <T>();
 }
Exemplo n.º 15
0
 public DepartmentWriteRepository(IMediaContext mediaContext)
 {
     this.mediaContext = mediaContext;
 }
Exemplo n.º 16
0
 public LibraryReadRepository(IMediaContext mediaContext)
 {
     this.mediaContext = mediaContext;
 }
Exemplo n.º 17
0
 public UserWriteRepository(IMediaContext mediaContext)
 {
     this.mediaContext = mediaContext;
 }
Exemplo n.º 18
0
 public UnitOfWork(IMediaContext context)
 {
     this.context = context ?? throw new ArgumentNullException("Context can not be null.");
 }
Exemplo n.º 19
0
 public CategoryWriteRepository(IMediaContext mediaContext)
 {
     this.mediaContext = mediaContext;
 }
Exemplo n.º 20
0
 public MediaLogic(IMediaContext iMediaContext)
 {
     _iMediaContext = iMediaContext;
 }
Exemplo n.º 21
0
 public void SetUp()
 {
     _iPlaylistContext = new PlaylistMemoryContext();
     _iMediaContext    = new MediaMemoryContext();
     _playlistLogic    = new PlaylistLogic(_iPlaylistContext, _iMediaContext);
 }