I just upgraded a cms 6 r2 site to cms 7 and im having some troubles with using the old code "LanguageBranch.ListAll()". The obsolete information says to use ILanguageBranchRepository.ListAll() instead, but that of course won't work. So how am I suppose to use this method? If I made a LanguageBranchRepository object i could call lbr.ListAll but I don't know how to work with the objects that the constructor expects or if making a new object of LanguageBranchRepository that way really is the most efficient way.
The constructor expects a ServiceAccessor<LanguageBranchDB> and LocalizationService object.
Any help apreachiated. I feel that I've had many obsolete calls which always suggest IInterface.Method() which wont work.
Hi, I think you should get the instance like this:
var repository = EPiServer.ServiceLocation.ServiceLocator.Current.GetInstance<ILanguageBranchRepository>();
var result = repository.ListAll();