Created
August 3, 2016 19:00
-
-
Save vbjay/67366b20ad219fa8f0111b1820aaf885 to your computer and use it in GitHub Desktop.
Add to ef 6 model.tt to generate metadata class templates
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
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