protected internal static object FindOne(Type targetType, params ICriterion[] criteria)
{
Array result = SlicedFindAll(targetType, 0, 2, criteria);
if (result.Length > 1)
{
throw new ActiveRecordException(targetType.Name + ".FindOne returned " + result.Length +
" rows. Expecting one or none");
}
return (result.Length == 0) ? null : result.GetValue(0);
}