LicenseRepository
Namespace: Babel.Data Assembly: Babel.Data.dll
A license repository.
Inheritance
object ← GenericRepository<License> ← LicenseRepository
Implements
ILicenseRepository, IGenericRepository<License>
Inherited Members
GenericRepository<License>.Get(Expression<Func<License, bool>>, Func<IQueryable<License>, IOrderedQueryable<License>>, string, string, int?, int?), GenericRepository<License>.GetAsync(Expression<Func<License, bool>>, Func<IQueryable<License>, IOrderedQueryable<License>>, string, string, int?, int?, CancellationToken), GenericRepository<License>.QueryAsync(string, string, string, string, int?, int?, CancellationToken), GenericRepository<License>.GetById(params object[]), GenericRepository<License>.GetByIdAsync(params object[]), GenericRepository<License>.GetByIdAsync(object[], CancellationToken), GenericRepository<License>.CountAsync(Expression<Func<License, bool>>, CancellationToken), GenericRepository<License>.CountAsync(string, CancellationToken), GenericRepository<License>.Insert(License), GenericRepository<License>.InsertAsync(License, CancellationToken), GenericRepository<License>.Update(License), GenericRepository<License>.Delete(params object[]), GenericRepository<License>.Delete(License), GenericRepository<License>.Save(), GenericRepository<License>.SaveAsync(CancellationToken), GenericRepository<License>.DbSet, GenericRepository<License>.Context, object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Constructors
LicenseRepository(BabelDbContext)
Initializes a new instance of the LicenseRepository class.
Parameters
Name | Description |
---|---|
| The database context. |
Methods
Delete(IEnumerable<int>)
Deletes a list of licenses 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 license primary key ids to delete. |
FindByLicenseIdAsync(string)
Find a license by its license id.
Parameters
Name | Description |
---|---|
| The license id to search for. |
Returns
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. |
InsertAsync(License, 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. |
Update(License)
Updates the given license in the repository. Begins tracking the given entity in the Modified state such that it will be updated in the database when SaveChanges() is called.
Parameters
Name | Description |
---|---|
| The license to update. |
Last updated