Ejemplo n.º 1
0
            /// <summary>
            ///
            /// </summary>
            /// <param name="cacheKey"></param>
            /// <param name="inputFields"></param>
            /// <param name="outputFields"></param>
            /// <param name="dbSetting"></param>
            /// <returns></returns>
            internal static Action <DbCommand, TEntity> Get(string cacheKey,
                                                            IEnumerable <DbField> inputFields,
                                                            IEnumerable <DbField> outputFields,
                                                            IDbSetting dbSetting = null)
            {
                var key = GetKey(cacheKey, inputFields, outputFields);

                if (cache.TryGetValue(key, out var func) == false)
                {
                    if (typeof(TEntity).IsDictionaryStringObject())
                    {
                        func = FunctionFactory.CompileDictionaryStringObjectDbParameterSetter <TEntity>(inputFields, dbSetting);
                    }
                    else
                    {
                        func = FunctionFactory.CompileDataEntityDbParameterSetter <TEntity>(inputFields, outputFields, dbSetting);
                    }
                }
                return(func);
            }