I have a viewmodel with an Id property
[Required] public int Id { get; set; }
But I think this attribute is working only for string propert
Use the Range Attribute.
Range
Set minimum to 1 and maximum to int.MaxValue
int.MaxValue
[Range(1, int.MaxValue, ErrorMessage = "Value for {0} must be between {1} and {2}.")]