my Model Entity FrameWork :
public partial class T02
{
public long ID { get; set; }
public int F01 { get; set; }
}
Table : T02
------------------------
id[Key,identity] F01
------------------------
1 a
2 b
==================================================== i have a button > Code
public void Button_Click(object Sender, EventArgs e)
{
T02 T1 = new T02 { ID = 1, F01 = "x" };
T02 T2 = new T02 { ID = 2, F01 = "y" };
T02 T3 = new T02 { ID = 0, F01 = "g" };
T02 T4 = new T02 { ID = 0, F01 = "h" };
// How ID > 1 2 Update in Table &
// because not in table, > g , h > automatic add to Table
// ???
}
my problem is : i not ontime update and if T02.ID not on the table automatic added..
Is it possible that I do added to table Records Without id and i do Update Records With id
i worked c#.NET 4.5 . Thanks