public void Lookup(ParameterLookupContext context)
 {
     foreach (var lookup in lookups)
     {
         lookup.Lookup(context);
     }
 }
Пример #2
0
        public SqlCommandDescription Generate(MethodInfo methodInfo, object[] arguments)
        {
            var context = SqlCommandGenerateContext.Create()
                          .SetMethod(methodInfo)
                          .Build();

            string cacheKey = $"SqlCOmmandDescription_{context.ToString()}";
            SqlCommandDescription description = cache.GetOrCreate <SqlCommandDescription>(cacheKey, key =>
            {
                if (context.HasAnyQueryAttribute)
                {
                    return(GetDescriptionByQuery(context));
                }
                else
                {
                    return(GetSqlCommandDescriptionWithourParameterFilled(context));
                }
            });

            if (arguments != null && arguments.Length != 0)
            {
                ParameterLookupContext lookupContet
                    = new ParameterLookupContext
                      (
                          this,
                          description,
                          methodInfo,
                          arguments
                      );
                this.parameterLookupFactory.Lookup(lookupContet);
            }
            return(description);
        }