<#@ template language="C#" HostSpecific="True" #>
<#@ output extension="vb" #>
<#@ include file="..\..\ControllerHead.vb.include.t4" #>
Imports System.Data
Imports System.Data.Entity
Imports System.Data.Entity.Validation
Imports System.Web
Imports System.Web.Mvc
Imports System.IO

' This code was generated by C1 Scaffolder.

Public class <#= ControllerName #> 
Inherits Controller
<#
if(!string.IsNullOrEmpty(Options["EntitySetName"]))
{
#>
    Dim db = New <#= DbContextTypeName #>()
<#
    if(Options["UseRemoteBind"])
    {
#>
    Public Function <#= ViewName #>_Read(requestData As CollectionViewRequest(Of <#= ViewDataTypeName #>)) As ActionResult
        Return Me.C1Json(CollectionViewHelper.Read(requestData, db.<#= Options["EntitySetName"] #>))
    End Function
<#
    }
}
#>

    Public Function <#= ViewName #>() As ActionResult
<#          if(Options["UseRemoteBind"] || string.IsNullOrEmpty(Options["EntitySetName"]))
        {
#>
        Return View()
<#
        }
        else
        {
#>
        Return View(db.<#= Options["EntitySetName"] #>)
<#
        }
#>
    End Function
End Class
