From b7df60b889e566123585d07d42b5f4d503d10fec Mon Sep 17 00:00:00 2001 From: 28810 <28810@YEXIANGQIN> Date: Thu, 7 Mar 2019 11:48:59 +0800 Subject: [PATCH] add .net 4.6.1 examples --- Examples/net461_console_01/App.config | 70 +++++ Examples/net461_console_01/Program.cs | 41 +++ .../Properties/AssemblyInfo.cs | 36 +++ .../net461_console_01.csproj | 280 ++++++++++++++++++ Examples/net461_console_01/packages.config | 84 ++++++ FreeSql.sln | 15 + 6 files changed, 526 insertions(+) create mode 100644 Examples/net461_console_01/App.config create mode 100644 Examples/net461_console_01/Program.cs create mode 100644 Examples/net461_console_01/Properties/AssemblyInfo.cs create mode 100644 Examples/net461_console_01/net461_console_01.csproj create mode 100644 Examples/net461_console_01/packages.config diff --git a/Examples/net461_console_01/App.config b/Examples/net461_console_01/App.config new file mode 100644 index 00000000..ff77f14f --- /dev/null +++ b/Examples/net461_console_01/App.config @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Examples/net461_console_01/Program.cs b/Examples/net461_console_01/Program.cs new file mode 100644 index 00000000..1d221945 --- /dev/null +++ b/Examples/net461_console_01/Program.cs @@ -0,0 +1,41 @@ +using FreeSql.DataAnnotations; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace net46_console_01 { + class Program { + static void Main(string[] args) { + + var orm = new FreeSql.FreeSqlBuilder() + .UseConnectionString(FreeSql.DataType.Sqlite, @"Data Source=|DataDirectory|\document.db;Pooling=true;Max Pool Size=10") + .UseAutoSyncStructure(true) + .Build(); + + var repos = orm.GetGuidRepository(); + + var item = repos.Insert(new Song()); + Console.WriteLine(Newtonsoft.Json.JsonConvert.SerializeObject(item)); + + item.Title = "xxx"; + repos.Update(item); + Console.WriteLine(Newtonsoft.Json.JsonConvert.SerializeObject(item)); + + Console.WriteLine(repos.UpdateDiy.Where(a => a.Id == item.Id).Set(a => a.Clicks + 1).ToSql()); + repos.UpdateDiy.Where(a => a.Id == item.Id).Set(a => a.Clicks + 1).ExecuteAffrows(); + + item = repos.Find(item.Id); + Console.WriteLine(Newtonsoft.Json.JsonConvert.SerializeObject(item)); + } + } + + public class Song { + + public Guid Id { get; set; } + public string Title { get; set; } + + public int Clicks { get; set; } = 10; + } +} diff --git a/Examples/net461_console_01/Properties/AssemblyInfo.cs b/Examples/net461_console_01/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..f0d414c9 --- /dev/null +++ b/Examples/net461_console_01/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 有关程序集的一般信息由以下 +// 控制。更改这些特性值可修改 +// 与程序集关联的信息。 +[assembly: AssemblyTitle("net46_console_01")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("net46_console_01")] +[assembly: AssemblyCopyright("Copyright © 2019")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// 将 ComVisible 设置为 false 会使此程序集中的类型 +//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型 +//请将此类型的 ComVisible 特性设置为 true。 +[assembly: ComVisible(false)] + +// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID +[assembly: Guid("0637a778-338e-4096-b439-32b18306c75f")] + +// 程序集的版本信息由下列四个值组成: +// +// 主版本 +// 次版本 +// 生成号 +// 修订号 +// +// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号 +// 方法是按如下所示使用“*”: : +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Examples/net461_console_01/net461_console_01.csproj b/Examples/net461_console_01/net461_console_01.csproj new file mode 100644 index 00000000..d83e08e1 --- /dev/null +++ b/Examples/net461_console_01/net461_console_01.csproj @@ -0,0 +1,280 @@ + + + + + Debug + AnyCPU + {0637A778-338E-4096-B439-32B18306C75F} + Exe + net46_console_01 + net46_console_01 + v4.6.1 + 512 + true + true + + + + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\..\packages\CS-Script.Core.1.0.6\lib\netstandard2.0\CSScriptLib.dll + + + ..\..\packages\FreeSql.0.1.11\lib\netstandard2.0\FreeSql.dll + + + ..\..\packages\FreeSql.Repository.0.1.11\lib\netstandard2.0\FreeSql.Repository.dll + + + ..\..\packages\Google.Protobuf.3.5.1\lib\net45\Google.Protobuf.dll + + + ..\..\packages\Microsoft.CodeAnalysis.Common.2.10.0\lib\netstandard1.3\Microsoft.CodeAnalysis.dll + + + ..\..\packages\Microsoft.CodeAnalysis.CSharp.2.10.0\lib\netstandard1.3\Microsoft.CodeAnalysis.CSharp.dll + + + ..\..\packages\Microsoft.CodeAnalysis.CSharp.Scripting.2.10.0\lib\netstandard1.3\Microsoft.CodeAnalysis.CSharp.Scripting.dll + + + ..\..\packages\Microsoft.CodeAnalysis.Scripting.Common.2.10.0\lib\netstandard1.3\Microsoft.CodeAnalysis.Scripting.dll + + + ..\..\packages\Microsoft.DotNet.PlatformAbstractions.2.1.0\lib\net45\Microsoft.DotNet.PlatformAbstractions.dll + + + ..\..\packages\Microsoft.Extensions.Caching.Abstractions.2.1.0\lib\netstandard2.0\Microsoft.Extensions.Caching.Abstractions.dll + + + ..\..\packages\Microsoft.Extensions.Caching.Memory.2.1.0\lib\netstandard2.0\Microsoft.Extensions.Caching.Memory.dll + + + ..\..\packages\Microsoft.Extensions.Configuration.2.1.0\lib\netstandard2.0\Microsoft.Extensions.Configuration.dll + + + ..\..\packages\Microsoft.Extensions.Configuration.Abstractions.2.1.0\lib\netstandard2.0\Microsoft.Extensions.Configuration.Abstractions.dll + + + ..\..\packages\Microsoft.Extensions.Configuration.Binder.2.1.0\lib\netstandard2.0\Microsoft.Extensions.Configuration.Binder.dll + + + ..\..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.2.1.0\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll + + + ..\..\packages\Microsoft.Extensions.DependencyModel.2.1.0\lib\net451\Microsoft.Extensions.DependencyModel.dll + + + ..\..\packages\Microsoft.Extensions.Logging.2.1.0\lib\netstandard2.0\Microsoft.Extensions.Logging.dll + + + ..\..\packages\Microsoft.Extensions.Logging.Abstractions.2.1.0\lib\netstandard2.0\Microsoft.Extensions.Logging.Abstractions.dll + + + ..\..\packages\Microsoft.Extensions.Logging.Debug.2.1.0\lib\netstandard2.0\Microsoft.Extensions.Logging.Debug.dll + + + ..\..\packages\Microsoft.Extensions.Options.2.1.0\lib\netstandard2.0\Microsoft.Extensions.Options.dll + + + ..\..\packages\Microsoft.Extensions.Primitives.2.1.0\lib\netstandard2.0\Microsoft.Extensions.Primitives.dll + + + ..\..\packages\MySql.Data.8.0.15\lib\net452\MySql.Data.dll + + + ..\..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll + + + ..\..\packages\Npgsql.4.0.5\lib\net451\Npgsql.dll + + + ..\..\packages\Npgsql.LegacyPostgis.4.0.5\lib\net45\Npgsql.LegacyPostgis.dll + + + ..\..\packages\Oracle.ManagedDataAccess.Core.2.18.3\lib\netstandard2.0\Oracle.ManagedDataAccess.dll + + + ..\..\packages\SafeObjectPool.1.0.14\lib\netstandard2.0\SafeObjectPool.dll + + + + ..\..\packages\System.AppContext.4.3.0\lib\net46\System.AppContext.dll + True + True + + + ..\..\packages\System.Buffers.4.4.0\lib\netstandard2.0\System.Buffers.dll + + + ..\..\packages\System.Collections.Immutable.1.5.0\lib\netstandard2.0\System.Collections.Immutable.dll + + + + + + + + ..\..\packages\System.Console.4.3.0\lib\net46\System.Console.dll + True + True + + + + ..\..\packages\System.Data.SqlClient.4.6.0\lib\net461\System.Data.SqlClient.dll + + + ..\..\packages\System.Data.SQLite.Core.1.0.110.0\lib\net46\System.Data.SQLite.dll + + + ..\..\packages\System.Diagnostics.FileVersionInfo.4.3.0\lib\net46\System.Diagnostics.FileVersionInfo.dll + True + True + + + ..\..\packages\System.Diagnostics.StackTrace.4.3.0\lib\net46\System.Diagnostics.StackTrace.dll + True + True + + + + + ..\..\packages\System.IO.Compression.4.3.0\lib\net46\System.IO.Compression.dll + True + True + + + ..\..\packages\System.IO.FileSystem.4.3.0\lib\net46\System.IO.FileSystem.dll + True + True + + + ..\..\packages\System.IO.FileSystem.Primitives.4.3.0\lib\net46\System.IO.FileSystem.Primitives.dll + True + True + + + + ..\..\packages\System.Memory.4.5.2\lib\netstandard2.0\System.Memory.dll + + + + ..\..\packages\System.Numerics.Vectors.4.4.0\lib\net46\System.Numerics.Vectors.dll + + + ..\..\packages\System.Reflection.Metadata.1.6.0\lib\netstandard2.0\System.Reflection.Metadata.dll + + + ..\..\packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll + + + ..\..\packages\System.Runtime.InteropServices.RuntimeInformation.4.0.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll + True + True + + + ..\..\packages\System.Runtime.Loader.4.3.0\lib\netstandard1.5\System.Runtime.Loader.dll + + + ..\..\packages\System.Security.Cryptography.Algorithms.4.3.0\lib\net461\System.Security.Cryptography.Algorithms.dll + True + True + + + ..\..\packages\System.Security.Cryptography.Encoding.4.3.0\lib\net46\System.Security.Cryptography.Encoding.dll + True + True + + + ..\..\packages\System.Security.Cryptography.Primitives.4.3.0\lib\net46\System.Security.Cryptography.Primitives.dll + True + True + + + ..\..\packages\System.Security.Cryptography.X509Certificates.4.3.0\lib\net461\System.Security.Cryptography.X509Certificates.dll + True + True + + + ..\..\packages\System.Text.Encoding.CodePages.4.3.0\lib\net46\System.Text.Encoding.CodePages.dll + + + ..\..\packages\System.Threading.Tasks.Extensions.4.5.2\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll + + + ..\..\packages\System.Threading.Thread.4.3.0\lib\net46\System.Threading.Thread.dll + True + True + + + + ..\..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll + + + + + + + + + ..\..\packages\System.Xml.ReaderWriter.4.3.0\lib\net46\System.Xml.ReaderWriter.dll + True + True + + + ..\..\packages\System.Xml.XmlDocument.4.3.0\lib\net46\System.Xml.XmlDocument.dll + True + True + + + ..\..\packages\System.Xml.XPath.4.3.0\lib\net46\System.Xml.XPath.dll + True + True + + + ..\..\packages\System.Xml.XPath.XDocument.4.3.0\lib\net46\System.Xml.XPath.XDocument.dll + True + True + + + + + + + + + + + + + + + + + + + 这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。 + + + + \ No newline at end of file diff --git a/Examples/net461_console_01/packages.config b/Examples/net461_console_01/packages.config new file mode 100644 index 00000000..7d9b1e8f --- /dev/null +++ b/Examples/net461_console_01/packages.config @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/FreeSql.sln b/FreeSql.sln index 7d1ef875..8da7be84 100644 --- a/FreeSql.sln +++ b/FreeSql.sln @@ -36,6 +36,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FreeSql.Site.UI", "Examples EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "domain_01", "Examples\domain_01\domain_01.csproj", "{A23D0455-CA7B-442D-827E-C4C7E84F9084}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "net461_console_01", "Examples\net461_console_01\net461_console_01.csproj", "{0637A778-338E-4096-B439-32B18306C75F}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -190,6 +192,18 @@ Global {A23D0455-CA7B-442D-827E-C4C7E84F9084}.Release|x64.Build.0 = Release|Any CPU {A23D0455-CA7B-442D-827E-C4C7E84F9084}.Release|x86.ActiveCfg = Release|Any CPU {A23D0455-CA7B-442D-827E-C4C7E84F9084}.Release|x86.Build.0 = Release|Any CPU + {0637A778-338E-4096-B439-32B18306C75F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0637A778-338E-4096-B439-32B18306C75F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0637A778-338E-4096-B439-32B18306C75F}.Debug|x64.ActiveCfg = Debug|Any CPU + {0637A778-338E-4096-B439-32B18306C75F}.Debug|x64.Build.0 = Debug|Any CPU + {0637A778-338E-4096-B439-32B18306C75F}.Debug|x86.ActiveCfg = Debug|Any CPU + {0637A778-338E-4096-B439-32B18306C75F}.Debug|x86.Build.0 = Debug|Any CPU + {0637A778-338E-4096-B439-32B18306C75F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0637A778-338E-4096-B439-32B18306C75F}.Release|Any CPU.Build.0 = Release|Any CPU + {0637A778-338E-4096-B439-32B18306C75F}.Release|x64.ActiveCfg = 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.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -203,6 +217,7 @@ Global {BA77AA20-9DDE-4C84-928C-11E3D71B3EF9} = {FB34DA8D-2486-426F-B9C5-2AC88ADAF955} {4F1788A6-CD82-41FE-ABFD-D14060708145} = {FB34DA8D-2486-426F-B9C5-2AC88ADAF955} {A23D0455-CA7B-442D-827E-C4C7E84F9084} = {94C8A78D-AA15-47B2-A348-530CD86BFC1B} + {0637A778-338E-4096-B439-32B18306C75F} = {94C8A78D-AA15-47B2-A348-530CD86BFC1B} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {089687FD-5D25-40AB-BA8A-A10D1E137F98}