mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-18 03:53:21 +08:00
add Examples/orm_vs
This commit is contained in:
parent
7738dfec88
commit
a0cebe229e
176
Examples/orm_vs/Program.cs
Normal file
176
Examples/orm_vs/Program.cs
Normal file
@ -0,0 +1,176 @@
|
|||||||
|
using FreeSql.DataAnnotations;
|
||||||
|
using SqlSugar;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace orm_vs
|
||||||
|
{
|
||||||
|
class Program
|
||||||
|
{
|
||||||
|
static IFreeSql fsql = new FreeSql.FreeSqlBuilder()
|
||||||
|
.UseConnectionString(FreeSql.DataType.SqlServer, "Data Source=.;Integrated Security=True;Initial Catalog=freesqlTest;Pooling=true;Max Pool Size=20")
|
||||||
|
//.UseConnectionString(FreeSql.DataType.MySql, "Data Source=127.0.0.1;Port=3306;User ID=root;Password=root;Initial Catalog=cccddd;Charset=utf8;SslMode=none;Max pool size=20")
|
||||||
|
.UseAutoSyncStructure(false)
|
||||||
|
.UseNoneCommandParameter(true)
|
||||||
|
//.UseConfigEntityFromDbFirst(true)
|
||||||
|
.Build();
|
||||||
|
|
||||||
|
static SqlSugarClient sugar {
|
||||||
|
get => new SqlSugarClient(new ConnectionConfig() {
|
||||||
|
//不欺负,让连接池100个最小
|
||||||
|
ConnectionString = "Data Source=.;Integrated Security=True;Initial Catalog=freesqlTest;Pooling=true;Min Pool Size=20;Max Pool Size=20",
|
||||||
|
DbType = DbType.SqlServer,
|
||||||
|
//ConnectionString = "Data Source=127.0.0.1;Port=3306;User ID=root;Password=root;Initial Catalog=cccddd;Charset=utf8;SslMode=none;Min Pool Size=20;Max Pool Size=20",
|
||||||
|
//DbType = DbType.MySql,
|
||||||
|
IsAutoCloseConnection = true,
|
||||||
|
InitKeyType = InitKeyType.Attribute
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
static StringBuilder sb = new StringBuilder();
|
||||||
|
|
||||||
|
static void Main(string[] args) {
|
||||||
|
|
||||||
|
//fsql.CodeFirst.SyncStructure(typeof(Song), typeof(Song_tag), typeof(Tag));
|
||||||
|
//sugar.CodeFirst.InitTables(typeof(Song), typeof(Song_tag), typeof(Tag));
|
||||||
|
//sugar创建表失败:SqlSugar.SqlSugarException: Sequence contains no elements
|
||||||
|
|
||||||
|
//测试前清空数据
|
||||||
|
fsql.Delete<Song>().Where(a => a.Id > 0).ExecuteAffrows();
|
||||||
|
sugar.Deleteable<Song>().Where(a => a.Id > 0).ExecuteCommand();
|
||||||
|
|
||||||
|
Console.WriteLine("插入性能:");
|
||||||
|
Insert(1000, 1);
|
||||||
|
Console.Write(sb.ToString());
|
||||||
|
sb.Clear();
|
||||||
|
Insert(1000, 10);
|
||||||
|
Console.Write(sb.ToString());
|
||||||
|
sb.Clear();
|
||||||
|
|
||||||
|
Insert(1, 1000);
|
||||||
|
Console.Write(sb.ToString());
|
||||||
|
sb.Clear();
|
||||||
|
Insert(1, 10000);
|
||||||
|
Console.Write(sb.ToString());
|
||||||
|
sb.Clear();
|
||||||
|
Insert(1, 50000);
|
||||||
|
Console.Write(sb.ToString());
|
||||||
|
sb.Clear();
|
||||||
|
|
||||||
|
Console.WriteLine("查询性能:");
|
||||||
|
Select(1000, 1);
|
||||||
|
Console.Write(sb.ToString());
|
||||||
|
sb.Clear();
|
||||||
|
Select(1000, 10);
|
||||||
|
Console.Write(sb.ToString());
|
||||||
|
sb.Clear();
|
||||||
|
|
||||||
|
Select(1, 1000);
|
||||||
|
Console.Write(sb.ToString());
|
||||||
|
sb.Clear();
|
||||||
|
Select(1, 10000);
|
||||||
|
Console.Write(sb.ToString());
|
||||||
|
sb.Clear();
|
||||||
|
Select(1, 50000);
|
||||||
|
Console.Write(sb.ToString());
|
||||||
|
sb.Clear();
|
||||||
|
Select(1, 100000);
|
||||||
|
Console.Write(sb.ToString());
|
||||||
|
sb.Clear();
|
||||||
|
|
||||||
|
Console.Write(sb.ToString());
|
||||||
|
Console.WriteLine("测试结束,按任意键退出...");
|
||||||
|
Console.ReadKey();
|
||||||
|
}
|
||||||
|
|
||||||
|
static void Select(int forTime, int size) {
|
||||||
|
Stopwatch sw = new Stopwatch();
|
||||||
|
|
||||||
|
sw.Restart();
|
||||||
|
for (var a = 0; a < forTime; a++)
|
||||||
|
fsql.Select<Song>().Limit(size).ToList();
|
||||||
|
sw.Stop();
|
||||||
|
sb.AppendLine($"FreeSql Select {size}条数据,循环{forTime}次,耗时{sw.ElapsedMilliseconds}ms");
|
||||||
|
|
||||||
|
sw.Restart();
|
||||||
|
for (var a = 0; a < forTime; a++)
|
||||||
|
sugar.Queryable<Song>().Take(size).ToList();
|
||||||
|
sw.Stop();
|
||||||
|
sb.AppendLine($"SqlSugar Select {size}条数据,循环{forTime}次,耗时{sw.ElapsedMilliseconds}ms\r\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
static void Insert(int forTime, int size) {
|
||||||
|
var songs = Enumerable.Range(0, size).Select(a => new Song {
|
||||||
|
Create_time = DateTime.Now,
|
||||||
|
Is_deleted = false,
|
||||||
|
Title = $"Insert_{a}",
|
||||||
|
Url = $"Url_{a}"
|
||||||
|
}).ToArray();
|
||||||
|
|
||||||
|
//预热
|
||||||
|
fsql.Insert(songs.First()).ExecuteAffrows();
|
||||||
|
sugar.Insertable(songs.First()).ExecuteCommand();
|
||||||
|
Stopwatch sw = new Stopwatch();
|
||||||
|
|
||||||
|
sw.Restart();
|
||||||
|
for (var a = 0; a < forTime; a++)
|
||||||
|
fsql.Insert(songs).ExecuteAffrows();
|
||||||
|
sw.Stop();
|
||||||
|
sb.AppendLine($"FreeSql Insert {size}条数据,循环{forTime}次,耗时{sw.ElapsedMilliseconds}ms");
|
||||||
|
|
||||||
|
sw.Restart();
|
||||||
|
for (var a = 0; a < forTime; a++)
|
||||||
|
sugar.Insertable(songs).ExecuteCommand();
|
||||||
|
sw.Stop();
|
||||||
|
|
||||||
|
sb.AppendLine($"SqlSugar Insert {size}条数据,循环{forTime}次,耗时{sw.ElapsedMilliseconds}ms\r\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[Table(Name = "freesql_song")]
|
||||||
|
[SugarTable("sugar_song")]
|
||||||
|
public class Song {
|
||||||
|
[Column(IsIdentity = true)]
|
||||||
|
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
|
||||||
|
public int Id { get; set; }
|
||||||
|
public DateTime? Create_time { get; set; }
|
||||||
|
public bool? Is_deleted { get; set; }
|
||||||
|
public string Title { get; set; }
|
||||||
|
public string Url { get; set; }
|
||||||
|
|
||||||
|
[SugarColumn(IsIgnore = true)]
|
||||||
|
public virtual ICollection<Tag> Tags { get; set; }
|
||||||
|
}
|
||||||
|
[Table(Name = "freesql_song_tag")]
|
||||||
|
[SugarTable("sugar_song_tag")]
|
||||||
|
public class Song_tag {
|
||||||
|
public int Song_id { get; set; }
|
||||||
|
[SugarColumn(IsIgnore = true)]
|
||||||
|
public virtual Song Song { get; set; }
|
||||||
|
|
||||||
|
public int Tag_id { get; set; }
|
||||||
|
[SugarColumn(IsIgnore = true)]
|
||||||
|
public virtual Tag Tag { get; set; }
|
||||||
|
}
|
||||||
|
[Table(Name = "freesql_tag")]
|
||||||
|
[SugarTable("sugar_tag")]
|
||||||
|
public class Tag {
|
||||||
|
[Column(IsIdentity = true)]
|
||||||
|
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
|
||||||
|
public int Id { get; set; }
|
||||||
|
public int? Parent_id { get; set; }
|
||||||
|
[SugarColumn(IsIgnore = true)]
|
||||||
|
public virtual Tag Parent { get; set; }
|
||||||
|
|
||||||
|
public decimal? Ddd { get; set; }
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
[SugarColumn(IsIgnore = true)]
|
||||||
|
public virtual ICollection<Song> Songs { get; set; }
|
||||||
|
[SugarColumn(IsIgnore = true)]
|
||||||
|
public virtual ICollection<Tag> Tags { get; set; }
|
||||||
|
}
|
||||||
|
}
|
16
Examples/orm_vs/orm_vs.csproj
Normal file
16
Examples/orm_vs/orm_vs.csproj
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<OutputType>Exe</OutputType>
|
||||||
|
<TargetFramework>netcoreapp2.2</TargetFramework>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="sqlSugarCore" Version="4.9.9.3" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\..\FreeSql\FreeSql.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netstandard2.0</TargetFramework>
|
<TargetFramework>netstandard2.0</TargetFramework>
|
||||||
<Version>0.3.17</Version>
|
<Version>0.3.18</Version>
|
||||||
<Authors>YeXiangQin</Authors>
|
<Authors>YeXiangQin</Authors>
|
||||||
<Description>FreeSql Implementation of General Repository, Support MySql/SqlServer/PostgreSQL/Oracle/Sqlite, and read/write separation、and split table.</Description>
|
<Description>FreeSql Implementation of General Repository, Support MySql/SqlServer/PostgreSQL/Oracle/Sqlite, and read/write separation、and split table.</Description>
|
||||||
<PackageProjectUrl>https://github.com/2881099/FreeSql/wiki/Repository</PackageProjectUrl>
|
<PackageProjectUrl>https://github.com/2881099/FreeSql/wiki/Repository</PackageProjectUrl>
|
||||||
|
15
FreeSql.sln
15
FreeSql.sln
@ -30,6 +30,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "domain_01", "Examples\domai
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "net461_console_01", "Examples\net461_console_01\net461_console_01.csproj", "{0637A778-338E-4096-B439-32B18306C75F}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "net461_console_01", "Examples\net461_console_01\net461_console_01.csproj", "{0637A778-338E-4096-B439-32B18306C75F}"
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "orm_vs", "Examples\orm_vs\orm_vs.csproj", "{1A5EC2EB-8C2B-4547-8AC6-EB5C0DE0CA81}"
|
||||||
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
@ -160,6 +162,18 @@ Global
|
|||||||
{0637A778-338E-4096-B439-32B18306C75F}.Release|x64.Build.0 = Release|Any CPU
|
{0637A778-338E-4096-B439-32B18306C75F}.Release|x64.Build.0 = Release|Any CPU
|
||||||
{0637A778-338E-4096-B439-32B18306C75F}.Release|x86.ActiveCfg = Release|Any CPU
|
{0637A778-338E-4096-B439-32B18306C75F}.Release|x86.ActiveCfg = Release|Any CPU
|
||||||
{0637A778-338E-4096-B439-32B18306C75F}.Release|x86.Build.0 = Release|Any CPU
|
{0637A778-338E-4096-B439-32B18306C75F}.Release|x86.Build.0 = Release|Any CPU
|
||||||
|
{1A5EC2EB-8C2B-4547-8AC6-EB5C0DE0CA81}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{1A5EC2EB-8C2B-4547-8AC6-EB5C0DE0CA81}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{1A5EC2EB-8C2B-4547-8AC6-EB5C0DE0CA81}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||||
|
{1A5EC2EB-8C2B-4547-8AC6-EB5C0DE0CA81}.Debug|x64.Build.0 = Debug|Any CPU
|
||||||
|
{1A5EC2EB-8C2B-4547-8AC6-EB5C0DE0CA81}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||||
|
{1A5EC2EB-8C2B-4547-8AC6-EB5C0DE0CA81}.Debug|x86.Build.0 = Debug|Any CPU
|
||||||
|
{1A5EC2EB-8C2B-4547-8AC6-EB5C0DE0CA81}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{1A5EC2EB-8C2B-4547-8AC6-EB5C0DE0CA81}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{1A5EC2EB-8C2B-4547-8AC6-EB5C0DE0CA81}.Release|x64.ActiveCfg = Release|Any CPU
|
||||||
|
{1A5EC2EB-8C2B-4547-8AC6-EB5C0DE0CA81}.Release|x64.Build.0 = Release|Any CPU
|
||||||
|
{1A5EC2EB-8C2B-4547-8AC6-EB5C0DE0CA81}.Release|x86.ActiveCfg = Release|Any CPU
|
||||||
|
{1A5EC2EB-8C2B-4547-8AC6-EB5C0DE0CA81}.Release|x86.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
@ -170,6 +184,7 @@ Global
|
|||||||
{C9940A46-D265-4088-9561-5A42ACEDA7AE} = {94C8A78D-AA15-47B2-A348-530CD86BFC1B}
|
{C9940A46-D265-4088-9561-5A42ACEDA7AE} = {94C8A78D-AA15-47B2-A348-530CD86BFC1B}
|
||||||
{A23D0455-CA7B-442D-827E-C4C7E84F9084} = {94C8A78D-AA15-47B2-A348-530CD86BFC1B}
|
{A23D0455-CA7B-442D-827E-C4C7E84F9084} = {94C8A78D-AA15-47B2-A348-530CD86BFC1B}
|
||||||
{0637A778-338E-4096-B439-32B18306C75F} = {94C8A78D-AA15-47B2-A348-530CD86BFC1B}
|
{0637A778-338E-4096-B439-32B18306C75F} = {94C8A78D-AA15-47B2-A348-530CD86BFC1B}
|
||||||
|
{1A5EC2EB-8C2B-4547-8AC6-EB5C0DE0CA81} = {94C8A78D-AA15-47B2-A348-530CD86BFC1B}
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
SolutionGuid = {089687FD-5D25-40AB-BA8A-A10D1E137F98}
|
SolutionGuid = {089687FD-5D25-40AB-BA8A-A10D1E137F98}
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netstandard2.0</TargetFramework>
|
<TargetFramework>netstandard2.0</TargetFramework>
|
||||||
<Version>0.3.17</Version>
|
<Version>0.3.18</Version>
|
||||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||||
<Authors>YeXiangQin</Authors>
|
<Authors>YeXiangQin</Authors>
|
||||||
<Description>FreeSql is the most convenient ORM in dotnet. It supports Mysql, Postgresql, SqlServer, Oracle and Sqlite.</Description>
|
<Description>FreeSql is the most convenient ORM in dotnet. It supports Mysql, Postgresql, SqlServer, Oracle and Sqlite.</Description>
|
||||||
|
@ -21,6 +21,12 @@ namespace FreeSql {
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
IInsert<T1> AppendData(T1 source);
|
IInsert<T1> AppendData(T1 source);
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
/// 追加准备插入的实体
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="source">实体</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
IInsert<T1> AppendData(T1[] source);
|
||||||
|
/// <summary>
|
||||||
/// 追加准备插入的实体集合
|
/// 追加准备插入的实体集合
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="source">实体集合</param>
|
/// <param name="source">实体集合</param>
|
||||||
|
@ -19,6 +19,13 @@ public interface IFreeSql {
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
IInsert<T1> Insert<T1>(T1 source) where T1 : class;
|
IInsert<T1> Insert<T1>(T1 source) where T1 : class;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
/// 插入数据,传入实体数组
|
||||||
|
/// </summary>
|
||||||
|
/// <typeparam name="T1"></typeparam>
|
||||||
|
/// <param name="source"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
IInsert<T1> Insert<T1>(T1[] source) where T1 : class;
|
||||||
|
/// <summary>
|
||||||
/// 插入数据,传入实体集合
|
/// 插入数据,传入实体集合
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <typeparam name="T1"></typeparam>
|
/// <typeparam name="T1"></typeparam>
|
||||||
|
@ -45,6 +45,10 @@ namespace FreeSql.Internal.CommonProvider {
|
|||||||
if (source != null) _source.Add(source);
|
if (source != null) _source.Add(source);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
public IInsert<T1> AppendData(T1[] source) {
|
||||||
|
if (source != null) _source.AddRange(source);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
public IInsert<T1> AppendData(IEnumerable<T1> source) {
|
public IInsert<T1> AppendData(IEnumerable<T1> source) {
|
||||||
if (source != null) _source.AddRange(source.Where(a => a != null));
|
if (source != null) _source.AddRange(source.Where(a => a != null));
|
||||||
return this;
|
return this;
|
||||||
|
@ -25,6 +25,7 @@ namespace FreeSql.MySql {
|
|||||||
public ISelect<T1> Select<T1>(object dywhere) where T1 : class => new MySqlSelect<T1>(this, this.InternalCommonUtils, this.InternalCommonExpression, dywhere);
|
public ISelect<T1> Select<T1>(object dywhere) where T1 : class => new MySqlSelect<T1>(this, this.InternalCommonUtils, this.InternalCommonExpression, dywhere);
|
||||||
public IInsert<T1> Insert<T1>() where T1 : class => new MySqlInsert<T1>(this, this.InternalCommonUtils, this.InternalCommonExpression);
|
public IInsert<T1> Insert<T1>() where T1 : class => new MySqlInsert<T1>(this, this.InternalCommonUtils, this.InternalCommonExpression);
|
||||||
public IInsert<T1> Insert<T1>(T1 source) where T1 : class => this.Insert<T1>().AppendData(source);
|
public IInsert<T1> Insert<T1>(T1 source) where T1 : class => this.Insert<T1>().AppendData(source);
|
||||||
|
public IInsert<T1> Insert<T1>(T1[] source) where T1 : class => this.Insert<T1>().AppendData(source);
|
||||||
public IInsert<T1> Insert<T1>(IEnumerable<T1> source) where T1 : class => this.Insert<T1>().AppendData(source);
|
public IInsert<T1> Insert<T1>(IEnumerable<T1> source) where T1 : class => this.Insert<T1>().AppendData(source);
|
||||||
public IUpdate<T1> Update<T1>() where T1 : class => new MySqlUpdate<T1>(this, this.InternalCommonUtils, this.InternalCommonExpression, null);
|
public IUpdate<T1> Update<T1>() where T1 : class => new MySqlUpdate<T1>(this, this.InternalCommonUtils, this.InternalCommonExpression, null);
|
||||||
public IUpdate<T1> Update<T1>(object dywhere) where T1 : class => new MySqlUpdate<T1>(this, this.InternalCommonUtils, this.InternalCommonExpression, dywhere);
|
public IUpdate<T1> Update<T1>(object dywhere) where T1 : class => new MySqlUpdate<T1>(this, this.InternalCommonUtils, this.InternalCommonExpression, dywhere);
|
||||||
|
@ -16,6 +16,7 @@ namespace FreeSql.Oracle {
|
|||||||
public ISelect<T1> Select<T1>(object dywhere) where T1 : class => new OracleSelect<T1>(this, this.InternalCommonUtils, this.InternalCommonExpression, dywhere);
|
public ISelect<T1> Select<T1>(object dywhere) where T1 : class => new OracleSelect<T1>(this, this.InternalCommonUtils, this.InternalCommonExpression, dywhere);
|
||||||
public IInsert<T1> Insert<T1>() where T1 : class => new OracleInsert<T1>(this, this.InternalCommonUtils, this.InternalCommonExpression);
|
public IInsert<T1> Insert<T1>() where T1 : class => new OracleInsert<T1>(this, this.InternalCommonUtils, this.InternalCommonExpression);
|
||||||
public IInsert<T1> Insert<T1>(T1 source) where T1 : class => this.Insert<T1>().AppendData(source);
|
public IInsert<T1> Insert<T1>(T1 source) where T1 : class => this.Insert<T1>().AppendData(source);
|
||||||
|
public IInsert<T1> Insert<T1>(T1[] source) where T1 : class => this.Insert<T1>().AppendData(source);
|
||||||
public IInsert<T1> Insert<T1>(IEnumerable<T1> source) where T1 : class => this.Insert<T1>().AppendData(source);
|
public IInsert<T1> Insert<T1>(IEnumerable<T1> source) where T1 : class => this.Insert<T1>().AppendData(source);
|
||||||
public IUpdate<T1> Update<T1>() where T1 : class => new OracleUpdate<T1>(this, this.InternalCommonUtils, this.InternalCommonExpression, null);
|
public IUpdate<T1> Update<T1>() where T1 : class => new OracleUpdate<T1>(this, this.InternalCommonUtils, this.InternalCommonExpression, null);
|
||||||
public IUpdate<T1> Update<T1>(object dywhere) where T1 : class => new OracleUpdate<T1>(this, this.InternalCommonUtils, this.InternalCommonExpression, dywhere);
|
public IUpdate<T1> Update<T1>(object dywhere) where T1 : class => new OracleUpdate<T1>(this, this.InternalCommonUtils, this.InternalCommonExpression, dywhere);
|
||||||
|
@ -52,6 +52,7 @@ namespace FreeSql.PostgreSQL {
|
|||||||
public ISelect<T1> Select<T1>(object dywhere) where T1 : class => new PostgreSQLSelect<T1>(this, this.InternalCommonUtils, this.InternalCommonExpression, dywhere);
|
public ISelect<T1> Select<T1>(object dywhere) where T1 : class => new PostgreSQLSelect<T1>(this, this.InternalCommonUtils, this.InternalCommonExpression, dywhere);
|
||||||
public IInsert<T1> Insert<T1>() where T1 : class => new PostgreSQLInsert<T1>(this, this.InternalCommonUtils, this.InternalCommonExpression);
|
public IInsert<T1> Insert<T1>() where T1 : class => new PostgreSQLInsert<T1>(this, this.InternalCommonUtils, this.InternalCommonExpression);
|
||||||
public IInsert<T1> Insert<T1>(T1 source) where T1 : class => this.Insert<T1>().AppendData(source);
|
public IInsert<T1> Insert<T1>(T1 source) where T1 : class => this.Insert<T1>().AppendData(source);
|
||||||
|
public IInsert<T1> Insert<T1>(T1[] source) where T1 : class => this.Insert<T1>().AppendData(source);
|
||||||
public IInsert<T1> Insert<T1>(IEnumerable<T1> source) where T1 : class => this.Insert<T1>().AppendData(source);
|
public IInsert<T1> Insert<T1>(IEnumerable<T1> source) where T1 : class => this.Insert<T1>().AppendData(source);
|
||||||
public IUpdate<T1> Update<T1>() where T1 : class => new PostgreSQLUpdate<T1>(this, this.InternalCommonUtils, this.InternalCommonExpression, null);
|
public IUpdate<T1> Update<T1>() where T1 : class => new PostgreSQLUpdate<T1>(this, this.InternalCommonUtils, this.InternalCommonExpression, null);
|
||||||
public IUpdate<T1> Update<T1>(object dywhere) where T1 : class => new PostgreSQLUpdate<T1>(this, this.InternalCommonUtils, this.InternalCommonExpression, dywhere);
|
public IUpdate<T1> Update<T1>(object dywhere) where T1 : class => new PostgreSQLUpdate<T1>(this, this.InternalCommonUtils, this.InternalCommonExpression, dywhere);
|
||||||
|
@ -11,7 +11,7 @@ namespace FreeSql.SqlServer.Curd {
|
|||||||
class SqlServerSelect<T1> : FreeSql.Internal.CommonProvider.Select1Provider<T1> where T1 : class {
|
class SqlServerSelect<T1> : FreeSql.Internal.CommonProvider.Select1Provider<T1> where T1 : class {
|
||||||
|
|
||||||
internal static string ToSqlStatic(CommonUtils _commonUtils, string _select, string field, StringBuilder _join, StringBuilder _where, string _groupby, string _having, string _orderby, int _skip, int _limit, List<SelectTableInfo> _tables, Func<Type, string, string> tableRuleInvoke, IFreeSql _orm)
|
internal static string ToSqlStatic(CommonUtils _commonUtils, string _select, string field, StringBuilder _join, StringBuilder _where, string _groupby, string _having, string _orderby, int _skip, int _limit, List<SelectTableInfo> _tables, Func<Type, string, string> tableRuleInvoke, IFreeSql _orm)
|
||||||
=> !(_commonUtils as SqlServerUtils).IsSelectRowNumber ?
|
=> (_commonUtils as SqlServerUtils).IsSelectRowNumber ?
|
||||||
ToSqlStaticRowNumber(_commonUtils, _select, field, _join, _where, _groupby, _having, _orderby, _skip, _limit, _tables, tableRuleInvoke, _orm) :
|
ToSqlStaticRowNumber(_commonUtils, _select, field, _join, _where, _groupby, _having, _orderby, _skip, _limit, _tables, tableRuleInvoke, _orm) :
|
||||||
ToSqlStaticOffsetFetchNext(_commonUtils, _select, field, _join, _where, _groupby, _having, _orderby, _skip, _limit, _tables, tableRuleInvoke, _orm);
|
ToSqlStaticOffsetFetchNext(_commonUtils, _select, field, _join, _where, _groupby, _having, _orderby, _skip, _limit, _tables, tableRuleInvoke, _orm);
|
||||||
|
|
||||||
|
@ -15,6 +15,7 @@ namespace FreeSql.SqlServer {
|
|||||||
public ISelect<T1> Select<T1>(object dywhere) where T1 : class => new SqlServerSelect<T1>(this, this.InternalCommonUtils, this.InternalCommonExpression, dywhere);
|
public ISelect<T1> Select<T1>(object dywhere) where T1 : class => new SqlServerSelect<T1>(this, this.InternalCommonUtils, this.InternalCommonExpression, dywhere);
|
||||||
public IInsert<T1> Insert<T1>() where T1 : class => new SqlServerInsert<T1>(this, this.InternalCommonUtils, this.InternalCommonExpression);
|
public IInsert<T1> Insert<T1>() where T1 : class => new SqlServerInsert<T1>(this, this.InternalCommonUtils, this.InternalCommonExpression);
|
||||||
public IInsert<T1> Insert<T1>(T1 source) where T1 : class => this.Insert<T1>().AppendData(source);
|
public IInsert<T1> Insert<T1>(T1 source) where T1 : class => this.Insert<T1>().AppendData(source);
|
||||||
|
public IInsert<T1> Insert<T1>(T1[] source) where T1 : class => this.Insert<T1>().AppendData(source);
|
||||||
public IInsert<T1> Insert<T1>(IEnumerable<T1> source) where T1 : class => this.Insert<T1>().AppendData(source);
|
public IInsert<T1> Insert<T1>(IEnumerable<T1> source) where T1 : class => this.Insert<T1>().AppendData(source);
|
||||||
public IUpdate<T1> Update<T1>() where T1 : class => new SqlServerUpdate<T1>(this, this.InternalCommonUtils, this.InternalCommonExpression, null);
|
public IUpdate<T1> Update<T1>() where T1 : class => new SqlServerUpdate<T1>(this, this.InternalCommonUtils, this.InternalCommonExpression, null);
|
||||||
public IUpdate<T1> Update<T1>(object dywhere) where T1 : class => new SqlServerUpdate<T1>(this, this.InternalCommonUtils, this.InternalCommonExpression, dywhere);
|
public IUpdate<T1> Update<T1>(object dywhere) where T1 : class => new SqlServerUpdate<T1>(this, this.InternalCommonUtils, this.InternalCommonExpression, dywhere);
|
||||||
|
@ -16,6 +16,7 @@ namespace FreeSql.Sqlite {
|
|||||||
public ISelect<T1> Select<T1>(object dywhere) where T1 : class => new SqliteSelect<T1>(this, this.InternalCommonUtils, this.InternalCommonExpression, dywhere);
|
public ISelect<T1> Select<T1>(object dywhere) where T1 : class => new SqliteSelect<T1>(this, this.InternalCommonUtils, this.InternalCommonExpression, dywhere);
|
||||||
public IInsert<T1> Insert<T1>() where T1 : class => new SqliteInsert<T1>(this, this.InternalCommonUtils, this.InternalCommonExpression);
|
public IInsert<T1> Insert<T1>() where T1 : class => new SqliteInsert<T1>(this, this.InternalCommonUtils, this.InternalCommonExpression);
|
||||||
public IInsert<T1> Insert<T1>(T1 source) where T1 : class => this.Insert<T1>().AppendData(source);
|
public IInsert<T1> Insert<T1>(T1 source) where T1 : class => this.Insert<T1>().AppendData(source);
|
||||||
|
public IInsert<T1> Insert<T1>(T1[] source) where T1 : class => this.Insert<T1>().AppendData(source);
|
||||||
public IInsert<T1> Insert<T1>(IEnumerable<T1> source) where T1 : class => this.Insert<T1>().AppendData(source);
|
public IInsert<T1> Insert<T1>(IEnumerable<T1> source) where T1 : class => this.Insert<T1>().AppendData(source);
|
||||||
public IUpdate<T1> Update<T1>() where T1 : class => new SqliteUpdate<T1>(this, this.InternalCommonUtils, this.InternalCommonExpression, null);
|
public IUpdate<T1> Update<T1>() where T1 : class => new SqliteUpdate<T1>(this, this.InternalCommonUtils, this.InternalCommonExpression, null);
|
||||||
public IUpdate<T1> Update<T1>(object dywhere) where T1 : class => new SqliteUpdate<T1>(this, this.InternalCommonUtils, this.InternalCommonExpression, dywhere);
|
public IUpdate<T1> Update<T1>(object dywhere) where T1 : class => new SqliteUpdate<T1>(this, this.InternalCommonUtils, this.InternalCommonExpression, dywhere);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user