public void AddVideoClip(MusicVideoClip clip) { var ent = new MediaCatalogueEntities(); var vc = new Music_Track(); vc.id = clip.id; vc.Duration = clip.Duration; // ToDo: Find/Add the artist and Genre entities ent.AddToMusic_Track(vc); // This will change when Genre and Artist are linked to this Music_Track (no need to Add the newly created entity). }
public void UpdateVideoClip(MusicVideoClip clip) { var ent = new MediaCatalogueEntities(); var vc = (from c in ent.Music_Track.Include("Media_Item") .Include("Music_Genre") .Include("Music_Artist") where c.id == clip.id select c).FirstOrDefault(); if (vc != null) { vc.Media_Item.Title = clip.SongName; vc.Duration = clip.Duration; // ToDo: Find the right Genre and Artist entities, and update the references ent.SaveChanges(); } }