SqlTable<TEntity> Class
A SqlSet<TResult> that provides CRUD (Create, Read, Update, Delete) operations for annotated classes. This class cannot be instantiated, to get an instance use the Table<TEntity>() method.
Inheritance Hierarchy
System.Object
DbExtensions.SqlSet
DbExtensions.SqlSet<TEntity>
DbExtensions.SqlTable<TEntity>
Namespace: DbExtensions
Assembly: DbExtensions.dll
Syntax
public sealed class SqlTable<TEntity> : SqlSet<TEntity>
where TEntity : class
Type Parameters
TEntity
The type of the entity.
The SqlTable<TEntity> type exposes the following members.
Properties
Name | Description | |
---|---|---|
CommandBuilder | Gets a SqlCommandBuilder<TEntity> object for the current table. | |
Name | Gets the name of the table. | |
ResultType | The type of objects this set returns. This property can be null. (Inherited from SqlSet.) |
Methods
Name | Description | |
---|---|---|
Add | Recursively executes INSERT commands for the specified entity and all its one-to-one and one-to-many associations. | |
AddRange(IEnumerable<TEntity>) | Recursively executes INSERT commands for the specified entities and all their one-to-one and one-to-many associations. | |
AddRange(TEntity[]) | Recursively executes INSERT commands for the specified entities and all their one-to-one and one-to-many associations. | |
All | Determines whether all elements of the set satisfy a condition. (Inherited from SqlSet.) | |
Any() | Determines whether the set contains any elements. (Inherited from SqlSet.) | |
Any(String, Object[]) | Determines whether any element of the set satisfies a condition. (Inherited from SqlSet.) | |
AsEnumerable | Gets all TResult objects in the set. The query is deferred-executed. (Inherited from SqlSet<TResult>.) | |
Cast(Type) | Casts the elements of the set to the specified type. (Inherited from SqlSet<TResult>.) | |
Cast<T>() | Casts the elements of the set to the specified type. (Inherited from SqlSet<TResult>.) | |
Contains(Object) | Checks the existance of the entity, using the primary key value. (Inherited from SqlSet<TResult>.) | |
Contains(TEntity) | Checks the existance of the entity, using the primary key value. | |
ContainsKey | Checks the existance of an entity whose primary matches the id parameter. | |
Count() | Returns the number of elements in the set. (Inherited from SqlSet.) | |
Count(String, Object[]) | Returns a number that represents how many elements in the set satisfy a condition. (Inherited from SqlSet.) | |
Find | Gets the entity whose primary key matches the id parameter. (Inherited from SqlSet<TResult>.) | |
First() | Returns the first element of the set. (Inherited from SqlSet<TResult>.) | |
First(String, Object[]) | Returns the first element in the set that satisfies a specified condition. (Inherited from SqlSet<TResult>.) | |
FirstOrDefault() | Returns the first element of the set, or a default value if the set contains no elements. (Inherited from SqlSet<TResult>.) | |
FirstOrDefault(String, Object[]) | Returns the first element of the set that satisfies a condition or a default value if no such element is found. (Inherited from SqlSet<TResult>.) | |
GetDefiningQuery | Returns the SQL query that is the source of data for the set. (Inherited from SqlSet.) | |
GetEnumerator | Returns an enumerator that iterates through the set. (Inherited from SqlSet<TResult>.) | |
Include | Specifies the related objects to include in the query results. (Inherited from SqlSet<TResult>.) | |
LongCount() | Returns an Int64 that represents the total number of elements in the set. (Inherited from SqlSet.) | |
LongCount(String, Object[]) | Returns an Int64 that represents how many elements in the set satisfy a condition. (Inherited from SqlSet.) | |
OrderBy | Sorts the elements of the set according to the columnList. (Inherited from SqlSet<TResult>.) | |
Refresh | Sets all column members of entity to their most current persisted value. | |
Remove | Executes a DELETE command for the specified entity. | |
RemoveKey | Executes a DELETE command for the entity whose primary key matches the id parameter. | |
RemoveRange(IEnumerable<TEntity>) | Executes DELETE commands for the specified entities. | |
RemoveRange(TEntity[]) | Executes DELETE commands for the specified entities. | |
Select(Type, String, Object[]) | Projects each element of the set into a new form. (Inherited from SqlSet.) | |
Select<TResult>(String, Object[]) | Projects each element of the set into a new form. (Inherited from SqlSet.) | |
Select<TResult>(Func<IDataRecord, TResult>, String, Object[]) | Projects each element of the set into a new form. (Inherited from SqlSet.) | |
Single() | The single element of the set. (Inherited from SqlSet<TResult>.) | |
Single(String, Object[]) | Returns the only element of the set that satisfies a specified condition, and throws an exception if more than one such element exists. (Inherited from SqlSet<TResult>.) | |
SingleOrDefault() | Returns the only element of the set, or a default value if the set is empty; this method throws an exception if there is more than one element in the set. (Inherited from SqlSet<TResult>.) | |
SingleOrDefault(String, Object[]) | Returns the only element of the set that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition. (Inherited from SqlSet<TResult>.) | |
Skip | Bypasses a specified number of elements in the set and then returns the remaining elements. (Inherited from SqlSet<TResult>.) | |
Take | Returns a specified number of contiguous elements from the start of the set. (Inherited from SqlSet<TResult>.) | |
ToArray | Creates an array from the set. (Inherited from SqlSet<TResult>.) | |
ToList | Creates a List<TResult> from the set. (Inherited from SqlSet<TResult>.) | |
ToString | Returns the SQL query of the set. (Inherited from SqlSet.) | |
Update(TEntity) | Executes an UPDATE command for the specified entity. | |
Update(TEntity, Object) | Executes an UPDATE command for the specified entity. | |
UpdateRange(IEnumerable<TEntity>) | Executes UPDATE commands for the specified entities. | |
UpdateRange(TEntity[]) | Executes UPDATE commands for the specified entities. | |
Where | Filters the set based on a predicate. (Inherited from SqlSet<TResult>.) |