I'm looking at some documentation regarding Improve testability and support for rapid releases without breaking changes: http://world.episerver.com/documentation/Release-Notes/ReleaseNote/?releaseNoteId=CMS-3446
It says that I should use IVisitorGroupRoleRepository instead. However, this interface doesn't expose a GetAll method, which we are using.
I've seen a List function in IVisitorGroupRepository, but is this the same as the old function? Also, what is the difference between a visitor group role and a visitor group?
When a visitor group is saved using the repository (IVisitorGroupRepository) it is registered in the system as a "role", the runtime representation if you will. The reason is that it can hook into the security system and become a "virtual role".
Anyhow, if you just want a list of visitor groups you can go directly to the source and use IVisitorGroupRepository.List.
I will report a bug that we should update the obsolete message.
Thanks for clarifying, Per.
Are you saying using IVisitorGroupRepository.List(), I will get the same result as VisitorGroupRole.GetRepository().GetAllRoles()?
I'm running into this issue while upgrading from 9 to 11 and getting the obsolete method warning
CS0618 'VisitorGroupRole.GetRepository()' is obsolete: 'Get IVisitorGroupRoleRepository/IVisitorGroupRepository from the IOC container.'
IVisitorGroupRepository.List() does not return the same type as VisitorGroupRole.GetRepository().GetAllRoles()... (IEnumerable<VisitorGroup> vs IEnumerable<string>)
Do any of the EPiServer guys know how this should be done yet? I imagine this will be breaking in v12.
Thanks in advance,