This repository was archived by the owner on Dec 19, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 223
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move TagHelperBinding out of Legacy.
- Added additional properties to the class to make it more production ready. #1092
- Loading branch information
1 parent
fd1f650
commit 9d9fca5
Showing
4 changed files
with
81 additions
and
30 deletions.
There are no files selected for viewing
25 changes: 0 additions & 25 deletions
25
src/Microsoft.AspNetCore.Razor.Language/Legacy/TagHelperBinding.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
src/Microsoft.AspNetCore.Razor.Language/TagHelperBinding.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// Copyright (c) .NET Foundation. All rights reserved. | ||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
using System.Collections.Generic; | ||
|
||
namespace Microsoft.AspNetCore.Razor.Language | ||
{ | ||
public sealed class TagHelperBinding | ||
{ | ||
private IReadOnlyDictionary<TagHelperDescriptor, IEnumerable<TagMatchingRule>> _mappings; | ||
|
||
internal TagHelperBinding( | ||
string tagName, | ||
IEnumerable<KeyValuePair<string, string>> attributes, | ||
string parentTagName, | ||
IReadOnlyDictionary<TagHelperDescriptor, IEnumerable<TagMatchingRule>> mappings, | ||
string tagHelperPrefix) | ||
{ | ||
TagName = tagName; | ||
Attributes = attributes; | ||
ParentTagName = parentTagName; | ||
TagHelperPrefix = tagHelperPrefix; | ||
|
||
_mappings = mappings; | ||
Descriptors = _mappings.Keys; | ||
} | ||
|
||
public IEnumerable<TagHelperDescriptor> Descriptors { get; } | ||
|
||
public string TagName { get; } | ||
|
||
public string ParentTagName { get; } | ||
|
||
public IEnumerable<KeyValuePair<string, string>> Attributes { get; } | ||
|
||
public string TagHelperPrefix { get; } | ||
|
||
public IEnumerable<TagMatchingRule> GetBoundRules(TagHelperDescriptor descriptor) | ||
{ | ||
return _mappings[descriptor]; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters