本文整理匯總了C#中Nop.Core.Domain.Topics.Topic.ValidateSeName方法的典型用法代碼示例。如果您正苦於以下問題:C# Topic.ValidateSeName方法的具體用法?C# Topic.ValidateSeName怎麽用?C# Topic.ValidateSeName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Nop.Core.Domain.Topics.Topic
的用法示例。
在下文中一共展示了Topic.ValidateSeName方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: UpdateLocales
protected virtual void UpdateLocales(Topic topic, TopicModel model)
{
foreach (var localized in model.Locales)
{
_localizedEntityService.SaveLocalizedValue(topic,
x => x.Title,
localized.Title,
localized.LanguageId);
_localizedEntityService.SaveLocalizedValue(topic,
x => x.Body,
localized.Body,
localized.LanguageId);
_localizedEntityService.SaveLocalizedValue(topic,
x => x.MetaKeywords,
localized.MetaKeywords,
localized.LanguageId);
_localizedEntityService.SaveLocalizedValue(topic,
x => x.MetaDescription,
localized.MetaDescription,
localized.LanguageId);
_localizedEntityService.SaveLocalizedValue(topic,
x => x.MetaTitle,
localized.MetaTitle,
localized.LanguageId);
//search engine name
var seName = topic.ValidateSeName(localized.SeName, localized.Title, false);
_urlRecordService.SaveSlug(topic, seName, localized.LanguageId);
}
}
示例2: UpdateLocales
protected virtual List<LocalizedProperty> UpdateLocales(Topic topic, TopicModel model)
{
List<LocalizedProperty> localized = new List<LocalizedProperty>();
foreach (var local in model.Locales)
{
var seName = topic.ValidateSeName(local.SeName, local.Title, false);
_urlRecordService.SaveSlug(topic, seName, local.LanguageId);
if (!(String.IsNullOrEmpty(seName)))
localized.Add(new LocalizedProperty()
{
LanguageId = local.LanguageId,
LocaleKey = "SeName",
LocaleValue = seName
});
if (!(String.IsNullOrEmpty(local.Body)))
localized.Add(new LocalizedProperty()
{
LanguageId = local.LanguageId,
LocaleKey = "Body",
LocaleValue = local.Body
});
if (!(String.IsNullOrEmpty(local.MetaDescription)))
localized.Add(new LocalizedProperty()
{
LanguageId = local.LanguageId,
LocaleKey = "MetaDescription",
LocaleValue = local.MetaDescription
});
if (!(String.IsNullOrEmpty(local.MetaKeywords)))
localized.Add(new LocalizedProperty()
{
LanguageId = local.LanguageId,
LocaleKey = "MetaKeywords",
LocaleValue = local.MetaKeywords
});
if (!(String.IsNullOrEmpty(local.MetaTitle)))
localized.Add(new LocalizedProperty()
{
LanguageId = local.LanguageId,
LocaleKey = "MetaTitle",
LocaleValue = local.MetaTitle
});
if (!(String.IsNullOrEmpty(local.Title)))
localized.Add(new LocalizedProperty()
{
LanguageId = local.LanguageId,
LocaleKey = "Title",
LocaleValue = local.Title
});
}
return localized;
}