From fd530878ccae356492a102189d3b8b91ca4eb92d Mon Sep 17 00:00:00 2001 From: "grzegorz.russek" Date: Thu, 3 Feb 2022 10:24:15 +0000 Subject: [PATCH] Prepare for NuGet --- AmalgamationTool/AmalgamationTool.csproj | 12 +- AmalgamationTool/DynamORM.Amalgamation.cs | 5 + DynamORM.Core/DynamORM.Core.csproj | 22 --- DynamORM.Mono.sln | 74 --------- DynamORM.Tests/DynamORM.Tests.csproj | 2 +- .../Properties/Resources.Designer.cs | 2 +- DynamORM.sln | 18 +- DynamORM/DynamORM.csproj | 156 +++--------------- DynamORM/DynamicDatabase.cs | 73 ++++---- DynamORM/Helpers/UnclassifiedExtensions.cs | 2 + DynamORM/Properties/AssemblyInfo.cs | 33 ---- Tester/Tester.csproj | 12 +- 12 files changed, 90 insertions(+), 321 deletions(-) delete mode 100644 DynamORM.Core/DynamORM.Core.csproj delete mode 100644 DynamORM.Mono.sln diff --git a/AmalgamationTool/AmalgamationTool.csproj b/AmalgamationTool/AmalgamationTool.csproj index 13f567a..741afdf 100644 --- a/AmalgamationTool/AmalgamationTool.csproj +++ b/AmalgamationTool/AmalgamationTool.csproj @@ -1,5 +1,5 @@  - + Debug x86 @@ -10,8 +10,9 @@ Properties AmalgamationTool AmalgamationTool - v4.0 - Client + v4.8 + + 512 @@ -23,6 +24,7 @@ DEBUG;TRACE prompt 4 + false x86 @@ -32,6 +34,7 @@ TRACE prompt 4 + false @@ -49,6 +52,9 @@ + + + - \ No newline at end of file + + + + netstandard2.0;net472;net5.0;net6.0 + Dynamic Object-Relational Mapping library. + Copyright © RUSSEK Software 2012-2022 + RUSSEK Software + Grzegorz Russek + 1.2.1 + https://svn.dr4cul4.pl/svn/DynamORM/ + https://dr4cul4.pl + DynamORM + + + + + + + + + + + diff --git a/DynamORM/DynamicDatabase.cs b/DynamORM/DynamicDatabase.cs index 1469170..24a3158 100644 --- a/DynamORM/DynamicDatabase.cs +++ b/DynamORM/DynamicDatabase.cs @@ -146,6 +146,8 @@ namespace DynamORM /// The dump command delegate. public Action DumpCommandDelegate { get; set; } +#if NETFRAMEWORK + // https://github.com/dotnet/runtime/issues/26229 /// Initializes a new instance of the class. /// Database provider by name. /// Connection string to provided database. @@ -154,6 +156,7 @@ namespace DynamORM : this(DbProviderFactories.GetFactory(provider), connectionString, options) { } +#endif /// Initializes a new instance of the class. /// Database provider. @@ -249,9 +252,9 @@ namespace DynamORM #endif } - #endregion Properties and Constructors +#endregion Properties and Constructors - #region Table +#region Table #if !DYNAMORM_OMMIT_OLDSYNTAX @@ -326,7 +329,7 @@ namespace DynamORM #endif - #endregion Table +#endregion Table /// Adds cached builder. /// New dynamic builder. @@ -344,7 +347,7 @@ namespace DynamORM RemainingBuilders.Remove(builder); } - #region From/Insert/Update/Delete +#region From/Insert/Update/Delete /// /// Adds to the FROM clause the contents obtained by parsing the dynamic lambda expressions given. The supported @@ -627,7 +630,7 @@ namespace DynamORM { try { - #region Update +#region Update Dictionary parametersUp = new Dictionary(); @@ -650,9 +653,9 @@ namespace DynamORM else PrepareBatchUpdate(t, mapper, cmdUp, parametersUp); - #endregion Update +#endregion Update - #region Insert +#region Insert Dictionary parametersIn = new Dictionary(); @@ -675,7 +678,7 @@ namespace DynamORM else PrepareBatchInsert(t, mapper, cmdIn, parametersIn); - #endregion Insert +#endregion Insert foreach (var o in e) { @@ -1020,9 +1023,9 @@ namespace DynamORM mapper.DeleteCommandText = cmd.CommandText; } - #endregion From/Insert/Update/Delete +#endregion From/Insert/Update/Delete - #region Procedure +#region Procedure /// Execute stored procedure. /// Name of stored procedure to execute. @@ -1089,9 +1092,9 @@ namespace DynamORM } } - #endregion Procedure +#endregion Procedure - #region Execute +#region Execute /// Execute non query. /// SQL query containing numbered parameters in format provided by @@ -1148,9 +1151,9 @@ namespace DynamORM return ret; } - #endregion Execute +#endregion Execute - #region Scalar +#region Scalar /// Returns a single result. /// SQL query containing numbered parameters in format provided by @@ -1221,9 +1224,9 @@ namespace DynamORM #endif - #endregion Scalar +#endregion Scalar - #region Query +#region Query /// Enumerate the reader and yield the result. /// SQL query containing numbered parameters in format provided by @@ -1305,9 +1308,9 @@ namespace DynamORM } } - #endregion Query +#endregion Query - #region Schema +#region Schema /// Builds query cache if necessary and returns it. /// The builder containing query to read schema from. @@ -1518,7 +1521,7 @@ namespace DynamORM (Options & DynamicDatabaseOptions.SupportSchema) == DynamicDatabaseOptions.SupportSchema; bool mapperSchema = mapper != null && mapper.Table != null && (mapper.Table.Override || !databaseSchemaSupport); - #region Database schema +#region Database schema if (databaseSchemaSupport && !Schema.ContainsKey(tableName.ToLower())) { @@ -1530,9 +1533,9 @@ namespace DynamORM Schema[tableName.ToLower()] = schema; } - #endregion Database schema +#endregion Database schema - #region Type schema +#region Type schema if ((mapperSchema && !Schema.ContainsKey(mapper.Type.FullName)) || (schema == null && mapper != null && !mapper.Type.IsAnonymous())) @@ -1540,7 +1543,7 @@ namespace DynamORM // TODO: Ged rid of this monster below... if (databaseSchemaSupport) { - #region Merge with db schema +#region Merge with db schema schema = mapper.ColumnsMap.ToDictionary(k => k.Key, (v) => { @@ -1576,11 +1579,11 @@ namespace DynamORM }; }); - #endregion Merge with db schema +#endregion Merge with db schema } else { - #region MapEnumerable based only on type +#region MapEnumerable based only on type schema = mapper.ColumnsMap.ToDictionary(k => k.Key, v => new DynamicSchemaColumn @@ -1595,21 +1598,21 @@ namespace DynamORM Scale = DynamicExtensions.CoalesceNullable(v.Value.Column != null ? v.Value.Column.Scale : null, 0).Value, }); - #endregion MapEnumerable based only on type +#endregion MapEnumerable based only on type } } if (mapper != null && schema != null) Schema[mapper.Type.FullName] = schema; - #endregion Type schema +#endregion Type schema return schema; } - #endregion Schema +#endregion Schema - #region Decorators +#region Decorators /// Gets or sets left side decorator for database objects. public string LeftDecorator @@ -1698,9 +1701,9 @@ namespace DynamORM cmd.Dump(Console.Out); } - #endregion Decorators +#endregion Decorators - #region Connection +#region Connection /// Open managed connection. /// Opened connection. @@ -1806,9 +1809,9 @@ namespace DynamORM .ExecuteNonQuery(); } - #endregion Connection +#endregion Connection - #region Transaction +#region Transaction /// Begins a global database transaction. /// Using this method connection is set to single open @@ -1870,9 +1873,9 @@ namespace DynamORM }); } - #endregion Transaction +#endregion Transaction - #region IExtendedDisposable Members +#region IExtendedDisposable Members /// Performs application-defined tasks associated with freeing, /// releasing, or resetting unmanaged resources. @@ -1941,6 +1944,6 @@ namespace DynamORM /// Gets a value indicating whether this instance is disposed. public bool IsDisposed { get; private set; } - #endregion IExtendedDisposable Members +#endregion IExtendedDisposable Members } } \ No newline at end of file diff --git a/DynamORM/Helpers/UnclassifiedExtensions.cs b/DynamORM/Helpers/UnclassifiedExtensions.cs index 51049bd..b2d0335 100644 --- a/DynamORM/Helpers/UnclassifiedExtensions.cs +++ b/DynamORM/Helpers/UnclassifiedExtensions.cs @@ -73,6 +73,7 @@ namespace DynamORM.Helpers func(obj) : elseFunc != null ? elseFunc() : default(R); } +#if !NET6_0_OR_GREATER /// Simple distinct by selector extension. /// The enumerator of elements distinct by specified selector. /// Source collection. @@ -86,5 +87,6 @@ namespace DynamORM.Helpers if (seenKeys.Add(keySelector(element))) yield return element; } +#endif } } \ No newline at end of file diff --git a/DynamORM/Properties/AssemblyInfo.cs b/DynamORM/Properties/AssemblyInfo.cs index a91163f..492f39d 100644 --- a/DynamORM/Properties/AssemblyInfo.cs +++ b/DynamORM/Properties/AssemblyInfo.cs @@ -35,40 +35,7 @@ using System.Reflection; using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("DynamORM")] -[assembly: AssemblyDescription("Dynamic Object-Relational Mapping library.")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("RUSSEK Software")] -[assembly: AssemblyProduct("DynamORM")] -[assembly: AssemblyCopyright("Copyright © RUSSEK Software 2012-2019")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("0a42480b-bba7-4b01-807f-9962a76e4e47")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.1.0.1")] -[assembly: AssemblyFileVersion("1.1.0.1")] [assembly: InternalsVisibleTo("DynamORM.Tests")] [assembly: Obfuscation(Feature = "encrypt symbol names with password #dr4cul4#", Exclude = false)] [assembly: Obfuscation(Feature = "code control flow obfuscation", Exclude = false)] diff --git a/Tester/Tester.csproj b/Tester/Tester.csproj index 8145bf4..99321de 100644 --- a/Tester/Tester.csproj +++ b/Tester/Tester.csproj @@ -1,5 +1,5 @@  - + Debug x86 @@ -10,8 +10,9 @@ Properties Tester Tester - v4.0 - Client + v4.8 + + 512 @@ -24,6 +25,7 @@ prompt 4 true + false AnyCPU @@ -34,6 +36,7 @@ prompt 4 true + false @@ -60,6 +63,9 @@ DynamORM + + +