using System;
using System.Collections.Generic;
using System.Data;
using System.Dynamic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace SqlSugar
{
///
/// ** description:Create datathis.access object
/// ** author:sunkaixuan
/// ** date:2017/1/2
/// ** email:610262374@qq.com
///
public partial class SqlSugarProvider: ISqlSugarClient
{
#region Constructor
public SqlSugarProvider(ConnectionConfig config)
{
this.Context = this;
this.CurrentConnectionConfig = config;
this.ContextID = Guid.NewGuid();
Check.ArgumentNullException(config, "config is null");
CheckDbDependency(config);
}
#endregion
#region ADO Methods
///
///Datathis.operation
///
public virtual IAdo Ado
{
get
{
if (this.ContextAdo == null)
{
var result = InstanceFactory.GetAdo(this.Context.CurrentConnectionConfig);
this.ContextAdo = result;
result.Context = this;
return result;
}
return this._Ado;
}
}
#endregion
#region Aop Log Methods
public virtual AopProvider Aop { get { return new AopProvider(this); } }
#endregion
#region Util Methods
[Obsolete("Use SqlSugarClient.Utilities")]
public virtual IContextMethods RewritableMethods
{
get { return this.Context.Utilities; }
set { this.Context.Utilities = value; }
}
public virtual IContextMethods Utilities
{
get
{
if (ContextRewritableMethods == null)
{
ContextRewritableMethods = new ContextMethods();
ContextRewritableMethods.Context = this;
}
return ContextRewritableMethods;
}
set { ContextRewritableMethods = value; }
}
#endregion
#region Queryable
///
/// Get datebase time
///
///
public DateTime GetDate()
{
var sqlBuilder = InstanceFactory.GetSqlbuilder(this.Context.CurrentConnectionConfig);
return this.Ado.GetDateTime(sqlBuilder.FullSqlDateNow);
}
///
/// Lambda Query operation
///
public virtual ISugarQueryable Queryable()
{
InitMappingInfo();
var result = this.CreateQueryable();
return result;
}
///
/// Lambda Query operation
///
public virtual ISugarQueryable Queryable(string shortName)
{
Check.Exception(shortName.HasValue() && shortName.Length > 20, ErrorMessage.GetThrowMessage("shortName参数长度不能超过20,你可能是想用这个方法 db.SqlQueryable(sql)而不是db.Queryable(shortName)", "Queryable.shortName max length 20"));
var queryable = Queryable();
queryable.SqlBuilder.QueryBuilder.TableShortName = shortName;
return queryable;
}
///
/// Lambda Query operation
///
public virtual ISugarQueryable Queryable(string tableName, string shortName)
{
var queryable = Queryable();
queryable.SqlBuilder.QueryBuilder.EntityName = tableName;
queryable.SqlBuilder.QueryBuilder.TableShortName = shortName;
return queryable;
}
public virtual ISugarQueryable Queryable(Expression> joinExpression)
{
InitMappingInfo();
var types = new Type[] { typeof(T2) };
var queryable = InstanceFactory.GetQueryable(this.CurrentConnectionConfig);
this.CreateQueryJoin(joinExpression, types, queryable);
return queryable;
}
public virtual ISugarQueryable Queryable(Expression> joinExpression)
{
InitMappingInfo();
var types = new Type[] { typeof(T2) };
var queryable = InstanceFactory.GetQueryable(this.CurrentConnectionConfig);
this.CreateQueryJoin(joinExpression, types, queryable);
return queryable;
}
public virtual ISugarQueryable Queryable(Expression> joinExpression)
{
InitMappingInfo();
var types = new Type[] { typeof(T2), typeof(T3) };
var queryable = InstanceFactory.GetQueryable(this.CurrentConnectionConfig);
this.CreateQueryJoin(joinExpression, types, queryable);
return queryable;
}
public virtual ISugarQueryable Queryable(Expression> joinExpression)
{
InitMappingInfo();
var types = new Type[] { typeof(T2), typeof(T3) };
var queryable = InstanceFactory.GetQueryable(this.CurrentConnectionConfig);
this.CreateQueryJoin(joinExpression, types, queryable);
return queryable;
}
public virtual ISugarQueryable Queryable(Expression> joinExpression)
{
InitMappingInfo();
var types = new Type[] { typeof(T2), typeof(T3), typeof(T4) };
var queryable = InstanceFactory.GetQueryable(this.CurrentConnectionConfig);
this.CreateQueryJoin(joinExpression, types, queryable);
return queryable;
}
public virtual ISugarQueryable Queryable(Expression> joinExpression)
{
InitMappingInfo();
var types = new Type[] { typeof(T2), typeof(T3), typeof(T4) };
var queryable = InstanceFactory.GetQueryable(this.CurrentConnectionConfig);
this.CreateQueryJoin(joinExpression, types, queryable);
return queryable;
}
public virtual ISugarQueryable Queryable(Expression> joinExpression)
{
InitMappingInfo();
var types = new Type[] { typeof(T2), typeof(T3), typeof(T4), typeof(T5) };
var queryable = InstanceFactory.GetQueryable(this.CurrentConnectionConfig);
this.CreateQueryJoin(joinExpression, types, queryable);
return queryable;
}
public virtual ISugarQueryable Queryable(Expression> joinExpression)
{
InitMappingInfo();
var types = new Type[] { typeof(T2), typeof(T3), typeof(T4), typeof(T5) };
var queryable = InstanceFactory.GetQueryable(this.CurrentConnectionConfig);
this.CreateQueryJoin(joinExpression, types, queryable);
return queryable;
}
public virtual ISugarQueryable Queryable(Expression> joinExpression)
{
InitMappingInfo();
var types = new Type[] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6) };
var queryable = InstanceFactory.GetQueryable(this.CurrentConnectionConfig);
this.CreateQueryJoin(joinExpression, types, queryable);
return queryable;
}
public virtual ISugarQueryable Queryable(Expression> joinExpression)
{
InitMappingInfo();
var types = new Type[] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6) };
var queryable = InstanceFactory.GetQueryable(this.CurrentConnectionConfig);
this.CreateQueryJoin(joinExpression, types, queryable);
return queryable;
}
public virtual ISugarQueryable Queryable(Expression> joinExpression)
{
InitMappingInfo();
var types = new Type[] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7) };
var queryable = InstanceFactory.GetQueryable(this.CurrentConnectionConfig);
this.CreateQueryJoin(joinExpression, types, queryable);
return queryable;
}
public virtual ISugarQueryable Queryable(Expression> joinExpression)
{
InitMappingInfo();
var types = new Type[] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7) };
var queryable = InstanceFactory.GetQueryable(this.CurrentConnectionConfig);
this.CreateQueryJoin(joinExpression, types, queryable);
return queryable;
}
public virtual ISugarQueryable Queryable(Expression> joinExpression)
{
InitMappingInfo();
var types = new Type[] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8) };
var queryable = InstanceFactory.GetQueryable(this.CurrentConnectionConfig);
this.CreateQueryJoin(joinExpression, types, queryable);
return queryable;
}
public virtual ISugarQueryable Queryable(Expression> joinExpression)
{
InitMappingInfo();
var types = new Type[] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8) };
var queryable = InstanceFactory.GetQueryable(this.CurrentConnectionConfig);
this.CreateQueryJoin(joinExpression, types, queryable);
return queryable;
}
#region 9-12
public virtual ISugarQueryable Queryable(Expression> joinExpression)
{
InitMappingInfo();
var types = new Type[] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9) };
var queryable = InstanceFactory.GetQueryable(this.CurrentConnectionConfig);
this.CreateQueryJoin(joinExpression, types, queryable);
return queryable;
}
public virtual ISugarQueryable Queryable(Expression> joinExpression)
{
InitMappingInfo();
var types = new Type[] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9) };
var queryable = InstanceFactory.GetQueryable(this.CurrentConnectionConfig);
this.CreateQueryJoin(joinExpression, types, queryable);
return queryable;
}
public virtual ISugarQueryable Queryable(Expression> joinExpression)
{
InitMappingInfo();
var types = new Type[] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9), typeof(T10) };
var queryable = InstanceFactory.GetQueryable(this.CurrentConnectionConfig);
this.CreateQueryJoin(joinExpression, types, queryable);
return queryable;
}
public virtual ISugarQueryable Queryable(Expression> joinExpression)
{
InitMappingInfo();
var types = new Type[] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9), typeof(T10) };
var queryable = InstanceFactory.GetQueryable(this.CurrentConnectionConfig);
this.CreateQueryJoin(joinExpression, types, queryable);
return queryable;
}
public virtual ISugarQueryable Queryable(Expression> joinExpression)
{
InitMappingInfo();
var types = new Type[] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9), typeof(T10), typeof(T11) };
var queryable = InstanceFactory.GetQueryable(this.CurrentConnectionConfig);
this.CreateQueryJoin(joinExpression, types, queryable);
return queryable;
}
public virtual ISugarQueryable Queryable(Expression> joinExpression)
{
InitMappingInfo();
var types = new Type[] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9), typeof(T10), typeof(T11) };
var queryable = InstanceFactory.GetQueryable(this.CurrentConnectionConfig);
this.CreateQueryJoin(joinExpression, types, queryable);
return queryable;
}
public virtual ISugarQueryable Queryable(Expression> joinExpression)
{
InitMappingInfo();
var types = new Type[] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9), typeof(T10), typeof(T11), typeof(T12) };
var queryable = InstanceFactory.GetQueryable(this.CurrentConnectionConfig);
this.CreateQueryJoin(joinExpression, types, queryable);
return queryable;
}
public virtual ISugarQueryable Queryable(Expression> joinExpression)
{
InitMappingInfo();
var types = new Type[] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9), typeof(T10), typeof(T11), typeof(T12) };
var queryable = InstanceFactory.GetQueryable(this.CurrentConnectionConfig);
this.CreateQueryJoin(joinExpression, types, queryable);
return queryable;
}
#endregion
public virtual ISugarQueryable Queryable(Expression> joinExpression) where T : class, new()
{
InitMappingInfo();
var types = new Type[] { typeof(T2) };
var queryable = InstanceFactory.GetQueryable(this.CurrentConnectionConfig);
this.CreateEasyQueryJoin(joinExpression, types, queryable);
queryable.Where(joinExpression);
return queryable;
}
public virtual ISugarQueryable Queryable(Expression> joinExpression) where T : class, new()
{
InitMappingInfo();
var types = new Type[] { typeof(T2), typeof(T3) };
var queryable = InstanceFactory.GetQueryable(this.CurrentConnectionConfig);
this.CreateEasyQueryJoin(joinExpression, types, queryable);
queryable.Where(joinExpression);
return queryable;
}
public virtual ISugarQueryable Queryable(Expression> joinExpression) where T : class, new()
{
InitMappingInfo();
var types = new Type[] { typeof(T2), typeof(T3), typeof(T4) };
var queryable = InstanceFactory.GetQueryable(this.CurrentConnectionConfig);
this.CreateEasyQueryJoin(joinExpression, types, queryable);
queryable.Where(joinExpression);
return queryable;
}
public virtual ISugarQueryable Queryable(Expression> joinExpression) where T : class, new()
{
InitMappingInfo();
var types = new Type[] { typeof(T2), typeof(T3), typeof(T4), typeof(T5) };
var queryable = InstanceFactory.GetQueryable(this.CurrentConnectionConfig);
this.CreateEasyQueryJoin(joinExpression, types, queryable);
queryable.Where(joinExpression);
return queryable;
}
public virtual ISugarQueryable Queryable(Expression> joinExpression) where T : class, new()
{
InitMappingInfo();
var types = new Type[] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6) };
var queryable = InstanceFactory.GetQueryable(this.CurrentConnectionConfig);
this.CreateEasyQueryJoin(joinExpression, types, queryable);
queryable.Where(joinExpression);
return queryable;
}
public virtual ISugarQueryable Queryable(Expression> joinExpression) where T : class, new()
{
InitMappingInfo();
var types = new Type[] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7) };
var queryable = InstanceFactory.GetQueryable(this.CurrentConnectionConfig);
this.CreateEasyQueryJoin(joinExpression, types, queryable);
queryable.Where(joinExpression);
return queryable;
}
public virtual ISugarQueryable Queryable(Expression> joinExpression) where T : class, new()
{
InitMappingInfo();
var types = new Type[] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8) };
var queryable = InstanceFactory.GetQueryable(this.CurrentConnectionConfig);
this.CreateEasyQueryJoin(joinExpression, types, queryable);
queryable.Where(joinExpression);
return queryable;
}
#region 9-12
public virtual ISugarQueryable Queryable(Expression> joinExpression) where T : class, new()
{
InitMappingInfo();
var types = new Type[] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9) };
var queryable = InstanceFactory.GetQueryable(this.CurrentConnectionConfig);
this.CreateEasyQueryJoin(joinExpression, types, queryable);
queryable.Where(joinExpression);
return queryable;
}
public virtual ISugarQueryable Queryable(Expression> joinExpression) where T : class, new()
{
InitMappingInfo();
var types = new Type[] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9), typeof(T10) };
var queryable = InstanceFactory.GetQueryable(this.CurrentConnectionConfig);
this.CreateEasyQueryJoin(joinExpression, types, queryable);
queryable.Where(joinExpression);
return queryable;
}
public virtual ISugarQueryable Queryable(Expression> joinExpression) where T : class, new()
{
InitMappingInfo();
var types = new Type[] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9), typeof(T10), typeof(T11) };
var queryable = InstanceFactory.GetQueryable(this.CurrentConnectionConfig);
this.CreateEasyQueryJoin(joinExpression, types, queryable);
queryable.Where(joinExpression);
return queryable;
}
public virtual ISugarQueryable Queryable(Expression> joinExpression) where T : class, new()
{
InitMappingInfo();
var types = new Type[] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9), typeof(T10), typeof(T11), typeof(T12) };
var queryable = InstanceFactory.GetQueryable(this.CurrentConnectionConfig);
this.CreateEasyQueryJoin(joinExpression, types, queryable);
queryable.Where(joinExpression);
return queryable;
}
public virtual ISugarQueryable Queryable(ISugarQueryable queryable) where T : class, new()
{
var sqlobj = queryable.ToSql();
return this.SqlQueryable(sqlobj.Key).AddParameters(sqlobj.Value);
}
public virtual ISugarQueryable Queryable(
ISugarQueryable joinQueryable1, ISugarQueryable joinQueryable2, Expression> joinExpression) where T : class, new() where T2 : class, new()
{
return Queryable(joinQueryable1, joinQueryable2, JoinType.Inner, joinExpression);
}
public virtual ISugarQueryable Queryable(
ISugarQueryable joinQueryable1, ISugarQueryable joinQueryable2, JoinType joinType, Expression> joinExpression) where T : class, new() where T2 : class, new()
{
Check.Exception(joinQueryable1.QueryBuilder.Take != null || joinQueryable1.QueryBuilder.Skip != null || joinQueryable1.QueryBuilder.OrderByValue.HasValue(), "joinQueryable1 Cannot have 'Skip' 'ToPageList' 'Take' Or 'OrderBy'");
Check.Exception(joinQueryable2.QueryBuilder.Take != null || joinQueryable2.QueryBuilder.Skip != null || joinQueryable2.QueryBuilder.OrderByValue.HasValue(), "joinQueryable2 Cannot have 'Skip' 'ToPageList' 'Take' Or 'OrderBy'");
var sqlBuilder = InstanceFactory.GetSqlbuilder(this.Context.CurrentConnectionConfig);
sqlBuilder.Context = this;
InitMappingInfo();
var types = new Type[] { typeof(T2) };
var queryable = InstanceFactory.GetQueryable(this.CurrentConnectionConfig);
queryable.Context = this.Context;
queryable.SqlBuilder = sqlBuilder;
queryable.QueryBuilder = InstanceFactory.GetQueryBuilder(this.CurrentConnectionConfig);
queryable.QueryBuilder.JoinQueryInfos = new List();
queryable.QueryBuilder.Builder = sqlBuilder;
queryable.QueryBuilder.Context = this;
queryable.QueryBuilder.EntityType = typeof(T);
queryable.QueryBuilder.LambdaExpressions = InstanceFactory.GetLambdaExpressions(this.CurrentConnectionConfig);
//master
var shortName1 = joinExpression.Parameters[0].Name;
var sqlObj1 = joinQueryable1.ToSql();
string sql1 = sqlObj1.Key;
UtilMethods.RepairReplicationParameters(ref sql1, sqlObj1.Value.ToArray(), 0, "Join");
queryable.QueryBuilder.EntityName = sqlBuilder.GetPackTable(sql1, shortName1); ;
queryable.QueryBuilder.Parameters.AddRange(sqlObj1.Value);
//join table 1
var shortName2 = joinExpression.Parameters[1].Name;
var sqlObj2 = joinQueryable2.ToSql();
string sql2 = sqlObj2.Key;
UtilMethods.RepairReplicationParameters(ref sql2, sqlObj2.Value.ToArray(), 1, "Join");
queryable.QueryBuilder.Parameters.AddRange(sqlObj2.Value);
var exp = queryable.QueryBuilder.GetExpressionValue(joinExpression, ResolveExpressType.WhereMultiple);
queryable.QueryBuilder.JoinQueryInfos.Add(new JoinQueryInfo() { JoinIndex = 0, JoinType = joinType, JoinWhere = exp.GetResultString(), TableName = sqlBuilder.GetPackTable(sql2, shortName2) });
return queryable;
}
#endregion
public virtual ISugarQueryable UnionAll(params ISugarQueryable[] queryables) where T : class, new()
{
var sqlBuilder = InstanceFactory.GetSqlbuilder(this.Context.CurrentConnectionConfig);
Check.Exception(queryables.IsNullOrEmpty(), "UnionAll.queryables is null ");
int i = 1;
List>> allItems = new List>>();
foreach (var item in queryables)
{
var sqlObj = item.ToSql();
string sql = sqlObj.Key;
UtilMethods.RepairReplicationParameters(ref sql, sqlObj.Value.ToArray(), i, "UnionAll");
if (sqlObj.Value.HasValue())
allItems.Add(new KeyValuePair>(sql, sqlObj.Value));
else
allItems.Add(new KeyValuePair>(sql, new List()));
i++;
}
var allSql = sqlBuilder.GetUnionAllSql(allItems.Select(it => it.Key).ToList());
var allParameters = allItems.SelectMany(it => it.Value).ToArray();
var resulut = this.Context.Queryable().AS(UtilMethods.GetPackTable(allSql, "unionTable")).With(SqlWith.Null);
resulut.AddParameters(allParameters);
return resulut.Select(sqlBuilder.SqlSelectAll);
}
public virtual ISugarQueryable UnionAll(List> queryables) where T : class, new()
{
Check.Exception(queryables.IsNullOrEmpty(), "UnionAll.queryables is null ");
return UnionAll(queryables.ToArray());
}
public virtual ISugarQueryable Union(params ISugarQueryable[] queryables) where T : class, new()
{
var sqlBuilder = InstanceFactory.GetSqlbuilder(this.Context.CurrentConnectionConfig);
Check.Exception(queryables.IsNullOrEmpty(), "UnionAll.queryables is null ");
int i = 1;
List>> allItems = new List>>();
foreach (var item in queryables)
{
var sqlObj = item.ToSql();
string sql = sqlObj.Key;
UtilMethods.RepairReplicationParameters(ref sql, sqlObj.Value.ToArray(), i, "Union");
if (sqlObj.Value.HasValue())
allItems.Add(new KeyValuePair>(sql, sqlObj.Value));
else
allItems.Add(new KeyValuePair>(sql, new List()));
i++;
}
var allSql = sqlBuilder.GetUnionSql(allItems.Select(it => it.Key).ToList());
var allParameters = allItems.SelectMany(it => it.Value).ToArray();
var resulut = this.Context.Queryable().AS(UtilMethods.GetPackTable(allSql, "unionTable")).With(SqlWith.Null);
resulut.AddParameters(allParameters);
return resulut.Select(sqlBuilder.SqlSelectAll);
}
public virtual ISugarQueryable Union(List> queryables) where T : class, new()
{
Check.Exception(queryables.IsNullOrEmpty(), "Union.queryables is null ");
return Union(queryables.ToArray());
}
#endregion
#region SqlQueryable
public ISugarQueryable SqlQueryable(string sql) where T : class, new()
{
var sqlBuilder = InstanceFactory.GetSqlbuilder(this.Context.CurrentConnectionConfig);
return this.Context.Queryable().AS(sqlBuilder.GetPackTable(sql, sqlBuilder.GetDefaultShortName())).With(SqlWith.Null).Select(sqlBuilder.GetDefaultShortName() + ".*");
}
#endregion
#region Insertable
public virtual IInsertable Insertable(T[] insertObjs) where T : class, new()
{
InitMappingInfo();
InsertableProvider result = this.CreateInsertable(insertObjs);
return result;
}
public virtual IInsertable Insertable(List insertObjs) where T : class, new()
{
if (insertObjs == null|| insertObjs.IsNullOrEmpty())
{
insertObjs = new List();
insertObjs.Add(default(T));
}
return this.Context.Insertable(insertObjs.ToArray());
}
public virtual IInsertable Insertable(T insertObj) where T : class, new()
{
return this.Context.Insertable(new T[] { insertObj });
}
public virtual IInsertable Insertable(Dictionary columnDictionary) where T : class, new()
{
InitMappingInfo();
Check.Exception(columnDictionary == null || columnDictionary.Count == 0, "Insertable.columnDictionary can't be null");
var insertObject = this.Context.Utilities.DeserializeObject(this.Context.Utilities.SerializeObject(columnDictionary));
var columns = columnDictionary.Select(it => it.Key).ToList();
return this.Context.Insertable(insertObject).InsertColumns(columns.ToArray()); ;
}
public virtual IInsertable Insertable(dynamic insertDynamicObject) where T : class, new()
{
InitMappingInfo();
if (insertDynamicObject is T)
{
return this.Context.Insertable((T)insertDynamicObject);
}
else
{
var columns = ((object)insertDynamicObject).GetType().GetProperties().Select(it => it.Name).ToList();
Check.Exception(columns.IsNullOrEmpty(), "Insertable.updateDynamicObject can't be null");
T insertObject = this.Context.Utilities.DeserializeObject(this.Context.Utilities.SerializeObject(insertDynamicObject));
return this.Context.Insertable(insertObject).InsertColumns(columns.ToArray());
}
}
#endregion
#region Deleteable
public virtual IDeleteable Deleteable() where T : class, new()
{
InitMappingInfo();
DeleteableProvider result = this.CreateDeleteable();
return result;
}
public virtual IDeleteable Deleteable(Expression> expression) where T : class, new()
{
InitMappingInfo();
return this.Context.Deleteable().Where(expression);
}
public virtual IDeleteable Deleteable(dynamic primaryKeyValue) where T : class, new()
{
InitMappingInfo();
return this.Context.Deleteable().In(primaryKeyValue);
}
public virtual IDeleteable Deleteable