Example #1
0
 public async Task <bool> ContainsSourceMedia(SourceMedia sourcemedia)
 {
     using (var _context = _factory())
     {
         return(null != await _context.Set <SourceMedia>()
                .FirstOrDefaultAsync(x =>
                                     x.SourceId == sourcemedia.SourceId &&
                                     x.MediaId == sourcemedia.MediaId));
     }
 }
Example #2
0
        public async Task AddSourceMedia(SourceMedia sourcemedia)
        {
            using (var _context = _factory())
            {
                await _context.Set <SourceMedia>()
                .AddAsync(sourcemedia);

                await _context.SaveChangesAsync();
            }
        }