internal static CriteriaPropertyCollection Clone(CriteriaPropertyCollection masterCritProps)
        {
            var newCritProps = new CriteriaPropertyCollection();

            foreach (var critProp in masterCritProps)
            {
                var newCritProp = new CriteriaProperty();
                newCritProp.DbBindColumn = (DbBindColumn)critProp.DbBindColumn.Clone();
                ((Property)newCritProp).Clone(critProp);
                newCritProp.ParameterValue = critProp.ParameterValue;

                newCritProps.Add(newCritProp);
            }

            return(newCritProps);
        }
        private static CriteriaPropertyCollection GetCriteriaProperties(CslaObjectInfo objectInfo)
        {
            var criteriaInfo               = typeof(CslaObjectInfo).GetProperty("CriteriaObjects");
            var criteriaObjects            = criteriaInfo.GetValue(objectInfo, null);
            var criteriaPropertyCollection = new CriteriaPropertyCollection();

            foreach (var crit in (CriteriaCollection)criteriaObjects)
            {
                foreach (var prop in crit.Properties)
                {
                    if (crit.GetOptions.Factory)
                    {
                        criteriaPropertyCollection.Add(prop);
                    }
                }
            }

            return(criteriaPropertyCollection);
        }