예제 #1
0
 public void AddSomeone()
 {
     var newbie = new Tenant("Colm");
     NhSession.Save(newbie);
 }
예제 #2
0
        public ActionResult CreatePerson(string newUserName)
        {
            var newPerson = new Tenant(newUserName){ Instance = CurrentUser.Instance};
            var alreadyExists = NhSession.Query<Tenant>().Where(x => x.Name == newUserName);

            if (alreadyExists.Any())
            {
                var message = "There's already a user called " + newUserName + ".";
                return RedirectToAction("Index", message);
            }

            NhSession.Save(newPerson);

            return RedirectToAction("Index");
        }