Web API nullable required property requires DataMember attribute

前端 未结 3 619
不知归路
不知归路 2021-02-01 05:55

I am receiving the following VM on a Web API Post action

public class ViewModel
{
    public string Name { get; set; }

    [Required]
    public int? Street {          


        
3条回答
  •  梦如初夏
    2021-02-01 06:12

    I think you are running into the same problem as discussed here:

    DataAnnotation for Required property

提交回复
热议问题