/// <summary> /// Ctor: init controller within app environment. /// </summary> public SmartsController(CountryResolver cres, LangRepo langRepo, SqlDict dict, QueryLogger qlog, IConfiguration config) { this.cres = cres; this.langRepo = langRepo; this.dict = dict; this.qlog = qlog; }
/// <summary> /// Ctor: Infuse app services. /// </summary> /// <remarks> /// Default null values make controller accessible to <see cref="IndexController"/>. /// That way, functionality is limited to serving static pages. /// </remarks> public DynpageController(PageProvider pageProvider, IConfiguration config, ILoggerFactory loggerFactory, Auth auth, SqlDict dict, CountryResolver cres, QueryLogger qlog, Sphinx sphinx, LangRepo langRepo) { this.cres = cres; this.pageProvider = pageProvider; this.dict = dict; this.sphinx = sphinx; this.qlog = qlog; this.config = config; this.logger = loggerFactory.CreateLogger("DynpageController"); this.auth = auth; this.langRepo = langRepo; }
public string GetLanguageCultureName(int languageId) { var languages = LangRepo.Load(); if (languages == null || languages.Count == 0) { return(null); } var langInfo = languages.FirstOrDefault(l => l.Id == languageId); return(langInfo == null ? String.Empty : langInfo.CultureName); }
public int?GetLanguageId(string cultureName) { var languages = LangRepo.Load(); if (languages == null || languages.Count == 0) { return(null); } var langInfo = languages.FirstOrDefault( l => String.Equals(l.CultureName, cultureName, StringComparison.OrdinalIgnoreCase)); return(langInfo == null ? (int?)null : langInfo.Id); }
public EditController(LangRepo langRepo, SqlDict dict, Auth auth) { this.langRepo = langRepo; this.dict = dict; this.auth = auth; }
public NewEntryController(LangRepo langRepo, SqlDict dict) { this.langRepo = langRepo; this.dict = dict; }