C# Client Library
A C# Client Library for the AnalyzeRe REST API
Loading...
Searching...
No Matches
NotEmptyAttribute.cs
Go to the documentation of this file.
1using System;
2using System.Collections;
3using System.Linq;
4
6{
10 [AttributeUsage(AttributeTargets.Property, Inherited = true, AllowMultiple = false)]
12 {
18 public override bool IsValid(object value)
19 {
20 return !(value is IEnumerable valuenumerable) || valuenumerable.Cast<object>().Any();
21 }
22 }
23}
Specifies that the enumerable property with this attribute cannot be empty when POSTing the resource ...
override bool IsValid(object value)
If the given value is an IEnumerable, it is only valid for POST if it is not empty.
Any attribute that can validate the value of a property.