Ejemplo n.º 1
0
        private static PropertyInfo GetMatchingProperty(object storedProcedure, SqlParameter parameter)
        {
            foreach (var propertyInfo in storedProcedure.GetType().GetProperties().Where(p => p.HasAttribute <StoredProcedureParameterAttribute>()))
            {
                var helper = new StoredProcedureParserHelper();

                var name = helper.GetParameterName(propertyInfo);

                if (parameter.ParameterName.Substring(1) == name)
                {
                    return(propertyInfo);
                }
            }

            return(null);
        }