Exemple #1
0
        public IActionResult CreateAccount([FromBody] User user)
        {
            IUserRepository rep      = new SqLiteUserRepository();
            long            last_id  = rep.SaveUser(user);
            string          response = $"user created with id {last_id}";

            return(Content(response));
        }
Exemple #2
0
        public IActionResult Post([FromBody] User user)
        {
            IUserRepository rep     = new SqLiteUserRepository();
            long            last_id = rep.SaveUser(user);

            if (last_id is 0)
            {
                string response = "user exist";
                return(Json(response));
            }
            else
            {
                string response = $"user created with id {last_id}";
                return(Json(response));
            }
        }