Skip to content
Permalink
Browse files

- 增加 .Net Framework 4.0 的支持,出于环境考虑 .Net Framework 4.0 不支持异步方法;

- 增加 IFreeSql.Insert<T>(IEnumerable<T1> source) 方法;
  • Loading branch information
28810 28810
28810 authored and 28810 committed Oct 21, 2019
1 parent cb3e3b0 commit de8cf9e17da98ee171b4789b27a261d5c3580000
Showing with 2,752 additions and 1,822 deletions.
  1. +261 −0 Examples/orm_vs_net40/Program.cs
  2. +36 −0 Examples/orm_vs_net40/Properties/AssemblyInfo.cs
  3. +67 −0 Examples/orm_vs_net40/orm_vs_net40.csproj
  4. +1 −1 Extensions/FreeSql.Extensions.JsonMap/FreeSql.Extensions.JsonMap.csproj
  5. +1 −1 Extensions/FreeSql.Extensions.JsonMap/JsonMapCore.cs
  6. +1 −1 Extensions/FreeSql.Extensions.LazyLoading/FreeSql.Extensions.LazyLoading.csproj
  7. +13 −8 FreeSql.DbContext/DbContext/DbContext.cs
  8. +3 −1 FreeSql.DbContext/DbContext/DbContextAsync.cs
  9. +3 −1 FreeSql.DbContext/DbSet/DbSetAsync.cs
  10. +2 −2 FreeSql.DbContext/DbSet/DbSetSync.cs
  11. +5 −2 FreeSql.DbContext/FreeSql.DbContext.csproj
  12. +3 −0 FreeSql.DbContext/Repository/ContextSet/RepositoryDbContext.cs
  13. +2 −51 FreeSql.DbContext/Repository/Repository/BaseRepository.cs
  14. +78 −0 FreeSql.DbContext/Repository/Repository/BaseRepositoryAsync.cs
  15. +3 −0 FreeSql.DbContext/Repository/Repository/IBaseRepository.cs
  16. +14 −5 FreeSql.DbContext/Repository/Repository/IBasicRepository.cs
  17. +4 −3 FreeSql.DbContext/Repository/Repository/IReadOnlyRepository.cs
  18. +1 −1 FreeSql.Repository/FreeSql.Repository.csproj
  19. +17 −2 FreeSql.sln
  20. +6 −4 FreeSql/Extensions/FreeSqlGlobalExtensions.cs
  21. +6 −2 FreeSql/FreeSql.csproj
  22. +8 −0 FreeSql/FreeSql.xml
  23. +5 −1 FreeSql/Interface/Curd/IDelete.cs
  24. +6 −2 FreeSql/Interface/Curd/IInsert.cs
  25. +14 −8 FreeSql/Interface/Curd/ISelect/ISelect0.cs
  26. +20 −13 FreeSql/Interface/Curd/ISelect/ISelect1.cs
  27. +13 −11 FreeSql/Interface/Curd/ISelect/ISelect10.cs
  28. +13 −12 FreeSql/Interface/Curd/ISelect/ISelect2.cs
  29. +13 −11 FreeSql/Interface/Curd/ISelect/ISelect3.cs
  30. +13 −11 FreeSql/Interface/Curd/ISelect/ISelect4.cs
  31. +13 −11 FreeSql/Interface/Curd/ISelect/ISelect5.cs
  32. +13 −11 FreeSql/Interface/Curd/ISelect/ISelect6.cs
  33. +13 −11 FreeSql/Interface/Curd/ISelect/ISelect7.cs
  34. +13 −11 FreeSql/Interface/Curd/ISelect/ISelect8.cs
  35. +13 −11 FreeSql/Interface/Curd/ISelect/ISelect9.cs
  36. +6 −1 FreeSql/Interface/Curd/ISelect/ISelectGrouping.cs
  37. +5 −1 FreeSql/Interface/Curd/IUpdate.cs
  38. +3 −0 FreeSql/Interface/IAdo.cs
  39. +7 −0 FreeSql/Interface/IFreeSql.cs
  40. +2 −2 FreeSql/Internal/CommonExpression.cs
  41. +3 −0 FreeSql/Internal/CommonProvider/AdoProvider/AdoProviderAsync.cs
  42. +0 −27 FreeSql/Internal/CommonProvider/DeleteProvider.cs
  43. +45 −0 FreeSql/Internal/CommonProvider/DeleteProviderAsync.cs
  44. +1 −181 FreeSql/Internal/CommonProvider/InsertProvider.cs
  45. +210 −0 FreeSql/Internal/CommonProvider/InsertProviderAsync.cs
  46. +190 −173 FreeSql/Internal/CommonProvider/SelectProvider/Select0Provider.cs
  47. +53 −49 FreeSql/Internal/CommonProvider/SelectProvider/Select10Provider.cs
  48. +58 −54 FreeSql/Internal/CommonProvider/SelectProvider/Select1Provider.cs
  49. +54 −49 FreeSql/Internal/CommonProvider/SelectProvider/Select2Provider.cs
  50. +54 −49 FreeSql/Internal/CommonProvider/SelectProvider/Select3Provider.cs
  51. +54 −49 FreeSql/Internal/CommonProvider/SelectProvider/Select4Provider.cs
  52. +54 −49 FreeSql/Internal/CommonProvider/SelectProvider/Select5Provider.cs
  53. +54 −49 FreeSql/Internal/CommonProvider/SelectProvider/Select6Provider.cs
  54. +54 −49 FreeSql/Internal/CommonProvider/SelectProvider/Select7Provider.cs
  55. +55 −49 FreeSql/Internal/CommonProvider/SelectProvider/Select8Provider.cs
  56. +54 −53 FreeSql/Internal/CommonProvider/SelectProvider/Select9Provider.cs
  57. +16 −11 FreeSql/Internal/CommonProvider/SelectProvider/SelectGroupingProvider.cs
  58. +2 −121 FreeSql/Internal/CommonProvider/UpdateProvider.cs
  59. +145 −0 FreeSql/Internal/CommonProvider/UpdateProviderAsync.cs
  60. +2 −2 FreeSql/Internal/CommonUtils.cs
  61. +13 −13 FreeSql/Internal/UtilsExpressionTree.cs
  62. +4 −0 Providers/FreeSql.Provider.MySql/Curd/MySqlDelete.cs
  63. +28 −23 Providers/FreeSql.Provider.MySql/Curd/MySqlInsert.cs
  64. +43 −39 Providers/FreeSql.Provider.MySql/Curd/MySqlUpdate.cs
  65. +13 −5 Providers/FreeSql.Provider.MySql/FreeSql.Provider.MySql.csproj
  66. +7 −0 Providers/FreeSql.Provider.MySql/MySqlAdo/MySqlConnectionPool.cs
  67. +5 −1 Providers/FreeSql.Provider.MySql/MySqlCodeFirst.cs
  68. +1 −1 Providers/FreeSql.Provider.MySql/MySqlExpression.cs
  69. +1 −0 Providers/FreeSql.Provider.MySql/MySqlProvider.cs
  70. +1 −1 Providers/FreeSql.Provider.MySqlConnector/FreeSql.Provider.MySqlConnector.csproj
  71. +4 −0 Providers/FreeSql.Provider.Odbc/Default/Curd/OdbcDelete.cs
  72. +10 −5 Providers/FreeSql.Provider.Odbc/Default/Curd/OdbcInsert.cs
  73. +8 −3 Providers/FreeSql.Provider.Odbc/Default/Curd/OdbcUpdate.cs
  74. +7 −0 Providers/FreeSql.Provider.Odbc/Default/OdbcAdo/OdbcConnectionPool.cs
  75. +5 −1 Providers/FreeSql.Provider.Odbc/Default/OdbcCodeFirst.cs
  76. +1 −1 Providers/FreeSql.Provider.Odbc/Default/OdbcExpression.cs
  77. +1 −0 Providers/FreeSql.Provider.Odbc/Default/OdbcProvider.cs
  78. +6 −2 Providers/FreeSql.Provider.Odbc/FreeSql.Provider.Odbc.csproj
  79. +4 −0 Providers/FreeSql.Provider.Odbc/MySql/Curd/OdbcMySqlDelete.cs
  80. +41 −36 Providers/FreeSql.Provider.Odbc/MySql/Curd/OdbcMySqlInsert.cs
  81. +43 −38 Providers/FreeSql.Provider.Odbc/MySql/Curd/OdbcMySqlUpdate.cs
  82. +7 −0 Providers/FreeSql.Provider.Odbc/MySql/OdbcMySqlAdo/OdbcMySqlConnectionPool.cs
  83. +5 −1 Providers/FreeSql.Provider.Odbc/MySql/OdbcMySqlCodeFirst.cs
  84. +1 −1 Providers/FreeSql.Provider.Odbc/MySql/OdbcMySqlExpression.cs
  85. +1 −0 Providers/FreeSql.Provider.Odbc/MySql/OdbcMySqlProvider.cs
  86. +4 −0 Providers/FreeSql.Provider.Odbc/Oracle/Curd/OdbcOracleDelete.cs
  87. +17 −13 Providers/FreeSql.Provider.Odbc/Oracle/Curd/OdbcOracleInsert.cs
  88. +11 −6 Providers/FreeSql.Provider.Odbc/Oracle/Curd/OdbcOracleUpdate.cs
  89. +7 −0 Providers/FreeSql.Provider.Odbc/Oracle/OdbcOracleAdo/OdbcOracleConnectionPool.cs
  90. +6 −2 Providers/FreeSql.Provider.Odbc/Oracle/OdbcOracleCodeFirst.cs
  91. +1 −1 Providers/FreeSql.Provider.Odbc/Oracle/OdbcOracleExpression.cs
  92. +1 −0 Providers/FreeSql.Provider.Odbc/Oracle/OdbcOracleProvider.cs
  93. +4 −0 Providers/FreeSql.Provider.Odbc/PostgreSQL/Curd/OdbcPostgreSQLDelete.cs
  94. +45 −41 Providers/FreeSql.Provider.Odbc/PostgreSQL/Curd/OdbcPostgreSQLInsert.cs
  95. +45 −41 Providers/FreeSql.Provider.Odbc/PostgreSQL/Curd/OdbcPostgreSQLUpdate.cs
  96. +7 −0 Providers/FreeSql.Provider.Odbc/PostgreSQL/OdbcPostgreSQLAdo/OdbcPostgreSQLConnectionPool.cs
  97. +5 −1 Providers/FreeSql.Provider.Odbc/PostgreSQL/OdbcPostgreSQLCodeFirst.cs
  98. +1 −1 Providers/FreeSql.Provider.Odbc/PostgreSQL/OdbcPostgreSQLExpression.cs
  99. +1 −0 Providers/FreeSql.Provider.Odbc/PostgreSQL/OdbcPostgreSQLProvider.cs
  100. +6 −2 Providers/FreeSql.Provider.Odbc/PostgreSQL/OdbcPostgreSQLUtils.cs
  101. +4 −0 Providers/FreeSql.Provider.Odbc/SqlServer/Curd/OdbcSqlServerDelete.cs
  102. +34 −29 Providers/FreeSql.Provider.Odbc/SqlServer/Curd/OdbcSqlServerInsert.cs
  103. +41 −37 Providers/FreeSql.Provider.Odbc/SqlServer/Curd/OdbcSqlServerUpdate.cs
  104. +7 −0 Providers/FreeSql.Provider.Odbc/SqlServer/OdbcSqlServerAdo/OdbcSqlServerConnectionPool.cs
  105. +5 −1 Providers/FreeSql.Provider.Odbc/SqlServer/OdbcSqlServerCodeFirst.cs
  106. +1 −1 Providers/FreeSql.Provider.Odbc/SqlServer/OdbcSqlServerExpression.cs
  107. +1 −0 Providers/FreeSql.Provider.Odbc/SqlServer/OdbcSqlServerProvider.cs
  108. +4 −0 Providers/FreeSql.Provider.Oracle/Curd/OracleDelete.cs
  109. +16 −12 Providers/FreeSql.Provider.Oracle/Curd/OracleInsert.cs
  110. +11 −6 Providers/FreeSql.Provider.Oracle/Curd/OracleUpdate.cs
  111. +9 −5 Providers/FreeSql.Provider.Oracle/FreeSql.Provider.Oracle.csproj
  112. +7 −0 Providers/FreeSql.Provider.Oracle/OracleAdo/OracleConnectionPool.cs
  113. +6 −2 Providers/FreeSql.Provider.Oracle/OracleCodeFirst.cs
  114. +1 −1 Providers/FreeSql.Provider.Oracle/OracleExpression.cs
  115. +1 −0 Providers/FreeSql.Provider.Oracle/OracleProvider.cs
  116. +4 −0 Providers/FreeSql.Provider.PostgreSQL/Curd/PostgreSQLDelete.cs
  117. +45 −41 Providers/FreeSql.Provider.PostgreSQL/Curd/PostgreSQLInsert.cs
  118. +45 −41 Providers/FreeSql.Provider.PostgreSQL/Curd/PostgreSQLUpdate.cs
  119. +10 −4 Providers/FreeSql.Provider.PostgreSQL/FreeSql.Provider.PostgreSQL.csproj
  120. +7 −0 Providers/FreeSql.Provider.PostgreSQL/PostgreSQLAdo/PostgreSQLConnectionPool.cs
  121. +19 −17 Providers/FreeSql.Provider.PostgreSQL/PostgreSQLAdo/PostgreSQLTypesExtensions.cs
  122. +1 −0 Providers/FreeSql.Provider.PostgreSQL/PostgreSQLProvider.cs
  123. +4 −0 Providers/FreeSql.Provider.SqlServer/Curd/SqlServerDelete.cs
  124. +32 −29 Providers/FreeSql.Provider.SqlServer/Curd/SqlServerInsert.cs
  125. +41 −36 Providers/FreeSql.Provider.SqlServer/Curd/SqlServerUpdate.cs
  126. +10 −6 Providers/FreeSql.Provider.SqlServer/FreeSql.Provider.SqlServer.csproj
  127. +6 −2 Providers/FreeSql.Provider.SqlServer/SqlServerAdo/SqlServerConnectionPool.cs
  128. +5 −1 Providers/FreeSql.Provider.SqlServer/SqlServerCodeFirst.cs
  129. +1 −1 Providers/FreeSql.Provider.SqlServer/SqlServerExpression.cs
  130. +1 −0 Providers/FreeSql.Provider.SqlServer/SqlServerProvider.cs
  131. +4 −0 Providers/FreeSql.Provider.Sqlite/Curd/SqliteDelete.cs
  132. +17 −12 Providers/FreeSql.Provider.Sqlite/Curd/SqliteInsert.cs
  133. +11 −6 Providers/FreeSql.Provider.Sqlite/Curd/SqliteUpdate.cs
  134. +5 −1 Providers/FreeSql.Provider.Sqlite/FreeSql.Provider.Sqlite.csproj
  135. +21 −15 Providers/FreeSql.Provider.Sqlite/SqliteAdo/SqliteConnectionPool.cs
  136. +5 −1 Providers/FreeSql.Provider.Sqlite/SqliteCodeFirst.cs
  137. +1 −1 Providers/FreeSql.Provider.Sqlite/SqliteExpression.cs
  138. +1 −0 Providers/FreeSql.Provider.Sqlite/SqliteProvider.cs
  139. +9 −8 readme.md
