CustomerRepository
Namespace: Babel.Data Assembly: Babel.Data.dll
A customer repository.
Inheritance
object ← GenericRepository<Customer> ← CustomerRepository
Implements
ICustomerRepository, IGenericRepository<Customer>
Inherited Members
GenericRepository<Customer>.Get(Expression<Func<Customer, bool>>, Func<IQueryable<Customer>, IOrderedQueryable<Customer>>, string, string, int?, int?), GenericRepository<Customer>.GetAsync(Expression<Func<Customer, bool>>, Func<IQueryable<Customer>, IOrderedQueryable<Customer>>, string, string, int?, int?, CancellationToken), GenericRepository<Customer>.QueryAsync(string, string, string, string, int?, int?, CancellationToken), GenericRepository<Customer>.GetById(params object[]), GenericRepository<Customer>.GetByIdAsync(params object[]), GenericRepository<Customer>.GetByIdAsync(object[], CancellationToken), GenericRepository<Customer>.CountAsync(Expression<Func<Customer, bool>>, CancellationToken), GenericRepository<Customer>.CountAsync(string, CancellationToken), GenericRepository<Customer>.Insert(Customer), GenericRepository<Customer>.InsertAsync(Customer, CancellationToken), GenericRepository<Customer>.Update(Customer), GenericRepository<Customer>.Delete(params object[]), GenericRepository<Customer>.Delete(Customer), GenericRepository<Customer>.Save(), GenericRepository<Customer>.SaveAsync(CancellationToken), GenericRepository<Customer>.DbSet, GenericRepository<Customer>.Context, object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Constructors
CustomerRepository(BabelDbContext)
Initializes a new instance of the CustomerRepository class.
Parameters
Name | Description |
---|---|
| The database context. |
Methods
Delete(IEnumerable<int>)
Deletes the given list of customers from the repository. 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 customer Identifiers to delete. |
GetAsync(DateTime?, DateTime?, int?, int?, string, string)
Asynchronously gets a list of customers from this repository.
Parameters
Name | Description |
---|---|
| (Optional) Specifies a filter for customer created after a given start date. |
| (Optional) Specifies a filter for customer created before a given end date. |
| (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 comma separated list of nested entity names to retrieve. |
| (Optional) Order by expression. |
Returns
Name | Description |
---|---|
A task that represents the asynchronous get operation. The task result contains the list of customers found. |
GetByCodeAsync(string)
Asynchronously gets the Customer with the given code value. If no Customer entity is found in the context or the store, then null is returned.
Parameters
Name | Description |
---|---|
| The customer code of the customer to be found. |
Returns
Name | Description |
---|---|
A task that represents the asynchronous get operation. The task result contains the Customer found, or null. |
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 Customer found, or null. |
GetLicensesByCustomerCodeAsync(string)
Asynchronously gets the Licenses for a given Customer code.
Parameters
Name | Description |
---|---|
| The customer code. |
Returns
Name | Description |
---|---|
A task that represents the asynchronous get operation. The task result contains the list of Licenses found, or null. |
GetOrdersByCustomerCodeAsync(string)
Asynchronously gets the orders for a given customer code.
Parameters
Name | Description |
---|---|
| The customer code. |
Returns
Name | Description |
---|---|
A task that represents the asynchronous get operation. The task result contains the list of Order found, or null. |
GetProductsByCustomerCodeAsync(string)
Asynchronously gets the Products for a given Customer code.
Parameters
Name | Description |
---|---|
| The customer code. |
Returns
Last updated