public static SearchConditions AddPropertyCondition <T>(this SearchConditions search, object value, MFConditionType cType = MFConditionType.MFConditionTypeEqual) where T : IMFPropertyDefinition { int pd_id = (int)typeof(T).GetField("id").GetRawConstantValue(); MFDataType data_type = (MFDataType)typeof(T).GetField("data_type").GetRawConstantValue(); if (value is IObjVerEx) { search.AddPropertyCondition(pd_id, cType, data_type, (value as IObjVerEx).objVerEx.ToLookup()); } else if (value is IList) { Lookups lookups = new Lookups(); foreach (IObjVerEx objVerEx in (value as IList)) { if (objVerEx == null) { break; } lookups.Add(-1, objVerEx.objVerEx.ToLookup()); } search.AddPropertyCondition(pd_id, cType, data_type, lookups); } else { search.AddPropertyCondition(pd_id, cType, data_type, value); } return(search); }