public VideoStreamViewModel(VideoStream stream)
     : this()
 {
     this.Source = stream.Source;
     this.IsPublic = stream.IsPublic;
     this.IsLive = stream.IsLive;
 }
 public EditStreamGroupsViewModel(VideoStream stream) : this()
 {
     this.VideoStreamId = (int)stream.VideoStreamId;
     this.Name = stream.Name;
     this.Description = stream.Description;
     this.Source = stream.Source;
     this.IsPublic = stream.IsPublic;
     this.IsLive = stream.IsLive;
     this.OwnerId = stream.OwnerId;
 }
        public void SaveVideoStream(VideoStream videoVideoStream)
        {
            if (context.VideoStreams.Count(b => b.VideoStreamId == videoVideoStream.VideoStreamId) != 0)
            {
                context.VideoStreams.Single(b => b.VideoStreamId == videoVideoStream.VideoStreamId).Update(videoVideoStream);
            }
            else
            {
                context.VideoStreams.Add(videoVideoStream);
            }

            context.SaveChanges();
        }
 public VideoStreamViewModel(VideoStream stream, string userId)
     : this()
 {
     this.Source = stream.Source;
     this.IsLive = stream.IsLive;
     if (stream.IsPublic)
     {
         this.IsPublic = true;
     }
     else
     {
         var identityManager = new IdentityManager();
         this.IsPublic = identityManager.IsUserInRole(userId, "Member");
     }
 }
 public void DeleteVideoStream(VideoStream videoVideoStream)
 {
     context.VideoStreams.Remove(videoVideoStream);
     context.SaveChanges();
 }
Beispiel #6
0
 /// <summary>
 /// Updates the specified new videoStream.
 /// </summary>
 /// <param name="videoStream">The new videoStream.</param>
 public void Update(VideoStream videoStream)
 {
     this.Name = videoStream.Name;
     this.Description = videoStream.Description;
     this.Source = videoStream.Source;
     this.OwnerId = videoStream.OwnerId;
     if (this.Created == DateTime.MinValue)
     {
         this.Created = DateTime.Now;
     }
     this.Modified = DateTime.Now;
 }