public User CreateUser(User user)
 {
     User result = null;
     using (UserManager manager = new UserManager())
     {
         result = manager.Create(user);
     }
     return result;
 }
        public bool SessionOnline(User user)
        {
            bool result = false;

            /// Validate user and password, to login.
            if (ValidateUser(user.UserName, user.Password) != null)
            {
                using (SessionManager manager = new SessionManager())
                {
                    result = manager.IsUserOnline(user);
                }
            }

            return result;
        }
        public User UpdateUser(User user)
        {
            User result = null;

            /// Validte user and password, to update.
            if (ValidateUser(user.UserName, user.Password) != null)
            {
                using (UserManager manager = new UserManager())
                {
                    result = manager.Update(user);
                }
            }

            return result;
        }
        public Guid? LogIn(User user)
        {
            Guid? sessionId = null;

            /// Validate user and password, to login.
            if (ValidateUser(user.UserName, user.Password) != null)
            {
                using (SessionManager manager = new SessionManager())
                {
                    sessionId = manager.LogInUser(user);
                }
            }

            return sessionId;
        }