Files
myoffice/MyOffice.Data.Repositories/Account/AccountAccountCategoryRepository.cs
T
2023-06-17 14:16:09 +03:00

21 lines
667 B
C#

namespace MyOffice.Data.Repositories.Account;
using Microsoft.EntityFrameworkCore;
using Models.Accounts;
public class AccountAccountCategoryRepository : AppRepository<AccountAccountCategory>, IAccountAccountCategoryRepository
{
public List<AccountAccountCategory> Get(Guid userId, Guid accountId, Guid categoryId)
{
return _context.AccountAccountCategories
.Include(x => x.Account)
.Include(x => x.Category)
.Where(x => x.AccountId == accountId && x.CategoryId == categoryId && x.Category.UserId == userId)
.ToList();
}
public bool Remove(AccountAccountCategory accountAccountCategory)
{
return RemoveBase(accountAccountCategory) > 0;
}
}