using _0_Framework.InfraStructure; using AccountManagement.Application.Contracts.SubAccount; using AccountManagement.Domain.SubAccountRoleAgg; using Microsoft.EntityFrameworkCore; using System.Collections.Generic; using System.Linq; namespace AccountMangement.Infrastructure.EFCore.Repository { public class SubAccountRoleRepository : RepositoryBase, ISubAccountRoleRepository { private readonly AccountContext _accountContext; public SubAccountRoleRepository(AccountContext context) : base(context) { _accountContext = context; } public List GetSubAccountRolesByAccountId(long accountId) { return _accountContext.SubAccountRoles.Where(x => x.AccountId == accountId) .Select(x => new SubAccountRoleViewModel() { Id = x.id, Title = x.Title }).ToList(); } } }