#@ Template Language="VB" HostSpecific="True" Inherits="DynamicTransform" #> <#@ Output extension="vbhtml" #> <#@ assembly name="System.ComponentModel.DataAnnotations" #> <#@ assembly name="System.Core" #> <#@ assembly name="System.Data.Entity" #> <#@ assembly name="System.Data.Linq" #> <#@ import namespace="System" #> <#@ import namespace="System.Collections" #> <#@ import namespace="System.Collections.Generic" #> <#@ import namespace="System.ComponentModel.DataAnnotations" #> <#@ import namespace="System.Data.Linq.Mapping" #> <#@ import namespace="System.Data.Objects.DataClasses" #> <#@ import namespace="System.Linq" #> <#@ import namespace="System.Reflection" #> <#@ import namespace="EnvDTE" #> <# Dim viewDataType = CType(Model.ViewDataType, CodeType) #> <# If viewDataType IsNot Nothing #> @ModelType IEnumerable(Of <#= viewDataType.FullName #>) <# End If #> @Code ViewData("Title") = "<#= Model.ViewName #>" <# If Not String.IsNullOrEmpty(Model.Layout) #> Layout = "<#= Model.Layout #>" <# End If #> End Code
@Html.ActionLink("Create New", "Create")
<# Dim properties As List(Of ModelProperty) = GetModelProperties(Model.ViewDataType, True) For Each modelProp As ModelProperty In properties If (Not modelProp.IsPrimaryKey AndAlso Not modelProp.IsForeignKey) Then #> | <#= modelProp.Name #> | <# End If Next #>|
---|---|---|
@Html.ActionLink("Edit", "Edit", New With {.id = itemValue.<#= Model.PrimaryKeyName #>}) | @Html.ActionLink("Details", "Details", New With {.id = itemValue.<#= Model.PrimaryKeyName #>}) | @Html.ActionLink("Delete", "Delete", New With {.id = itemValue.<#= Model.PrimaryKeyName #>}) | <# Else #>@*@Html.ActionLink("Edit", "Edit", New With {.id = itemValue.PrimaryKey}) | @Html.ActionLink("Details", "Details", New With {.id = itemValue.PrimaryKey}) | @Html.ActionLink("Delete", "Delete", New With {.id = itemValue.PrimaryKey})*@ | <# End If For Each modelProp As ModelProperty In properties If (Not modelProp.IsPrimaryKey AndAlso Not modelProp.IsForeignKey) Then #>@<#= modelProp.ValueExpression.Replace("Model.", "itemValue.") #> | <# End If Next #>