@@ -0,0 +1,261 @@
//using SqlSugar;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

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 void Main(string[] args)
{
var testlist1 = fsql.Select<Song>().OrderBy(a => a.Id).ToList();
var testlist2 = new List<Song>();
fsql.Select<Song>().OrderBy(a => a.Id).ToChunk(0, list =>
{
testlist2.AddRange(list);
});

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

//sugar.Aop.OnLogExecuted = (s, e) =>
//{
// Trace.WriteLine(s);
//};
//测试前清空数据
fsql.Delete<Song>().Where(a => a.Id > 0).ExecuteAffrows();
//sugar.Deleteable<Song>().Where(a => a.Id > 0).ExecuteCommand();
fsql.Ado.ExecuteNonQuery("delete from efcore_song");

var sb = new StringBuilder();
Console.WriteLine("插入性能:");
Insert(sb, 1000, 1);
Console.Write(sb.ToString());
sb.Clear();
Insert(sb, 1000, 10);
Console.Write(sb.ToString());
sb.Clear();

Insert(sb, 1, 1000);
Console.Write(sb.ToString());
sb.Clear();
Insert(sb, 1, 10000);
Console.Write(sb.ToString());
sb.Clear();
Insert(sb, 1, 50000);
Console.Write(sb.ToString());
sb.Clear();
Insert(sb, 1, 100000);
Console.Write(sb.ToString());
sb.Clear();

Console.WriteLine("查询性能:");
Select(sb, 1000, 1);
Console.Write(sb.ToString());
sb.Clear();
Select(sb, 1000, 10);
Console.Write(sb.ToString());
sb.Clear();

Select(sb, 1, 1000);
Console.Write(sb.ToString());
sb.Clear();
Select(sb, 1, 10000);
Console.Write(sb.ToString());
sb.Clear();
Select(sb, 1, 50000);
Console.Write(sb.ToString());
sb.Clear();
Select(sb, 1, 100000);
Console.Write(sb.ToString());
sb.Clear();

Console.WriteLine("更新:");
Update(sb, 1000, 1);
Console.Write(sb.ToString());
sb.Clear();
Update(sb, 1000, 10);
Console.Write(sb.ToString());
sb.Clear();

Update(sb, 1, 1000);
Console.Write(sb.ToString());
sb.Clear();
Update(sb, 1, 10000);
Console.Write(sb.ToString());
sb.Clear();
Update(sb, 1, 50000);
Console.Write(sb.ToString());
sb.Clear();
Update(sb, 1, 100000);
Console.Write(sb.ToString());
sb.Clear();

Console.WriteLine("测试结束,按任意键退出...");
Console.ReadKey();
}

