private bool HasAnySongs() { using (MusicLibraryContext dbContext = new MusicLibraryContext()) { return(dbContext .Entry(this.data) .Collection(album => album.Songs) .Query() .Any()); } }
public void Update(T obj) { table.Attach(obj); _context.Entry(obj).State = EntityState.Modified; }