public TrackableContainerSqlMapper(ISqlProvider sqlProvider, Tuple <string, object[]>[] mapperParameters)
        {
            _sqlProvider = sqlProvider;

            _trackableType = TrackableResolver.GetContainerTrackerType(typeof(T));
            if (_trackableType == null)
            {
                throw new ArgumentException($"Cannot find tracker type of '{nameof(T)}'");
            }

            _items = ConstructPropertyItems(sqlProvider, mapperParameters);
        }
예제 #2
0
        public TrackableContainerRedisMapper(RedisTypeConverter typeConverter = null)
        {
            if (typeConverter == null)
            {
                typeConverter = RedisTypeConverter.Instance;
            }

            _trackableType = TrackableResolver.GetContainerTrackerType(typeof(T));
            if (_trackableType == null)
            {
                throw new ArgumentException($"Cannot find tracker type of '{nameof(T)}'");
            }

            _items = ConstructPropertyItems(typeConverter);
        }
        public TrackableContainerHashesRedisMapper(RedisTypeConverter typeConverter = null)
        {
            if (typeConverter == null)
            {
                typeConverter = RedisTypeConverter.Instance;
            }

            _trackableType = TrackableResolver.GetContainerTrackerType(typeof(T));
            if (_trackableType == null)
            {
                throw new ArgumentException($"Cannot find tracker type of '{nameof(T)}'");
            }

            _items = ConstructPropertyItems(typeConverter);
            _fieldNameToItemMap = _items.ToDictionary(x => x.FieldName, y => y);
        }
예제 #4
0
        public TrackableContainerMongoDbMapper()
        {
            _trackableType = TrackableResolver.GetContainerTrackerType(typeof(T));

            _items = ConstructPropertyItems();
        }