public static void AddOrUpdate(PowerEntities db, TS_OPER_ROLE selectedData, TS_OPERATOR oper) { try { db.TS_OPER_ROLE.AddOrUpdate(p => p.UID, selectedData); } catch (DbEntityValidationException dbEx) { Console.WriteLine(dbEx.ToString()); throw; } }
public static void Delete(PowerEntities db, TS_OPER_ROLE data, TS_OPERATOR oper) { db.Entry(data).State = EntityState.Deleted; }