public void Load <TElement>(VideoTranscript videoTranscript, Expression <Func <VideoTranscript, ICollection <TElement> > > includeProperty) where TElement : class { var oldVT = _context.VideoTranscripts.Find(videoTranscript.Id); if (oldVT != null) { _context.Entry(oldVT).State = EntityState.Detached; } _context.VideoTranscripts.Attach(videoTranscript); _context.Entry(videoTranscript).Collection(includeProperty).Load(); }
public void InsertOrUpdate(VideoTranscript videoTranscript) { if (videoTranscript.Id == default(int)) { // New entity _context.VideoTranscripts.Add(videoTranscript); } else { // Existing entity _context.Entry(videoTranscript).State = EntityState.Modified; } }
public DbPropertyEntry GetProperty <TProperty>(VideoTranscript videoTranscript, Expression <Func <VideoTranscript, TProperty> > property) { return(_context.Entry(videoTranscript).Property(property)); }