Exemple #1
0
        internal static IEnumerable <ICallableParameter> CreateParameters(Type type)
        {
            foreach (PropertyInfo info in type.GetProperties(BindingFlags.Public | BindingFlags.Instance))
            {
                ActiveProcedureParameterAttribute attr = (ActiveProcedureParameterAttribute)Attribute.GetCustomAttribute(info, typeof(ActiveProcedureParameterAttribute));
                if (attr == null)
                {
                    continue;
                }

                yield return(new ProcedureParameterData(attr.Name, attr.DbType, attr.MaxLength, attr.ParameterType, attr.IsResult));
            }
        }
Exemple #2
0
        internal static ICallableParameter CreateParameter(string name, Type type)
        {
            PropertyInfo property = type.GetProperty(name, BindingFlags.Public | BindingFlags.Instance);

            if (property == null)
            {
                return(null);
            }

            ActiveProcedureParameterAttribute attr = (ActiveProcedureParameterAttribute)Attribute.GetCustomAttribute(property, typeof(ActiveProcedureParameterAttribute));

            return(new ProcedureParameterData(attr.Name, attr.DbType, attr.MaxLength, attr.ParameterType, attr.IsResult));
        }