データベースにテーブルがあります。
このテーブルには、A という名前の列が 1 つあります。この列は、エンティティまたは自動番号、一意のキー、または... ではありません。
Entity Framework 4.1 を使用してデータベースからモデルを作成しました。
私のコード
using (var contex = new testEntities())
{
Table_1 t = new Table_1();
t.A = 1;
contex.Table_1.Add(t);
contex.SaveChanges();
}
テーブルで ID 番号またはインデックスを使用したくありません。行を挿入しようとすると、次のエラーが表示されます。
Unable to update the EntitySet 'Table_1' because it has a DefiningQuery and no
<InsertFunction> element exists in the <ModificationFunctionMapping> element to
support the current operation.