Write the C# code using .NET Core to create the user registration and login endpoints. The registration endpoint should accept username, password and email as input and return a success message upon successful registration. The login endpoint should accept username and password as input and return a JWT token upon successful authentication.
Write the C# code using .NET Core to create the user registration and login endpoints. The registration endpoint should accept username, password and email as input and return a success message upon successful registration. The login endpoint should accept username and password as input and return a JWT token upon successful authentication.