-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #174 from mfenniak/issue_174
Support multi-indexes in IndexDefine
- Loading branch information
Showing
11 changed files
with
186 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using System; | ||
using System.ComponentModel; | ||
using System.Linq.Expressions; | ||
|
||
namespace RethinkDb | ||
{ | ||
[ImmutableObject(true)] | ||
public interface IBaseIndex<TRecord, TIndex> | ||
{ | ||
ITableQuery<TRecord> Table { get; } | ||
string Name { get; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.ComponentModel; | ||
using System.Linq.Expressions; | ||
|
||
namespace RethinkDb | ||
{ | ||
[ImmutableObject(true)] | ||
public interface IMultiIndex<TRecord, TIndex> : IBaseIndex<TRecord, TIndex> | ||
{ | ||
Expression<Func<TRecord, IEnumerable<TIndex>>> IndexAccessor { get; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq.Expressions; | ||
|
||
namespace RethinkDb | ||
{ | ||
public class MultiIndex<TRecord, TIndex> : IMultiIndex<TRecord, TIndex> | ||
{ | ||
private readonly ITableQuery<TRecord> table; | ||
private readonly string name; | ||
private readonly Expression<Func<TRecord, IEnumerable<TIndex>>> indexAccessor; | ||
|
||
public MultiIndex(ITableQuery<TRecord> table, string name, Expression<Func<TRecord, IEnumerable<TIndex>>> indexAccessor) | ||
{ | ||
this.table = table; | ||
this.name = name; | ||
this.indexAccessor = indexAccessor; | ||
} | ||
|
||
public ITableQuery<TRecord> Table | ||
{ | ||
get { return table; } | ||
} | ||
|
||
public string Name | ||
{ | ||
get { return name; } | ||
} | ||
|
||
public Expression<Func<TRecord, IEnumerable<TIndex>>> IndexAccessor | ||
{ | ||
get { return indexAccessor; } | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters