Beispiel #1
0
        public LiveComment GetComment(Guid guid)
        {
            var result = new LiveComment();

            result = _liveCommentService.GetComment(guid);

            return(result);
        }
Beispiel #2
0
        public Guid NewComment(LiveComment comment = null, string movieName = "", string userName = "")
        {
            var newComment = new LiveComment
            {
                Comment = "this is a test"
            };

            //add comment, returnd new guid
            var result = _liveCommentService.AddComment(newComment);


            return(Guid.NewGuid());
        }
Beispiel #3
0
        public Guid NewComment(LiveComment comment = null, string movieName = "", string userName = "")
        {
            var newComment = new LiveComment
            {
                Id          = Guid.NewGuid().ToString(),
                UserId      = Guid.NewGuid().ToString(),
                MovieId     = Guid.NewGuid().ToString(),
                Comment     = "this is a test",
                CreatedDate = DateTime.Now.ToString(),
                Interval    = new TimeSpan(1, 2, 1).ToString()
            };

            //add comment, returnd new guid
            var result = _liveCommentService.AddComment(newComment);


            return(Guid.NewGuid());
        }
Beispiel #4
0
        public LiveComment GetComment(Guid guid)
        {
            var result = new LiveComment();

            var documentStore = new DocumentStore
            {
                Url             = "http://localhost:8080",
                DefaultDatabase = "LiveCommentary",
            };

            documentStore.Initialize();
            using (var session = documentStore.OpenSession())
            {
                result = session.Load <dynamic>("movies/1");
            }

            return(result);
        }
Beispiel #5
0
        public Guid AddComment(LiveComment liveComment)
        {
            var documentStore = new DocumentStore
            {
                Url             = "http://localhost:8080",
                DefaultDatabase = "LiveCommentary",
            };

            documentStore.Initialize();

            using (var session = documentStore.OpenSession())
            {
                session.Store(liveComment);

                session.SaveChanges();
            }

            return(Guid.NewGuid());
        }