最近在研究.netcore,尝试把前后端完全分离。但是在写接口的时候,Post参数是FromBody的时候报错了
Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware[1] An unhandled exception has occurred while executing the request. System.InvalidCastException: Unable to cast object of type 'System.Int32' to type 'System.String'. at System.ComponentModel.DataAnnotations.StringLengthAttribute.IsValid(Object value) at System.ComponentModel.DataAnnotations.ValidationAttribute.