Esempio n. 1
0
        public LiteDbFlexer(ConnectionType type = ConnectionType.Shared)
        {
            var resolveInfo = LiteDbResolver.Resolve <T>(type);

            TableName    = resolveInfo.tableName;
            FileName     = resolveInfo.fileName;
            LiteDatabase = resolveInfo.liteDatabase;
        }
Esempio n. 2
0
        public LiteDbFlexer()
        {
            var resolveInfo = LiteDbResolver.Resolve <T>();

            TableName    = resolveInfo.tableName;
            FileName     = resolveInfo.fileName;
            LiteDatabase = resolveInfo.liteDatabase;

            LiteCollection = resolveInfo.liteDatabase.GetCollection <T>(resolveInfo.tableName);
            resolveInfo.indexItems.forEach(indexItem => {
                LiteCollection.EnsureIndex(indexItem.Key, indexItem.Value);
            });
        }