实现了ztree与datagrid互动

This commit is contained in:
yubaolee
2015-10-30 23:14:31 +08:00
parent 104866d83b
commit 1f574aca70
10 changed files with 99 additions and 52 deletions

View File

@@ -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();