Esempio n. 1
0
        public ActionResult AddAsync(string sourceId, IPrincipal principal)
        {
            StartBackgroundSignallingTask(
                (session, signal) =>
                {
                    var u = new UserUpdater(session, signal);
                    u.AddShow(principal.Identity.Name, sourceId);
                });

            return Json("ok",
                        JsonRequestBehavior.AllowGet);
        }
Esempio n. 2
0
        public void TestFullRun()
        {
            using (var store = new DocumentStore { Url = "http://localhost:8080" }.Initialize())
            {
                IndexCreation.CreateIndexes(typeof(SourceShowInfoCaches_ByName).Assembly, store);

                using (var session = store.OpenSession())
                {
                    var updater = new ShowUpdater(session, x => Console.WriteLine("Updated: " + x));
                    updater.UpdateShowNames();
                    session.SaveChanges();
                }

                using (var session = store.OpenSession())
                {
                    var updater = new ShowUpdater(session, x => Console.WriteLine("Updated: " + x));
                    updater.UpdateShowNames();
                    session.SaveChanges();
                }

                using (var session = store.OpenSession())
                {
                    var updater = new ShowUpdater(session, x => Console.WriteLine("Updated: " + x));
                    updater.SeedShow("24496");
                    session.SaveChanges();
                }

                using (var session = store.OpenSession())
                {
                    var updater = new ShowUpdater(session, x => Console.WriteLine("Updated: " + x));
                    updater.UpdateShows();
                    session.SaveChanges();
                }

                using (var session = store.OpenSession())
                {
                    var updater = new UserUpdater(session, x => Console.WriteLine("CreateUser: "******"testve", "2342342434234", "2353465346546");
                    session.SaveChanges();
                }

                using (var session = store.OpenSession())
                {
                    var updater = new UserUpdater(session, x => Console.WriteLine("AddShow: " + x));
                    updater.AddShow("testve", "24496");
                    session.SaveChanges();
                }

                using (var session = store.OpenSession())
                {
                    var updater = new UserUpdater(session, x => Console.WriteLine("AddShow: " + x));
                    updater.SetEpisodeWatched("testve", "24496");
                    session.SaveChanges();
                }

                using (var session = store.OpenSession())
                {
                    var updater = new UserUpdater(session, x => Console.WriteLine("AddShow: " + x));
                    updater.SetSeasonWatched("testve", "24496");
                    session.SaveChanges();
                }
            }
        }