bind-Value on EditText often results in the wrong thing (dotnet/aspnetcore-tooling#364)

Updates the bindtaghelperdescriptorprovider to use the changed event property type name on the bound attribute instead of the value property type attribute.\n\nCommit migrated from 3009045206
This commit is contained in:
Javier Calvarro Nelson 2019-03-26 10:06:18 +01:00 committed by GitHub
parent f98ffcd759
commit 9c35c07a0b
2 changed files with 7 additions and 7 deletions

View File

@ -437,7 +437,7 @@ namespace Microsoft.CodeAnalysis.Razor
changeAttribute.Name);
attribute.Name = "bind-" + valueAttribute.Name;
attribute.TypeName = valueAttribute.TypeName;
attribute.TypeName = changeAttribute.TypeName;
attribute.IsEnum = valueAttribute.IsEnum;
// WTE has a bug 15.7p1 where a Tag Helper without a display-name that looks like

View File

@ -122,11 +122,11 @@ namespace Test
Assert.Equal("bind-MyProperty", attribute.Name);
Assert.Equal("MyProperty", attribute.GetPropertyName());
Assert.Equal("string Test.MyComponent.MyProperty", attribute.DisplayName);
Assert.Equal("System.Action<System.String> Test.MyComponent.MyProperty", attribute.DisplayName);
// Defined from the property type
Assert.Equal("System.String", attribute.TypeName);
Assert.True(attribute.IsStringProperty);
Assert.Equal("System.Action<System.String>", attribute.TypeName);
Assert.False(attribute.IsStringProperty);
Assert.False(attribute.IsBooleanProperty);
Assert.False(attribute.IsEnum);
}
@ -237,11 +237,11 @@ namespace Test
Assert.Equal("bind-MyProperty", attribute.Name);
Assert.Equal("MyProperty", attribute.GetPropertyName());
Assert.Equal("string Test.MyComponent.MyProperty", attribute.DisplayName);
Assert.Equal("Microsoft.AspNetCore.Components.EventCallback<System.String> Test.MyComponent.MyProperty", attribute.DisplayName);
// Defined from the property type
Assert.Equal("System.String", attribute.TypeName);
Assert.True(attribute.IsStringProperty);
Assert.Equal("Microsoft.AspNetCore.Components.EventCallback<System.String>", attribute.TypeName);
Assert.False(attribute.IsStringProperty);
Assert.False(attribute.IsBooleanProperty);
Assert.False(attribute.IsEnum);
}