Affecto.IdentityManagement.Store.EntityFramework.Queries.AccountQuery.Execute C# (CSharp) Метод

Execute() публичный Метод

public Execute ( System.Guid userId, AccountType type ) : Account
userId System.Guid
type AccountType
Результат Account
        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;
        }

Usage Example

 public Account GetUserAccount(Guid userId, AccountType type)
 {
     var query = new AccountQuery(dbContext.Accounts);
     return query.Execute(userId, type);
 }