Incomprehensible work Scaffolding

Mar 31, 2011 at 1:27 PM

1. When shaping pattern T4 controller and and views 
Scaffold Controller Team 
Scaffold Controller Player 

If the end of the field classes have merged with the Id (TeamId)


public class Team { 
    public int TeamId {get; set;} 
    [Required] 
    public string Name {get; set;} 
    public string City {get; set;} 
    public DateTime Founded {get; set;}} 

public class Player { 
    public int PlayerId {get; set;} 
    public string Name {get; set;} 
    public int TeamId {get; set;}} 

Then, a pattern formed CreateOrEdit.t4 kinds DropDownListFor
<%: Html.DropDownListFor ... 

if not (Team_ID) 

public class Team { 
    public int Team_ID {get; set;} 
    
[Required] 
    public string Name {get; set;} 
    public string City {get; set;} 
    public DateTime Founded {get; set;}} 

public class Player { 
    public int PlayerId {get; set;} 
    public string Name {get; set;} 
    public int Team_ID {get; set;}} 

is an ordinary field <%: Html.EditorFor ( 

If someone knows a link to the specification of classes for working with templates T4. 
______________________________________________________

2. 
Opaque condition of the shaping the names in base
Scaffold DbContext <modelType> <dbContextName> 

public class HnsContext: DbContext 
{ 
        public DbSet <Team> Team {get; set;} 
        public DbSet <Player> Player {get; set;} 
 } 

 

In some cases, add S to the table, not in others. How to manage it? 
_______________________________________________________________

3. 
ForeignKeyAttribute probably must indicate the models on external key relationship but actually he forms in specified table cascade removing?