/// <summary> /// 创建一个异常处理 /// </summary> /// <param name="db">实体数据</param> /// <param name="entity">将要创建的一个异常处理</param> public void Create(SysEntities db, SysException entity) { if (entity != null) { db.SysException.AddObject(entity); } }
/// <summary> /// 创建一个对象 /// </summary> /// <param name="db">数据库</param> /// <param name="entity">实体</param> public int Create(SysException entity) { using (DBContainer db = new DBContainer()) { db.SysException.AddObject(entity); return(db.SaveChanges()); } }
/// <summary> /// 创建一个异常处理 /// </summary> /// <param name="entity">一个对象</param> /// <returns></returns> public int Create(SysException entity) { using (SysEntities db = new SysEntities()) { Create(db, entity); return(this.Save(db)); } }
/// <summary> /// 删除一个异常处理 /// </summary> /// <param name="db">实体数据</param> /// <param name="id">一条异常处理的主键</param> public void Delete(SysEntities db, string id) { SysException deleteItem = GetById(db, id); if (deleteItem != null) { db.SysException.DeleteObject(deleteItem); } }
/// <summary> /// 编辑一个异常处理对象 /// </summary> /// <param name="db">实体数据</param> /// <param name="entity">将要编辑的一个异常处理对象</param> public SysException Edit(SysEntities db, SysException entity) { db.SysException.Attach(entity); db.ObjectStateManager.ChangeObjectState(entity, EntityState.Modified); return(entity); }
public static void Log(SysException ex) { }