Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Have you made your Entity Class Properties public?</p> <p>The scaffolding engine uses .NET reflection to look at the public properties exposed on the class passed it, and will add appropriate content based on each type it <a href="http://nerddinnerbook.s3.amazonaws.com/Part4.htm" rel="nofollow">finds</a></p> <p>The following works for me:</p> <pre><code>namespace Entities { public class Page { public virtual int Id { get; private set; } public virtual string Name { get; set; } public virtual string Title { get; set; } public virtual string Description { get; set; } } } public class PageMap : ClassMap&lt;Page&gt; { public PageMap() { Table("Pages"); Id(x =&gt; x.Id); Map(x =&gt; x.Name); Map(x =&gt; x.Keywords); Map(x =&gt; x.Description); } } </code></pre> <p>Strongly Typed View: ticked</p> <p>View Data Class: Entities.Page</p> <p>View Content: List</p> <p>Which then creates:</p> <pre><code>&lt;%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl&lt;IEnumerable&lt;Entities.Page&gt;&gt;" %&gt; &lt;table&gt; &lt;tr&gt; &lt;th&gt;&lt;/th&gt; &lt;th&gt; Id &lt;/th&gt; &lt;th&gt; Name &lt;/th&gt; &lt;th&gt; Title &lt;/th&gt; &lt;th&gt; Description &lt;/th&gt; &lt;/tr&gt; &lt;% foreach (var item in Model) { %&gt; &lt;tr&gt; &lt;td&gt; &lt;%= Html.ActionLink("Edit", "Edit", new { /* id=item.PrimaryKey */ }) %&gt; | &lt;%= Html.ActionLink("Details", "Details", new { /* id=item.PrimaryKey */ })%&gt; | &lt;%= Html.ActionLink("Delete", "Delete", new { /* id=item.PrimaryKey */ })%&gt; &lt;/td&gt; &lt;td&gt; &lt;%= Html.Encode(item.Id) %&gt; &lt;/td&gt; &lt;td&gt; &lt;%= Html.Encode(item.Name) %&gt; &lt;/td&gt; &lt;td&gt; &lt;%= Html.Encode(item.Title) %&gt; &lt;/td&gt; &lt;td&gt; &lt;%= Html.Encode(item.Description) %&gt; &lt;/td&gt; &lt;/tr&gt; &lt;% } %&gt; &lt;/table&gt; &lt;p&gt; &lt;%= Html.ActionLink("Create New", "Create") %&gt; &lt;/p&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload