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; } }
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; }
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; } }
// 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(); }
public DataRepository(MediaDbContext context) { _context = context; }
public StatisticsController(MediaDbContext mediaDatabase) { _mediaDatabase = mediaDatabase; //_medias = _mediaDatabase.Getmedias(); }
public MediaController(IPhotoService photoService, MediaDbContext dbContext) { _photoService = photoService; _dbContext = dbContext; }
public PodCastController(MediaDbContext context, UserManager <MediaWebUser> userManager, IUserDbService dbService) { _mediaDbContext = context; _userManager = userManager; _userDbService = dbService; }
public AuthController(MediaDbContext context, IUserService userService, IDataRepository <User> repo) { _userService = userService; _repo = repo; _context = context; }
public MediaController(MediaDbContext context, IDataRepository <Media> repo) { _context = context; _repo = repo; }
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; }
public ReviewRepository(MediaDbContext context) : base(context) { _db = context; }
public MediaRepository(MediaDbContext context) { this.context = context; }