EF添加数据后返回添加的自增ID
public int InsertSingle(SDTI_VendorInfoEntity Ven) { db.Entry<SDTI_VendorInfoEntity>(Ven).State = System.Data.Entity.EntityState.Added; db.SaveChanges(); return Ven.V_Vendor_ID; }
public int InsertSingle(SDTI_VendorInfoEntity ven) { try { int b = vendor.InsertSingle(ven); int x = ven.V_Vendor_ID; return 1; } catch (Exception e) { return 0; } }