Converting Object Initializers from C# to VB incorrectly adds 'Key' #223
Description
SD-1896, originally created on 4/12/2012 13:32:35 by Daniel Grunwald
http://community.sharpdevelop.net/forums/t/15616.aspx
ModelBindingContext innerBindingContext = new ModelBindingContext()
{
Model = null,
ModelType = ga[1],
ModelName =
key.Substring(0, endbracket + 1),
ModelState = bindingContext.ModelState,
PropertyFilter =
bindingContext.PropertyFilter,
ValueProvider =
bindingContext.ValueProvider
};
Dim innerBindingContext As New ModelBindingContext() With { _
Key .Model = Nothing, _
Key .ModelType = ga(1), _
Key .ModelName = key.Substring(0, endbracket +
1), _
Key .ModelState = bindingContext.ModelState,
_
Key .PropertyFilter =
bindingContext.PropertyFilter, _
Key .ValueProvider =
bindingContext.ValueProvider _
}
The 'Key' keyword is incorrect in this context, it should be inserted
only for anonymous object creations.