I need to add some attributes to properties that were autogenerated by Entity Framework and do not want to lose them when regenerating objects. I don't want to touch T4 either.
Looking interenet I found that the partial class can be added MetaDataType like:
<MetadataType(GetType(Employee_Metadata))> _
Partial Public Class employee
...
And then create another class where we add the actual metadata to properties:
Public Class Employee_Metadata
<Category("General"), DisplayName("Name"), Description("Employee name.")> _
Public Property employee_name() As String
Get
Return _employee_name
End Get
Set(value As String)
_employee_name = value
End Set
End Property
Private _employee_name As String
End Class
Now, what else I need to do to get access to the attributes? I am currently binding a UI component to class employee autogenerated property "employee_name" (using MVVM). Do I need to change further something in my partial class or should I change the databinding itself (WPF in this case)?