Beispiel #1
0
        public IActionResult Login(string userName, string password)
        {
            User user = dataAccess.Login(userName, password);

            if (user == null)
            {
                return(NotFound());
            }
            return(new ObjectResult(user));
        }
Beispiel #2
0
        public IActionResult Create([FromBody] User user)
        {
            User newuser = dataAccess.Create(user);

            return(new ObjectResult(newuser));
        }
Beispiel #3
0
        public User GetUser(int id)
        {
            User user = dataAccess.GetUsers().FirstOrDefault();

            return(user);
        }