本文整理汇总了C#中System.Web.Mvc.UrlHelper.Blog方法的典型用法代码示例。如果您正苦于以下问题:C# UrlHelper.Blog方法的具体用法?C# UrlHelper.Blog怎么用?C# UrlHelper.Blog使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Web.Mvc.UrlHelper
的用法示例。
在下文中一共展示了UrlHelper.Blog方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MetaWeblogGetUserBlogs
private XRpcArray MetaWeblogGetUserBlogs(UrlHelper urlHelper,
string userName,
string password)
{
IUser user = ValidateUser(userName, password);
XRpcArray array = new XRpcArray();
foreach (BlogPart blog in _blogService.Get()) {
// User needs to at least have permission to edit its own blog posts to access the service
if (_authorizationService.TryCheckAccess(Permissions.EditBlogPost, user, blog)) {
BlogPart blogPart = blog;
array.Add(new XRpcStruct()
.Set("url", urlHelper.AbsoluteAction(() => urlHelper.Blog(blogPart)))
.Set("blogid", blog.Id)
.Set("blogName", blog.Name));
}
}
return array;
}
示例2: MetaWeblogGetUserBlogs
private XRpcArray MetaWeblogGetUserBlogs(UrlHelper urlHelper,
string appkey,
string userName,
string password) {
var user = _membershipService.ValidateUser(userName, password);
_authorizationService.CheckAccess(StandardPermissions.AccessFrontEnd, user, null);
var array = new XRpcArray();
foreach (var blog in _blogService.Get()) {
array.Add(new XRpcStruct()
.Set("url", urlHelper.AbsoluteAction(() => urlHelper.Blog(blog.Slug)))
.Set("blogid", blog.Id)
.Set("blogName", blog.Name));
}
return array;
}