Exemplo n.º 1
0
        public List <Video> VideoFromUser(string username)
        {
            MediaPlatformDbContext db = MediaPlatformRepository.GetDbContext();
            User user = db.Set <User>().Include(u => u.Videos).SingleOrDefault(u => u.Username == username);

            return(user.Videos);
        }
Exemplo n.º 2
0
        public List <Video> VideoFromCommunity(string community_name)
        {
            MediaPlatformDbContext db = MediaPlatformRepository.GetDbContext();
            Community com             = db.Set <Community>().Include(c => c.Videos).SingleOrDefault(c => c.Name == community_name);

            return(com.Videos);
        }
Exemplo n.º 3
0
 public void SetDbContext(MediaPlatformDbContext dbContext)
 {
     _mpr = new MediaPlatformRepository(dbContext);
 }
 public MediaPlatformRepository(MediaPlatformDbContext dbContext)
 {
     _db = dbContext;
 }