Exemplo n.º 1
0
        //
        // GET: /Home/
        public ActionResult Index()
        {
            var user = Session["user"] as User;

            if (user == null)
            {
                user = new User();
                Session.Add("user", user);
            }

            return View(user);
        }
Exemplo n.º 2
0
        private void AddLightObjToDb(LightWeightObject lightObj, User user, string fileName)
        {
            using (Db.Server.RequestStart(Db.Database))
            {
                var collection = Db.Database.GetCollection<LightWeightObject>("lightObjCollection");

                collection.Insert(lightObj);

                user.ListFiles.Add(new UploadedFileInfo(lightObj.Id, fileName));

                Session.Add("user", user);
            }
        }