ASP.NET Web API POST parameter is null

前端 未结 2 1980
被撕碎了的回忆
被撕碎了的回忆 2021-01-13 08:43

(To clarify, I have read other questions and their answers and tried all solutions, but none of them solved the issue)

I\'m debugging locally a code that I\'ll deplo

2条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-13 09:17

    I believe the default model binder does not bind to fields, only properties with a public setter. Try changing your fields to properties:

    public class PlayerEntry
    {
        public string userID { get; set; }
        public string userName { get; set; }
        public int userProgress { get; set; }
    }
    

提交回复
热议问题