代码之家  ›  专栏  ›  技术社区  ›  Kevin LaBranche

将下面的动态数据上下文注册代码转换为vb?

  •  0
  • Kevin LaBranche  · 技术社区  · 16 年前
            model.RegisterContext(typeof(NorthwindDataContext), new ContextConfiguration()
        {
            ScaffoldAllTables = true,
            MetadataProviderFactory = (type => new DefaultTypeDescriptionProvider(type, new AssociatedMetadataTypeTypeDescriptionProvider(type)))
        });
    

    尤其是MetadataProviderFactory行…我不太明白它在VB中应该是什么样子的…

    3 回复  |  直到 13 年前
        1
  •  1
  •   Shimmy Weitzhandler 500 - Internal Server Error    15 年前
    MetadataProviderFactory = Function(type) new DefaultTypeDescriptionProvider(
        type, new AssociatedMetadataTypeTypeDescriptionProvider(type))
    
        2
  •  1
  •   Shimmy Weitzhandler 500 - Internal Server Error    15 年前

    我相信你在找这样的东西:

    model.RegisterContext(GetType(NorthwindDataContext), 
        New ContextConfiguration() With
        {
            .ScaffoldAllTables = True,
            .MetadataProviderFactory = Function(type) _
                New DefaultTypeDescriptionProvider(
                    type, 
                    New AssociatedMetadataTypeTypeDescriptionProvider(type))
        })
    
        3
  •  1
  •   Shimmy Weitzhandler 500 - Internal Server Error    15 年前
    MetadataProviderFactory = Function (type) New DefaultTypeDescriptionProvider(
        type, New AssociatedMetadataTypeTypeDescriptionProvider(type))