TrackableCollection
( )に新しいエンティティを追加しますcontext.Entities.Add(entity)
(EntityState = New)- 保存せず、追加したエンティティを
TrackableCollection
(context.Entities.Remove(entity)
) から削除 (EntityState = Unmodified) - 保存。(
context.SubmitChanges()
)
エンティティに関連付けられたデータ注釈からまだ検証エラーが発生します。なぜですか?
public class Entity
{
[Required]
public string Name { get; set; }
}