public Asset GetAsset(int id, Owner owner) { var asset = RavenSession.Query<Asset>().SingleOrDefault(x => x.Id == id && x.OwnerId == owner.Id); return asset; }
public ActionResult Register(RegisterModel model) { if (ModelState.IsValid) { Owner owner = new Owner { UserName = model.UserName, Password = model.Password}; RavenSession.Store(owner); FormsAuthentication.SetAuthCookie(model.UserName, false /* createPersistentCookie */); return RedirectToAction("Index", "Home"); } // If we got this far, something failed, redisplay form return View(model); }
public Asset GetAsset(int id, Owner owner) { if (owner == null) return null; return RavenSession.Query<Asset>().SingleOrDefault(x => x.Id == id && x.OwnerId == owner.Id); }