locked
Dynamic data metadata - property is not declared RRS feed

  • Question

  • User1146730029 posted

    I have a website with dynamic data and entity framework setup. It is listing and showing all the table data.

    Now I want to add some metadata classes to it. So I have the following:

        <MetadataType(GetType(UserMetaData))> _
        Partial Public Class User
    
            Public Overrides Function ToString() As String
                Return Forename & " " & Surname
            End Function
    
        End Class
    

    My problem is that, even though the Forename and Surname is part of the User table, I get the error :

    'Forename' is not declared. It may be inaccessible due to its protection level.

    How do I correct this?

    Tuesday, February 12, 2013 5:26 AM

Answers

  • User3866881 posted

    Public myProperty As String

    Hi,

    You can try to change the String to Object.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, February 14, 2013 5:04 AM

All replies

  • User-330204900 posted

    sorry Jagdipa, but cstom properties are not yet supported in DD with Entity Framework, this is an entity framwwork issue,

    Tuesday, February 12, 2013 1:24 PM
  • User3866881 posted

    Hi jagdipa,

    Please change your "Forname" to public, which can be accessed by outside publish program files.

    Wednesday, February 13, 2013 3:32 AM
  • User1146730029 posted

    To be honest, I am not trying to implement the a custom property. I am trying to pass a UI hint using the meta data. So my code is really the following:

        <MetadataType(GetType(UserMetaData))> _
        Partial Public Class User
        End Class
    
        Public Class UserMetaData
    
            <UIHint("myPropertyField")> _
            Public myProperty As String
    
        End Class

    My problem is that DD just doesnt seem to load my custom field control for myPropertyField.  So I was using the custom property to try debug this.

    Wednesday, February 13, 2013 4:26 AM
  • User3866881 posted

    Public myProperty As String

    Hi,

    You can try to change the String to Object.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, February 14, 2013 5:04 AM