public Account Execute(Guid userId, AccountType type) { Account account = accounts.SingleOrDefault(a => a.UserId == userId && a.Type == type); if (account == null) { throw new AccountNotFoundException(userId, type); } return account; }
public Account GetUserAccount(Guid userId, AccountType type) { var query = new AccountQuery(dbContext.Accounts); return query.Execute(userId, type); }