Data Annotations for validation, at least one required field?

前端 未结 4 1327
我在风中等你
我在风中等你 2020-12-03 00:52

If I have a search object with a list of fields, can I, using the System.ComponentModel.DataAnnotations namespace, set it up to validate that at least one of the fields in t

4条回答
  •  独厮守ぢ
    2020-12-03 01:21

    If you want to do complex validation against any .Net class, without litering them with annotations, look at FluentValidation, or for .Net 2.0, FluentValidation for 2.0

提交回复
热议问题