私は尋ねた:
asp.net 3.5 には 2 種類のテンプレートがあります
1) 動的データ Web アプリ。
2) 動的データ Web アプリ。エンティティ
私の SQL データベースには Customer テーブルがあります。列 : ID、名前、姓 vs.
最初のもの(Dynamic Data Web App)を使用する場合; ID列(顧客テーブル)が見えない(Linq to Sql)
しかし、2 つ目 (Dynamic Data Web App. Entities) を使用すると、ID 列が表示されます。
列、特に ID 領域をフィルタリングするにはどうすればよいですか。つまり; ID列が表示される必要があります= false
そしてあなたは言いました:
In your metadata class, set the Id to the following:
[ScaffoldColumn(false)]
public object Id { get; set; }
In case you don't have a reference to the metadata class, you add this by adding the attribute to the partial class, something like this:
[MetadataType(typeof(MyEntityFromTable_MD))]
public partial class MyEntityFromTable
{
}
Then you need the metadata class itself. Something like:
public class MyEntityFromTable_MD
{
[ScaffoldColumn(false)]
public object Id;
}
あなたは正しいです!しかし、私が検索しようとすると。私はこのリンクを見つけます:
http://mattberseth.com/blog/2008/08/dynamic_data_and_custom_metada.html
http://mattberseth.com/blog/2008/08/aspnet_dynamic_data_simple_5_t.html
私は読む。そして私は私の要求をすることを理解しています:私はApp_codeが必要ですが、私はそれを見つけられません! どうすれば App_code を見つけることができますか