CS8604 Possible null reference argument for parameter 's' in 'int int.Parse(string s)'.

Asjad Butt 71 Reputation points
2022-09-24T06:30:20.073+00:00

Hi the base is not explain able but im using name identifier of claims principal to get user id so i convert it to int user parse operation now its giving a null reference warning as follows: Possible null reference argument for parameter 's' in 'int int.Parse(string s)'.
now when i call this method in post postman i get an Input string was not in a correct format. error.
ill provide the controller with and the repositories the have the methods
the controller
the repository interface
the repository implementation

Developer technologies ASP.NET ASP.NET Core
{count} votes

1 answer

Sort by: Most helpful
  1. Asjad Butt 71 Reputation points
    2022-09-24T07:29:08.96+00:00

    i can refactor the question as the likedid is zero the claims principal return nothing


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.