Beispiel #1
0
            /// <summary>
            ///
            /// </summary>
            /// <param name="field"></param>
            /// <param name="parameterName"></param>
            /// <param name="index"></param>
            /// <param name="dbSetting"></param>
            /// <returns></returns>
            internal static Action <TEntity, DbCommand> Get(Field field,
                                                            string parameterName,
                                                            int index,
                                                            IDbSetting dbSetting = null)
            {
                var key = (long)typeof(TEntity).GetHashCode() + field.GetHashCode() +
                          parameterName.GetHashCode() + index.GetHashCode();

                if (cache.TryGetValue(key, out var func) == false)
                {
                    func = FunctionFactory.CompileDbCommandToProperty <TEntity>(field, parameterName, index, dbSetting);
                    cache.TryAdd(key, func);
                }
                return(func);
            }