public void Add() { using (var db = new WXDBContext()) { db.RefundmentInfo.Add(this); db.SaveChanges(); } }
public void Add() { using (var db = new WXDBContext()) { db.PayNotifyInfo.Add(this); db.SaveChanges(); } }
public void Modify() { using (var db = new WXDBContext()) { db.PayNotifyInfo.Attach(this); db.Entry(this).State = EntityState.Modified; db.SaveChanges(); } }
public void SaveChange() { try { _context.SaveChanges(); } catch (DbEntityValidationException dbEx) { foreach (var validationErrors in dbEx.EntityValidationErrors) { foreach (var validationError in validationErrors.ValidationErrors) { Trace.TraceInformation("Property: {0} Error: {1}", validationError.PropertyName, validationError.ErrorMessage); } } } }