// // GET: /Home/ public ActionResult Index() { var user = Session["user"] as User; if (user == null) { user = new User(); Session.Add("user", user); } return View(user); }
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); } }