2009-08-08 3 views
0
 model.RegisterContext(typeof(NorthwindDataContext), new ContextConfiguration() 
    { 
     ScaffoldAllTables = true, 
     MetadataProviderFactory = (type => new DefaultTypeDescriptionProvider(type, new AssociatedMetadataTypeTypeDescriptionProvider(type))) 
    }); 

... 나는 확실히 그것을 VB에서 보일 것입니다 방법을 알아낼 수없는 것 ...C#에서 동적 데이터 컨텍스트 등록 코드를 VB로 변환 하시겠습니까? MetadataProviderFactory 라인 특히

답변

1
MetadataProviderFactory = Function(type) new DefaultTypeDescriptionProvider(
    type, new AssociatedMetadataTypeTypeDescriptionProvider(type)) 
1
MetadataProviderFactory = Function (type) New DefaultTypeDescriptionProvider(
    type, New AssociatedMetadataTypeTypeDescriptionProvider(type)) 
1

난 당신이 뭔가를 찾고 있다고 생각 이렇게 :

model.RegisterContext(GetType(NorthwindDataContext), 
    New ContextConfiguration() With 
    { 
     .ScaffoldAllTables = True, 
     .MetadataProviderFactory = Function(type) _ 
      New DefaultTypeDescriptionProvider(
       type, 
       New AssociatedMetadataTypeTypeDescriptionProvider(type)) 
    })