0

I'm getting this error, while running the application:

System.InvalidOperationException: 'Action 'ProjectAPI.Controllers.UserController.CreatePasswordHash (TravelMoreAPI)' has more than one parameter that was specified or inferred as bound from request body. Only one parameter per action may be bound from body. Inspect the following parameters, and use 'FromQueryAttribute' to specify bound from query,
'FromRouteAttribute' to specify bound from route, and 'FromBodyAttribute' for parameters to be bound from body:
Byte[]& passwordHash
Byte[]& passwordSalt'


This is my CreatePasswordHash method :
public void CreatePasswordHash(string password, out byte[] passwordHash, out byte[] passwordSalt)
{
    using (var hmac = new HMACSHA512())
    {
        passwordSalt = hmac.Key;
        passwordHash = hmac.ComputeHash(System.Text.Encoding.UTF8.GetBytes(password));
    }
}
1
  • While building or while running? Please edit your question to state a consistent problem. Commented Jun 14, 2022 at 21:24

1 Answer 1

-1

Make your method private,

that's my solution

Sign up to request clarification or add additional context in comments.

1 Comment

As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.