Class Table<TEntity>
A Linq IQueryProvider that represents a table in Cassandra
Implements
Inherited Members
Namespace: Dse.Data.Linq
Assembly: Dse.dll
Syntax
public class Table<TEntity> : CqlQuery<TEntity>, IInternalStatement, IStatement, IQueryable<TEntity>, IEnumerable<TEntity>, IOrderedQueryable, IQueryable, IEnumerable, ITable, IQueryProvider
Type Parameters
Name | Description |
---|---|
TEntity |
Constructors
Table(ISession)
Creates a new instance of the Linq IQueryProvider that represents a table in Cassandra using Global configuration.
Declaration
public Table(ISession session)
Parameters
Type | Name | Description |
---|---|---|
ISession | session | Session instance to be used to execute the statements |
Table(ISession, MappingConfiguration)
Creates a new instance of the Linq IQueryProvider that represents a table in Cassandra using the mapping configuration provided.
Fluent configuration or attributes can be used to define mapping information.
Declaration
public Table(ISession session, MappingConfiguration config)
Parameters
Type | Name | Description |
---|---|---|
ISession | session | Session instance to be used to execute the statements |
MappingConfiguration | config | Mapping configuration |
Remarks
In case no mapping information is defined, case-insensitive class and method names will be used.
Table(ISession, MappingConfiguration, String)
Creates a new instance of the Linq IQueryProvider that represents a table in Cassandra using the mapping configuration provided.
Use this constructor if you want to use a different table name than the one defined in the mapping configuration.
Fluent configuration or attributes can be used to define mapping information.
Declaration
public Table(ISession session, MappingConfiguration config, string tableName)
Parameters
Type | Name | Description |
---|---|---|
ISession | session | Session instance to be used to execute the statements |
MappingConfiguration | config | Mapping configuration |
System.String | tableName | Name of the table |
Remarks
In case no mapping information is defined, case-insensitive class and method names will be used.
Table(ISession, MappingConfiguration, String, String)
Creates a new instance of the Linq IQueryProvider that represents a table in Cassandra using the mapping configuration provided.
Use this constructor if you want to use a different table and keyspace names than the ones defined in the mapping configuration.
Fluent configuration or attributes can be used to define mapping information.
Declaration
public Table(ISession session, MappingConfiguration config, string tableName, string keyspaceName)
Parameters
Type | Name | Description |
---|---|---|
ISession | session | Session instance to be used to execute the statements |
MappingConfiguration | config | Mapping configuration |
System.String | tableName | Name of the table |
System.String | keyspaceName | Name of the keyspace were the table was created. |
Remarks
In case no mapping information is defined, case-insensitive class and method names will be used.
Properties
KeyspaceName
Gets the name of the keyspace used. If null, it uses the active session keyspace.
Declaration
public string KeyspaceName { get; }
Property Value
Type | Description |
---|---|
System.String |
Name
Gets the name of the Table in Cassandra
Declaration
public string Name { get; }
Property Value
Type | Description |
---|---|
System.String |
Methods
Create()
Declaration
public void Create()
CreateIfNotExists()
Declaration
public void CreateIfNotExists()
CreateQuery<TElement>(Expression)
Creates a CqlQuery<TEntity>
Declaration
public IQueryable<TElement> CreateQuery<TElement>(Expression expression)
Parameters
Type | Name | Description |
---|---|---|
System.Linq.Expressions.Expression | expression |
Returns
Type | Description |
---|---|
System.Linq.IQueryable<TElement> |
Type Parameters
Name | Description |
---|---|
TElement |
GetEntityType()
Declaration
public Type GetEntityType()
Returns
Type | Description |
---|---|
System.Type |
GetSession()
Declaration
public ISession GetSession()
Returns
Type | Description |
---|---|
ISession |
GetTableType()
Declaration
public TableType GetTableType()
Returns
Type | Description |
---|---|
TableType |
Insert(TEntity)
Returns a new CqlInsert<TEntity> command. Use Execute() method to execute the query.
Declaration
public CqlInsert<TEntity> Insert(TEntity entity)
Parameters
Type | Name | Description |
---|---|---|
TEntity | entity |
Returns
Type | Description |
---|---|
CqlInsert<TEntity> |
Insert(TEntity, Boolean)
Returns a new CqlInsert<TEntity> command. Use Execute() method to execute the query.
Declaration
public CqlInsert<TEntity> Insert(TEntity entity, bool insertNulls)
Parameters
Type | Name | Description |
---|---|---|
TEntity | entity | The entity to insert |
System.Boolean | insertNulls | Determines if the query must be generated using
Use
Use |
Returns
Type | Description |
---|---|
CqlInsert<TEntity> |
Explicit Interface Implementations
IQueryProvider.CreateQuery(Expression)
Declaration
IQueryable IQueryProvider.CreateQuery(Expression expression)
Parameters
Type | Name | Description |
---|---|---|
System.Linq.Expressions.Expression | expression |
Returns
Type | Description |
---|---|
System.Linq.IQueryable |
IQueryProvider.Execute(Expression)
Declaration
object IQueryProvider.Execute(Expression expression)
Parameters
Type | Name | Description |
---|---|---|
System.Linq.Expressions.Expression | expression |
Returns
Type | Description |
---|---|
System.Object |
IQueryProvider.Execute<TResult>(Expression)
Declaration
TResult IQueryProvider.Execute<TResult>(Expression expression)
Parameters
Type | Name | Description |
---|---|---|
System.Linq.Expressions.Expression | expression |
Returns
Type | Description |
---|---|
TResult |
Type Parameters
Name | Description |
---|---|
TResult |