Class NoopStoreConfigurator.NoopDataStore
Non storing data store.IDataStore.
public class NoopStoreConfigurator.NoopDataStore : IDataStore
- Inheritance
-
NoopStoreConfigurator.NoopDataStore
- Implements
- Inherited Members
- Extension Methods
Constructors
NoopDataStore()
public NoopDataStore()
Properties
AutoCommit
True if tracked changes are (auto) committed on store dispose.
public bool AutoCommit { get; set; }
Property Value
Methods
CommitChanges()
Commit all tracked (detected) changes to the undrlying persistence store.
public void CommitChanges()
Delete<E>(IEnumerable<E>)
Mark IEnumerable<T> of entities
as deleted for removing from the store.
public void Delete<E>(IEnumerable<E> entities) where E : class
Parameters
entities
IEnumerable<E>
Type Parameters
E
Delete<TEntity>(TEntity)
Mark given ent
as deleted for removing from the store.
public void Delete<TEntity>(TEntity ent) where TEntity : class
Parameters
ent
TEntity
Type Parameters
TEntity
EnsureStore(IEnumerable<IDataSeed>?)
Take actions to make sure the underlying store exists and optional plants all provided seeds
.
public void EnsureStore(IEnumerable<IDataSeed>? seeds)
Parameters
seeds
IEnumerable<IDataSeed>
Remarks
Should create the entire store, if not present.
Evict<TEntity>(TEntity)
Evict given ent
from beeing tracked by the repository.
public void Evict<TEntity>(TEntity ent) where TEntity : class
Parameters
ent
TEntity
Type Parameters
TEntity
GetIdentifier<TEntity>(TEntity)
Get the data store identifier value(s) of the given ent
.
public object GetIdentifier<TEntity>(TEntity ent) where TEntity : class
Parameters
ent
TEntity
Returns
Type Parameters
TEntity
Get<TEntity>(params object[])
Get a persistent entity instance from the data store.
public TEntity Get<TEntity>(params object[] keys) where TEntity : class
Parameters
keys
object[]
Returns
- TEntity
Type Parameters
TEntity
Insert<E>(IEnumerable<E>)
Add an IEnumerable<T> of entities
for inserting to the store.
public IEnumerable<E> Insert<E>(IEnumerable<E> entities) where E : class
Parameters
entities
IEnumerable<E>
Returns
- IEnumerable<E>
Type Parameters
E
Insert<E>(E)
Add ent
for inserting to the store.
public E Insert<E>(E ent) where E : class
Parameters
ent
E
Returns
- E
Type Parameters
E
LoadExplicit<E, P>(E, Expression<Func<E, IEnumerable<P>>>)
Explicitly load collection prop
from ent
(if not already loaded).
public E LoadExplicit<E, P>(E entity, Expression<Func<E, IEnumerable<P>>> prop) where E : class where P : class
Parameters
entity
Eprop
Expression<Func<E, IEnumerable<P>>>
Returns
- E
Type Parameters
E
P
LoadExplicit<E, P>(E, Expression<Func<E, P?>>)
Explicitly load referenced prop
from ent
(if not already loaded).
public E LoadExplicit<E, P>(E entity, Expression<Func<E, P?>> prop) where E : class where P : class
Parameters
entity
Eprop
Expression<Func<E, P>>
Returns
- E
Type Parameters
E
P
LoadRelated<E>(IQueryable<E>, string)
Load related data associated with the given navigationPropertyPath
with the entities selected by the query
.
public IQueryable<E> LoadRelated<E>(IQueryable<E> query, string navigationPropertyPath) where E : class
Parameters
query
IQueryable<E>navigationPropertyPath
string
Returns
- IQueryable<E>
Type Parameters
E
Remarks
navigationPropertyPath
is a '.' separated path of navigation property names (all) to be included.
LoadRelated<E, P>(IQueryable<E>, Expression<Func<E, P>>)
Load related data associated with the given navProperty
with the entities selected by the query
.
public IEagerLoadedQueryable<E, P> LoadRelated<E, P>(IQueryable<E> query, Expression<Func<E, P>> navProperty) where E : class
Parameters
query
IQueryable<E>navProperty
Expression<Func<E, P>>
Returns
- IEagerLoadedQueryable<E, P>
Type Parameters
E
P
Remarks
This method can be chained to eagerly load multiple navigation properties.
Merge<TEntity>(TEntity)
Merge given ent
with any persistent version.
public TEntity Merge<TEntity>(TEntity entity) where TEntity : class, new()
Parameters
entity
TEntity
Returns
- TEntity
Type Parameters
TEntity
Remarks
A merge is especially usefull when persisting data updated from an input form that typically does not manage any navigation properties (i.e. references to other entities) and thus will leave such properties with their default value (null).
- if the given entity is not persistent yet it gets inserted, else only properties with non-null values are set on the persistent entity.
- Any property changed by the merge operation marks the entity as modified for updating with the store.
Query<TEntity>()
Return a queryable enumeration of ALL entities of E
in the store.
public IQueryable<TEntity> Query<TEntity>() where TEntity : class
Returns
- IQueryable<TEntity>
Type Parameters
TEntity
Remarks
Any changes to returned entities are beeing tracked (for potential commit with the underlying store).
ResetAll()
Reset all tracked entities to 'untracked'.
public void ResetAll()
ResetChanges()
Reset the change state of all tracked entities to 'unchanged'.
public void ResetChanges()
ThenLoadRelated<E, Prev, Prop>(IEagerLoadedQueryable<E, IEnumerable<Prev>>, Expression<Func<Prev, Prop>>)
Load additional related data associated with the given navProperty
based on a related type that was just loaded.
public IEagerLoadedQueryable<E, Prop> ThenLoadRelated<E, Prev, Prop>(IEagerLoadedQueryable<E, IEnumerable<Prev>> query, Expression<Func<Prev, Prop>> navProperty) where E : class
Parameters
query
IEagerLoadedQueryable<E, IEnumerable<Prev>>navProperty
Expression<Func<Prev, Prop>>
Returns
- IEagerLoadedQueryable<E, Prop>
Type Parameters
E
Prev
Prop
ThenLoadRelated<E, Prev, Prop>(IEagerLoadedQueryable<E, Prev>, Expression<Func<Prev, Prop>>)
Load additional related data associated with the given navProperty
based on a related type that was just loaded.
public IEagerLoadedQueryable<E, Prop> ThenLoadRelated<E, Prev, Prop>(IEagerLoadedQueryable<E, Prev> query, Expression<Func<Prev, Prop>> navProperty) where E : class
Parameters
query
IEagerLoadedQueryable<E, Prev>navProperty
Expression<Func<Prev, Prop>>
Returns
- IEagerLoadedQueryable<E, Prop>
Type Parameters
E
Prev
Prop
UntrackedQuery<TEntity>()
Return a queryable enumeration of ALL entities of E
in the store.
public IQueryable<TEntity> UntrackedQuery<TEntity>() where TEntity : class
Returns
- IQueryable<TEntity>
Type Parameters
TEntity
Remarks
Changes to returned entities are NOT beeing tracked.
Update<E>(IEnumerable<E>)
Track IEnumerable<T> of entities
as modified for updating with the store.
public IEnumerable<E> Update<E>(IEnumerable<E> entities) where E : class
Parameters
entities
IEnumerable<E>
Returns
- IEnumerable<E>
Type Parameters
E
Update<E>(E)
Track given ent
as modified for updating with the store.
public E Update<E>(E ent) where E : class
Parameters
ent
E
Returns
- E
Type Parameters
E
WithTransaction(Action<IDataTransaction>)
Excecutes operation
within a transaction.
public void WithTransaction(Action<IDataTransaction> operation)
Parameters
operation
Action<IDataTransaction>
Remarks
The operation
needs to call Commit() to commit.
Explicit Interface Implementations
IDataStore.Attach<E>(E)
Attach given ent
as unchanged (but tracked).
E IDataStore.Attach<E>(E ent) where E : class
Parameters
ent
E
Returns
- E
Type Parameters
E