您好我想使用LocalizationService()获取Umbraco CMS中的所有语言.GetAllLanguages()但是在Umbraco 7.5.4中似乎已经更改了LocalizationService()并要求强制参数。
如何正确实例化LocalizationService()?
public LocalizationService(IDatabaseUnitOfWorkProvider provider, RepositoryFactory repositoryFactory, ILogger logger, IEventMessagesFactory eventMessagesFactory)
答案 0 :(得分:2)
您不必实例化它,它是ApplicationContext.Current.Services中的单例
所以你可以这样做:Services.LocalizationService.GetAllLanguages()