public LiveComment GetComment(Guid guid) { var result = new LiveComment(); result = _liveCommentService.GetComment(guid); return(result); }
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()); }
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()); }
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); }
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()); }