Skip to content

Instantly share code, notes, and snippets.

@vbjay
Created August 3, 2016 19:00
Show Gist options
  • Save vbjay/67366b20ad219fa8f0111b1820aaf885 to your computer and use it in GitHub Desktop.
Save vbjay/67366b20ad219fa8f0111b1820aaf885 to your computer and use it in GitHub Desktop.
Add to ef 6 model.tt to generate metadata class templates
<#
fileManager.StartNewFile(entity.Name & "MetaData" & ".vb")
BeginNamespace(code)
#>
' Copy this class to a partial file to get started on adding metadata to <#=entity.name#> class
<#=codeStringGenerator.EnityClassMetaDataOpening(entity)#>
<#
If simpleProperties.Any() Then
For Each edmProperty As EdmProperty In simpleProperties
#>
' <DisplayName("Display Name")>
'<#=codeStringGenerator.SimpleProperty(edmProperty)#>
<#
Next
End If
#>
<#
If complexProperties.Any() Then
#>
<#
For Each complexProperty As EdmProperty In complexProperties
#>
' <DisplayName("Display Name")>
'<#=codeStringGenerator.ComplexProperty(complexProperty)#>
<#
Next
End If
#>
<#
If navigationProperties.Any() Then
#>
<#
For Each navigationProperty As NavigationProperty In navigationProperties
#>
' <DisplayName("Display Name")>
'<#=codeStringGenerator.NavigationProperty(navigationProperty)#>
<#
Next
End If
#>
End Class
<#
EndNamespace(code)
#>
<#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment