Browse Source

RemoveSqlable

pull/12/MERGE
610262374@qq.com 8 years ago
parent
commit
77c7329bae
  1. 8
      OrmTest/UnitTest/Query/SelectQuery.cs
  2. 67
      SqlSugar/Abstract/SqlBuilderProvider/DMLBuilder/SqlableQueryBuilder.cs
  3. 12
      SqlSugar/Abstract/SqlableProvider.cs
  4. 11
      SqlSugar/Databases/SqlServer/Sqlable/SqlServerSqlable.cs
  5. 8
      SqlSugar/InstanceFactory.cs
  6. 12
      SqlSugar/Interface/ISqlable.cs
  7. 4
      SqlSugar/SqlSugar.csproj
  8. 25
      SqlSugar/SqlSugarClient.cs

8
OrmTest/UnitTest/Query/SelectQuery.cs

@ -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")

67
SqlSugar/Abstract/SqlBuilderProvider/DMLBuilder/SqlableQueryBuilder.cs

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

12
SqlSugar/Abstract/SqlableProvider.cs

@ -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; }
}
}

11
SqlSugar/Databases/SqlServer/Sqlable/SqlServerSqlable.cs

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

8
SqlSugar/InstanceFactory.cs

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

12
SqlSugar/Interface/ISqlable.cs

@ -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; }
}
}

4
SqlSugar/SqlSugar.csproj

@ -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" />

25
SqlSugar/SqlSugarClient.cs

@ -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

Loading…
Cancel
Save