LicenseRepository
Namespace: Babel.Data Assembly: Babel.Data.dll
A license repository.
public class LicenseRepository : GenericRepository<License>, ILicenseRepository, IGenericRepository<License>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>.GroupByAsync(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, GenericRepository<License>.NoTracking, 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.
public LicenseRepository(BabelDbContext context)Parameters
context BabelDbContext
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.
public void Delete(IEnumerable<int> licenseIds)Parameters
licenseIds IEnumerable<int>
The license primary key ids to delete.
FindByLicenseIdAsync(string)
Find a license by its license id.
public Task<List<License>> FindByLicenseIdAsync(string licenseId)Parameters
licenseId string
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.
public override Task<License> GetByIdAsync(params object[] ids)Parameters
ids object[]
The values of the primary key for the entity to be found.
Returns
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.
public override Task<EntityEntry<License>> InsertAsync(License license, CancellationToken cancellationToken = default)Parameters
license License
The entity.
cancellationToken CancellationToken
(Optional) A token that allows processing to be cancelled.
Returns
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.
public override void Update(License license)Parameters
license License
The license to update.
Last updated