123456789101112131415161718192021222324252627282930313233343536373839 |
-
- namespace Repository;
- public class BankOperationRepository : RepositoryBase<BankOperation>, IBankOperationRepository
- {
- public BankOperationRepository(RepositoryContext repositoryContext)
- :base(repositoryContext)
- {
- }
- public IQueryable<BankOperation> GetAll()
- {
- return FindAll().OrderBy(x => x.DocDate);
- }
- public IQueryable<BankOperation> GetAllConfirmed(Guid accountId, Guid businessId)
- {
- if (accountId == Guid.Empty)
- return FindByCondition(x => x.Status == "CONFIRMED");
- return FindByCondition(x => x.Status == "CONFIRMED" && x.BankAccountId == accountId && x.BusinessId == businessId);
- }
- public IQueryable<BankOperation> GetAllNew(Guid accountId, Guid businessId)
- {
- if(accountId == Guid.Empty)
- return FindByCondition(x => !x.Status!.Equals("CONFIRMED"));
- return FindByCondition(x => !x.Status!.Equals("CONFIRMED") && x.BankAccountId == accountId && x.BusinessId == businessId);
- }
- public IQueryable<BankOperation> GetByBankAccountId(Guid bankAccountId)
- {
- return FindByCondition(x => x.BankAccountId == bankAccountId);
- }
- }
|