mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-09-20 18:47:55 +08:00
实现了ztree与datagrid互动
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
using System.Data.Entity.Migrations;
|
||||
using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
using EntityFramework.Extensions;
|
||||
using OpenAuth.Domain.Interface;
|
||||
using OpenAuth.Repository.Models;
|
||||
using Infrastructure;
|
||||
@@ -70,6 +71,16 @@ namespace OpenAuth.Repository
|
||||
Save();
|
||||
}
|
||||
|
||||
public void Update(Expression<Func<T, bool>> exp, T entity)
|
||||
{
|
||||
Context.Set<T>().Where(exp).Update(u => entity);
|
||||
}
|
||||
|
||||
public void Delete(Expression<Func<T, bool>> exp)
|
||||
{
|
||||
Context.Set<T>().Where(exp).Delete();
|
||||
}
|
||||
|
||||
public void Save()
|
||||
{
|
||||
Context.SaveChanges();
|
||||
|
Reference in New Issue
Block a user