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?
I miss a time when programmers were real programmers, and not drag and drop artists!!
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.
I miss a time when programmers were real programmers, and not drag and drop artists!!
Participant
893 Points
2009 Posts
Dynamic data metadata - property is not declared
Feb 12, 2013 05:26 AM|jagdipa|LINK
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:
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?
All-Star
17916 Points
5681 Posts
MVP
Re: Dynamic data metadata - property is not declared
Feb 12, 2013 01:24 PM|sjnaughton|LINK
sorry Jagdipa, but cstom properties are not yet supported in DD with Entity Framework, this is an entity framwwork issue,
Always seeking an elegant solution.
All-Star
94130 Points
18109 Posts
Re: Dynamic data metadata - property is not declared
Feb 13, 2013 03:32 AM|Decker Dong - MSFT|LINK
Hi jagdipa,
Please change your "Forname" to public, which can be accessed by outside publish program files.
Participant
893 Points
2009 Posts
Re: Dynamic data metadata - property is not declared
Feb 13, 2013 04:26 AM|jagdipa|LINK
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:
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.
All-Star
94130 Points
18109 Posts
Re: Dynamic data metadata - property is not declared
Feb 14, 2013 05:04 AM|Decker Dong - MSFT|LINK
Hi,
You can try to change the String to Object.