Class SqlDataStore<TEntity, TDbEntity>
A IDataStore<TData> that uses EntityFramework to support complex data structures with SQL Server.s
Inheritance
Inherited Members
Namespace: Cqrs.Sql.DataStores
Assembly: Cqrs.Sql.dll
Syntax
public class SqlDataStore<TEntity, TDbEntity> : IDataStore<TEntity>, IOrderedQueryable<TEntity>, IQueryable<TEntity>, IEnumerable<TEntity>, IOrderedQueryable, IQueryable, IEnumerable, IDisposable where TDbEntity : class, new ()
Type Parameters
Name | Description |
---|---|
TEntity | |
TDbEntity |
Constructors
SqlDataStore(IExpressionTreeConverter, DataContext)
Instantiates a new instance of the SqlDataStore<TEntity, TDbEntity> class
Declaration
public SqlDataStore(IExpressionTreeConverter expressionConverter, DataContext dataContext)
Parameters
Type | Name | Description |
---|---|---|
IExpressionTreeConverter | expressionConverter | |
System.Data.Linq.DataContext | dataContext |
Properties
ElementType
Gets the type of the element(s) that are returned when the expression tree associated with this instance of System.Linq.IQueryable is executed.
Declaration
public Type ElementType { get; }
Property Value
Type | Description |
---|---|
System.Type | A System.Type that represents the type of the element(s) that are returned when the expression tree associated with this object is executed. |
Implements
Expression
Gets the expression tree that is associated with the instance of System.Linq.IQueryable.
Declaration
public Expression Expression { get; }
Property Value
Type | Description |
---|---|
System.Linq.Expressions.Expression | The System.Linq.Expressions.Expression that is associated with this instance of System.Linq.IQueryable. |
Implements
Provider
Gets the query provider that is associated with this data source.
Declaration
public IQueryProvider Provider { get; }
Property Value
Type | Description |
---|---|
System.Linq.IQueryProvider | The System.Linq.IQueryProvider that is associated with this data source. |
Implements
Methods
Add(TEntity)
Add the provided data
to the data store and persist the change.
Declaration
public void Add(TEntity data)
Parameters
Type | Name | Description |
---|---|---|
TEntity | data |
Implements
Add(IEnumerable<TEntity>)
Add the provided data
to the data store and persist the change.
Declaration
public void Add(IEnumerable<TEntity> data)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<TEntity> | data |
Implements
Destroy(TEntity)
Remove the provided data
(normally by Rsn) from the data store and persist the change.
Declaration
public void Destroy(TEntity data)
Parameters
Type | Name | Description |
---|---|---|
TEntity | data |
Implements
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
public void Dispose()
Implements
GetEnumerator()
Returns an enumerator that iterates through the collection.
Declaration
public IEnumerator<TDbEntity> GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerator<TDbEntity> | A System.Collections.Generic.IEnumerator<T> that can be used to iterate through the collection. |
Remove(TEntity)
Will NOT mark the data
as logically (or soft) deleted. This will destroy and delete the row in the SQL Server.
Declaration
public void Remove(TEntity data)
Parameters
Type | Name | Description |
---|---|---|
TEntity | data |
Implements
RemoveAll()
Remove all contents (normally by use of a truncate operation) from the data store and persist the change.
Declaration
public void RemoveAll()
Implements
Update(TEntity)
Update the provided data
in the data store and persist the change.
Declaration
public void Update(TEntity data)
Parameters
Type | Name | Description |
---|---|---|
TEntity | data |
Implements
Explicit Interface Implementations
IEnumerable<TEntity>.GetEnumerator()
Returns an enumerator that iterates through the collection.
Declaration
IEnumerator<TEntity> IEnumerable<TEntity>.GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerator<TEntity> | A System.Collections.Generic.IEnumerator<T> that can be used to iterate through the collection. |
Implements
IEnumerable.GetEnumerator()
Returns an enumerator that iterates through a collection.
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.IEnumerator | An System.Collections.IEnumerator object that can be used to iterate through the collection. |