OrderRepository
Namespace: Babel.Data Assembly: Babel.Data.dll
An order repository.
Inheritance
object ← GenericRepository<Order> ← OrderRepository
Implements
IOrderRepository, IGenericRepository<Order>
Inherited Members
GenericRepository<Order>.Get(Expression<Func<Order, bool>>, Func<IQueryable<Order>, IOrderedQueryable<Order>>, string, string, int?, int?), GenericRepository<Order>.GetAsync(Expression<Func<Order, bool>>, Func<IQueryable<Order>, IOrderedQueryable<Order>>, string, string, int?, int?, CancellationToken), GenericRepository<Order>.QueryAsync(string, string, string, string, int?, int?, CancellationToken), GenericRepository<Order>.GetById(params object[]), GenericRepository<Order>.GetByIdAsync(params object[]), GenericRepository<Order>.GetByIdAsync(object[], CancellationToken), GenericRepository<Order>.CountAsync(Expression<Func<Order, bool>>, CancellationToken), GenericRepository<Order>.CountAsync(string, CancellationToken), GenericRepository<Order>.Insert(Order), GenericRepository<Order>.InsertAsync(Order, CancellationToken), GenericRepository<Order>.Update(Order), GenericRepository<Order>.Delete(params object[]), GenericRepository<Order>.Delete(Order), GenericRepository<Order>.Save(), GenericRepository<Order>.SaveAsync(CancellationToken), GenericRepository<Order>.DbSet, GenericRepository<Order>.Context, object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Constructors
OrderRepository(BabelDbContext)
Initializes a new instance of the OrderRepository class.
Parameters
Name | Description |
---|---|
| The database context. |
Methods
Delete(IEnumerable<int>)
Deletes a list of order with the given primary key values. Begins tracking the given entities in the Detached state such that they will be deleted in the database when SaveChanges() is called.
Parameters
Name | Description |
---|---|
| The order primary key ids to delete. |
DeleteResourceAsync(int, IEnumerable<int>)
Asynchronously deletes the resources for a given order. Begins tracking the given entities in the Detached state such that they will be deleted in the database when SaveChanges() is called.
Parameters
Name | Description |
---|---|
| The order primary key. |
| List of resources primary keys. |
Returns
Name | Description |
---|---|
A task that represents the asynchronous delete operation. |
GetByIdAsync(params object[])
Asynchronously gets an entity with the given primary key values. If an entity with the given primary key values exists in the context, then it is returned immediately without making a request to the store. Otherwise, a request is made to the store for an entity with the given primary key values and this entity, if found, is attached to the context and returned. If no entity is found in the context or the store, then null is returned.
Parameters
Name | Description |
---|---|
| The values of the primary key for the entity to be found. |
Returns
Name | Description |
---|---|
A task that represents the asynchronous get operation. The task result contains the entity found, or null. |
GetResourcesAsync(int)
Asynchronously gets a list of resources for the given order.
Parameters
Name | Description |
---|---|
| The order primary key. |
Returns
InsertAsync(Order, CancellationToken)
Asynchronously inserts the given entity in the repository. Begins tracking the given entity, and any other reachable entities that are not already being tracked, in the Added state such that they will be inserted into the database when SaveChanges() is called.
Parameters
Name | Description |
---|---|
| The entity. |
| (Optional) A token that allows processing to be cancelled. |
Returns
Name | Description |
---|---|
An asynchronous result that yields the insert. |
InsertResourceAsync(int, Resource)
Asynchronously insert the given resource in the repository for the specified order.
Parameters
Returns
Name | Description |
---|---|
A task that represents the asynchronous insert operation. The task result contains the Order for the given |
QueryProductsAsync(int, string, string, string, string, int?, int?, CancellationToken)
Asynchronously query a list of ProductOrder for a given order.
Parameters
Name | Description |
---|---|
| Specifies the order id. |
| (Optional) Specifies a select expression. |
| (Optional) Specifies the filter expression. |
| (Optional) Order by expression. |
| (Optional) A comma separated list of nested entity names to retrieve. |
| (Optional) The number of records to skip before the first record found. |
| (Optional) The number of records to take after the first record found. |
| (Optional) A token that allows processing to be cancelled. |
Returns
Name | Description |
---|---|
A task that represents the asynchronous get operation. |
Last updated