Affecto.IdentityManagement.Store.EntityFramework.Queries.UsersByCustomPropertyQuery.Execute C# (CSharp) Method

Execute() public method

public Execute ( string customPropertyName, string customPropertyValue ) : IQueryable
customPropertyName string
customPropertyValue string
return IQueryable
        public IQueryable<User> Execute(string customPropertyName, string customPropertyValue)
        {
            return queryBuilder.IncludeAll()
                .Where(u => u.CustomProperties.Any(c => c.Name == customPropertyName && c.Value == customPropertyValue));
        }

Usage Example

        public IReadOnlyCollection<User> GetUsers(string customPropertyName, string customPropertyValue)
        {
            var query = new UsersByCustomPropertyQuery(dbContext.Users);
            IQueryable<Model.User> users = query.Execute(customPropertyName, customPropertyValue);

            return new UserMapper().Map(users).ToList();
        }
UsersByCustomPropertyQuery