本文整理汇总了C#中Kooboo.CMS.Sites.Models.Site.GetRepository方法的典型用法代码示例。如果您正苦于以下问题:C# Site.GetRepository方法的具体用法?C# Site.GetRepository怎么用?C# Site.GetRepository使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Kooboo.CMS.Sites.Models.Site
的用法示例。
在下文中一共展示了Site.GetRepository方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Submit
public ActionResult Submit(Site site, ControllerContext controllerContext, SubmissionSetting submissionSetting)
{
object model = null;
Exception exception = null;
var formValues = new NameValueCollection(controllerContext.HttpContext.Request.Unvalidated().Form);
try
{
var repository = site.GetRepository();
var valueProvider = new NameValueCollectionProvider(formValues);
formValues = PluginHelper.ApplySubmissionSettings(submissionSetting, formValues);
var folderName = formValues["FolderName"];
if (!string.IsNullOrEmpty(folderName))
{
var folder = FolderHelper.Parse<TextFolder>(repository, folderName);
model = DoPost(repository, folder, controllerContext, formValues);
}
}
catch (Exception e)
{
exception = e;
}
return PluginHelper.ReturnActionResult(controllerContext, model, exception);
}
示例2: Sync
private void Sync(Site site, Repository orginalRepository, Action<Repository> syncAction)
{
if (site == null)
{
return;
}
Repository siteRepository = site.GetRepository();
if (siteRepository != orginalRepository)
{
syncAction(siteRepository);
}
foreach (Site childSite in _siteProvider.ChildSites(site))
{
Sync(childSite, siteRepository, syncAction);
}
}