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)); }
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)); } }