Exemplo n.º 1
0
 /// <summary>
 /// 修改
 /// </summary>
 /// <param name="entity">要修改的实体</param>
 /// <returns></returns>
 public bool Edit(T entity)
 {
     CurrentContext.Entry(entity).State = EntityState.Modified;
     return(true);
 }
 /// <summary>
 /// 删除
 /// </summary>
 /// <param name="entity">要删除的实体</param>
 /// <returns></returns>
 public bool DeleteEntity(T entity)
 {
     CurrentContext.Entry(entity).State = EntityState.Deleted;
     return(true);
 }