Closed bjarnef closed 5 years ago
I noticed there wasn't a GetCount() method, but just a Count() for member type: https://github.com/umbraco/Umbraco-CMS/blob/dev-v7/src/Umbraco.Core/Services/MemberService.cs#L721-L734
public int Count(string memberTypeAlias = null)
{
using (var uow = UowProvider.GetUnitOfWork(readOnly: true))
{
var repository = RepositoryFactory.CreateMemberRepository(uow);
return repository.Count(memberTypeAlias);
}
}
Thanks @bjarnef - it looks like this functionality is now available in v8.
The
GetCount
in MemberService has been added recently I guess (since it wasn't documented https://github.com/umbraco/UmbracoDocs/pull/975). However it would be great to have an overload method to specify member type, e.g. count all members of typeCustomer
.The signature could be like:
With ModelsBuilder it could be used something like this, which would use the signature
GetCount(string memberAlias)
:I am not sure if there could be another specific signature for ModelsBuilder? Maybe this?
Furthermore for MemberService
GetPagedXmlEntries
maybe an overload to specify member type alias performs better than the following?