本文整理汇总了C#中IUrlHelper类的典型用法代码示例。如果您正苦于以下问题:C# IUrlHelper类的具体用法?C# IUrlHelper怎么用?C# IUrlHelper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IUrlHelper类属于命名空间,在下文中一共展示了IUrlHelper类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AlphaPagerTagHelper
public AlphaPagerTagHelper(
IUrlHelper urlHelper,
IHtmlGenerator generator)
{
Generator = generator;
}
示例2: ManifestService
public ManifestService(
IOptions<AppSettings> appSettings,
IUrlHelper urlHelper)
{
this.appSettings = appSettings;
this.urlHelper = urlHelper;
}
示例3: NavigationViewModel
public NavigationViewModel(
string startingNodeKey,
string navigationFilterName,
HttpContext context,
IUrlHelper urlHelper,
TreeNode<NavigationNode> rootNode,
INavigationNodePermissionResolver permissionResolver,
string nodeSearchUrlPrefix,
ILogger logger)
{
this.navigationFilterName = navigationFilterName;
this.nodeSearchUrlPrefix = nodeSearchUrlPrefix;
this.context = context;
this.RootNode = rootNode;
this.permissionResolver = permissionResolver;
this.urlHelper = urlHelper;
this.startingNodeKey = startingNodeKey;
log = logger;
removalFilters.Add(FilterIsAllowed);
removalFilters.Add(permissionResolver.ShouldAllowView);
removalFilters.Add(IsAllowedByAdjuster);
}
示例4: GetDataSeriesArray
/// <summary>
/// Returns a serializable array for the given series.
/// </summary>
public object GetDataSeriesArray(IUrlHelper urlHelper, bool passed)
{
var dayBoundaries = GetDayBoundaries();
var lastBuild = AllBuildTestCounts.Last();
var totalTests = lastBuild.PassedCount + lastBuild.FailedCount;
return AllBuildTestCounts.Select
(
(value, index) => new
{
Index = index,
TestCount = passed
? value.PassedCount
: totalTests - value.PassedCount,
ShortCommitDate = dayBoundaries[index]
? value.PushDate.ToLocalTime().ToString("MM/dd")
: "--",
LongCommitDate = value.PushDate.ToLocalTime().ToString("MM/dd/yyyy h:mm tt"),
BuildUrl = urlHelper.Action
(
"BuildResult",
"Build",
new { buildId = value.BuildId }
)
}
);
}
示例5: FileSystemHelper
public FileSystemHelper(IApplicationEnvironment appEnv, IHostingEnvironment hostingEnv, ISmidgeConfig config, IUrlHelper urlHelper)
{
_appEnv = appEnv;
_config = config;
_urlHelper = urlHelper;
_hostingEnv = hostingEnv;
}
示例6: UsersController
public UsersController(IUserServices userServices,
IAccountServices accountServices,
ICategoryServices categoryServices,
ITransactionServices transactionServices,
IBudgetServices budgetServices,
IHttpContextProvider context,
ISiteConfiguration config,
ICryptoProvider crypto,
IUrlHelper urlHelper,
IModelCache cache,
ICachingHelpers cachingHelpers,
ISessionServices sessionServices)
: base(userServices,
accountServices,
categoryServices,
transactionServices,
budgetServices,
context,
config,
urlHelper,
cache,
cachingHelpers)
{
_crypto = crypto;
_sessionServices = sessionServices;
}
示例7: OrganizationApiController
public OrganizationApiController(IBus bus, IDocumentSession session, IMapper mapper, IUrlHelper urlHelper)
{
_bus = bus;
_session = session;
_mapper = mapper;
_urlHelper = urlHelper;
}
示例8: NavigationViewModel
public NavigationViewModel(
string startingNodeKey,
string navigationFilterName,
HttpContext context,
IUrlHelper urlHelper,
TreeNode<NavigationNode> rootNode,
IEnumerable<INavigationNodePermissionResolver> permissionResolvers,
IEnumerable<IFindCurrentNode> nodeFinders,
string nodeSearchUrlPrefix,
ILogger logger)
{
this.navigationFilterName = navigationFilterName;
this.nodeSearchUrlPrefix = nodeSearchUrlPrefix;
this.context = context;
this.RootNode = rootNode;
this.permissionResolvers = permissionResolvers;
this.nodeFinders = nodeFinders;
this.urlHelper = urlHelper;
this.startingNodeKey = startingNodeKey;
log = logger;
removalFilters.Add(FilterIsAllowed);
foreach(var permissionResolver in permissionResolvers)
{
removalFilters.Add(permissionResolver.ShouldAllowView);
}
removalFilters.Add(IsAllowedByAdjuster);
}
示例9: ComponentTagHelper
public ComponentTagHelper(IHttpContextAccessor contextAccessor, IBricsContextAccessor bricsContext)
{
_contextAccessor = contextAccessor;
_bricsContext = bricsContext;
_urlHelper = contextAccessor.HttpContext.RequestServices.GetService<IUrlHelper>();
_htmlHelper = contextAccessor.HttpContext.RequestServices.GetService<IHtmlHelper>();
}
示例10: DefaultUrlManager
public DefaultUrlManager(IOptions<SmidgeOptions> options, ISmidgeConfig config, IHasher hasher, IUrlHelper urlHelper)
{
_hasher = hasher;
_urlHelper = urlHelper;
_options = options.Value.UrlOptions;
_config = config;
}
示例11: OpenSearchService
public OpenSearchService(
IOptions<AppSettings> appSettings,
IUrlHelper urlHelper)
{
this.appSettings = appSettings;
this.urlHelper = urlHelper;
}
示例12: FeedService
/// <summary>
/// Initializes a new instance of the <see cref="FeedService"/> class.
/// </summary>
/// <param name="appSettings">The application settings.</param>
/// <param name="urlHelper">The URL helper.</param>
public FeedService(
IOptions<AppSettings> appSettings,
IUrlHelper urlHelper)
{
this.appSettings = appSettings;
this.urlHelper = urlHelper;
this.httpClient = new HttpClient();
}
示例13: TestableHtmlGenerator
public TestableHtmlGenerator(IModelMetadataProvider metadataProvider, IUrlHelper urlHelper)
: this(
metadataProvider,
Mock.Of<IScopedInstance<ActionBindingContext>>(),
urlHelper,
validationAttributes: new Dictionary<string, object>(StringComparer.OrdinalIgnoreCase))
{
}
示例14: AddBackofficeBottom
public void AddBackofficeBottom(string urlstring, IUrlHelper url, IHtmlHelper html)
{
const string prefix = @"~/Areas/Backoffice/Scripts/framework/";
urlstring = urlstring.TrimStart('/');
var path = string.Format("{0}{1}", url.Content(prefix), (urlstring.EndsWith(".js") ? urlstring : urlstring + ".js"));
html.Statics().FooterScripts.Add(path);
}
示例15: SitemapPingerService
/// <summary>
/// Initializes a new instance of the <see cref="SitemapPingerService"/> class.
/// </summary>
/// <param name="logger">The <see cref="SitemapPingerService"/> logger.</param>
/// <param name="urlHelper">The URL helper.</param>
public SitemapPingerService(
ILogger<SitemapPingerService> logger,
IUrlHelper urlHelper)
{
this.logger = logger;
this.urlHelper = urlHelper;
this.httpClient = new HttpClient();
}