static void Select(StringBuilder sb, 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");
}

static void Insert(StringBuilder sb, 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}"
});

//预热
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();
//using (var db = new FreeSongContext()) {
// //db.Configuration.AutoDetectChangesEnabled = false;
// db.Songs.AddRange(songs.ToArray());
// db.SaveChanges();
//}
}
sw.Stop();
sb.AppendLine($"FreeSql Insert {size}条数据,循环{forTime}次,耗时{sw.ElapsedMilliseconds}ms");

//sw.Restart();
//Exception sugarEx = null;
//try
//{
// for (var a = 0; a < forTime; a++)
// sugar.Insertable(songs.ToArray()).ExecuteCommand();
//}
//catch (Exception ex)
//{
// sugarEx = ex;
//}
//sw.Stop();
//sb.AppendLine($"SqlSugar Insert {size}条数据,循环{forTime}次,耗时{sw.ElapsedMilliseconds}ms" + (sugarEx != null ? $"成绩无效,错误:{sugarEx.Message}" : ""));
}

static void Update(StringBuilder sb, int forTime, int size)
{
Stopwatch sw = new Stopwatch();

var songs = fsql.Select<Song>().Limit(size).ToList();
sw.Restart();
for (var a = 0; a < forTime; a++)
{
fsql.Update<Song>().SetSource(songs).ExecuteAffrows();
}
sw.Stop();
sb.AppendLine($"FreeSql Update {size}条数据,循环{forTime}次,耗时{sw.ElapsedMilliseconds}ms");

//songs = sugar.Queryable<Song>().Take(size).ToList();
//sw.Restart();
//Exception sugarEx = null;
//try
//{
// for (var a = 0; a < forTime; a++)
// sugar.Updateable(songs).ExecuteCommand();
//}
//catch (Exception ex)
//{
// sugarEx = ex;
//}
//sw.Stop();
//sb.AppendLine($"SqlSugar Update {size}条数据,循环{forTime}次,耗时{sw.ElapsedMilliseconds}ms" + (sugarEx != null ? $"成绩无效,错误:{sugarEx.Message}" : ""));
}
}

[FreeSql.DataAnnotations.Table(Name = "freesql_song")]
//[SugarTable("sugar_song")]
public class Song
{
[FreeSql.DataAnnotations.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; }
}
[FreeSql.DataAnnotations.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; }
}
[FreeSql.DataAnnotations.Table(Name = "freesql_tag")]
//[SugarTable("sugar_tag")]
public class Tag
{
[FreeSql.DataAnnotations.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; }
}
}
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("orm_vs_net40")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("orm_vs_net40")]
[assembly: AssemblyCopyright("Copyright © 2019")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]

// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("1674bce3-eeb4-4003-a2a7-06f51efaea23")]

// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{1674BCE3-EEB4-4003-A2A7-06F51EFAEA23}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>orm_vs_net40</RootNamespace>
<AssemblyName>orm_vs_net40</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\FreeSql\FreeSql.csproj">
<Project>{af9c50ec-6eb6-494b-9b3b-7edba6fd0ebb}</Project>
<Name>FreeSql</Name>
</ProjectReference>
<ProjectReference Include="..\..\Providers\FreeSql.Provider.MySql\FreeSql.Provider.MySql.csproj">
<Project>{28c6a39c-7ae7-4210-b7b0-0970216637a8}</Project>
<Name>FreeSql.Provider.MySql</Name>
</ProjectReference>
<ProjectReference Include="..\..\Providers\FreeSql.Provider.SqlServer\FreeSql.Provider.SqlServer.csproj">
<Project>{b61aac9e-59e9-4f47-bbe3-97ac24112efe}</Project>
<Name>FreeSql.Provider.SqlServer</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json">
<Version>12.0.2</Version>
</PackageReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0;net45</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net45;net40</TargetFrameworks>
<Version>0.10.14</Version>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Authors>YeXiangQin</Authors>
@@ -37,7 +37,7 @@ public static void UseJsonMap(this IFreeSql that)

that.Aop.ConfigEntityProperty += new EventHandler<Aop.ConfigEntityPropertyEventArgs>((s, e) =>
{
if (e.Property.GetCustomAttribute<JsonMapAttribute>(false) != null)
if (e.Property.GetCustomAttributes(typeof(JsonMapAttribute), false).Any())
{
e.ModifyResult.MapType = typeof(string);
if (_dicTypes.TryAdd(e.Property.PropertyType, true))
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0;net45</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net45;net40</TargetFrameworks>
<Version>0.10.14</Version>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Authors>YeXiangQin</Authors>

0 comments on commit de8cf9e

Please sign in to comment.
You can’t perform that action at this time.