Esempio n. 1
0
        private static void FillUserTable(ISession session)
        {
            MmdbUser Frida = new MmdbUser()
            {
                Username = "******",
                Password = "******"
            };

            MmdbUser Lena = new MmdbUser()
            {
                Username = "******",
                Password = "******"
            };

            session.Save(Frida);
            session.Save(Lena);
        }
Esempio n. 2
0
        public IHttpActionResult CreateNewUser(MmdbUser newUser)
        {
            var    session     = DbService.OpenSession();
            string response    = "";
            string newUsername = newUser.Username;
            string newPassword = newUser.Password;

            MmdbUser newMmdbUser = new MmdbUser()
            {
                Username = newUsername,
                Password = newPassword
            };

            session.Save(newMmdbUser);

            response = "New user created successfully.";

            DbService.CloseSession(session);

            return(Ok(response));
        }