public void LinkMedia(string relation, string sourceMediaContentId, MediaDto linkedMedia) { var sourceMedia = this.DocumentList.FirstOrDefault(x => x.ContentId == sourceMediaContentId); if (sourceMedia == null) { throw new Exception("Cannot find the source media"); } if (linkedMedia == null || linkedMedia.ContentId == null || linkedMedia.ContentId == sourceMediaContentId) { throw new Exception("Invalid linked media"); } LinkedMediaDto lm = new LinkedMediaDto(relation, sourceMedia, linkedMedia); this.LinkedMediaList.Add(lm); }
public void LinkMedia(string relation, MediaDto sourceMedia, MediaDto linkedMedia, Direction direction = Direction.Bi) { if (sourceMedia == null) { throw new Exception("Source Media cannot be null."); } if (!this.DocumentList.Contains(sourceMedia)) { throw new Exception("Cannot find the source media"); } if (linkedMedia == null) { throw new Exception("Cannot find the linked media"); } LinkedMediaDto lm = new LinkedMediaDto(relation, sourceMedia, linkedMedia); lm.Direction = direction; this.LinkedMediaList.Add(lm); }
public LinkedMediaDto(string relation, MediaDto sourceMedia, MediaDto linkedMedia) { this.Relation = relation; this.SourceMedia = sourceMedia; this.LinkedMedia = linkedMedia; }
public void AddMedia(MediaDto media) { media.CaseId = this.CaseId; this.DocumentList.Add(media); }