Code: Select all
class Person
{
public string Name {get;set;}
public decimal Id {get;set;} // EntityKey
}
...
Person p = new Person{Name="Test"};
...
using(PersonContext context = new PersonContext())
{
context.Persons.AddObject(p);
context.SaveChanges();
}