标签:pre turn try .property set let current [] 删除
public int Remove(int id) { T u1 = context.Set<T>().Find(id); //context.Set<T>().Remove(u1); //return context.SaveChanges(); context.Entry(u1).Property("IsDelete").IsModified = true; context.Entry(u1).Property("IsDelete").CurrentValue = true; return 0; } public int Remove(int[] ids) { int counter = ids.Length; for (int i = 0; i < counter; i++) { //T u1 = context.Set<T>().Find(ids[i]); //context.Set<T>().Remove(u1); Remove(ids[i]); } //return context.SaveChanges(); return 0; }
标签:pre turn try .property set let current [] 删除
原文地址:http://www.cnblogs.com/duanyuerui/p/6962601.html