Interface IRepository<T\>
Namespace: Common.Contracts
Assembly: Common.dll
Common.Contracts.IRepository%601 is an interface that get a generic parameter and give method definitions to query the database. The generic type have to implement the Common.Primitives.Entity class to be used.
Type Parameters
T
Methods
Add\(T\)
Method that add an entity of type T in the database.
Parameters
entity T
Returns
T
The added entity.
Delete\(T\)
Method that remove an entity of type T from the database.
Parameters
entity T
DeleteRange\(IEnumerable<T\>\)
Method that remove all passed entities of type T from the database.
Parameters
entities IEnumerable <T\>
Exists\(Func<T, bool\>\)
Method that check if entity of type T in the database responds to a certain predicate.
Parameters
Returns
True if the entities in database respond to the given predicate, false otherwise.
GetAllAsync\(\)
Method that get all entities of type T in the database.
Returns
Task < IEnumerable <T\>\>
System.Collections.Generic.IEnumerable%601 that contains all the elements.
GetByIdAsync\(Guid\)
Method that get an entity of type T in the database by it's System.Guid.
Parameters
entityId Guid
Returns
Task <T?\>
Remarks
This method doesn't include related entities.
GetByIdAsyncWithConcurrency\(Guid\)
Method that get an entity of type T in the database by it's System.Guid. Remove entity tracking that was previously stored in it.
Parameters
entityId Guid
Returns
Task <T?\>
Remarks
This method doesn't include related entities.
Update\(T\)
Method that update an entity of type T in the database.
Parameters
entity T
UpdateRange\(IEnumerable<T\>\)
Method that update an entity of type T in the database.
Parameters
entities IEnumerable <T\>