using Ant.Data;
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
namespace Ant.ORM
{
///
/// 定义接口
///
public interface IDbContext : IDisposable
{
//IDbSession CurrentSession { get; }
///
/// 组装SQL语句
///
///
///
IQuery Query() where T : new();
///
/// 自定义SQL语句
///
///
///
///
///
IEnumerable SqlQuery(string sql, params DbParam[] parameters) where T : new();
///
/// 保存
///
///
///
///
T Insert(T entity);
///
/// 保存
///
///
///
/// PrimaryKey
object Insert(Expression> body);
///
///
///
///
///
///
int Update(T entity);
///
///
///
///
///
///
///
int Update(Expression> body, Expression> condition);
///
///
///
///
///
///
int Delete(T entity);
///
///
///
///
///
///
int Delete(Expression> condition);
///
///
///
///
void TrackEntity(object entity);
}
}