private MakePost(Event ev) { InitializeComponent(); _event = ev; _logicMedia = new MediaOracleContext(); _logicPost = new PostLogic(new PostOracleContext()); }
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 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); }
public MediaLogic(IMediaContext context) { _context = context; }
/// <summary> /// MediaApplication Constructor /// </summary> /// <param name="mediaContext">MediaContext Interface</param> public MediaApplication(IMediaContext mediaContext) { _mediaContext = mediaContext; }
public PlaylistLogic(IPlaylistContext iPlaylistContext, IMediaContext iMediaContext) { _iPlaylistContext = iPlaylistContext; _iMediaContext = iMediaContext; }
public MediaLogic() { _context = new MediaOracleContext(); }
// 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 UserReadRepository(IMediaContext mediaContext) { this.mediaContext = mediaContext; }
public LibraryWriteRepository(IMediaContext mediaContext) { this.mediaContext = mediaContext; }
public CategoryReadRepository(IMediaContext mediaContext) { this.mediaContext = mediaContext; }
public Repository(IMediaContext context) { this.context = context ?? throw new ArgumentNullException("Context can not be null."); dbSet = context.Set <T>(); }
public DepartmentWriteRepository(IMediaContext mediaContext) { this.mediaContext = mediaContext; }
public LibraryReadRepository(IMediaContext mediaContext) { this.mediaContext = mediaContext; }
public UserWriteRepository(IMediaContext mediaContext) { this.mediaContext = mediaContext; }
public UnitOfWork(IMediaContext context) { this.context = context ?? throw new ArgumentNullException("Context can not be null."); }
public CategoryWriteRepository(IMediaContext mediaContext) { this.mediaContext = mediaContext; }
public MediaLogic(IMediaContext iMediaContext) { _iMediaContext = iMediaContext; }
public void SetUp() { _iPlaylistContext = new PlaylistMemoryContext(); _iMediaContext = new MediaMemoryContext(); _playlistLogic = new PlaylistLogic(_iPlaylistContext, _iMediaContext); }