Add data to entity context from console app-northwind sample

static void Main(string[] args)
{

using (var db = new ModelNW())
{
db.Region.Add(new Region { RegionDescription = "test 2" });
db.SaveChanges();

foreach (var sreg in db.Region)
{
Console.WriteLine(sreg.RegionDescription);
}
}

}


Yorumlar