Skip to content
This repository was archived by the owner on Oct 16, 2020. It is now read-only.
This repository was archived by the owner on Oct 16, 2020. It is now read-only.

Converting Object Initializers from C# to VB incorrectly adds 'Key' #223

Open
@dgrunwald

Description

@dgrunwald

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions