Prepare for NuGet

This commit is contained in:
grzegorz.russek
2022-02-03 10:24:15 +00:00
parent 20267b469e
commit fd530878cc
12 changed files with 90 additions and 321 deletions

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform> <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
@@ -10,8 +10,9 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>AmalgamationTool</RootNamespace> <RootNamespace>AmalgamationTool</RootNamespace>
<AssemblyName>AmalgamationTool</AssemblyName> <AssemblyName>AmalgamationTool</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion> <TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile>Client</TargetFrameworkProfile> <TargetFrameworkProfile>
</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
@@ -23,6 +24,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<PlatformTarget>x86</PlatformTarget> <PlatformTarget>x86</PlatformTarget>
@@ -32,6 +34,7 @@
<DefineConstants>TRACE</DefineConstants> <DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="System" /> <Reference Include="System" />
@@ -49,6 +52,9 @@
<Compile Include="Program.cs" /> <Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<None Include="app.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.

View File

@@ -1605,6 +1605,8 @@ namespace DynamORM
/// <value>The dump command delegate.</value> /// <value>The dump command delegate.</value>
public Action<IDbCommand, string> DumpCommandDelegate { get; set; } public Action<IDbCommand, string> DumpCommandDelegate { get; set; }
#if NETFRAMEWORK
// https://github.com/dotnet/runtime/issues/26229
/// <summary>Initializes a new instance of the <see cref="DynamicDatabase" /> class.</summary> /// <summary>Initializes a new instance of the <see cref="DynamicDatabase" /> class.</summary>
/// <param name="provider">Database provider by name.</param> /// <param name="provider">Database provider by name.</param>
/// <param name="connectionString">Connection string to provided database.</param> /// <param name="connectionString">Connection string to provided database.</param>
@@ -1613,6 +1615,7 @@ namespace DynamORM
: this(DbProviderFactories.GetFactory(provider), connectionString, options) : this(DbProviderFactories.GetFactory(provider), connectionString, options)
{ {
} }
#endif
/// <summary>Initializes a new instance of the <see cref="DynamicDatabase" /> class.</summary> /// <summary>Initializes a new instance of the <see cref="DynamicDatabase" /> class.</summary>
/// <param name="provider">Database provider.</param> /// <param name="provider">Database provider.</param>
@@ -11272,6 +11275,7 @@ namespace DynamORM
func(obj) : elseFunc != null ? elseFunc() : default(R); func(obj) : elseFunc != null ? elseFunc() : default(R);
} }
#if !NET6_0_OR_GREATER
/// <summary>Simple distinct by selector extension.</summary> /// <summary>Simple distinct by selector extension.</summary>
/// <returns>The enumerator of elements distinct by specified selector.</returns> /// <returns>The enumerator of elements distinct by specified selector.</returns>
/// <param name="source">Source collection.</param> /// <param name="source">Source collection.</param>
@@ -11285,6 +11289,7 @@ namespace DynamORM
if (seenKeys.Add(keySelector(element))) if (seenKeys.Add(keySelector(element)))
yield return element; yield return element;
} }
#endif
} }
namespace Dynamics namespace Dynamics

View File

@@ -1,22 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<Description>Dynamic Object-Relational Mapping library.</Description>
<Copyright>Copyright © RUSSEK Software 2012-2019</Copyright>
<Company>RUSSEK Software</Company>
<Authors>Grzegorz Russek</Authors>
<FileVersion>1.1.0.1</FileVersion>
<AssemblyVersion>1.1.0.1</AssemblyVersion>
<RepositoryUrl>https://dr4cul4.pl/svn/DynamORM/</RepositoryUrl>
<PackageProjectUrl>https://dr4cul4.pl</PackageProjectUrl>
<Product>DynamORM</Product>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\AmalgamationTool\DynamORM.Amalgamation.cs" Link="DynamORM.Amalgamation.cs" />
<Compile Include="..\DynamORM\Properties\AssemblyInfo.cs" Link="AssemblyInfo.cs" />
</ItemGroup>
</Project>

View File

@@ -1,74 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DynamORM", "DynamORM\DynamORM.csproj", "{63963ED7-9C78-4672-A4D4-339B6E825503}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DynamORM.Tests.Mono", "DynamORM.Tests\DynamORM.Tests.Mono.csproj", "{D5013B4E-8A1B-4DBB-8FB5-E09935F4F764}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{63963ED7-9C78-4672-A4D4-339B6E825503}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{63963ED7-9C78-4672-A4D4-339B6E825503}.Debug|Any CPU.Build.0 = Debug|Any CPU
{63963ED7-9C78-4672-A4D4-339B6E825503}.Release|Any CPU.ActiveCfg = Release|Any CPU
{63963ED7-9C78-4672-A4D4-339B6E825503}.Release|Any CPU.Build.0 = Release|Any CPU
{D5013B4E-8A1B-4DBB-8FB5-E09935F4F764}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D5013B4E-8A1B-4DBB-8FB5-E09935F4F764}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D5013B4E-8A1B-4DBB-8FB5-E09935F4F764}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D5013B4E-8A1B-4DBB-8FB5-E09935F4F764}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(MonoDevelopProperties) = preSolution
StartupItem = DynamORM\DynamORM.csproj
Policies = $0
$0.DotNetNamingPolicy = $1
$1.DirectoryNamespaceAssociation = None
$1.ResourceNamePolicy = FileFormatDefault
$0.TextStylePolicy = $2
$2.FileWidth = 120
$2.RemoveTrailingWhitespace = True
$2.EolMarker = Windows
$2.inheritsSet = VisualStudio
$2.inheritsScope = text/plain
$2.scope = text/x-csharp
$0.CSharpFormattingPolicy = $3
$3.inheritsSet = Mono
$3.inheritsScope = text/x-csharp
$3.scope = text/x-csharp
$0.TextStylePolicy = $4
$4.FileWidth = 120
$4.RemoveTrailingWhitespace = True
$4.EolMarker = Windows
$4.inheritsSet = VisualStudio
$4.inheritsScope = text/plain
$4.scope = text/plain
$0.TextStylePolicy = $5
$5.FileWidth = 120
$5.TabWidth = 2
$5.RemoveTrailingWhitespace = True
$5.EolMarker = Windows
$5.inheritsSet = VisualStudio
$5.inheritsScope = text/plain
$5.scope = text/microsoft-resx
$0.XmlFormattingPolicy = $6
$6.inheritsSet = null
$6.scope = text/microsoft-resx
$0.TextStylePolicy = $7
$7.FileWidth = 120
$7.TabWidth = 2
$7.RemoveTrailingWhitespace = True
$7.EolMarker = Windows
$7.inheritsSet = VisualStudio
$7.inheritsScope = text/plain
$7.scope = application/xml
$0.XmlFormattingPolicy = $8
$8.inheritsSet = Mono
$8.inheritsScope = application/xml
$8.scope = application/xml
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View File

@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>DynamORM.Tests</RootNamespace> <RootNamespace>DynamORM.Tests</RootNamespace>
<AssemblyName>DynamORM.Tests</AssemblyName> <AssemblyName>DynamORM.Tests</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> <TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<TargetFrameworkProfile /> <TargetFrameworkProfile />
<AllowUnsafeBlocks>False</AllowUnsafeBlocks> <AllowUnsafeBlocks>False</AllowUnsafeBlocks>

View File

@@ -19,7 +19,7 @@ namespace DynamORM.Tests.Properties {
// class via a tool like ResGen or Visual Studio. // class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen // To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project. // with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources { internal class Resources {

View File

@@ -1,7 +1,7 @@
 
Microsoft Visual Studio Solution File, Format Version 12.00 Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15 # Visual Studio Version 17
VisualStudioVersion = 15.0.28307.136 VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DynamORM", "DynamORM\DynamORM.csproj", "{63963ED7-9C78-4672-A4D4-339B6E825503}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DynamORM", "DynamORM\DynamORM.csproj", "{63963ED7-9C78-4672-A4D4-339B6E825503}"
EndProject EndProject
@@ -11,8 +11,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AmalgamationTool", "Amalgam
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tester", "Tester\Tester.csproj", "{F747AA57-BEA7-4FB8-B371-546296789AEF}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tester", "Tester\Tester.csproj", "{F747AA57-BEA7-4FB8-B371-546296789AEF}"
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DynamORM.Core", "DynamORM.Core\DynamORM.Core.csproj", "{A0D69E18-0D0A-47EB-8E4D-EDD9B73752A1}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@@ -65,18 +63,6 @@ Global
{F747AA57-BEA7-4FB8-B371-546296789AEF}.Release|Mixed Platforms.Build.0 = Release|x86 {F747AA57-BEA7-4FB8-B371-546296789AEF}.Release|Mixed Platforms.Build.0 = Release|x86
{F747AA57-BEA7-4FB8-B371-546296789AEF}.Release|x86.ActiveCfg = Release|x86 {F747AA57-BEA7-4FB8-B371-546296789AEF}.Release|x86.ActiveCfg = Release|x86
{F747AA57-BEA7-4FB8-B371-546296789AEF}.Release|x86.Build.0 = Release|x86 {F747AA57-BEA7-4FB8-B371-546296789AEF}.Release|x86.Build.0 = Release|x86
{A0D69E18-0D0A-47EB-8E4D-EDD9B73752A1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A0D69E18-0D0A-47EB-8E4D-EDD9B73752A1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A0D69E18-0D0A-47EB-8E4D-EDD9B73752A1}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{A0D69E18-0D0A-47EB-8E4D-EDD9B73752A1}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{A0D69E18-0D0A-47EB-8E4D-EDD9B73752A1}.Debug|x86.ActiveCfg = Debug|Any CPU
{A0D69E18-0D0A-47EB-8E4D-EDD9B73752A1}.Debug|x86.Build.0 = Debug|Any CPU
{A0D69E18-0D0A-47EB-8E4D-EDD9B73752A1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A0D69E18-0D0A-47EB-8E4D-EDD9B73752A1}.Release|Any CPU.Build.0 = Release|Any CPU
{A0D69E18-0D0A-47EB-8E4D-EDD9B73752A1}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{A0D69E18-0D0A-47EB-8E4D-EDD9B73752A1}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{A0D69E18-0D0A-47EB-8E4D-EDD9B73752A1}.Release|x86.ActiveCfg = Release|Any CPU
{A0D69E18-0D0A-47EB-8E4D-EDD9B73752A1}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE

View File

@@ -1,133 +1,23 @@
<?xml version="1.0" encoding="utf-8"?> <Project Sdk="Microsoft.NET.Sdk">
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <TargetFrameworks>netstandard2.0;net472;net5.0;net6.0</TargetFrameworks>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Description>Dynamic Object-Relational Mapping library.</Description>
<ProductVersion>8.0.30703</ProductVersion> <Copyright>Copyright © RUSSEK Software 2012-2022</Copyright>
<SchemaVersion>2.0</SchemaVersion> <Company>RUSSEK Software</Company>
<ProjectGuid>{63963ED7-9C78-4672-A4D4-339B6E825503}</ProjectGuid> <Authors>Grzegorz Russek</Authors>
<OutputType>Library</OutputType> <VersionPrefix>1.2.1</VersionPrefix>
<AppDesignerFolder>Properties</AppDesignerFolder> <RepositoryUrl>https://svn.dr4cul4.pl/svn/DynamORM/</RepositoryUrl>
<RootNamespace>DynamORM</RootNamespace> <PackageProjectUrl>https://dr4cul4.pl</PackageProjectUrl>
<AssemblyName>DynamORM</AssemblyName> <Product>DynamORM</Product>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion> </PropertyGroup>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile>Client</TargetFrameworkProfile> <ItemGroup>
<SignAssembly>False</SignAssembly> <PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<DelaySign>False</DelaySign> <PackageReference Include="System.Data.Common" Version="4.3.0" />
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent> </ItemGroup>
<AllowUnsafeBlocks>False</AllowUnsafeBlocks> <ItemGroup Condition="$(TargetFramework.StartsWith('net4')) AND '$(MSBuildRuntimeType)' == 'Core' AND '$(OS)' != 'Windows_NT'">
<NoStdLib>False</NoStdLib> <PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.2" PrivateAssets="All" />
</PropertyGroup> </ItemGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols> </Project>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<RegisterForComInterop>False</RegisterForComInterop>
<GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies>
<BaseAddress>4194304</BaseAddress>
<PlatformTarget>AnyCPU</PlatformTarget>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>PdbOnly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<DocumentationFile>bin\Release\DynamORM.xml</DocumentationFile>
<RegisterForComInterop>False</RegisterForComInterop>
<GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies>
<BaseAddress>4194304</BaseAddress>
<PlatformTarget>AnyCPU</PlatformTarget>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'AnyCPU' ">
<RegisterForComInterop>False</RegisterForComInterop>
<GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies>
<BaseAddress>4194304</BaseAddress>
<PlatformTarget>AnyCPU</PlatformTarget>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.CSharp" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Data">
<HintPath>C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Data.dll</HintPath>
</Reference>
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Builders\Extensions\DynamicHavingQueryExtensions.cs" />
<Compile Include="Builders\IDynamicInsertQueryBuilder.cs" />
<Compile Include="Builders\IDynamicSelectQueryBuilder.cs" />
<Compile Include="Builders\IDynamicUpdateQueryBuilder.cs" />
<Compile Include="Builders\Implementation\DynamicDeleteQueryBuilder.cs" />
<Compile Include="Builders\Implementation\DynamicInsertQueryBuilder.cs" />
<Compile Include="Builders\Implementation\DynamicModifyBuilder.cs" />
<Compile Include="Builders\Implementation\DynamicQueryBuilder.cs" />
<Compile Include="Builders\Extensions\DynamicModifyBuilderExtensions.cs" />
<Compile Include="Builders\Extensions\DynamicWhereQueryExtensions.cs" />
<Compile Include="Builders\Implementation\DynamicSelectQueryBuilder.cs" />
<Compile Include="Builders\Implementation\DynamicUpdateQueryBuilder.cs" />
<Compile Include="Builders\IDynamicDeleteQueryBuilder.cs" />
<Compile Include="Builders\IDynamicQueryBuilder.cs" />
<Compile Include="Builders\IParameter.cs" />
<Compile Include="Builders\ITableInfo.cs" />
<Compile Include="DynamicCachedReader.cs" />
<Compile Include="DynamicColumn.cs" />
<Compile Include="DynamicCommand.cs" />
<Compile Include="DynamicConnection.cs" />
<Compile Include="DynamicDatabase.cs" />
<Compile Include="DynamicDatabaseOptions.cs" />
<Compile Include="DynamicExtensions.cs" />
<Compile Include="DynamicProcedureInvoker.cs" />
<Compile Include="DynamicQueryException.cs" />
<Compile Include="DynamicSchemaColumn.cs" />
<Compile Include="DynamicTable.cs" />
<Compile Include="DynamicTransaction.cs" />
<Compile Include="Helpers\CollectionComparer.cs" />
<Compile Include="Helpers\Dynamics\DynamicParser.cs" />
<Compile Include="Helpers\Dynamics\DynamicProxy.cs" />
<Compile Include="Helpers\IExtendedDisposable.cs" />
<Compile Include="Helpers\FrameworkTools.cs" />
<Compile Include="Helpers\StringExtensions.cs" />
<Compile Include="Helpers\UnclassifiedExtensions.cs" />
<Compile Include="Mapper\ColumnAttribute.cs" />
<Compile Include="Mapper\DynamicMapperCache.cs" />
<Compile Include="Mapper\DynamicMapperException.cs" />
<Compile Include="Mapper\DynamicPropertyInvoker.cs" />
<Compile Include="Mapper\DynamicTypeMap.cs" />
<Compile Include="Mapper\IgnoreAttribute.cs" />
<Compile Include="Objects\DynamicEntityBase.cs" />
<Compile Include="Objects\DynamicEntityState.cs" />
<Compile Include="Objects\DynamicPropertyChangingEventArgs.cs" />
<Compile Include="Objects\DynamicRepositoryBase.cs" />
<Compile Include="Validation\RequiredAttribute.cs" />
<Compile Include="Mapper\TableAttribute.cs" />
<Compile Include="Mapper\DynamicCast.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="DynamicExpando.cs" />
<Compile Include="Helpers\IFinalizerDisposable.cs" />
<Compile Include="Validation\ValidateResult.cs" />
<Compile Include="Validation\ValidationResult.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@@ -146,6 +146,8 @@ namespace DynamORM
/// <value>The dump command delegate.</value> /// <value>The dump command delegate.</value>
public Action<IDbCommand, string> DumpCommandDelegate { get; set; } public Action<IDbCommand, string> DumpCommandDelegate { get; set; }
#if NETFRAMEWORK
// https://github.com/dotnet/runtime/issues/26229
/// <summary>Initializes a new instance of the <see cref="DynamicDatabase" /> class.</summary> /// <summary>Initializes a new instance of the <see cref="DynamicDatabase" /> class.</summary>
/// <param name="provider">Database provider by name.</param> /// <param name="provider">Database provider by name.</param>
/// <param name="connectionString">Connection string to provided database.</param> /// <param name="connectionString">Connection string to provided database.</param>
@@ -154,6 +156,7 @@ namespace DynamORM
: this(DbProviderFactories.GetFactory(provider), connectionString, options) : this(DbProviderFactories.GetFactory(provider), connectionString, options)
{ {
} }
#endif
/// <summary>Initializes a new instance of the <see cref="DynamicDatabase" /> class.</summary> /// <summary>Initializes a new instance of the <see cref="DynamicDatabase" /> class.</summary>
/// <param name="provider">Database provider.</param> /// <param name="provider">Database provider.</param>
@@ -249,9 +252,9 @@ namespace DynamORM
#endif #endif
} }
#endregion Properties and Constructors #endregion Properties and Constructors
#region Table #region Table
#if !DYNAMORM_OMMIT_OLDSYNTAX #if !DYNAMORM_OMMIT_OLDSYNTAX
@@ -326,7 +329,7 @@ namespace DynamORM
#endif #endif
#endregion Table #endregion Table
/// <summary>Adds cached builder.</summary> /// <summary>Adds cached builder.</summary>
/// <param name="builder">New dynamic builder.</param> /// <param name="builder">New dynamic builder.</param>
@@ -344,7 +347,7 @@ namespace DynamORM
RemainingBuilders.Remove(builder); RemainingBuilders.Remove(builder);
} }
#region From/Insert/Update/Delete #region From/Insert/Update/Delete
/// <summary> /// <summary>
/// Adds to the <code>FROM</code> clause the contents obtained by parsing the dynamic lambda expressions given. The supported /// Adds to the <code>FROM</code> clause the contents obtained by parsing the dynamic lambda expressions given. The supported
@@ -627,7 +630,7 @@ namespace DynamORM
{ {
try try
{ {
#region Update #region Update
Dictionary<IDbDataParameter, DynamicPropertyInvoker> parametersUp = new Dictionary<IDbDataParameter, DynamicPropertyInvoker>(); Dictionary<IDbDataParameter, DynamicPropertyInvoker> parametersUp = new Dictionary<IDbDataParameter, DynamicPropertyInvoker>();
@@ -650,9 +653,9 @@ namespace DynamORM
else else
PrepareBatchUpdate(t, mapper, cmdUp, parametersUp); PrepareBatchUpdate(t, mapper, cmdUp, parametersUp);
#endregion Update #endregion Update
#region Insert #region Insert
Dictionary<IDbDataParameter, DynamicPropertyInvoker> parametersIn = new Dictionary<IDbDataParameter, DynamicPropertyInvoker>(); Dictionary<IDbDataParameter, DynamicPropertyInvoker> parametersIn = new Dictionary<IDbDataParameter, DynamicPropertyInvoker>();
@@ -675,7 +678,7 @@ namespace DynamORM
else else
PrepareBatchInsert(t, mapper, cmdIn, parametersIn); PrepareBatchInsert(t, mapper, cmdIn, parametersIn);
#endregion Insert #endregion Insert
foreach (var o in e) foreach (var o in e)
{ {
@@ -1020,9 +1023,9 @@ namespace DynamORM
mapper.DeleteCommandText = cmd.CommandText; mapper.DeleteCommandText = cmd.CommandText;
} }
#endregion From/Insert/Update/Delete #endregion From/Insert/Update/Delete
#region Procedure #region Procedure
/// <summary>Execute stored procedure.</summary> /// <summary>Execute stored procedure.</summary>
/// <param name="procName">Name of stored procedure to execute.</param> /// <param name="procName">Name of stored procedure to execute.</param>
@@ -1089,9 +1092,9 @@ namespace DynamORM
} }
} }
#endregion Procedure #endregion Procedure
#region Execute #region Execute
/// <summary>Execute non query.</summary> /// <summary>Execute non query.</summary>
/// <param name="sql">SQL query containing numbered parameters in format provided by /// <param name="sql">SQL query containing numbered parameters in format provided by
@@ -1148,9 +1151,9 @@ namespace DynamORM
return ret; return ret;
} }
#endregion Execute #endregion Execute
#region Scalar #region Scalar
/// <summary>Returns a single result.</summary> /// <summary>Returns a single result.</summary>
/// <param name="sql">SQL query containing numbered parameters in format provided by /// <param name="sql">SQL query containing numbered parameters in format provided by
@@ -1221,9 +1224,9 @@ namespace DynamORM
#endif #endif
#endregion Scalar #endregion Scalar
#region Query #region Query
/// <summary>Enumerate the reader and yield the result.</summary> /// <summary>Enumerate the reader and yield the result.</summary>
/// <param name="sql">SQL query containing numbered parameters in format provided by /// <param name="sql">SQL query containing numbered parameters in format provided by
@@ -1305,9 +1308,9 @@ namespace DynamORM
} }
} }
#endregion Query #endregion Query
#region Schema #region Schema
/// <summary>Builds query cache if necessary and returns it.</summary> /// <summary>Builds query cache if necessary and returns it.</summary>
/// <param name="builder">The builder containing query to read schema from.</param> /// <param name="builder">The builder containing query to read schema from.</param>
@@ -1518,7 +1521,7 @@ namespace DynamORM
(Options & DynamicDatabaseOptions.SupportSchema) == DynamicDatabaseOptions.SupportSchema; (Options & DynamicDatabaseOptions.SupportSchema) == DynamicDatabaseOptions.SupportSchema;
bool mapperSchema = mapper != null && mapper.Table != null && (mapper.Table.Override || !databaseSchemaSupport); bool mapperSchema = mapper != null && mapper.Table != null && (mapper.Table.Override || !databaseSchemaSupport);
#region Database schema #region Database schema
if (databaseSchemaSupport && !Schema.ContainsKey(tableName.ToLower())) if (databaseSchemaSupport && !Schema.ContainsKey(tableName.ToLower()))
{ {
@@ -1530,9 +1533,9 @@ namespace DynamORM
Schema[tableName.ToLower()] = schema; Schema[tableName.ToLower()] = schema;
} }
#endregion Database schema #endregion Database schema
#region Type schema #region Type schema
if ((mapperSchema && !Schema.ContainsKey(mapper.Type.FullName)) || if ((mapperSchema && !Schema.ContainsKey(mapper.Type.FullName)) ||
(schema == null && mapper != null && !mapper.Type.IsAnonymous())) (schema == null && mapper != null && !mapper.Type.IsAnonymous()))
@@ -1540,7 +1543,7 @@ namespace DynamORM
// TODO: Ged rid of this monster below... // TODO: Ged rid of this monster below...
if (databaseSchemaSupport) if (databaseSchemaSupport)
{ {
#region Merge with db schema #region Merge with db schema
schema = mapper.ColumnsMap.ToDictionary(k => k.Key, (v) => 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 else
{ {
#region MapEnumerable based only on type #region MapEnumerable based only on type
schema = mapper.ColumnsMap.ToDictionary(k => k.Key, schema = mapper.ColumnsMap.ToDictionary(k => k.Key,
v => new DynamicSchemaColumn v => new DynamicSchemaColumn
@@ -1595,21 +1598,21 @@ namespace DynamORM
Scale = DynamicExtensions.CoalesceNullable<byte>(v.Value.Column != null ? v.Value.Column.Scale : null, 0).Value, Scale = DynamicExtensions.CoalesceNullable<byte>(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) if (mapper != null && schema != null)
Schema[mapper.Type.FullName] = schema; Schema[mapper.Type.FullName] = schema;
#endregion Type schema #endregion Type schema
return schema; return schema;
} }
#endregion Schema #endregion Schema
#region Decorators #region Decorators
/// <summary>Gets or sets left side decorator for database objects.</summary> /// <summary>Gets or sets left side decorator for database objects.</summary>
public string LeftDecorator public string LeftDecorator
@@ -1698,9 +1701,9 @@ namespace DynamORM
cmd.Dump(Console.Out); cmd.Dump(Console.Out);
} }
#endregion Decorators #endregion Decorators
#region Connection #region Connection
/// <summary>Open managed connection.</summary> /// <summary>Open managed connection.</summary>
/// <returns>Opened connection.</returns> /// <returns>Opened connection.</returns>
@@ -1806,9 +1809,9 @@ namespace DynamORM
.ExecuteNonQuery(); .ExecuteNonQuery();
} }
#endregion Connection #endregion Connection
#region Transaction #region Transaction
/// <summary>Begins a global database transaction.</summary> /// <summary>Begins a global database transaction.</summary>
/// <remarks>Using this method connection is set to single open /// <remarks>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
/// <summary>Performs application-defined tasks associated with freeing, /// <summary>Performs application-defined tasks associated with freeing,
/// releasing, or resetting unmanaged resources.</summary> /// releasing, or resetting unmanaged resources.</summary>
@@ -1941,6 +1944,6 @@ namespace DynamORM
/// <summary>Gets a value indicating whether this instance is disposed.</summary> /// <summary>Gets a value indicating whether this instance is disposed.</summary>
public bool IsDisposed { get; private set; } public bool IsDisposed { get; private set; }
#endregion IExtendedDisposable Members #endregion IExtendedDisposable Members
} }
} }

View File

@@ -73,6 +73,7 @@ namespace DynamORM.Helpers
func(obj) : elseFunc != null ? elseFunc() : default(R); func(obj) : elseFunc != null ? elseFunc() : default(R);
} }
#if !NET6_0_OR_GREATER
/// <summary>Simple distinct by selector extension.</summary> /// <summary>Simple distinct by selector extension.</summary>
/// <returns>The enumerator of elements distinct by specified selector.</returns> /// <returns>The enumerator of elements distinct by specified selector.</returns>
/// <param name="source">Source collection.</param> /// <param name="source">Source collection.</param>
@@ -86,5 +87,6 @@ namespace DynamORM.Helpers
if (seenKeys.Add(keySelector(element))) if (seenKeys.Add(keySelector(element)))
yield return element; yield return element;
} }
#endif
} }
} }

View File

@@ -35,40 +35,7 @@
using System.Reflection; using System.Reflection;
using System.Runtime.CompilerServices; 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: InternalsVisibleTo("DynamORM.Tests")]
[assembly: Obfuscation(Feature = "encrypt symbol names with password #dr4cul4#", Exclude = false)] [assembly: Obfuscation(Feature = "encrypt symbol names with password #dr4cul4#", Exclude = false)]
[assembly: Obfuscation(Feature = "code control flow obfuscation", Exclude = false)] [assembly: Obfuscation(Feature = "code control flow obfuscation", Exclude = false)]

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform> <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
@@ -10,8 +10,9 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Tester</RootNamespace> <RootNamespace>Tester</RootNamespace>
<AssemblyName>Tester</AssemblyName> <AssemblyName>Tester</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion> <TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile>Client</TargetFrameworkProfile> <TargetFrameworkProfile>
</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
@@ -24,6 +25,7 @@
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<Externalconsole>true</Externalconsole> <Externalconsole>true</Externalconsole>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
@@ -34,6 +36,7 @@
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<Externalconsole>true</Externalconsole> <Externalconsole>true</Externalconsole>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="System" /> <Reference Include="System" />
@@ -60,6 +63,9 @@
<Name>DynamORM</Name> <Name>DynamORM</Name>
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>
<ItemGroup>
<None Include="app.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.