Beispiel #1
0
        public QueryProperty FindPropertyByText(QueryProperty testProperty, DbPropertyType direction, IList <QueryProperty> propertyList)
        {
            // Remove the alias if it exists at the end since the name of the
            // alias might have changed.

            if (string.IsNullOrEmpty(testProperty.Text)) //thro
            {
                return(null);
            }

            string testText = Regex.Replace(testProperty.Text, string.Format(@"\s+{0}$", testProperty.Name), string.Empty);

            IEnumerable <QueryProperty> foundProperties =
                from QueryProperty property in propertyList
                where !string.IsNullOrEmpty(property.Text) && Regex.Replace(property.Text, string.Format(@"\s+{0}$", property.Name), string.Empty) == testText &&
                property.PropertyType == direction
                select property;

            if (foundProperties.Count() > 0)
            {
                return(foundProperties.First());
            }
            else
            {
                return(null);
            }
        }
        private static ProcedureProperty FindPropertyByName(string propertyName, DbPropertyType direction, IList <ProcedureProperty> propertyList)
        {
            IEnumerable <ProcedureProperty> foundProperties =
                from ProcedureProperty property in propertyList
                where property.Name == propertyName &&
                property.PropertyType == direction
                select property;

            if (foundProperties.Count() > 0)
            {
                return(foundProperties.First());
            }
            else
            {
                return(null);
            }
        }