private static void InitEntity(Assembly assembly) { foreach (var row in assembly.GetTypes()) { RedisTableAttribute rt = row.GetCustomAttribute <RedisTableAttribute>(); if (rt != null) { if (!_objectCache.ContainsKey(row)) { _objectCache.Add(row, ReflectionUtil.CreateInstanceDelegate(row)); } if (!_keyCache.ContainsKey(row)) { foreach (var propertie in row.GetProperties()) { RedisColumnAttribute redisColumn = propertie.GetCustomAttribute <RedisColumnAttribute>(); if (redisColumn != null && redisColumn.ColumnType == RedisColumnType.RedisKey) { _keyCache.Add(row, new ReflectionUtil( ReflectionUtil.CreatePropertyGetter(propertie), ReflectionUtil.CreatePropertySetter(propertie) )); } if (redisColumn != null && redisColumn.ColumnType == RedisColumnType.RedisScore) { _scoreCache.Add(row, new ReflectionUtil( ReflectionUtil.CreatePropertyGetter(propertie), ReflectionUtil.CreatePropertySetter(propertie) )); } } } } } }