I have API where I need to validate my user model. I choose an approach where I create different classes for Create/Edit actions to avoid mass-assignment and divide validati
There is a simple Solution for your problem
public class UserCreate { [Required(AllowEmptyStrings = false)] public string Username { get; set; } }
Here AllowEmptyStrings = false can be used for your validation