using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
namespace NXWMS.Code.Verifications
{
///
/// 字符串验证
///
public static class UtilCheckString
{
///
/// 获取动态参数空结果处理
///
///
///
public static bool GetDynamicParmaValidateResult(params object[] paramArray)
{
foreach (var item in paramArray)
{
if (string.IsNullOrWhiteSpace(item.ToString()))
{
return false;
}
}
return true;
}
///
/// 获取动态参数空结果处理T
///
///
///
///
public static bool GetDynamicParmaValidateResult(T data) where T : class
{
var props = typeof(T).GetProperties();
foreach (PropertyInfo detail in props)
{
if (props.Where(m => string.IsNullOrWhiteSpace(m.ToString())).Count() > 0)
{
return false;
}
}
return true;
}
}
}