This commit is contained in:
2018-11-12 23:34:47 +00:00
parent f1fe285fd5
commit 9b5c4094b5
3 changed files with 15 additions and 4 deletions

View File

@@ -354,8 +354,12 @@ namespace AyaNova.Biz
return v.First();
}
public static long LocaleNameToIdStatic(string localeName, AyContext ct)
public static long LocaleNameToIdStatic(string localeName, AyContext ct = null)
{
if (ct == null)
{
ct = ServiceProviderProvider.DBContext;
}
var v = ct.Locale.Where(c => c.Name == localeName).Select(x => x.Id);
if (v.Count() < 1) return ServerBootConfig.AYANOVA_DEFAULT_LANGUAGE_ID;
return v.First();