RemoveSqlable

This commit is contained in:
610262374@qq.com
2017-03-08 16:46:34 +08:00
parent 67f168a231
commit 77c7329bae
8 changed files with 11 additions and 136 deletions

View File

@@ -36,9 +36,11 @@ namespace OrmTest.UnitTest
//var list2 = db.Queryable<Student>()
// .Where(st => st.Id > 0)
// .Select("id").ToList();
var list = db.Queryable<Student, School>((st, sc) => new object[] {
JoinType.Left,st.SchoolId==sc.Id
}).Where(st => st.Id > 0).Select<Student>("*").ToList();
var list = db.Queryable<Student, School,School>((st, sc,sc2) => new object[] {
JoinType.Left,st.SchoolId==sc.Id,
JoinType.Left,sc2.Id==sc.Id
}).Where(st => st.Id > 0).ToList();
var list3 = db.Queryable("Student", "st")
.AddJoinInfo("School", "sh", "sh.id=st.schoolid")

View File

@@ -1,67 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace SqlSugar
{
public class SqlableQueryBuilder : IDMLBuilder
{
public SqlBuilderProvider BuilderConext
{
get
{
throw new NotImplementedException();
}
set
{
throw new NotImplementedException();
}
}
public SqlSugarClient Context
{
get
{
throw new NotImplementedException();
}
set
{
throw new NotImplementedException();
}
}
public StringBuilder Sql
{
get
{
throw new NotImplementedException();
}
set
{
throw new NotImplementedException();
}
}
public string SqlTemplate
{
get
{
throw new NotImplementedException();
}
}
public void Clear()
{
throw new NotImplementedException();
}
public string ToSqlString()
{
throw new NotImplementedException();
}
}
}

View File

@@ -1,12 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace SqlSugar
{
public partial class SqlableProvider : ISugarSqlable
{
public SqlSugarClient Context { get; set; }
}
}

View File

@@ -1,11 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace SqlSugar
{
public class SqlServerSqlable:SqlableProvider
{
}
}

View File

@@ -33,14 +33,6 @@ namespace SqlSugar
return reval;
}
public static ISugarSqlable GetSqlable(IConnectionConfig currentConnectionConfig)
{
CheckConfig(currentConnectionConfig);
ISugarSqlable reval = CreateInstance<ISugarSqlable>(GetClassName(currentConnectionConfig.DbType, "Sqlable"), currentConnectionConfig.DbType);
return reval;
}
public static ISqlBuilder GetSqlbuilder(IConnectionConfig currentConnectionConfig)
{
CheckConfig(currentConnectionConfig);

View File

@@ -1,12 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace SqlSugar
{
public partial interface ISugarSqlable
{
SqlSugarClient Context { get; set; }
}
}

View File

@@ -57,11 +57,9 @@
<Compile Include="Abstract\QueryableProvider\QueryableAccessory.cs" />
<Compile Include="Abstract\QueryableProvider\QueryableExtendsions.cs" />
<Compile Include="Abstract\QueryableProvider\QueryableProvider.cs" />
<Compile Include="Abstract\SqlableProvider.cs" />
<Compile Include="Abstract\SqlBuilderProvider\DMLBuilder\DeleteBuilder.cs" />
<Compile Include="Abstract\SqlBuilderProvider\DMLBuilder\InsertBuilder.cs" />
<Compile Include="Abstract\SqlBuilderProvider\DMLBuilder\LambadaQueryBuilder.cs" />
<Compile Include="Abstract\SqlBuilderProvider\DMLBuilder\SqlableQueryBuilder.cs" />
<Compile Include="Abstract\SqlBuilderProvider\DMLBuilder\SqlQueryBuilder.cs" />
<Compile Include="Abstract\SqlBuilderProvider\DMLBuilder\UpdateBuilder.cs" />
<Compile Include="Abstract\SqlBuilderProvider\SqlBuilderAccessory.cs" />
@@ -85,7 +83,6 @@
<Compile Include="Databases\SqlServer\Db\SqlBuilder\SqlServerLambadaQueryBuilder.cs" />
<Compile Include="Databases\SqlServer\Db\SqlServerDb.cs" />
<Compile Include="Databases\SqlServer\Queryable\SqlServerQueryable.cs" />
<Compile Include="Databases\SqlServer\Sqlable\SqlServerSqlable.cs" />
<Compile Include="DetaultT.cs" />
<Compile Include="Entities\ConnectionConfig.cs" />
<Compile Include="Entities\DbColumnInfo.cs" />
@@ -139,7 +136,6 @@
<Compile Include="Interface\IDbMaintenance.cs" />
<Compile Include="Interface\ILambdaExpressions.cs" />
<Compile Include="Interface\IQueryable.cs" />
<Compile Include="Interface\ISqlable.cs" />
<Compile Include="Interface\ISqlBuilder\IDMLBuilder.cs" />
<Compile Include="Interface\ISqlBuilder\ISqlBuilder.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />

View File

@@ -153,9 +153,13 @@ namespace SqlSugar
queryable.SqlBuilder.LambadaQueryBuilder.TableShortName=shortName;
return queryable;
}
public virtual ISugarQueryable<T> Queryable<T, T2, T3>(Func<T, T2, T3, object[]> joinExpression) where T : class, new()
public virtual ISugarQueryable<T> Queryable<T, T2, T3>(Expression<Func<T, T2, T3, object[]>> joinExpression) where T : class, new()
{
return null;
var queryable = Queryable<T>();
string shortName = string.Empty;
queryable.SqlBuilder.LambadaQueryBuilder.JoinQueryInfos = base.GetJoinInfos(joinExpression, this, ref shortName, typeof(T2),typeof(T3));
queryable.SqlBuilder.LambadaQueryBuilder.TableShortName = shortName;
return queryable;
}
public virtual List<T> Queryable<T, T2, T3, T4>(Func<T, T2, T3, T4, object[]> joinExpression) where T : class, new()
{
@@ -185,23 +189,6 @@ namespace SqlSugar
{
return null;
}
/// <summary>
/// Sqlable Query operation
/// </summary>
public virtual ISugarSqlable Sqlable
{
get
{
if (_Sqlable == null)
{
var reval = InstanceFactory.GetSqlable(base.CurrentConnectionConfig);
reval.Context = this;
_Sqlable = reval;
return reval;
}
return (ISugarSqlable)_Sqlable;
}
}
#endregion
#region functions