标签:let nbsp info arp customer inf ring ati rod
static void Main(string[] args)
{
//创建上下文对象 PpDbEntities dbEntities = new PpDbEntities(); #region Add() //多表增加 // Customer customer = new Customer(); customer.Name = "mmm"; dbEntities.Customer.Add(customer); //customer.ID = 5; //dbEntities.Entry(customer).State=EntityState.Deleted; //dbEntities.Entry<ProductInfo>(productInfo).State = EntityState.Deleted; // OrderInfo orderInfo = new OrderInfo(); orderInfo.Name = "mmm订单2"; dbEntities.OrderInfo.Add(orderInfo);
//第二张增加 用客户指向订单 customer.OrderInfo.Add(orderInfo); dbEntities.SaveChanges();
}
标签:let nbsp info arp customer inf ring ati rod
原文地址:http://www.cnblogs.com/gdsblog/p/7159854.html