public bool CreateMediaItem(CreateMediaItemModel cmim)
        {
            if (cmim != null)
            {
                MediaItem mi = new MediaItem();
                mi.FileName = cmim.FileName;
                mi.FilePath = cmim.FilePath;
                mi.UploaderUsername = cmim.UploaderUsername;

                Event evt = db.Events.Where(e => e.EventId == cmim.EventId).FirstOrDefault();

                evt.MediaItems.Add(mi);
                db.SaveChanges();

                return true;
            }
            else
            {
                return false;
            }
        }
 /// <summary>
 /// Deprecated Method for adding a new object to the MediaItems EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToMediaItems(MediaItem mediaItem)
 {
     base.AddObject("MediaItems", mediaItem);
 }
 /// <summary>
 /// Create a new MediaItem object.
 /// </summary>
 /// <param name="mediaItemId">Initial value of the MediaItemId property.</param>
 /// <param name="fileName">Initial value of the FileName property.</param>
 /// <param name="filePath">Initial value of the FilePath property.</param>
 /// <param name="eventId">Initial value of the EventId property.</param>
 /// <param name="uploaderUsername">Initial value of the UploaderUsername property.</param>
 public static MediaItem CreateMediaItem(global::System.Int32 mediaItemId, global::System.String fileName, global::System.String filePath, global::System.Int32 eventId, global::System.String uploaderUsername)
 {
     MediaItem mediaItem = new MediaItem();
     mediaItem.MediaItemId = mediaItemId;
     mediaItem.FileName = fileName;
     mediaItem.FilePath = filePath;
     mediaItem.EventId = eventId;
     mediaItem.UploaderUsername = uploaderUsername;
     return mediaItem;
 }