Example #1
0
 public CommentsController(MediaDbContext context, IDataService dataService, ImageStore imageStore, AzureNotifications azureNotifications)
 {
     _context            = context;
     _dataService        = dataService;
     _imageStore         = imageStore;
     _azureNotifications = azureNotifications;
 }
        public async Task MapShow()
        {
            try
            {
                var shows = await MazeHelper.GetShows();

                using (var db = new MediaDbContext())
                {
                    foreach (var show in shows)
                    {
                        if (db.Shows.Find(show.Id) == null)
                        {
                            await db.AddAsync(show);

                            await db.SaveChangesAsync();
                        }
                        await MapPerson(show.Id);
                    }
                }
            }
            catch (Exception ex)
            {
                var message = ex.Message;
            }
        }
        public async Task MapPerson(int showId)
        {
            try
            {
                var casts = await MazeHelper.GetCasts(showId);

                using (var db = new MediaDbContext())
                {
                    foreach (var cast in casts)
                    {
                        if (await db.Persons.FindAsync(cast.Person.Id) == null)
                        {
                            await db.AddAsync(cast.Person);

                            await db.SaveChangesAsync();
                        }
                        await MapShowPerson(showId, cast.Person.Id);
                    }
                }
            }
            catch (Exception ex)
            {
                var message = ex.Message;
            }
        }
Example #4
0
 public VideosController(MediaDbContext context, ProgenyDbContext progenyDbContext, IDataService dataService, AzureNotifications azureNotifications)
 {
     _context            = context;
     _progenyDbContext   = progenyDbContext;
     _dataService        = dataService;
     _azureNotifications = azureNotifications;
 }
 public ApiAccessService(
     ILogger <ApiAccessService> logger,
     MediaDbContext dbContext
     )
 {
     _logger    = logger;
     _dbContext = dbContext;
 }
Example #6
0
 public DataService(ProgenyDbContext context, MediaDbContext mediaContext, IDistributedCache cache)
 {
     _context      = context;
     _mediaContext = mediaContext;
     _cache        = cache;
     _cacheOptions.SetAbsoluteExpiration(new System.TimeSpan(0, 5, 0));        // Expire after 5 minutes.
     _cacheOptionsSliding.SetSlidingExpiration(new System.TimeSpan(96, 0, 0)); // Expire after 24 hours.
 }
        public async Task MapShowPerson(int showId, int personId)
        {
            try
            {
                using (var db = new MediaDbContext())
                {
                    if (await db.ShowPersons.FindAsync(showId, personId) == null)
                    {
                        await db.AddAsync(new ShowPerson()
                        {
                            ShowId = showId, PersonId = personId
                        });

                        await db.SaveChangesAsync();
                    }
                }
            }
            catch (Exception ex)
            {
                var message = ex.Message;
            }
        }
Example #8
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env, MediaDbContext mediaDbContext, IMediaRepository mediaRepository)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            app.UseRouting();

            app.UseAuthorization();

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllers();
            });

            app.UseSwagger();

            app.UseSwaggerUI(option => option.SwaggerEndpoint("/swagger/v1/swagger.json", "Api for Shows"));

            mediaDbContext.Database.EnsureCreated();

            mediaRepository.MapShow();
        }
Example #9
0
 public DataRepository(MediaDbContext context)
 {
     _context = context;
 }
 public StatisticsController(MediaDbContext mediaDatabase)
 {
     _mediaDatabase = mediaDatabase;
     //_medias = _mediaDatabase.Getmedias();
 }
Example #11
0
 public MediaController(IPhotoService photoService, MediaDbContext dbContext)
 {
     _photoService = photoService;
     _dbContext    = dbContext;
 }
Example #12
0
 public PodCastController(MediaDbContext context, UserManager <MediaWebUser> userManager, IUserDbService dbService)
 {
     _mediaDbContext = context;
     _userManager    = userManager;
     _userDbService  = dbService;
 }
Example #13
0
 public AuthController(MediaDbContext context, IUserService userService, IDataRepository <User> repo)
 {
     _userService = userService;
     _repo        = repo;
     _context     = context;
 }
Example #14
0
 public MediaController(MediaDbContext context, IDataRepository <Media> repo)
 {
     _context = context;
     _repo    = repo;
 }
Example #15
0
 public PublicAccessController(MediaDbContext context, ImageStore imageStore, IDataService dataService)
 {
     _context     = context;
     _imageStore  = imageStore;
     _dataService = dataService;
 }
 public UserDbService(MediaDbContext context)
 {
     _mediaDbContext = context;
 }
 public SqlServerRepository(MediaDbContext mediaDbContext)
 {
     _db = mediaDbContext;
 }
 public TestController(MediaDbContext DBManager, IOptionsMonitor <AppSettings> AppSettings)
 {
     _DBManager   = DBManager;
     _AppSettings = AppSettings.CurrentValue;
 }
Example #19
0
 public ReviewRepository(MediaDbContext context) : base(context)
 {
     _db = context;
 }
 public MediaRepository(MediaDbContext context)
 {
     this.context = context;
 }