mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-09-19 10:08:04 +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();
|
||||
|
@@ -36,6 +36,9 @@
|
||||
<Reference Include="EntityFramework">
|
||||
<HintPath>..\packages\EntityFramework.6.1.3\lib\net45\EntityFramework.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="EntityFramework.Extended">
|
||||
<HintPath>..\packages\EntityFramework.Extended.6.1.0.168\lib\net45\EntityFramework.Extended.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="EntityFramework.SqlServer">
|
||||
<HintPath>..\packages\EntityFramework.6.1.3\lib\net45\EntityFramework.SqlServer.dll</HintPath>
|
||||
</Reference>
|
||||
|
@@ -1,4 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="EntityFramework" version="6.1.3" targetFramework="net45" />
|
||||
<package id="EntityFramework.Extended" version="6.1.0.168" targetFramework="net45" />
|
||||
</packages>
|
Reference in New Issue
Block a user