Exemplo n.º 1
0
        public LiveComment GetComment(Guid guid)
        {
            var result = new LiveComment();

            result = _liveCommentService.GetComment(guid);

            return(result);
        }
Exemplo n.º 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());
        }
Exemplo n.º 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());
        }
Exemplo n.º 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);
        }
Exemplo n.º 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());
        }