Compare commits
31 Commits
Core
...
be6c172ec8
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
be6c172ec8 | ||
| 437403f966 | |||
| dd05d67de6 | |||
| 30978158e9 | |||
| 8519ca3a13 | |||
| 9364a45561 | |||
| b68ae51ddb | |||
| a45651dfbd | |||
| d093cc9007 | |||
| 1a95c0e546 | |||
| 025bed61b1 | |||
|
|
20287a6b8b | ||
|
|
9e0f315b24 | ||
|
|
23c0da2ac8 | ||
|
|
83c6b5071d | ||
|
|
086f278e84 | ||
|
|
e8c0224a03 | ||
|
|
f5a1e14934 | ||
|
|
53ba71f808 | ||
|
|
0984883f68 | ||
|
|
b5cb4ba17f | ||
|
|
d83ac6307e | ||
|
|
f01ba13ad9 | ||
|
|
54b4f2de22 | ||
|
|
51060bcd60 | ||
|
|
fd530878cc | ||
|
|
20267b469e | ||
|
|
68a81020e4 | ||
|
|
7ce3a00613 | ||
|
|
552f7a1f86 | ||
|
|
d1193cba01 |
51
.gitignore
vendored
Normal file
51
.gitignore
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
# ---> core
|
||||
*.swp
|
||||
*.*~
|
||||
project.lock.json
|
||||
.DS_Store
|
||||
*.pyc
|
||||
nupkg/
|
||||
|
||||
# Visual Studio Code
|
||||
.vscode
|
||||
|
||||
# Rider
|
||||
.idea
|
||||
|
||||
# User-specific files
|
||||
*.suo
|
||||
*.user
|
||||
*.userosscache
|
||||
*.sln.docstates
|
||||
|
||||
# Build results
|
||||
[Dd]ebug/
|
||||
[Dd]ebugPublic/
|
||||
[Rr]elease/
|
||||
[Rr]eleases/
|
||||
x64/
|
||||
x86/
|
||||
build/
|
||||
bld/
|
||||
[Bb]in/
|
||||
[Oo]bj/
|
||||
[Oo]ut/
|
||||
msbuild.log
|
||||
msbuild.err
|
||||
msbuild.wrn
|
||||
*/[Bb]in/
|
||||
*/[Oo]bj/
|
||||
*/[Oo]ut/
|
||||
|
||||
# Visual Studio 2015
|
||||
.vs/
|
||||
|
||||
# Logs
|
||||
[Ll]og-*.txt
|
||||
[Ll]ogs/
|
||||
|
||||
# Other
|
||||
appsettings.Development.json
|
||||
configurationCache.bin
|
||||
configurationCache.bin.bak
|
||||
*.cache
|
||||
@@ -1,5 +1,5 @@
|
||||
<?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>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
|
||||
@@ -10,8 +10,9 @@
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>AmalgamationTool</RootNamespace>
|
||||
<AssemblyName>AmalgamationTool</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<TargetFrameworkProfile>
|
||||
</TargetFrameworkProfile>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
||||
@@ -23,6 +24,7 @@
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
@@ -32,6 +34,7 @@
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -25,7 +25,7 @@ namespace AmalgamationTool
|
||||
|
||||
// Deal with usings
|
||||
foreach (var u in content.Split(new string[] { Environment.NewLine }, StringSplitOptions.None)
|
||||
.Where(l => l.Trim().StartsWith("using "))
|
||||
.Where(l => l.Trim().StartsWith("using ") && !l.Trim().StartsWith("using ("))
|
||||
.Select(l => l.Trim()))
|
||||
if (!usings.Contains(u))
|
||||
usings.Add(u);
|
||||
@@ -49,6 +49,9 @@ namespace AmalgamationTool
|
||||
//}
|
||||
//else
|
||||
{
|
||||
if (content.Trim().Length == 0)
|
||||
continue;
|
||||
|
||||
var nstart = content.IndexOf("namespace ") + "namespace ".Length;
|
||||
var bbrace = content.IndexOf("{", nstart);
|
||||
var nlen = bbrace - nstart;
|
||||
@@ -93,6 +96,41 @@ namespace AmalgamationTool
|
||||
|
||||
FillClassesAndNamespacesIddented(classes, sb);
|
||||
|
||||
string amalgamation = sb.ToString();
|
||||
|
||||
sb = new StringBuilder();
|
||||
|
||||
string prevTrimmed = null;
|
||||
|
||||
string[] array = amalgamation.Split(new string[] { Environment.NewLine }, StringSplitOptions.None);
|
||||
|
||||
for (int i = 0; i < array.Length; i++)
|
||||
{
|
||||
string l = array[i];
|
||||
var currentTrimmed = l.Trim();
|
||||
var nextTrimmed = (i + 1 == array.Length) ? null : array[i + 1].Trim();
|
||||
|
||||
if (prevTrimmed != null)
|
||||
{
|
||||
switch (prevTrimmed)
|
||||
{
|
||||
case "":
|
||||
if (currentTrimmed == string.Empty)
|
||||
continue;
|
||||
break;
|
||||
|
||||
case "{":
|
||||
case "}":
|
||||
if (currentTrimmed == string.Empty && (nextTrimmed == prevTrimmed || nextTrimmed == string.Empty))
|
||||
continue;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
sb.AppendLine(l);
|
||||
prevTrimmed = currentTrimmed;
|
||||
}
|
||||
|
||||
File.WriteAllText(Path.GetFullPath(args[1].Trim('"', '\'')), sb.ToString());
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
@@ -10,7 +10,7 @@
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>DynamORM.Tests</RootNamespace>
|
||||
<AssemblyName>DynamORM.Tests</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7.1</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<TargetFrameworkProfile />
|
||||
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
|
||||
@@ -118,13 +118,13 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="MSTest.TestAdapter">
|
||||
<Version>2.0.0-beta4</Version>
|
||||
<Version>3.3.1</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="MSTest.TestFramework">
|
||||
<Version>2.0.0-beta4</Version>
|
||||
<Version>3.3.1</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="System.Data.SQLite">
|
||||
<Version>1.0.111</Version>
|
||||
<Version>1.0.118</Version>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
|
||||
2
DynamORM.Tests/Properties/Resources.Designer.cs
generated
2
DynamORM.Tests/Properties/Resources.Designer.cs
generated
@@ -19,7 +19,7 @@ namespace DynamORM.Tests.Properties {
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources {
|
||||
|
||||
@@ -47,7 +47,8 @@ namespace DynamORM.Tests.Select
|
||||
CreateDynamicDatabase(
|
||||
DynamicDatabaseOptions.SingleConnection |
|
||||
DynamicDatabaseOptions.SingleTransaction |
|
||||
DynamicDatabaseOptions.SupportLimitOffset);
|
||||
DynamicDatabaseOptions.SupportLimitOffset |
|
||||
DynamicDatabaseOptions.SupportNoLock);
|
||||
}
|
||||
|
||||
/// <summary>Tear down test objects.</summary>
|
||||
@@ -98,6 +99,18 @@ namespace DynamORM.Tests.Select
|
||||
Assert.AreEqual("SELECT * FROM \"dbo\".\"Users\" AS c", cmd.CommandText());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tests from method with as expression in text.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
public void TestFromGetAsNoLock1()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
|
||||
cmd.From(u => u.dbo.Users.As("c").NoLock());
|
||||
Assert.AreEqual("SELECT * FROM \"dbo\".\"Users\" AS c WITH(NOLOCK)", cmd.CommandText());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tests from method with as expression using lambda.
|
||||
/// </summary>
|
||||
@@ -211,6 +224,19 @@ namespace DynamORM.Tests.Select
|
||||
Assert.AreEqual("SELECT * FROM (SELECT * FROM \"dbo\".\"Users\") AS u", cmd.CommandText());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tests from method using invoke with sub query.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
public void TestFromSubQuery4()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
|
||||
cmd.From(u => u(new DynamicSelectQueryBuilder(Database).From(x => x.dbo.Users.NoLock())).As("u"));
|
||||
|
||||
Assert.AreEqual("SELECT * FROM (SELECT * FROM \"dbo\".\"Users\" WITH(NOLOCK)) AS u", cmd.CommandText());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tests where method with alias.
|
||||
/// </summary>
|
||||
@@ -416,6 +442,35 @@ namespace DynamORM.Tests.Select
|
||||
Assert.AreEqual(string.Format("SELECT usr.*, uc.\"Users\" FROM \"dbo\".\"Users\" AS usr INNER JOIN (SELECT * FROM \"dbo\".\"UserClients\" WHERE (\"Deleted\" = [${0}])) AS uc ON ((usr.\"Id_User\" = uc.\"User_Id\") AND (uc.\"Users\" IS NOT NULL))", cmd.Parameters.Keys.First()), cmd.CommandText());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tests from method using invoke with sub query an no lock.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
public void TestInnerJoin5()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
|
||||
cmd.From(u => u.dbo.Users.As(u.usr).NoLock())
|
||||
.SubQuery((b, s) => b.Join(usr => usr(s.From(x => x.dbo.UserClients.NoLock()).Where(x => x.Deleted == 0)).Inner().As(usr.uc).On(usr.Id_User == usr.uc.User_Id && usr.uc.Users != null)))
|
||||
.Select(usr => usr.All(), uc => uc.Users);
|
||||
|
||||
Assert.AreEqual(string.Format("SELECT usr.*, uc.\"Users\" FROM \"dbo\".\"Users\" AS usr WITH(NOLOCK) INNER JOIN (SELECT * FROM \"dbo\".\"UserClients\" WITH(NOLOCK) WHERE (\"Deleted\" = [${0}])) AS uc ON ((usr.\"Id_User\" = uc.\"User_Id\") AND (uc.\"Users\" IS NOT NULL))", cmd.Parameters.Keys.First()), cmd.CommandText());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tests inner join method with no lock.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
public void TestInnerJoin6()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
|
||||
cmd.From(u => u.dbo.Users.As(u.usr).NoLock())
|
||||
.Join(u => u.Inner().dbo.UserClients.AS(u.uc).NoLock().On(u.usr.Id_User == u.uc.User_Id));
|
||||
|
||||
Assert.AreEqual(string.Format("SELECT * FROM \"dbo\".\"Users\" AS usr WITH(NOLOCK) INNER JOIN \"dbo\".\"UserClients\" AS uc WITH(NOLOCK) ON (usr.\"Id_User\" = uc.\"User_Id\")"), cmd.CommandText());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tests left outer join method.
|
||||
/// </summary>
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
// <autogenerated />
|
||||
using System;
|
||||
using System.Reflection;
|
||||
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
|
||||
Binary file not shown.
Binary file not shown.
196
DynamORM.Tests/obj/DynamORM.Tests.csproj.nuget.dgspec.json
Normal file
196
DynamORM.Tests/obj/DynamORM.Tests.csproj.nuget.dgspec.json
Normal file
@@ -0,0 +1,196 @@
|
||||
{
|
||||
"format": 1,
|
||||
"restore": {
|
||||
"D:\\Source\\.NET\\DynamORM\\DynamORM.Tests\\DynamORM.Tests.csproj": {}
|
||||
},
|
||||
"projects": {
|
||||
"D:\\Source\\.NET\\DynamORM\\DynamORM.Tests\\DynamORM.Tests.csproj": {
|
||||
"version": "1.0.0",
|
||||
"restore": {
|
||||
"projectUniqueName": "D:\\Source\\.NET\\DynamORM\\DynamORM.Tests\\DynamORM.Tests.csproj",
|
||||
"projectName": "DynamORM.Tests",
|
||||
"projectPath": "D:\\Source\\.NET\\DynamORM\\DynamORM.Tests\\DynamORM.Tests.csproj",
|
||||
"packagesPath": "C:\\Users\\gruss\\.nuget\\packages\\",
|
||||
"outputPath": "D:\\Source\\.NET\\DynamORM\\DynamORM.Tests\\obj\\",
|
||||
"projectStyle": "PackageReference",
|
||||
"skipContentFileWrite": true,
|
||||
"fallbackFolders": [
|
||||
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"
|
||||
],
|
||||
"configFilePaths": [
|
||||
"C:\\Users\\gruss\\AppData\\Roaming\\NuGet\\NuGet.Config",
|
||||
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config",
|
||||
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
|
||||
],
|
||||
"originalTargetFrameworks": [
|
||||
"net48"
|
||||
],
|
||||
"sources": {
|
||||
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
|
||||
"https://api.nuget.org/v3/index.json": {}
|
||||
},
|
||||
"frameworks": {
|
||||
"net48": {
|
||||
"projectReferences": {
|
||||
"D:\\Source\\.NET\\DynamORM\\DynamORM\\DynamORM.csproj": {
|
||||
"projectPath": "D:\\Source\\.NET\\DynamORM\\DynamORM\\DynamORM.csproj"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"frameworks": {
|
||||
"net48": {
|
||||
"dependencies": {
|
||||
"MSTest.TestAdapter": {
|
||||
"target": "Package",
|
||||
"version": "[2.0.0-beta4, )"
|
||||
},
|
||||
"MSTest.TestFramework": {
|
||||
"target": "Package",
|
||||
"version": "[2.0.0-beta4, )"
|
||||
},
|
||||
"System.Data.SQLite": {
|
||||
"target": "Package",
|
||||
"version": "[1.0.111, )"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"runtimes": {
|
||||
"win": {
|
||||
"#import": []
|
||||
},
|
||||
"win-x64": {
|
||||
"#import": []
|
||||
},
|
||||
"win-x86": {
|
||||
"#import": []
|
||||
}
|
||||
}
|
||||
},
|
||||
"D:\\Source\\.NET\\DynamORM\\DynamORM\\DynamORM.csproj": {
|
||||
"version": "1.3.0",
|
||||
"restore": {
|
||||
"projectUniqueName": "D:\\Source\\.NET\\DynamORM\\DynamORM\\DynamORM.csproj",
|
||||
"projectName": "DynamORM",
|
||||
"projectPath": "D:\\Source\\.NET\\DynamORM\\DynamORM\\DynamORM.csproj",
|
||||
"packagesPath": "C:\\Users\\gruss\\.nuget\\packages\\",
|
||||
"outputPath": "D:\\Source\\.NET\\DynamORM\\DynamORM\\obj\\",
|
||||
"projectStyle": "PackageReference",
|
||||
"crossTargeting": true,
|
||||
"fallbackFolders": [
|
||||
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"
|
||||
],
|
||||
"configFilePaths": [
|
||||
"C:\\Users\\gruss\\AppData\\Roaming\\NuGet\\NuGet.Config",
|
||||
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config",
|
||||
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
|
||||
],
|
||||
"originalTargetFrameworks": [
|
||||
"net472",
|
||||
"net6.0",
|
||||
"netstandard2.0"
|
||||
],
|
||||
"sources": {
|
||||
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
|
||||
"https://api.nuget.org/v3/index.json": {}
|
||||
},
|
||||
"frameworks": {
|
||||
"net6.0": {
|
||||
"targetAlias": "net6.0",
|
||||
"projectReferences": {}
|
||||
},
|
||||
"net472": {
|
||||
"targetAlias": "net472",
|
||||
"projectReferences": {}
|
||||
},
|
||||
"netstandard2.0": {
|
||||
"targetAlias": "netstandard2.0",
|
||||
"projectReferences": {}
|
||||
}
|
||||
},
|
||||
"warningProperties": {
|
||||
"warnAsError": [
|
||||
"NU1605"
|
||||
]
|
||||
}
|
||||
},
|
||||
"frameworks": {
|
||||
"net6.0": {
|
||||
"targetAlias": "net6.0",
|
||||
"dependencies": {
|
||||
"Microsoft.CSharp": {
|
||||
"target": "Package",
|
||||
"version": "[4.7.0, )"
|
||||
},
|
||||
"System.Data.Common": {
|
||||
"target": "Package",
|
||||
"version": "[4.3.0, )"
|
||||
}
|
||||
},
|
||||
"imports": [
|
||||
"net461",
|
||||
"net462",
|
||||
"net47",
|
||||
"net471",
|
||||
"net472",
|
||||
"net48"
|
||||
],
|
||||
"assetTargetFallback": true,
|
||||
"warn": true,
|
||||
"frameworkReferences": {
|
||||
"Microsoft.NETCore.App": {
|
||||
"privateAssets": "all"
|
||||
}
|
||||
},
|
||||
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\6.0.201\\RuntimeIdentifierGraph.json"
|
||||
},
|
||||
"net472": {
|
||||
"targetAlias": "net472",
|
||||
"dependencies": {
|
||||
"Microsoft.CSharp": {
|
||||
"target": "Package",
|
||||
"version": "[4.7.0, )"
|
||||
},
|
||||
"System.Data.Common": {
|
||||
"target": "Package",
|
||||
"version": "[4.3.0, )"
|
||||
}
|
||||
},
|
||||
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\6.0.201\\RuntimeIdentifierGraph.json"
|
||||
},
|
||||
"netstandard2.0": {
|
||||
"targetAlias": "netstandard2.0",
|
||||
"dependencies": {
|
||||
"Microsoft.CSharp": {
|
||||
"target": "Package",
|
||||
"version": "[4.7.0, )"
|
||||
},
|
||||
"NETStandard.Library": {
|
||||
"suppressParent": "All",
|
||||
"target": "Package",
|
||||
"version": "[2.0.3, )",
|
||||
"autoReferenced": true
|
||||
},
|
||||
"System.Data.Common": {
|
||||
"target": "Package",
|
||||
"version": "[4.3.0, )"
|
||||
}
|
||||
},
|
||||
"imports": [
|
||||
"net461",
|
||||
"net462",
|
||||
"net47",
|
||||
"net471",
|
||||
"net472",
|
||||
"net48"
|
||||
],
|
||||
"assetTargetFallback": true,
|
||||
"warn": true,
|
||||
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\6.0.201\\RuntimeIdentifierGraph.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
23
DynamORM.Tests/obj/DynamORM.Tests.csproj.nuget.g.props
Normal file
23
DynamORM.Tests/obj/DynamORM.Tests.csproj.nuget.g.props
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
|
||||
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
|
||||
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
|
||||
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
|
||||
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\gruss\.nuget\packages\;C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages</NuGetPackageFolders>
|
||||
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
|
||||
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.1.0</NuGetToolVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||
<SourceRoot Include="C:\Users\gruss\.nuget\packages\" />
|
||||
<SourceRoot Include="C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages\" />
|
||||
</ItemGroup>
|
||||
<ImportGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||
<Import Project="$(NuGetPackageRoot)mstest.testadapter\2.0.0-beta4\build\net45\MSTest.TestAdapter.props" Condition="Exists('$(NuGetPackageRoot)mstest.testadapter\2.0.0-beta4\build\net45\MSTest.TestAdapter.props')" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||
<PkgEntityFramework Condition=" '$(PkgEntityFramework)' == '' ">C:\Users\gruss\.nuget\packages\entityframework\6.2.0</PkgEntityFramework>
|
||||
<PkgSystem_Data_SQLite_EF6 Condition=" '$(PkgSystem_Data_SQLite_EF6)' == '' ">C:\Users\gruss\.nuget\packages\system.data.sqlite.ef6\1.0.111</PkgSystem_Data_SQLite_EF6>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
7
DynamORM.Tests/obj/DynamORM.Tests.csproj.nuget.g.targets
Normal file
7
DynamORM.Tests/obj/DynamORM.Tests.csproj.nuget.g.targets
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ImportGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||
<Import Project="$(NuGetPackageRoot)system.data.sqlite.core\1.0.111\build\net46\System.Data.SQLite.Core.targets" Condition="Exists('$(NuGetPackageRoot)system.data.sqlite.core\1.0.111\build\net46\System.Data.SQLite.Core.targets')" />
|
||||
<Import Project="$(NuGetPackageRoot)mstest.testadapter\2.0.0-beta4\build\net45\MSTest.TestAdapter.targets" Condition="Exists('$(NuGetPackageRoot)mstest.testadapter\2.0.0-beta4\build\net45\MSTest.TestAdapter.targets')" />
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
1002
DynamORM.Tests/obj/project.assets.json
Normal file
1002
DynamORM.Tests/obj/project.assets.json
Normal file
File diff suppressed because it is too large
Load Diff
18
DynamORM.Tests/obj/project.nuget.cache
Normal file
18
DynamORM.Tests/obj/project.nuget.cache
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"version": 2,
|
||||
"dgSpecHash": "rAFgnQ0ruwj6gTzn4dYezodFcNf5+kCOxLq8HTYaz7PuF0I0Uc4bTWz4d/BjGTmeTByLE/ZMDAWkH2yJJcIImQ==",
|
||||
"success": true,
|
||||
"projectFilePath": "D:\\Source\\.NET\\DynamORM\\DynamORM.Tests\\DynamORM.Tests.csproj",
|
||||
"expectedPackageFiles": [
|
||||
"C:\\Users\\gruss\\.nuget\\packages\\entityframework\\6.2.0\\entityframework.6.2.0.nupkg.sha512",
|
||||
"C:\\Users\\gruss\\.nuget\\packages\\microsoft.csharp\\4.7.0\\microsoft.csharp.4.7.0.nupkg.sha512",
|
||||
"C:\\Users\\gruss\\.nuget\\packages\\mstest.testadapter\\2.0.0-beta4\\mstest.testadapter.2.0.0-beta4.nupkg.sha512",
|
||||
"C:\\Users\\gruss\\.nuget\\packages\\mstest.testframework\\2.0.0-beta4\\mstest.testframework.2.0.0-beta4.nupkg.sha512",
|
||||
"C:\\Users\\gruss\\.nuget\\packages\\system.data.common\\4.3.0\\system.data.common.4.3.0.nupkg.sha512",
|
||||
"C:\\Users\\gruss\\.nuget\\packages\\system.data.sqlite\\1.0.111\\system.data.sqlite.1.0.111.nupkg.sha512",
|
||||
"C:\\Users\\gruss\\.nuget\\packages\\system.data.sqlite.core\\1.0.111\\system.data.sqlite.core.1.0.111.nupkg.sha512",
|
||||
"C:\\Users\\gruss\\.nuget\\packages\\system.data.sqlite.ef6\\1.0.111\\system.data.sqlite.ef6.1.0.111.nupkg.sha512",
|
||||
"C:\\Users\\gruss\\.nuget\\packages\\system.data.sqlite.linq\\1.0.111\\system.data.sqlite.linq.1.0.111.nupkg.sha512"
|
||||
],
|
||||
"logs": []
|
||||
}
|
||||
50
DynamORM.sln
50
DynamORM.sln
@@ -1,13 +1,15 @@
|
||||
|
||||
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}"
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.0.31903.59
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DynamORM", "DynamORM\DynamORM.csproj", "{63963ED7-9C78-4672-A4D4-339B6E825503}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DynamORM.Tests", "DynamORM.Tests\DynamORM.Tests.csproj", "{D5013B4E-8A1B-4DBB-8FB5-E09935F4F764}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AmalgamationTool", "AmalgamationTool\AmalgamationTool.csproj", "{A64D2052-D0CD-488E-BF05-E5952615D926}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tester", "Tester\Tester.csproj", "{F747AA57-BEA7-4FB8-B371-546296789AEF}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tester", "Tester\Tester.csproj", "{F747AA57-BEA7-4FB8-B371-546296789AEF}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
@@ -29,6 +31,16 @@ Global
|
||||
{63963ED7-9C78-4672-A4D4-339B6E825503}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{63963ED7-9C78-4672-A4D4-339B6E825503}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{63963ED7-9C78-4672-A4D4-339B6E825503}.Release|x86.ActiveCfg = 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}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{D5013B4E-8A1B-4DBB-8FB5-E09935F4F764}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{D5013B4E-8A1B-4DBB-8FB5-E09935F4F764}.Debug|x86.ActiveCfg = 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
|
||||
{D5013B4E-8A1B-4DBB-8FB5-E09935F4F764}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{D5013B4E-8A1B-4DBB-8FB5-E09935F4F764}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{D5013B4E-8A1B-4DBB-8FB5-E09935F4F764}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{A64D2052-D0CD-488E-BF05-E5952615D926}.Debug|Any CPU.ActiveCfg = Debug|x86
|
||||
{A64D2052-D0CD-488E-BF05-E5952615D926}.Debug|Any CPU.Build.0 = Debug|x86
|
||||
{A64D2052-D0CD-488E-BF05-E5952615D926}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
|
||||
@@ -41,31 +53,25 @@ Global
|
||||
{A64D2052-D0CD-488E-BF05-E5952615D926}.Release|Mixed Platforms.Build.0 = Release|x86
|
||||
{A64D2052-D0CD-488E-BF05-E5952615D926}.Release|x86.ActiveCfg = Release|x86
|
||||
{A64D2052-D0CD-488E-BF05-E5952615D926}.Release|x86.Build.0 = Release|x86
|
||||
{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}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{D5013B4E-8A1B-4DBB-8FB5-E09935F4F764}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{D5013B4E-8A1B-4DBB-8FB5-E09935F4F764}.Debug|x86.ActiveCfg = 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
|
||||
{D5013B4E-8A1B-4DBB-8FB5-E09935F4F764}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{D5013B4E-8A1B-4DBB-8FB5-E09935F4F764}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{D5013B4E-8A1B-4DBB-8FB5-E09935F4F764}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{F747AA57-BEA7-4FB8-B371-546296789AEF}.Debug|Any CPU.ActiveCfg = Debug|x86
|
||||
{F747AA57-BEA7-4FB8-B371-546296789AEF}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
|
||||
{F747AA57-BEA7-4FB8-B371-546296789AEF}.Debug|Mixed Platforms.Build.0 = Debug|x86
|
||||
{F747AA57-BEA7-4FB8-B371-546296789AEF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{F747AA57-BEA7-4FB8-B371-546296789AEF}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{F747AA57-BEA7-4FB8-B371-546296789AEF}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{F747AA57-BEA7-4FB8-B371-546296789AEF}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{F747AA57-BEA7-4FB8-B371-546296789AEF}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{F747AA57-BEA7-4FB8-B371-546296789AEF}.Debug|x86.Build.0 = Debug|x86
|
||||
{F747AA57-BEA7-4FB8-B371-546296789AEF}.Release|Any CPU.ActiveCfg = Release|x86
|
||||
{F747AA57-BEA7-4FB8-B371-546296789AEF}.Release|Mixed Platforms.ActiveCfg = Release|x86
|
||||
{F747AA57-BEA7-4FB8-B371-546296789AEF}.Release|Mixed Platforms.Build.0 = Release|x86
|
||||
{F747AA57-BEA7-4FB8-B371-546296789AEF}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{F747AA57-BEA7-4FB8-B371-546296789AEF}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{F747AA57-BEA7-4FB8-B371-546296789AEF}.Release|x86.ActiveCfg = Release|x86
|
||||
{F747AA57-BEA7-4FB8-B371-546296789AEF}.Release|x86.Build.0 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(MonoDevelopProperties) = preSolution
|
||||
StartupItem = Tester\Tester.csproj
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {22781EB3-2148-4CA4-845A-B55265A7B5C2}
|
||||
EndGlobalSection
|
||||
GlobalSection(MonoDevelopProperties) = preSolution
|
||||
StartupItem = Tester\Tester.csproj
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
||||
@@ -43,6 +43,9 @@ namespace DynamORM.Builders
|
||||
/// <summary>Gets table alias.</summary>
|
||||
string Alias { get; }
|
||||
|
||||
/// <summary>Gets table no lock status.</summary>
|
||||
bool NoLock { get; }
|
||||
|
||||
/// <summary>Gets table schema.</summary>
|
||||
Dictionary<string, DynamicSchemaColumn> Schema { get; }
|
||||
}
|
||||
|
||||
@@ -86,12 +86,14 @@ namespace DynamORM.Builders.Implementation
|
||||
/// <param name="name">The name of table.</param>
|
||||
/// <param name="alias">The table alias.</param>
|
||||
/// <param name="owner">The table owner.</param>
|
||||
public TableInfo(DynamicDatabase db, string name, string alias = null, string owner = null)
|
||||
/// <param name="nolock">The table should be used with nolock.</param>
|
||||
public TableInfo(DynamicDatabase db, string name, string alias = null, string owner = null, bool nolock = false)
|
||||
: this()
|
||||
{
|
||||
Name = name;
|
||||
Alias = alias;
|
||||
Owner = owner;
|
||||
NoLock = nolock;
|
||||
|
||||
if (!name.ContainsAny(StringExtensions.InvalidMemberChars))
|
||||
Schema = db.GetSchema(name, owner: owner);
|
||||
@@ -104,7 +106,8 @@ namespace DynamORM.Builders.Implementation
|
||||
/// <param name="type">The type which can be mapped to database.</param>
|
||||
/// <param name="alias">The table alias.</param>
|
||||
/// <param name="owner">The table owner.</param>
|
||||
public TableInfo(DynamicDatabase db, Type type, string alias = null, string owner = null)
|
||||
/// <param name="nolock">The table should be used with nolock.</param>
|
||||
public TableInfo(DynamicDatabase db, Type type, string alias = null, string owner = null, bool nolock = false)
|
||||
: this()
|
||||
{
|
||||
DynamicTypeMap mapper = DynamicMapperCache.GetMapper(type);
|
||||
@@ -114,6 +117,7 @@ namespace DynamORM.Builders.Implementation
|
||||
|
||||
Owner = (mapper.Table != null) ? mapper.Table.Owner : owner;
|
||||
Alias = alias;
|
||||
NoLock = nolock;
|
||||
|
||||
Schema = db.GetSchema(type);
|
||||
}
|
||||
@@ -127,6 +131,9 @@ namespace DynamORM.Builders.Implementation
|
||||
/// <summary>Gets or sets table alias.</summary>
|
||||
public string Alias { get; internal set; }
|
||||
|
||||
/// <summary>Gets or sets table alias.</summary>
|
||||
public bool NoLock { get; internal set; }
|
||||
|
||||
/// <summary>Gets or sets table schema.</summary>
|
||||
public Dictionary<string, DynamicSchemaColumn> Schema { get; internal set; }
|
||||
|
||||
@@ -139,8 +146,8 @@ namespace DynamORM.Builders.Implementation
|
||||
{
|
||||
IsDisposed = true;
|
||||
|
||||
if (Schema != null)
|
||||
Schema.Clear();
|
||||
////if (Schema != null)
|
||||
//// Schema.Clear();
|
||||
|
||||
Owner = Name = Alias = null;
|
||||
Schema = null;
|
||||
@@ -235,6 +242,7 @@ namespace DynamORM.Builders.Implementation
|
||||
Database.AddToCache(this);
|
||||
|
||||
SupportSchema = (db.Options & DynamicDatabaseOptions.SupportSchema) == DynamicDatabaseOptions.SupportSchema;
|
||||
SupportNoLock = (db.Options & DynamicDatabaseOptions.SupportNoLock) == DynamicDatabaseOptions.SupportNoLock;
|
||||
}
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="DynamicQueryBuilder"/> class.</summary>
|
||||
@@ -283,6 +291,9 @@ namespace DynamORM.Builders.Implementation
|
||||
/// <summary>Gets a value indicating whether database supports standard schema.</summary>
|
||||
public bool SupportSchema { get; private set; }
|
||||
|
||||
/// <summary>Gets a value indicating whether database supports with no lock syntax.</summary>
|
||||
public bool SupportNoLock { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Generates the text this command will execute against the underlying database.
|
||||
/// </summary>
|
||||
@@ -725,6 +736,15 @@ namespace DynamORM.Builders.Implementation
|
||||
item = item.Validated("Alias"); // Intercepting null and empty aliases
|
||||
return string.Format("{0} AS {1}", parent, item);
|
||||
|
||||
case "NOLOCK":
|
||||
if (!SupportNoLock)
|
||||
return parent;
|
||||
|
||||
if (node.Arguments != null && node.Arguments.Length > 1)
|
||||
throw new ArgumentException("NOLOCK method expects no arguments.");
|
||||
|
||||
return string.Format("{0} {1}", parent, "WITH(NOLOCK)");
|
||||
|
||||
case "COUNT":
|
||||
if (node.Arguments != null && node.Arguments.Length > 1)
|
||||
throw new ArgumentException("COUNT method expects one or none argument: " + node.Arguments.Sketch());
|
||||
|
||||
@@ -346,6 +346,7 @@ namespace DynamORM.Builders.Implementation
|
||||
string owner = null;
|
||||
string main = null;
|
||||
string alias = null;
|
||||
bool nolock = false;
|
||||
Type type = null;
|
||||
|
||||
while (true)
|
||||
@@ -369,6 +370,20 @@ namespace DynamORM.Builders.Implementation
|
||||
node = node.Host;
|
||||
continue;
|
||||
}
|
||||
|
||||
// Support for the NoLock() virtual method...
|
||||
if (node is DynamicParser.Node.Method && ((DynamicParser.Node.Method)node).Name.ToUpper() == "NOLOCK")
|
||||
{
|
||||
object[] args = ((DynamicParser.Node.Method)node).Arguments;
|
||||
|
||||
if (args != null && args.Length > 0)
|
||||
throw new ArgumentNullException("arg", "NoLock() doesn't support arguments.");
|
||||
|
||||
nolock = true;
|
||||
|
||||
node = node.Host;
|
||||
continue;
|
||||
}
|
||||
|
||||
/*if (node is DynamicParser.Node.Method && ((DynamicParser.Node.Method)node).Name.ToUpper() == "subquery")
|
||||
{
|
||||
@@ -439,7 +454,7 @@ namespace DynamORM.Builders.Implementation
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(main))
|
||||
tableInfo = type == null ? new TableInfo(Database, main, alias, owner) : new TableInfo(Database, type, alias, owner);
|
||||
tableInfo = type == null ? new TableInfo(Database, main, alias, owner, nolock) : new TableInfo(Database, type, alias, owner, nolock);
|
||||
else
|
||||
throw new ArgumentException(string.Format("Specification #{0} is invalid: {1}", index, result));
|
||||
}
|
||||
@@ -461,6 +476,9 @@ namespace DynamORM.Builders.Implementation
|
||||
if (!string.IsNullOrEmpty(tableInfo.Alias))
|
||||
sb.AppendFormat(" AS {0}", tableInfo.Alias);
|
||||
|
||||
if (SupportNoLock && tableInfo.NoLock)
|
||||
sb.AppendFormat(" WITH(NOLOCK)");
|
||||
|
||||
_from = string.IsNullOrEmpty(_from) ? sb.ToString() : string.Format("{0}, {1}", _from, sb.ToString());
|
||||
}
|
||||
|
||||
@@ -530,6 +548,7 @@ namespace DynamORM.Builders.Implementation
|
||||
string owner = null;
|
||||
string alias = null;
|
||||
string condition = null;
|
||||
bool nolock = false;
|
||||
Type tableType = null;
|
||||
|
||||
// If the expression resolves to a string...
|
||||
@@ -607,6 +626,20 @@ namespace DynamORM.Builders.Implementation
|
||||
continue;
|
||||
}
|
||||
|
||||
// Support for the NoLock() virtual method...
|
||||
if (node is DynamicParser.Node.Method && ((DynamicParser.Node.Method)node).Name.ToUpper() == "NOLOCK")
|
||||
{
|
||||
object[] args = ((DynamicParser.Node.Method)node).Arguments;
|
||||
|
||||
if (args != null && args.Length > 0)
|
||||
throw new ArgumentNullException("arg", "NoLock() doesn't support arguments.");
|
||||
|
||||
nolock = true;
|
||||
|
||||
node = node.Host;
|
||||
continue;
|
||||
}
|
||||
|
||||
// Support for table specifications...
|
||||
if (node is DynamicParser.Node.GetMember)
|
||||
{
|
||||
@@ -718,7 +751,7 @@ namespace DynamORM.Builders.Implementation
|
||||
if (justAddTables)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(main))
|
||||
tableInfo = tableType == null ? new TableInfo(Database, main, alias, owner) : new TableInfo(Database, tableType, alias, owner);
|
||||
tableInfo = tableType == null ? new TableInfo(Database, main, alias, owner, nolock) : new TableInfo(Database, tableType, alias, owner, nolock);
|
||||
else
|
||||
throw new ArgumentException(string.Format("Specification #{0} is invalid: {1}", index, result));
|
||||
|
||||
@@ -746,6 +779,9 @@ namespace DynamORM.Builders.Implementation
|
||||
if (!string.IsNullOrEmpty(tableInfo.Alias))
|
||||
sb.AppendFormat(" AS {0}", tableInfo.Alias);
|
||||
|
||||
if (SupportNoLock && tableInfo.NoLock)
|
||||
sb.AppendFormat(" WITH(NOLOCK)");
|
||||
|
||||
if (!string.IsNullOrEmpty(condition))
|
||||
sb.AppendFormat(" ON {0}", condition);
|
||||
|
||||
|
||||
@@ -1,129 +1,29 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>8.0.30703</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{63963ED7-9C78-4672-A4D4-339B6E825503}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>DynamORM</RootNamespace>
|
||||
<AssemblyName>DynamORM</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<TargetFrameworkProfile />
|
||||
<SignAssembly>False</SignAssembly>
|
||||
<DelaySign>False</DelaySign>
|
||||
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
|
||||
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
|
||||
<NoStdLib>False</NoStdLib>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<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>
|
||||
</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>
|
||||
</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" />
|
||||
<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>
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netstandard2.0;net472;net6.0;net7.0;net8.0</TargetFrameworks>
|
||||
<Description>Dynamic Object-Relational Mapping library.</Description>
|
||||
<Copyright>Copyright © RUSSEK Software 2012-2023</Copyright>
|
||||
<Company>RUSSEK Software</Company>
|
||||
<Authors>Grzegorz Russek</Authors>
|
||||
<VersionPrefix>1.5</VersionPrefix>
|
||||
<RepositoryUrl>https://git.dr4cul4.pl/RUSSEK-Software/DynamORM</RepositoryUrl>
|
||||
<PackageProjectUrl>https://dr4cul4.pl</PackageProjectUrl>
|
||||
<Product>DynamORM</Product>
|
||||
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<IncludeSymbols>true</IncludeSymbols>
|
||||
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
|
||||
<PackageReference Include="System.Data.Common" Version="4.3.0" />
|
||||
</ItemGroup>
|
||||
<ItemGroup Condition="$(TargetFramework.StartsWith('net4')) AND '$(MSBuildRuntimeType)' == 'Core' AND '$(OS)' != 'Windows_NT'">
|
||||
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" PrivateAssets="All" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -4,6 +4,7 @@ using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Dynamic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using DynamORM.Helpers;
|
||||
using DynamORM.Mapper;
|
||||
|
||||
@@ -43,6 +44,95 @@ namespace DynamORM
|
||||
|
||||
#region Helpers
|
||||
|
||||
/// <summary>Create data reader from dynamic enumerable.</summary>
|
||||
/// <param name="objects">List of objects.</param>
|
||||
/// <returns>Instance of <see cref="DynamicCachedReader"/> containing objects data.</returns>
|
||||
public static DynamicCachedReader FromDynamicEnumerable(IEnumerable<dynamic> objects)
|
||||
{
|
||||
var first = (objects as IEnumerable<dynamic>).FirstOrDefault();
|
||||
|
||||
if (first == null)
|
||||
return null;
|
||||
|
||||
var firstDict = first as IDictionary<string, object>;
|
||||
var r = new DynamicCachedReader();
|
||||
r.Init(firstDict.Keys.Count);
|
||||
|
||||
for (int i = 0; i < firstDict.Keys.Count; i++)
|
||||
r._types.Add(null);
|
||||
|
||||
foreach (dynamic elem in (objects as IEnumerable<dynamic>))
|
||||
{
|
||||
int c = 0;
|
||||
var dict = elem as IDictionary<string, object>;
|
||||
|
||||
foreach (var k in firstDict.Keys)
|
||||
{
|
||||
object val = dict[k];
|
||||
|
||||
r._cache.Add(val);
|
||||
|
||||
if (r._types[c] == null && val != null)
|
||||
r._types[c] = val.GetType();
|
||||
|
||||
c++;
|
||||
}
|
||||
|
||||
r._rows++;
|
||||
}
|
||||
|
||||
for (int i = 0; i < firstDict.Keys.Count; i++)
|
||||
if (r._types[i] == null)
|
||||
r._types[i] = typeof(string);
|
||||
|
||||
r._schema = new DataTable("DYNAMIC");
|
||||
r._schema.Columns.Add(new DataColumn("ColumnName", typeof(string)));
|
||||
r._schema.Columns.Add(new DataColumn("ColumnOrdinal", typeof(int)));
|
||||
r._schema.Columns.Add(new DataColumn("ColumnSize", typeof(int)));
|
||||
r._schema.Columns.Add(new DataColumn("NumericPrecision", typeof(short)));
|
||||
r._schema.Columns.Add(new DataColumn("NumericScale", typeof(short)));
|
||||
r._schema.Columns.Add(new DataColumn("DataType", typeof(Type)));
|
||||
r._schema.Columns.Add(new DataColumn("ProviderType", typeof(int)));
|
||||
r._schema.Columns.Add(new DataColumn("NativeType", typeof(int)));
|
||||
r._schema.Columns.Add(new DataColumn("AllowDBNull", typeof(bool)));
|
||||
r._schema.Columns.Add(new DataColumn("IsUnique", typeof(bool)));
|
||||
r._schema.Columns.Add(new DataColumn("IsKey", typeof(bool)));
|
||||
r._schema.Columns.Add(new DataColumn("IsAutoIncrement", typeof(bool)));
|
||||
|
||||
int ordinal = 0;
|
||||
DataRow dr = null;
|
||||
|
||||
foreach (var column in firstDict.Keys)
|
||||
{
|
||||
dr = r._schema.NewRow();
|
||||
|
||||
dr[0] = column;
|
||||
dr[1] = ordinal;
|
||||
dr[2] = 0;
|
||||
dr[3] = 0;
|
||||
dr[4] = 0;
|
||||
dr[5] = r._types[ordinal];
|
||||
dr[6] = r._types[ordinal].ToDbType();
|
||||
dr[7] = r._types[ordinal].ToDbType();
|
||||
dr[8] = true;
|
||||
dr[9] = false;
|
||||
dr[10] = false;
|
||||
dr[11] = false;
|
||||
|
||||
r._schema.Rows.Add(dr);
|
||||
|
||||
r._names.Add(dr[0].ToString());
|
||||
r._ordinals.Add(dr[0].ToString().ToUpper(), ordinal++);
|
||||
r._types.Add((Type)dr[5]);
|
||||
|
||||
dr.AcceptChanges();
|
||||
}
|
||||
|
||||
dr.AcceptChanges();
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
/// <summary>Create data reader from enumerable.</summary>
|
||||
/// <typeparam name="T">Type of enumerated objects.</typeparam>
|
||||
/// <param name="objects">List of objects.</param>
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Text;
|
||||
|
||||
namespace DynamORM
|
||||
@@ -88,6 +89,7 @@ namespace DynamORM
|
||||
/// <summary>Initializes a new instance of the <see cref="DynamicColumn" /> class.</summary>
|
||||
public DynamicColumn()
|
||||
{
|
||||
ParameterDirection = ParameterDirection.Input;
|
||||
}
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="DynamicColumn" /> class.</summary>
|
||||
@@ -129,6 +131,9 @@ namespace DynamORM
|
||||
/// <summary>Gets or sets order direction.</summary>
|
||||
public SortOrder Order { get; set; }
|
||||
|
||||
/// <summary>Gets or sets parameter direction when used in procedure invocation.</summary>
|
||||
public ParameterDirection ParameterDirection { get; set; }
|
||||
|
||||
/// <summary>Gets or sets value for parameters.</summary>
|
||||
public object Value { get; set; }
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@ using System.Data;
|
||||
using System.Data.Common;
|
||||
using System.Dynamic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using DynamORM.Builders;
|
||||
using DynamORM.Builders.Extensions;
|
||||
@@ -121,6 +122,90 @@ namespace DynamORM
|
||||
public DbProviderFactory Provider { get { return _provider; } }
|
||||
|
||||
/// <summary>Gets the procedures invoker.</summary>
|
||||
/// <example>
|
||||
/// <code>
|
||||
/// using (var db = GetORM())
|
||||
/// {
|
||||
/// db.Execute(@"CREATE OR ALTER PROCEDURE sp_Exp_Scalar AS SELECT 42;");
|
||||
/// var res0 = db.Procedures.sp_Exp_Scalar();
|
||||
/// var res1 = db.Procedures.sp_Exp_Scalar<int>();
|
||||
///
|
||||
/// db.Execute(@"CREATE OR ALTER PROCEDURE sp_Exp_ReturnInt AS RETURN 42;");
|
||||
/// var res2 = db.Procedures.sp_Exp_ReturnInt();
|
||||
///
|
||||
/// db.Execute(@"CREATE OR ALTER PROCEDURE sp_Exp_SomeData AS
|
||||
/// SELECT 1 Id, 'Some Name 1' [Name], 'Some Desc 1' [Desc], GETDATE() [Date]
|
||||
/// UNION ALL SELECT 2 Id, 'Some Name 2', 'Some Desc 2', GETDATE() [Date];");
|
||||
/// var res3 = db.Procedures.sp_Exp_SomeData<sp_Exp_SomeData_Result>();
|
||||
/// var res4 = db.Procedures.sp_Exp_SomeData<List<sp_Exp_SomeData_Result>>();
|
||||
///
|
||||
/// db.Execute(@"CREATE OR ALTER PROCEDURE sp_Exp_SomeInputAndOutput
|
||||
/// @Name nvarchar(50),
|
||||
/// @Result nvarchar(256) OUTPUT
|
||||
/// AS
|
||||
/// SELECT @Result = 'Hi, ' + @Name + ' your lucky number is 42!';");
|
||||
/// var res5 = db.Procedures.sp_Exp_SomeInputAndOutput<string, sp_Exp_SomeInputAndOutput_Result>(Name: "G4g4r1n", out_Result: new DynamicColumn
|
||||
/// {
|
||||
/// Schema = new DynamicSchemaColumn
|
||||
/// {
|
||||
/// Size = 256,
|
||||
/// },
|
||||
/// }, ret_Return: 0);
|
||||
/// var res6 = db.Procedures.sp_Exp_SomeInputAndOutput<string, sp_Exp_SomeInputAndOutput_Result>(Name: "G4g4r1n", out_Result: new DynamicSchemaColumn
|
||||
/// {
|
||||
/// Size = 256,
|
||||
/// }, ret_Return: 0);
|
||||
///
|
||||
/// db.Execute(@"CREATE OR ALTER PROCEDURE sp_Exp_SomeInputAndOutputWithDataAndReturn
|
||||
/// @Name nvarchar(50),
|
||||
/// @Result nvarchar(256) OUTPUT
|
||||
/// AS
|
||||
/// SELECT @Result = 'Hi, ' + @Name + ' your lucky number is 42!'
|
||||
///
|
||||
/// SELECT 1 Id, 'Some Name 1' [Name], 'Some Desc 1' [Desc], GETDATE() [Date]
|
||||
/// UNION ALL SELECT 2 Id, 'Some Name 2', 'Some Desc 2', GETDATE() [Date]
|
||||
///
|
||||
/// RETURN 42;");
|
||||
/// var res7 = db.Procedures.sp_Exp_SomeInputAndOutputWithDataAndReturn<List<sp_Exp_SomeInputAndOutputWithDataAndReturn_Result.Data>, sp_Exp_SomeInputAndOutputWithDataAndReturn_Result>(Name: "G4g4r1n", out_Result: new DynamicColumn
|
||||
/// {
|
||||
/// Schema = new DynamicSchemaColumn
|
||||
/// {
|
||||
/// Size = 256,
|
||||
/// },
|
||||
/// }, ret_Return: 0);
|
||||
/// var res8 = db.Procedures.sp_Exp_SomeInputAndOutputWithDataAndReturn<List<sp_Exp_SomeInputAndOutputWithDataAndReturn_Result.Data>, sp_Exp_SomeInputAndOutputWithDataAndReturn_Result>(Name: "G4g4r1n", out_Result: new DynamicSchemaColumn
|
||||
/// {
|
||||
/// Size = 256,
|
||||
/// }, ret_Return: 0);
|
||||
/// }
|
||||
///
|
||||
///private class sp_Exp_SomeData_Result
|
||||
///{
|
||||
/// public virtual int Id { get; set; }
|
||||
/// public virtual string Name { get; set; }
|
||||
/// public virtual string Desc { get; set; }
|
||||
/// public virtual DateTime Date { get; set; }
|
||||
///}
|
||||
///private class sp_Exp_SomeInputAndOutput_Result
|
||||
///{
|
||||
/// public virtual string Result { get; set; }
|
||||
/// public virtual string Return { get; set; }
|
||||
///}
|
||||
///private class sp_Exp_SomeInputAndOutputWithDataAndReturn_Result
|
||||
///{
|
||||
/// public class Data
|
||||
/// {
|
||||
/// public virtual int Id { get; set; }
|
||||
/// public virtual string Name { get; set; }
|
||||
/// public virtual string Desc { get; set; }
|
||||
/// public virtual DateTime Date { get; set; }
|
||||
/// }
|
||||
/// public virtual List<Data> sp_Exp_SomeInputAndOutputWithDataAndReturn { get; set; }
|
||||
/// public virtual string Result { get; set; }
|
||||
/// public virtual string Return { get; set; }
|
||||
///}
|
||||
/// </code>
|
||||
/// </example>
|
||||
public dynamic Procedures
|
||||
{
|
||||
get
|
||||
@@ -128,7 +213,7 @@ namespace DynamORM
|
||||
if (_proc == null)
|
||||
{
|
||||
if ((Options & DynamicDatabaseOptions.SupportStoredProcedures) != DynamicDatabaseOptions.SupportStoredProcedures)
|
||||
throw new InvalidOperationException("Database connection desn't support stored procedures.");
|
||||
throw new InvalidOperationException("Database connection doesn't support stored procedures.");
|
||||
|
||||
_proc = new DynamicProcedureInvoker(this);
|
||||
}
|
||||
@@ -145,6 +230,8 @@ namespace DynamORM
|
||||
/// <value>The dump command delegate.</value>
|
||||
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>
|
||||
/// <param name="provider">Database provider by name.</param>
|
||||
/// <param name="connectionString">Connection string to provided database.</param>
|
||||
@@ -153,6 +240,7 @@ namespace DynamORM
|
||||
: this(DbProviderFactories.GetFactory(provider), connectionString, options)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="DynamicDatabase" /> class.</summary>
|
||||
/// <param name="provider">Database provider.</param>
|
||||
@@ -166,19 +254,61 @@ namespace DynamORM
|
||||
InitCommon(connectionString, options);
|
||||
}
|
||||
|
||||
private DbProviderFactory FindDbProviderFactoryFromConnection(Type t)
|
||||
{
|
||||
foreach (var type in t.Assembly.GetTypes().Where(x => x.IsSubclassOf(typeof(DbProviderFactory))))
|
||||
{
|
||||
DbProviderFactory provider = null;
|
||||
bool dispose = false;
|
||||
|
||||
var pi = type.GetProperty("Instance", BindingFlags.Static | BindingFlags.Public | BindingFlags.GetProperty);
|
||||
if (pi != null)
|
||||
provider = (DbProviderFactory)pi.GetValue(null, null);
|
||||
else
|
||||
{
|
||||
var fi = type.GetField("Instance", BindingFlags.Static | BindingFlags.Public | BindingFlags.GetField);
|
||||
if (fi != null)
|
||||
provider = (DbProviderFactory)fi.GetValue(null);
|
||||
}
|
||||
|
||||
if (provider == null)
|
||||
{
|
||||
var ci = type.GetConstructor(Type.EmptyTypes);
|
||||
if (ci != null)
|
||||
{
|
||||
provider = ci.Invoke(null) as DbProviderFactory;
|
||||
dispose = true;
|
||||
}
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
if (provider != null)
|
||||
{
|
||||
using (var c = provider.CreateConnection())
|
||||
{
|
||||
if (c.GetType() == t)
|
||||
return provider;
|
||||
}
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (provider != null && dispose && provider is IDisposable)
|
||||
((IDisposable)provider).Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="DynamicDatabase" /> class.</summary>
|
||||
/// <param name="connection">Active database connection.</param>
|
||||
/// <param name="options">Connection options. <see cref="DynamicDatabaseOptions.SingleConnection"/> required.</param>
|
||||
public DynamicDatabase(IDbConnection connection, DynamicDatabaseOptions options)
|
||||
{
|
||||
// Try to find correct provider if possible
|
||||
Type t = connection.GetType();
|
||||
if (t == typeof(System.Data.SqlClient.SqlConnection))
|
||||
_provider = System.Data.SqlClient.SqlClientFactory.Instance;
|
||||
else if (t == typeof(System.Data.Odbc.OdbcConnection))
|
||||
_provider = System.Data.Odbc.OdbcFactory.Instance;
|
||||
else if (t == typeof(System.Data.OleDb.OleDbConnection))
|
||||
_provider = System.Data.OleDb.OleDbFactory.Instance;
|
||||
_provider = FindDbProviderFactoryFromConnection(connection.GetType());
|
||||
|
||||
IsDisposed = false;
|
||||
InitCommon(connection.ConnectionString, options);
|
||||
@@ -1264,6 +1394,44 @@ namespace DynamORM
|
||||
|
||||
#endregion Query
|
||||
|
||||
#region CachedQuery
|
||||
|
||||
/// <summary>Enumerate the reader and yield the result.</summary>
|
||||
/// <param name="sql">SQL query containing numbered parameters in format provided by
|
||||
/// <see cref="DynamicDatabase.GetParameterName(object)"/> methods. Also names should be formatted with
|
||||
/// <see cref="DynamicDatabase.DecorateName(string)"/> method.</param>
|
||||
/// <param name="args">Arguments (parameters).</param>
|
||||
/// <returns>Enumerator of objects expanded from query.</returns>
|
||||
public virtual DynamicCachedReader CachedQuery(string sql, params object[] args)
|
||||
{
|
||||
using (IDbConnection con = Open())
|
||||
using (IDbCommand cmd = con.CreateCommand())
|
||||
{
|
||||
using (IDataReader rdr = cmd
|
||||
.SetCommand(sql)
|
||||
.AddParameters(this, args)
|
||||
.ExecuteReader())
|
||||
return new DynamicCachedReader(rdr);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Enumerate the reader and yield the result.</summary>
|
||||
/// <param name="builder">Command builder.</param>
|
||||
/// <returns>Enumerator of objects expanded from query.</returns>
|
||||
public virtual DynamicCachedReader CachedQuery(IDynamicQueryBuilder builder)
|
||||
{
|
||||
using (IDbConnection con = Open())
|
||||
using (IDbCommand cmd = con.CreateCommand())
|
||||
{
|
||||
using (IDataReader rdr = cmd
|
||||
.SetCommand(builder)
|
||||
.ExecuteReader())
|
||||
return new DynamicCachedReader(rdr);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Query
|
||||
|
||||
#region Schema
|
||||
|
||||
/// <summary>Builds query cache if necessary and returns it.</summary>
|
||||
@@ -1407,7 +1575,7 @@ namespace DynamORM
|
||||
/// <param name="cmd">Command containing query to execute.</param>
|
||||
/// <returns>List of <see cref="DynamicSchemaColumn"/> objects .
|
||||
/// If your database doesn't get those values in upper case (like most of the databases) you should override this method.</returns>
|
||||
protected virtual IEnumerable<DynamicSchemaColumn> ReadSchema(IDbCommand cmd)
|
||||
public virtual IEnumerable<DynamicSchemaColumn> ReadSchema(IDbCommand cmd)
|
||||
{
|
||||
DataTable st = null;
|
||||
|
||||
@@ -1441,7 +1609,7 @@ namespace DynamORM
|
||||
Type type = (Type)schema.DATATYPE;
|
||||
|
||||
// Small hack for SQL Server Provider
|
||||
if (type == typeof(string) && Provider != null && Provider.GetType() == typeof(System.Data.SqlClient.SqlClientFactory))
|
||||
if (type == typeof(string) && Provider != null && Provider.GetType().Name == "SqlClientFactory")
|
||||
{
|
||||
var map = schema as IDictionary<string, object>;
|
||||
string typeName = (map.TryGetValue("DATATYPENAME") ?? string.Empty).ToString();
|
||||
@@ -1481,7 +1649,7 @@ namespace DynamORM
|
||||
{
|
||||
schema = ReadSchema(tableName, owner)
|
||||
.Where(x => x.Name != null)
|
||||
.DistinctBy(x => x.Name)
|
||||
.DistinctBy(x => x.Name.ToLower())
|
||||
.ToDictionary(k => k.Name.ToLower(), k => k);
|
||||
|
||||
Schema[tableName.ToLower()] = schema;
|
||||
|
||||
@@ -59,6 +59,9 @@ namespace DynamORM
|
||||
/// <summary>Database support stored procedures (EXEC procedure ...).</summary>
|
||||
SupportStoredProcedures = 0x00000100,
|
||||
|
||||
/// <summary>Database support with no lock syntax.</summary>
|
||||
SupportNoLock = 0x00001000,
|
||||
|
||||
/// <summary>Debug option allowing to enable command dumps by default.</summary>
|
||||
DumpCommands = 0x01000000,
|
||||
}
|
||||
|
||||
@@ -1014,7 +1014,7 @@ namespace DynamORM
|
||||
public static List<dynamic> ToList(this IDataReader r)
|
||||
{
|
||||
List<dynamic> result = new List<dynamic>();
|
||||
|
||||
|
||||
while (r.Read())
|
||||
result.Add(r.RowToDynamic());
|
||||
|
||||
@@ -1554,7 +1554,7 @@ namespace DynamORM
|
||||
if (mapper == null)
|
||||
throw new InvalidOperationException("Type can't be mapped for unknown reason.");
|
||||
|
||||
mapper.Map(item, source);
|
||||
mapper.Map(source, item);
|
||||
|
||||
return item;
|
||||
}
|
||||
@@ -1571,7 +1571,7 @@ namespace DynamORM
|
||||
if (mapper == null)
|
||||
throw new InvalidOperationException("Type can't be mapped for unknown reason.");
|
||||
|
||||
mapper.MapByProperty(item, source);
|
||||
mapper.MapByProperty(source, item);
|
||||
|
||||
return item;
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Dynamic;
|
||||
using System.Linq;
|
||||
@@ -105,6 +106,8 @@ namespace DynamORM
|
||||
#region Prepare arguments
|
||||
|
||||
int alen = args.Length;
|
||||
bool retIsAdded = false;
|
||||
|
||||
if (alen > 0)
|
||||
{
|
||||
for (int i = 0; i < alen; i++)
|
||||
@@ -115,6 +118,113 @@ namespace DynamORM
|
||||
cmd.AddParameters(_db, (DynamicExpando)arg);
|
||||
else if (arg is ExpandoObject)
|
||||
cmd.AddParameters(_db, (ExpandoObject)arg);
|
||||
else if (arg is DynamicColumn)
|
||||
{
|
||||
var dcv = (DynamicColumn)arg;
|
||||
|
||||
string paramName = i.ToString();
|
||||
bool isOut = false;
|
||||
bool isRet = false;
|
||||
bool isBoth = false;
|
||||
|
||||
if (info.ArgumentNames.Count > i)
|
||||
{
|
||||
isOut = info.ArgumentNames[i].StartsWith("out_");
|
||||
isRet = info.ArgumentNames[i].StartsWith("ret_");
|
||||
isBoth = info.ArgumentNames[i].StartsWith("both_");
|
||||
|
||||
paramName = isOut || isRet ?
|
||||
info.ArgumentNames[i].Substring(4) :
|
||||
isBoth ? info.ArgumentNames[i].Substring(5) :
|
||||
info.ArgumentNames[i];
|
||||
}
|
||||
|
||||
paramName = dcv.Alias ?? dcv.ColumnName ??
|
||||
(dcv.Schema.HasValue ? dcv.Schema.Value.Name : null) ??
|
||||
paramName;
|
||||
|
||||
if (!isOut && !isRet && !isBoth)
|
||||
{
|
||||
isOut = dcv.ParameterDirection == ParameterDirection.Output;
|
||||
isRet = dcv.ParameterDirection == ParameterDirection.ReturnValue;
|
||||
isBoth = dcv.ParameterDirection == ParameterDirection.InputOutput;
|
||||
}
|
||||
|
||||
if (isRet)
|
||||
retIsAdded = true;
|
||||
|
||||
if (isOut || isRet || isBoth)
|
||||
{
|
||||
if (retParams == null)
|
||||
retParams = new Dictionary<string, int>();
|
||||
retParams.Add(paramName, cmd.Parameters.Count);
|
||||
}
|
||||
|
||||
if (dcv.Schema != null)
|
||||
{
|
||||
var ds = dcv.Schema.Value;
|
||||
cmd.AddParameter(
|
||||
_db.GetParameterName(paramName),
|
||||
isOut ? ParameterDirection.Output :
|
||||
isRet ? ParameterDirection.ReturnValue :
|
||||
isBoth ? ParameterDirection.InputOutput :
|
||||
ParameterDirection.Input,
|
||||
ds.Type, ds.Size, ds.Precision, ds.Scale,
|
||||
(isOut || isRet) ? DBNull.Value : dcv.Value);
|
||||
}
|
||||
else
|
||||
cmd.AddParameter(
|
||||
_db.GetParameterName(paramName),
|
||||
isOut ? ParameterDirection.Output :
|
||||
isRet ? ParameterDirection.ReturnValue :
|
||||
isBoth ? ParameterDirection.InputOutput :
|
||||
ParameterDirection.Input,
|
||||
arg == null ? DbType.String : arg.GetType().ToDbType(),
|
||||
isRet ? 4 : 0,
|
||||
(isOut || isRet) ? DBNull.Value : dcv.Value);
|
||||
}
|
||||
else if (arg is DynamicSchemaColumn)
|
||||
{
|
||||
var dsc = (DynamicSchemaColumn)arg;
|
||||
|
||||
string paramName = i.ToString();
|
||||
bool isOut = false;
|
||||
bool isRet = false;
|
||||
bool isBoth = false;
|
||||
|
||||
if (info.ArgumentNames.Count > i)
|
||||
{
|
||||
isOut = info.ArgumentNames[i].StartsWith("out_");
|
||||
isRet = info.ArgumentNames[i].StartsWith("ret_");
|
||||
isBoth = info.ArgumentNames[i].StartsWith("both_");
|
||||
|
||||
paramName = isOut || isRet ?
|
||||
info.ArgumentNames[i].Substring(4) :
|
||||
isBoth ? info.ArgumentNames[i].Substring(5) :
|
||||
info.ArgumentNames[i];
|
||||
}
|
||||
|
||||
paramName = dsc.Name ?? paramName;
|
||||
|
||||
if (isRet)
|
||||
retIsAdded = true;
|
||||
|
||||
if (isOut || isRet || isBoth)
|
||||
{
|
||||
if (retParams == null)
|
||||
retParams = new Dictionary<string, int>();
|
||||
retParams.Add(paramName, cmd.Parameters.Count);
|
||||
}
|
||||
|
||||
cmd.AddParameter(
|
||||
_db.GetParameterName(paramName),
|
||||
isOut ? ParameterDirection.Output :
|
||||
isRet ? ParameterDirection.ReturnValue :
|
||||
isBoth ? ParameterDirection.InputOutput :
|
||||
ParameterDirection.Input,
|
||||
dsc.Type, dsc.Size, dsc.Precision, dsc.Scale,
|
||||
DBNull.Value);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (info.ArgumentNames.Count > i && !string.IsNullOrEmpty(info.ArgumentNames[i]))
|
||||
@@ -123,6 +233,9 @@ namespace DynamORM
|
||||
bool isRet = info.ArgumentNames[i].StartsWith("ret_");
|
||||
bool isBoth = info.ArgumentNames[i].StartsWith("both_");
|
||||
|
||||
if (isRet)
|
||||
retIsAdded = true;
|
||||
|
||||
string paramName = isOut || isRet ?
|
||||
info.ArgumentNames[i].Substring(4) :
|
||||
isBoth ? info.ArgumentNames[i].Substring(5) :
|
||||
@@ -139,8 +252,11 @@ namespace DynamORM
|
||||
_db.GetParameterName(paramName),
|
||||
isOut ? ParameterDirection.Output :
|
||||
isRet ? ParameterDirection.ReturnValue :
|
||||
isBoth ? ParameterDirection.InputOutput : ParameterDirection.Input,
|
||||
arg == null ? DbType.String : arg.GetType().ToDbType(), 0, isOut ? DBNull.Value : arg);
|
||||
isBoth ? ParameterDirection.InputOutput :
|
||||
ParameterDirection.Input,
|
||||
arg == null ? isRet ? DbType.Int32 : DbType.String : arg.GetType().ToDbType(),
|
||||
isRet ? 4 : 0,
|
||||
(isOut || isRet) ? DBNull.Value : arg);
|
||||
}
|
||||
else
|
||||
cmd.AddParameter(_db, arg);
|
||||
@@ -163,6 +279,11 @@ namespace DynamORM
|
||||
using (IDataReader rdr = cmd.ExecuteReader())
|
||||
mainResult = rdr.CachedReader();
|
||||
}
|
||||
else if (types[0] == typeof(DataTable))
|
||||
{
|
||||
using (IDataReader rdr = cmd.ExecuteReader())
|
||||
mainResult = rdr.CachedReader().ToDataTable(binder.Name);
|
||||
}
|
||||
else if (types[0].IsGenericEnumerable())
|
||||
{
|
||||
Type argType = types[0].GetGenericArguments().First();
|
||||
@@ -174,7 +295,7 @@ namespace DynamORM
|
||||
|
||||
mainResult = cache.EnumerateReader().ToList();
|
||||
}
|
||||
else if (argType.IsValueType)
|
||||
else if (argType.IsValueType || argType == typeof(string))
|
||||
{
|
||||
Type listType = typeof(List<>).MakeGenericType(new Type[] { argType });
|
||||
IList listInstance = (IList)Activator.CreateInstance(listType);
|
||||
@@ -186,7 +307,26 @@ namespace DynamORM
|
||||
cache = rdr.CachedReader();
|
||||
|
||||
while (cache.Read())
|
||||
listInstance.Add(cache[0] == DBNull.Value ? defVal : argType.CastObject(cache[0]));
|
||||
listInstance.Add(cache[0] != null && cache[0] != DBNull.Value ? argType.CastObject(cache[0]) : defVal);
|
||||
|
||||
mainResult = listInstance;
|
||||
}
|
||||
else if (argType == typeof(Guid))
|
||||
{
|
||||
Type listType = typeof(List<>).MakeGenericType(new Type[] { argType });
|
||||
IList listInstance = (IList)Activator.CreateInstance(listType);
|
||||
|
||||
object defVal = listType.GetDefaultValue();
|
||||
|
||||
IDataReader cache = null;
|
||||
using (IDataReader rdr = cmd.ExecuteReader())
|
||||
cache = rdr.CachedReader();
|
||||
|
||||
while (cache.Read())
|
||||
{
|
||||
if (cache[0] != null && cache[0] != DBNull.Value && Guid.TryParse(cache[0].ToString(), out Guid g))
|
||||
listInstance.Add(g);
|
||||
}
|
||||
|
||||
mainResult = listInstance;
|
||||
}
|
||||
@@ -194,37 +334,77 @@ namespace DynamORM
|
||||
{
|
||||
DynamicTypeMap mapper = DynamicMapperCache.GetMapper(argType);
|
||||
if (mapper == null)
|
||||
throw new InvalidCastException(string.Format("Don't konw what to do with this type: '{0}'.", argType.ToString()));
|
||||
throw new InvalidCastException(string.Format("Don't know what to do with this type: '{0}'.", argType.ToString()));
|
||||
|
||||
IDataReader cache = null;
|
||||
using (IDataReader rdr = cmd.ExecuteReader())
|
||||
cache = rdr.CachedReader();
|
||||
|
||||
mainResult = cache.EnumerateReader().MapEnumerable(argType).ToList();
|
||||
var lt = typeof(List<>);
|
||||
var ltc = lt.MakeGenericType(argType);
|
||||
var instance = Activator.CreateInstance(ltc) as IList;
|
||||
|
||||
foreach (var item in cache.EnumerateReader())
|
||||
instance.Add(DynamicExtensions.Map(item, argType));
|
||||
|
||||
mainResult = instance;
|
||||
|
||||
//mainResult = cache.EnumerateReader().MapEnumerable(argType).ToList();
|
||||
}
|
||||
}
|
||||
else if (types[0].IsValueType)
|
||||
else if (types[0].IsValueType || types[0] == typeof(string))
|
||||
{
|
||||
mainResult = cmd.ExecuteScalar();
|
||||
if (mainResult != DBNull.Value)
|
||||
if (mainResult != null && mainResult != DBNull.Value)
|
||||
mainResult = types[0].CastObject(mainResult);
|
||||
}
|
||||
else if (types[0] == typeof(Guid))
|
||||
{
|
||||
mainResult = cmd.ExecuteScalar();
|
||||
if (mainResult != null && mainResult != DBNull.Value && Guid.TryParse(mainResult.ToString(), out Guid g))
|
||||
mainResult = g;
|
||||
}
|
||||
else
|
||||
{
|
||||
DynamicTypeMap mapper = DynamicMapperCache.GetMapper(types[0]);
|
||||
if (mapper == null)
|
||||
throw new InvalidCastException(string.Format("Don't konw what to do with this type: '{0}'.", types[0].ToString()));
|
||||
throw new InvalidCastException(string.Format("Don't know what to do with this type: '{0}'.", types[0].ToString()));
|
||||
|
||||
using (IDataReader rdr = cmd.ExecuteReader())
|
||||
if (rdr.Read())
|
||||
mainResult = (rdr.ToDynamic() as object).Map(types[0]);
|
||||
mainResult = (rdr.RowToDynamic() as object).Map(types[0]);
|
||||
else
|
||||
mainResult = null;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var returnName = _db.GetParameterName("___result___");
|
||||
if (!retIsAdded)
|
||||
cmd.AddParameter(returnName, ParameterDirection.ReturnValue, DbType.Int32, 4, 0, 0, DBNull.Value);
|
||||
|
||||
mainResult = cmd.ExecuteNonQuery();
|
||||
|
||||
IDbDataParameter returnParam = null;
|
||||
if (!retIsAdded)
|
||||
returnParam = cmd.Parameters[returnName] as IDbDataParameter;
|
||||
else
|
||||
{
|
||||
foreach (var e in cmd.Parameters)
|
||||
{
|
||||
var p = e as IDbDataParameter;
|
||||
if (p != null && p.Direction == ParameterDirection.ReturnValue)
|
||||
{
|
||||
returnParam = p;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (returnParam != null && returnParam.Value != null && returnParam.Value != DBNull.Value)
|
||||
mainResult = returnParam.Value;
|
||||
}
|
||||
|
||||
#endregion Get main result
|
||||
|
||||
#region Handle out params
|
||||
|
||||
@@ -247,7 +247,7 @@ namespace DynamORM
|
||||
IsDisposed = false;
|
||||
Database = database;
|
||||
TableName = Database.StripName(table);
|
||||
OwnerName = Database.StripName(owner);
|
||||
OwnerName = owner != null ? Database.StripName(owner) : string.Empty;
|
||||
TableType = null;
|
||||
|
||||
BuildAndCacheSchema(keys);
|
||||
|
||||
44
DynamORM/Helpers/DataReaderExtensions.cs
Normal file
44
DynamORM/Helpers/DataReaderExtensions.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
|
||||
namespace DynamORM.Helpers
|
||||
{
|
||||
/// <summary>Extensions for data reader handling.</summary>
|
||||
public static class DataReaderExtensions
|
||||
{
|
||||
/// <summary>Gets the data table from data reader.</summary>
|
||||
/// <param name="r">The data reader.</param>
|
||||
/// <param name="name">The name to give the table. If tableName is null or an empty string, a default name is given when added to the System.Data.DataTableCollection.</param>
|
||||
/// <param name="nameSpace">The namespace for the XML representation of the data stored in the DataTable.</param>
|
||||
/// <returns></returns>
|
||||
public static DataTable ToDataTable(this IDataReader r, string name = null, string nameSpace = null)
|
||||
{
|
||||
DataTable schemaTable = r.GetSchemaTable();
|
||||
DataTable resultTable = new DataTable(name, nameSpace);
|
||||
|
||||
foreach (DataRow col in schemaTable.Rows)
|
||||
{
|
||||
dynamic c = col.RowToDynamicUpper();
|
||||
|
||||
DataColumn dataColumn = new DataColumn();
|
||||
dataColumn.ColumnName = c.COLUMNNAME;
|
||||
dataColumn.DataType = (Type)c.DATATYPE;
|
||||
dataColumn.ReadOnly = true;
|
||||
dataColumn.Unique = c.ISUNIQUE;
|
||||
|
||||
resultTable.Columns.Add(dataColumn);
|
||||
}
|
||||
|
||||
while (r.Read())
|
||||
{
|
||||
DataRow row = resultTable.NewRow();
|
||||
for (int i = 0; i < resultTable.Columns.Count; i++)
|
||||
row[i] = r[i];
|
||||
|
||||
resultTable.Rows.Add(row);
|
||||
}
|
||||
|
||||
return resultTable;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -67,10 +67,27 @@ namespace DynamORM.Helpers
|
||||
{
|
||||
ParameterExpression param = Expression.Parameter(typeof(InvokeMemberBinder), "o");
|
||||
|
||||
try
|
||||
{
|
||||
return Expression.Lambda<Func<InvokeMemberBinder, IList<Type>>>(
|
||||
Expression.TypeAs(
|
||||
Expression.Field(
|
||||
Expression.TypeAs(param, binderType), "typeArguments"),
|
||||
typeof(IList<Type>)), param).Compile();
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
|
||||
PropertyInfo prop = binderType.GetProperty("TypeArguments");
|
||||
|
||||
if (!prop.CanRead)
|
||||
return null;
|
||||
|
||||
return Expression.Lambda<Func<InvokeMemberBinder, IList<Type>>>(
|
||||
Expression.TypeAs(
|
||||
Expression.Field(
|
||||
Expression.TypeAs(param, binderType), "typeArguments"),
|
||||
Expression.Property(
|
||||
Expression.TypeAs(param, binderType), prop.Name),
|
||||
typeof(IList<Type>)), param).Compile();
|
||||
}
|
||||
}
|
||||
@@ -127,6 +144,14 @@ namespace DynamORM.Helpers
|
||||
// If this was a success get and return it's value
|
||||
if (field != null)
|
||||
return field.GetValue(binder) as IList<Type>;
|
||||
else
|
||||
{
|
||||
PropertyInfo prop = binder.GetType().GetProperty("TypeArguments");
|
||||
|
||||
// If we have a property, return it's value
|
||||
if (prop != null)
|
||||
return prop.GetValue(binder, null) as IList<Type>;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -73,6 +73,7 @@ namespace DynamORM.Helpers
|
||||
func(obj) : elseFunc != null ? elseFunc() : default(R);
|
||||
}
|
||||
|
||||
#if !NET6_0_OR_GREATER
|
||||
/// <summary>Simple distinct by selector extension.</summary>
|
||||
/// <returns>The enumerator of elements distinct by specified selector.</returns>
|
||||
/// <param name="source">Source collection.</param>
|
||||
@@ -86,5 +87,6 @@ namespace DynamORM.Helpers
|
||||
if (seenKeys.Add(keySelector(element)))
|
||||
yield return element;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -156,7 +156,7 @@ namespace DynamORM.Mapper
|
||||
/// <summary>Sets the specified value to destination object.</summary>
|
||||
/// <param name="dest">The destination object.</param>
|
||||
/// <param name="val">The value.</param>
|
||||
public void Set(object dest, object val)
|
||||
public void Set(object dest, object val, bool byProperty = false)
|
||||
{
|
||||
object value = null;
|
||||
|
||||
@@ -168,19 +168,27 @@ namespace DynamORM.Mapper
|
||||
{
|
||||
if (val != null)
|
||||
{
|
||||
var lst = (val as IEnumerable<object>).Select(x => GetElementVal(ArrayType, x)).ToList();
|
||||
if (val is IEnumerable<object>)
|
||||
{
|
||||
var lst = (val as IEnumerable<object>).Select(x => GetElementVal(ArrayType, x, byProperty)).ToList();
|
||||
|
||||
value = Array.CreateInstance(ArrayType, lst.Count);
|
||||
value = Array.CreateInstance(ArrayType, lst.Count);
|
||||
|
||||
int i = 0;
|
||||
foreach (var e in lst)
|
||||
((Array)value).SetValue(e, i++);
|
||||
int i = 0;
|
||||
foreach (var e in lst)
|
||||
((Array)value).SetValue(e, i++);
|
||||
}
|
||||
else
|
||||
{
|
||||
value = Array.CreateInstance(ArrayType, 1);
|
||||
((Array)value).SetValue(GetElementVal(ArrayType, val, byProperty), 0);
|
||||
}
|
||||
}
|
||||
else
|
||||
value = Array.CreateInstance(ArrayType, 0);
|
||||
}
|
||||
else
|
||||
value = GetElementVal(Type, val);
|
||||
value = GetElementVal(Type, val, byProperty);
|
||||
}
|
||||
else
|
||||
value = val;
|
||||
@@ -196,7 +204,7 @@ namespace DynamORM.Mapper
|
||||
}
|
||||
}
|
||||
|
||||
private object GetElementVal(System.Type etype, object val)
|
||||
private object GetElementVal(System.Type etype, object val, bool byProperty)
|
||||
{
|
||||
bool nullable = etype.IsGenericType && etype.GetGenericTypeDefinition() == typeof(Nullable<>);
|
||||
Type type = Nullable.GetUnderlyingType(etype) ?? etype;
|
||||
@@ -226,13 +234,24 @@ namespace DynamORM.Mapper
|
||||
}
|
||||
else if (Type == typeof(string) && val.GetType() == typeof(Guid))
|
||||
return val.ToString();
|
||||
else if (Type == typeof(Guid) && val.GetType() == typeof(string))
|
||||
else if (Type == typeof(Guid))
|
||||
{
|
||||
Guid g;
|
||||
return Guid.TryParse((string)val, out g) ? g : Guid.Empty;
|
||||
if (val.GetType() == typeof(byte[]))
|
||||
return new Guid((byte[])val);
|
||||
else if (val.GetType() == typeof(string))
|
||||
{
|
||||
Guid g;
|
||||
return Guid.TryParse((string)val, out g) ? g : Guid.Empty;
|
||||
}
|
||||
else return (nullable) ? null : (object)Guid.Empty;
|
||||
}
|
||||
else if (IsDataContract)
|
||||
else if (!typeof(IConvertible).IsAssignableFrom(type) && (IsDataContract || (!type.IsValueType && val is IDictionary<string, object>)))
|
||||
{
|
||||
if (byProperty)
|
||||
return val.MapByProperty(type);
|
||||
|
||||
return val.Map(type);
|
||||
}
|
||||
else
|
||||
try
|
||||
{
|
||||
|
||||
@@ -82,6 +82,10 @@ namespace DynamORM.Mapper
|
||||
|
||||
foreach (PropertyInfo pi in GetAllMembers(Type).Where(x => x is PropertyInfo).Cast<PropertyInfo>())
|
||||
{
|
||||
// Skip indexers
|
||||
if (pi.GetIndexParameters().Any())
|
||||
continue;
|
||||
|
||||
ColumnAttribute attr = null;
|
||||
|
||||
object[] attrs = pi.GetCustomAttributes(typeof(ColumnAttribute), true);
|
||||
@@ -167,7 +171,7 @@ namespace DynamORM.Mapper
|
||||
if (PropertyMap.TryGetValue(item.Key, out cn) && item.Value != null)
|
||||
if (ColumnsMap.TryGetValue(cn.ToLower(), out dpi) && item.Value != null)
|
||||
if (dpi.Setter != null)
|
||||
dpi.Set(destination, item.Value);
|
||||
dpi.Set(destination, item.Value, true);
|
||||
}
|
||||
|
||||
return destination;
|
||||
|
||||
@@ -102,13 +102,16 @@ namespace DynamORM.Objects
|
||||
/// <returns>Returns <c>true</c> if operation was successful.</returns>
|
||||
public virtual bool Insert(DynamicDatabase db)
|
||||
{
|
||||
if (db.Insert(this.GetType())
|
||||
.Values(x => this)
|
||||
.Execute() > 0)
|
||||
using (var query = db.Insert(this.GetType()))
|
||||
{
|
||||
_changedFields.Clear();
|
||||
SetDynamicEntityState(DynamicEntityState.Existing);
|
||||
return true;
|
||||
if (query
|
||||
.Values(x => this)
|
||||
.Execute() > 0)
|
||||
{
|
||||
_changedFields.Clear();
|
||||
SetDynamicEntityState(DynamicEntityState.Existing);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -121,47 +124,68 @@ namespace DynamORM.Objects
|
||||
{
|
||||
var t = GetType();
|
||||
var mapper = DynamicMapperCache.GetMapper(t);
|
||||
var query = db.Update(t);
|
||||
|
||||
MakeQueryWhere(mapper, query);
|
||||
|
||||
if (_changedFields.Any())
|
||||
using (var query = db.Update(t))
|
||||
{
|
||||
MakeQueryWhere(mapper, query);
|
||||
|
||||
bool any = false;
|
||||
|
||||
foreach (var cf in _changedFields)
|
||||
if (_changedFields.Any())
|
||||
{
|
||||
var cn = mapper.PropertyMap[cf.Key];
|
||||
var pm = mapper.ColumnsMap[cn.ToLower()];
|
||||
if (pm.Ignore)
|
||||
continue;
|
||||
|
||||
if (pm.Column != null)
|
||||
foreach (var cf in _changedFields)
|
||||
{
|
||||
if (pm.Column.IsKey)
|
||||
var cn = mapper.PropertyMap[cf.Key];
|
||||
var pm = mapper.ColumnsMap[cn.ToLower()];
|
||||
if (pm.Ignore)
|
||||
continue;
|
||||
|
||||
if (!pm.Column.AllowNull && cf.Value == null)
|
||||
continue;
|
||||
if (pm.Column != null)
|
||||
{
|
||||
if (pm.Column.IsKey)
|
||||
continue;
|
||||
|
||||
if (!pm.Column.AllowNull && cf.Value == null)
|
||||
continue;
|
||||
}
|
||||
|
||||
query.Values(cn, cf.Value);
|
||||
any = true;
|
||||
}
|
||||
|
||||
query.Values(cn, cf.Value);
|
||||
any = true;
|
||||
}
|
||||
|
||||
if (!any)
|
||||
query.Set(x => this);
|
||||
foreach (var pmk in mapper.ColumnsMap)
|
||||
{
|
||||
var pm = pmk.Value;
|
||||
var val = pm.Get(this);
|
||||
var cn = pm.Name;
|
||||
|
||||
if (pm.Ignore)
|
||||
continue;
|
||||
|
||||
if (pm.Column != null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(pm.Column.Name))
|
||||
cn = pm.Column.Name;
|
||||
|
||||
if (pm.Column.IsKey)
|
||||
continue;
|
||||
|
||||
if (!pm.Column.AllowNull && val == null)
|
||||
continue;
|
||||
}
|
||||
|
||||
query.Values(cn, val);
|
||||
}
|
||||
|
||||
if (query.Execute() == 0)
|
||||
return false;
|
||||
|
||||
SetDynamicEntityState(DynamicEntityState.Existing);
|
||||
_changedFields.Clear();
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
query.Set(x => this);
|
||||
|
||||
if (query.Execute() == 0)
|
||||
return false;
|
||||
|
||||
SetDynamicEntityState(DynamicEntityState.Existing);
|
||||
_changedFields.Clear();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>Deletes this object from database.</summary>
|
||||
@@ -172,14 +196,15 @@ namespace DynamORM.Objects
|
||||
var t = this.GetType();
|
||||
var mapper = DynamicMapperCache.GetMapper(t);
|
||||
|
||||
var query = db.Delete(t);
|
||||
using (var query = db.Delete(t))
|
||||
{
|
||||
MakeQueryWhere(mapper, query);
|
||||
|
||||
MakeQueryWhere(mapper, query);
|
||||
if (query.Execute() == 0)
|
||||
return false;
|
||||
|
||||
if (query.Execute() == 0)
|
||||
return false;
|
||||
|
||||
SetDynamicEntityState(DynamicEntityState.Deleted);
|
||||
SetDynamicEntityState(DynamicEntityState.Deleted);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -196,17 +221,19 @@ namespace DynamORM.Objects
|
||||
{
|
||||
var t = this.GetType();
|
||||
var mapper = DynamicMapperCache.GetMapper(t);
|
||||
var query = db.From(t);
|
||||
MakeQueryWhere(mapper, query);
|
||||
var o = (query.Execute() as IEnumerable<dynamic>).FirstOrDefault();
|
||||
using (var query = db.From(t))
|
||||
{
|
||||
MakeQueryWhere(mapper, query);
|
||||
var o = (query.Execute() as IEnumerable<dynamic>).FirstOrDefault();
|
||||
|
||||
if (o == null)
|
||||
return false;
|
||||
if (o == null)
|
||||
return false;
|
||||
|
||||
mapper.Map(o, this);
|
||||
mapper.Map(o, this);
|
||||
|
||||
SetDynamicEntityState(DynamicEntityState.Existing);
|
||||
_changedFields.Clear();
|
||||
SetDynamicEntityState(DynamicEntityState.Existing);
|
||||
_changedFields.Clear();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -23,7 +23,8 @@ namespace DynamORM.Objects
|
||||
/// <returns>Objects enumerator.</returns>
|
||||
public virtual IEnumerable<T> GetAll()
|
||||
{
|
||||
return EnumerateQuery(_database.From<T>());
|
||||
using (var q = _database.From<T>())
|
||||
return EnumerateQuery(q);
|
||||
}
|
||||
|
||||
/// <summary>Get rows from database by custom query.</summary>
|
||||
|
||||
@@ -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")]
|
||||
[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)]
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
// <autogenerated />
|
||||
using System;
|
||||
using System.Reflection;
|
||||
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
|
||||
26
DynamORM/obj/Debug/net472/DynamORM.AssemblyInfo.cs
Normal file
26
DynamORM/obj/Debug/net472/DynamORM.AssemblyInfo.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
|
||||
[assembly: System.Reflection.AssemblyCompanyAttribute("RUSSEK Software")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||
[assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © RUSSEK Software 2012-2023")]
|
||||
[assembly: System.Reflection.AssemblyDescriptionAttribute("Dynamic Object-Relational Mapping library.")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.3.0.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.3.0")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("DynamORM")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("DynamORM")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.3.0.0")]
|
||||
[assembly: System.Reflection.AssemblyMetadataAttribute("RepositoryUrl", "https://git.dr4cul4.pl/RUSSEK-Software/DynamORM")]
|
||||
|
||||
// Generated by the MSBuild WriteCodeFragment class.
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
fc853c749cf501759ad6a0d5531aafc846ac0fde
|
||||
@@ -0,0 +1,3 @@
|
||||
is_global = true
|
||||
build_property.RootNamespace = DynamORM
|
||||
build_property.ProjectDir = D:\Source\.NET\DynamORM\DynamORM\
|
||||
BIN
DynamORM/obj/Debug/net472/DynamORM.assets.cache
Normal file
BIN
DynamORM/obj/Debug/net472/DynamORM.assets.cache
Normal file
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,4 @@
|
||||
// <autogenerated />
|
||||
using System;
|
||||
using System.Reflection;
|
||||
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v5.0", FrameworkDisplayName = "")]
|
||||
26
DynamORM/obj/Debug/net5.0/DynamORM.AssemblyInfo.cs
Normal file
26
DynamORM/obj/Debug/net5.0/DynamORM.AssemblyInfo.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
|
||||
[assembly: System.Reflection.AssemblyCompanyAttribute("RUSSEK Software")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||
[assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © RUSSEK Software 2012-2023")]
|
||||
[assembly: System.Reflection.AssemblyDescriptionAttribute("Dynamic Object-Relational Mapping library.")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.3.0.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.3.0")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("DynamORM")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("DynamORM")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.3.0.0")]
|
||||
[assembly: System.Reflection.AssemblyMetadataAttribute("RepositoryUrl", "https://git.dr4cul4.pl/RUSSEK-Software/DynamORM")]
|
||||
|
||||
// Generated by the MSBuild WriteCodeFragment class.
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
fc853c749cf501759ad6a0d5531aafc846ac0fde
|
||||
@@ -0,0 +1,10 @@
|
||||
is_global = true
|
||||
build_property.TargetFramework = net5.0
|
||||
build_property.TargetPlatformMinVersion =
|
||||
build_property.UsingMicrosoftNETSdkWeb =
|
||||
build_property.ProjectTypeGuids =
|
||||
build_property.InvariantGlobalization =
|
||||
build_property.PlatformNeutralAssembly =
|
||||
build_property._SupportedPlatformList = Linux,macOS,Windows
|
||||
build_property.RootNamespace = DynamORM
|
||||
build_property.ProjectDir = D:\Source\.NET\DynamORM\DynamORM\
|
||||
BIN
DynamORM/obj/Debug/net5.0/DynamORM.assets.cache
Normal file
BIN
DynamORM/obj/Debug/net5.0/DynamORM.assets.cache
Normal file
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,4 @@
|
||||
// <autogenerated />
|
||||
using System;
|
||||
using System.Reflection;
|
||||
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v6.0", FrameworkDisplayName = "")]
|
||||
26
DynamORM/obj/Debug/net6.0/DynamORM.AssemblyInfo.cs
Normal file
26
DynamORM/obj/Debug/net6.0/DynamORM.AssemblyInfo.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
|
||||
[assembly: System.Reflection.AssemblyCompanyAttribute("RUSSEK Software")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||
[assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © RUSSEK Software 2012-2023")]
|
||||
[assembly: System.Reflection.AssemblyDescriptionAttribute("Dynamic Object-Relational Mapping library.")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.3.0.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.3.0")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("DynamORM")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("DynamORM")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.3.0.0")]
|
||||
[assembly: System.Reflection.AssemblyMetadataAttribute("RepositoryUrl", "https://git.dr4cul4.pl/RUSSEK-Software/DynamORM")]
|
||||
|
||||
// Generated by the MSBuild WriteCodeFragment class.
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
fc853c749cf501759ad6a0d5531aafc846ac0fde
|
||||
@@ -0,0 +1,10 @@
|
||||
is_global = true
|
||||
build_property.TargetFramework = net6.0
|
||||
build_property.TargetPlatformMinVersion =
|
||||
build_property.UsingMicrosoftNETSdkWeb =
|
||||
build_property.ProjectTypeGuids =
|
||||
build_property.InvariantGlobalization =
|
||||
build_property.PlatformNeutralAssembly =
|
||||
build_property._SupportedPlatformList = Linux,macOS,Windows
|
||||
build_property.RootNamespace = DynamORM
|
||||
build_property.ProjectDir = D:\Source\.NET\DynamORM\DynamORM\
|
||||
BIN
DynamORM/obj/Debug/net6.0/DynamORM.assets.cache
Normal file
BIN
DynamORM/obj/Debug/net6.0/DynamORM.assets.cache
Normal file
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,4 @@
|
||||
// <autogenerated />
|
||||
using System;
|
||||
using System.Reflection;
|
||||
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETStandard,Version=v2.0", FrameworkDisplayName = "")]
|
||||
26
DynamORM/obj/Debug/netstandard2.0/DynamORM.AssemblyInfo.cs
Normal file
26
DynamORM/obj/Debug/netstandard2.0/DynamORM.AssemblyInfo.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
|
||||
[assembly: System.Reflection.AssemblyCompanyAttribute("RUSSEK Software")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||
[assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © RUSSEK Software 2012-2023")]
|
||||
[assembly: System.Reflection.AssemblyDescriptionAttribute("Dynamic Object-Relational Mapping library.")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.3.0.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.3.0")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("DynamORM")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("DynamORM")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.3.0.0")]
|
||||
[assembly: System.Reflection.AssemblyMetadataAttribute("RepositoryUrl", "https://git.dr4cul4.pl/RUSSEK-Software/DynamORM")]
|
||||
|
||||
// Generated by the MSBuild WriteCodeFragment class.
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
fc853c749cf501759ad6a0d5531aafc846ac0fde
|
||||
@@ -0,0 +1,3 @@
|
||||
is_global = true
|
||||
build_property.RootNamespace = DynamORM
|
||||
build_property.ProjectDir = D:\Source\.NET\DynamORM\DynamORM\
|
||||
BIN
DynamORM/obj/Debug/netstandard2.0/DynamORM.assets.cache
Normal file
BIN
DynamORM/obj/Debug/netstandard2.0/DynamORM.assets.cache
Normal file
Binary file not shown.
Binary file not shown.
131
DynamORM/obj/DynamORM.csproj.nuget.dgspec.json
Normal file
131
DynamORM/obj/DynamORM.csproj.nuget.dgspec.json
Normal file
@@ -0,0 +1,131 @@
|
||||
{
|
||||
"format": 1,
|
||||
"restore": {
|
||||
"D:\\Source\\.NET\\DynamORM\\DynamORM\\DynamORM.csproj": {}
|
||||
},
|
||||
"projects": {
|
||||
"D:\\Source\\.NET\\DynamORM\\DynamORM\\DynamORM.csproj": {
|
||||
"version": "1.3.0",
|
||||
"restore": {
|
||||
"projectUniqueName": "D:\\Source\\.NET\\DynamORM\\DynamORM\\DynamORM.csproj",
|
||||
"projectName": "DynamORM",
|
||||
"projectPath": "D:\\Source\\.NET\\DynamORM\\DynamORM\\DynamORM.csproj",
|
||||
"packagesPath": "C:\\Users\\gruss\\.nuget\\packages\\",
|
||||
"outputPath": "D:\\Source\\.NET\\DynamORM\\DynamORM\\obj\\",
|
||||
"projectStyle": "PackageReference",
|
||||
"crossTargeting": true,
|
||||
"fallbackFolders": [
|
||||
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"
|
||||
],
|
||||
"configFilePaths": [
|
||||
"C:\\Users\\gruss\\AppData\\Roaming\\NuGet\\NuGet.Config",
|
||||
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config",
|
||||
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
|
||||
],
|
||||
"originalTargetFrameworks": [
|
||||
"net472",
|
||||
"net6.0",
|
||||
"netstandard2.0"
|
||||
],
|
||||
"sources": {
|
||||
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
|
||||
"https://api.nuget.org/v3/index.json": {}
|
||||
},
|
||||
"frameworks": {
|
||||
"net6.0": {
|
||||
"targetAlias": "net6.0",
|
||||
"projectReferences": {}
|
||||
},
|
||||
"net472": {
|
||||
"targetAlias": "net472",
|
||||
"projectReferences": {}
|
||||
},
|
||||
"netstandard2.0": {
|
||||
"targetAlias": "netstandard2.0",
|
||||
"projectReferences": {}
|
||||
}
|
||||
},
|
||||
"warningProperties": {
|
||||
"warnAsError": [
|
||||
"NU1605"
|
||||
]
|
||||
}
|
||||
},
|
||||
"frameworks": {
|
||||
"net6.0": {
|
||||
"targetAlias": "net6.0",
|
||||
"dependencies": {
|
||||
"Microsoft.CSharp": {
|
||||
"target": "Package",
|
||||
"version": "[4.7.0, )"
|
||||
},
|
||||
"System.Data.Common": {
|
||||
"target": "Package",
|
||||
"version": "[4.3.0, )"
|
||||
}
|
||||
},
|
||||
"imports": [
|
||||
"net461",
|
||||
"net462",
|
||||
"net47",
|
||||
"net471",
|
||||
"net472",
|
||||
"net48"
|
||||
],
|
||||
"assetTargetFallback": true,
|
||||
"warn": true,
|
||||
"frameworkReferences": {
|
||||
"Microsoft.NETCore.App": {
|
||||
"privateAssets": "all"
|
||||
}
|
||||
},
|
||||
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\6.0.201\\RuntimeIdentifierGraph.json"
|
||||
},
|
||||
"net472": {
|
||||
"targetAlias": "net472",
|
||||
"dependencies": {
|
||||
"Microsoft.CSharp": {
|
||||
"target": "Package",
|
||||
"version": "[4.7.0, )"
|
||||
},
|
||||
"System.Data.Common": {
|
||||
"target": "Package",
|
||||
"version": "[4.3.0, )"
|
||||
}
|
||||
},
|
||||
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\6.0.201\\RuntimeIdentifierGraph.json"
|
||||
},
|
||||
"netstandard2.0": {
|
||||
"targetAlias": "netstandard2.0",
|
||||
"dependencies": {
|
||||
"Microsoft.CSharp": {
|
||||
"target": "Package",
|
||||
"version": "[4.7.0, )"
|
||||
},
|
||||
"NETStandard.Library": {
|
||||
"suppressParent": "All",
|
||||
"target": "Package",
|
||||
"version": "[2.0.3, )",
|
||||
"autoReferenced": true
|
||||
},
|
||||
"System.Data.Common": {
|
||||
"target": "Package",
|
||||
"version": "[4.3.0, )"
|
||||
}
|
||||
},
|
||||
"imports": [
|
||||
"net461",
|
||||
"net462",
|
||||
"net47",
|
||||
"net471",
|
||||
"net472",
|
||||
"net48"
|
||||
],
|
||||
"assetTargetFallback": true,
|
||||
"warn": true,
|
||||
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\6.0.201\\RuntimeIdentifierGraph.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
16
DynamORM/obj/DynamORM.csproj.nuget.g.props
Normal file
16
DynamORM/obj/DynamORM.csproj.nuget.g.props
Normal file
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
|
||||
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
|
||||
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
|
||||
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
|
||||
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\gruss\.nuget\packages\;C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages</NuGetPackageFolders>
|
||||
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
|
||||
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.1.0</NuGetToolVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||
<SourceRoot Include="C:\Users\gruss\.nuget\packages\" />
|
||||
<SourceRoot Include="C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages\" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
6
DynamORM/obj/DynamORM.csproj.nuget.g.targets
Normal file
6
DynamORM/obj/DynamORM.csproj.nuget.g.targets
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ImportGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' AND '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||
<Import Project="$(NuGetPackageRoot)netstandard.library\2.0.3\build\netstandard2.0\NETStandard.Library.targets" Condition="Exists('$(NuGetPackageRoot)netstandard.library\2.0.3\build\netstandard2.0\NETStandard.Library.targets')" />
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
1714
DynamORM/obj/project.assets.json
Normal file
1714
DynamORM/obj/project.assets.json
Normal file
File diff suppressed because it is too large
Load Diff
26
DynamORM/obj/project.nuget.cache
Normal file
26
DynamORM/obj/project.nuget.cache
Normal file
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"version": 2,
|
||||
"dgSpecHash": "IuYP4tdqCfN1hgy879V5KHbsnBQClfQ9vldxowC+IrPfJ7aGphHYKMfCNAuH/rZVylrlcnncc6biySxBiZHxXA==",
|
||||
"success": true,
|
||||
"projectFilePath": "D:\\Source\\.NET\\DynamORM\\DynamORM\\DynamORM.csproj",
|
||||
"expectedPackageFiles": [
|
||||
"C:\\Users\\gruss\\.nuget\\packages\\microsoft.csharp\\4.7.0\\microsoft.csharp.4.7.0.nupkg.sha512",
|
||||
"C:\\Users\\gruss\\.nuget\\packages\\microsoft.netcore.platforms\\1.1.0\\microsoft.netcore.platforms.1.1.0.nupkg.sha512",
|
||||
"C:\\Users\\gruss\\.nuget\\packages\\microsoft.netcore.targets\\1.1.0\\microsoft.netcore.targets.1.1.0.nupkg.sha512",
|
||||
"C:\\Users\\gruss\\.nuget\\packages\\netstandard.library\\2.0.3\\netstandard.library.2.0.3.nupkg.sha512",
|
||||
"C:\\Users\\gruss\\.nuget\\packages\\system.collections\\4.3.0\\system.collections.4.3.0.nupkg.sha512",
|
||||
"C:\\Users\\gruss\\.nuget\\packages\\system.data.common\\4.3.0\\system.data.common.4.3.0.nupkg.sha512",
|
||||
"C:\\Users\\gruss\\.nuget\\packages\\system.globalization\\4.3.0\\system.globalization.4.3.0.nupkg.sha512",
|
||||
"C:\\Users\\gruss\\.nuget\\packages\\system.io\\4.3.0\\system.io.4.3.0.nupkg.sha512",
|
||||
"C:\\Users\\gruss\\.nuget\\packages\\system.reflection\\4.3.0\\system.reflection.4.3.0.nupkg.sha512",
|
||||
"C:\\Users\\gruss\\.nuget\\packages\\system.reflection.primitives\\4.3.0\\system.reflection.primitives.4.3.0.nupkg.sha512",
|
||||
"C:\\Users\\gruss\\.nuget\\packages\\system.resources.resourcemanager\\4.3.0\\system.resources.resourcemanager.4.3.0.nupkg.sha512",
|
||||
"C:\\Users\\gruss\\.nuget\\packages\\system.runtime\\4.3.0\\system.runtime.4.3.0.nupkg.sha512",
|
||||
"C:\\Users\\gruss\\.nuget\\packages\\system.runtime.extensions\\4.3.0\\system.runtime.extensions.4.3.0.nupkg.sha512",
|
||||
"C:\\Users\\gruss\\.nuget\\packages\\system.text.encoding\\4.3.0\\system.text.encoding.4.3.0.nupkg.sha512",
|
||||
"C:\\Users\\gruss\\.nuget\\packages\\system.text.regularexpressions\\4.3.0\\system.text.regularexpressions.4.3.0.nupkg.sha512",
|
||||
"C:\\Users\\gruss\\.nuget\\packages\\system.threading\\4.3.0\\system.threading.4.3.0.nupkg.sha512",
|
||||
"C:\\Users\\gruss\\.nuget\\packages\\system.threading.tasks\\4.3.0\\system.threading.tasks.4.3.0.nupkg.sha512"
|
||||
],
|
||||
"logs": []
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
<StyleCopSettings Version="105">
|
||||
<GlobalSettings>
|
||||
<GlobalSettings>
|
||||
<StringProperty Name="MergeSettingsFiles">NoMerge</StringProperty>
|
||||
<CollectionProperty Name="RecognizedWords">
|
||||
<Value>aspx</Value>
|
||||
|
||||
@@ -1,48 +1,149 @@
|
||||
using System.Linq;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using DynamORM;
|
||||
using DynamORM.Helpers;
|
||||
|
||||
namespace Tester
|
||||
{
|
||||
internal class Program
|
||||
{
|
||||
private static DynamORM.DynamicDatabase GetORM()
|
||||
private static DynamicDatabase GetORM()
|
||||
{
|
||||
return new DynamORM.DynamicDatabase(System.Data.SqlClient.SqlClientFactory.Instance,
|
||||
//"packet size=4096;User Id=sa;Password=Sa123;data source=192.168.1.9,1434;initial catalog=MAH_Melle-GAGARIN;",
|
||||
"packet size=4096;User Id=sa;Password=sa123;data source=192.168.1.9,1433;initial catalog=MOM_NEXT_Florentyna_WMS_PROD;",
|
||||
DynamORM.DynamicDatabaseOptions.SingleConnection | DynamORM.DynamicDatabaseOptions.SingleTransaction | DynamORM.DynamicDatabaseOptions.SupportStoredProcedures |
|
||||
DynamORM.DynamicDatabaseOptions.SupportSchema | DynamORM.DynamicDatabaseOptions.SupportTop);
|
||||
return new DynamicDatabase(System.Data.SqlClient.SqlClientFactory.Instance,
|
||||
"packet size=4096;User Id=sa;Password=;data source=192.168.22.;initial catalog=PLAYGROUND;",
|
||||
DynamicDatabaseOptions.SingleConnection | DynamicDatabaseOptions.SingleTransaction | DynamicDatabaseOptions.SupportSchema |
|
||||
DynamicDatabaseOptions.SupportStoredProcedures | DynamicDatabaseOptions.SupportTop | DynamicDatabaseOptions.DumpCommands);
|
||||
|
||||
////return new DynamORM.DynamicDatabase(System.Data.SQLite.SQLiteFactory.Instance,
|
||||
//// "Data Source=test.db3;",
|
||||
//// DynamORM.DynamicDatabaseOptions.SingleConnection | DynamORM.DynamicDatabaseOptions.SingleTransaction |
|
||||
//// DynamORM.DynamicDatabaseOptions.SupportSchema | DynamORM.DynamicDatabaseOptions.SupportLimitOffset);
|
||||
///
|
||||
}
|
||||
|
||||
private static void Main(string[] args)
|
||||
{
|
||||
DynamicDatabase db = new DynamicDatabase(System.Data.SqlClient.SqlClientFactory.Instance, "packet size=4096;User Id=sa;Password=Sa123;data source=127.0.0.1,1434;initial catalog=MAH_Levant;",
|
||||
DynamicDatabaseOptions.SingleConnection | DynamicDatabaseOptions.SingleTransaction | DynamicDatabaseOptions.SupportSchema |
|
||||
DynamicDatabaseOptions.SupportStoredProcedures | DynamicDatabaseOptions.SupportTop | DynamicDatabaseOptions.DumpCommands);
|
||||
//var c = new System.Data.SqlClient.SqlConnection("packet size=4096;User Id=sa;Password=sa123;data source=192.168.0.6;initial catalog=DynamORM;");
|
||||
|
||||
try
|
||||
using (var db = GetORM())
|
||||
{
|
||||
db.Execute("DROP TABLE Experiments ");
|
||||
db.Execute(@"CREATE OR ALTER PROCEDURE sp_Exp_Scalar AS SELECT 42;");
|
||||
var res0 = db.Procedures.sp_Exp_Scalar();
|
||||
var res1 = db.Procedures.sp_Exp_Scalar<int>();
|
||||
|
||||
db.Execute(@"CREATE OR ALTER PROCEDURE sp_Exp_ReturnInt AS RETURN 42;");
|
||||
var res2 = db.Procedures.sp_Exp_ReturnInt();
|
||||
|
||||
db.Execute(@"CREATE OR ALTER PROCEDURE sp_Exp_SomeData AS
|
||||
SELECT 1 Id, 'Some Name 1' [Name], 'Some Desc 1' [Desc], GETDATE() [Date]
|
||||
UNION ALL SELECT 2 Id, 'Some Name 2', 'Some Desc 2', GETDATE() [Date];");
|
||||
var res3 = db.Procedures.sp_Exp_SomeData<sp_Exp_SomeData_Result>();
|
||||
var res4 = db.Procedures.sp_Exp_SomeData<List<sp_Exp_SomeData_Result>>();
|
||||
|
||||
db.Execute(@"CREATE OR ALTER PROCEDURE sp_Exp_SomeInputAndOutput
|
||||
@Name nvarchar(50),
|
||||
@Result nvarchar(256) OUTPUT
|
||||
AS
|
||||
SELECT @Result = 'Hi, ' + @Name + ' your lucky number is 42!';");
|
||||
var res5 = db.Procedures.sp_Exp_SomeInputAndOutput<string, sp_Exp_SomeInputAndOutput_Result>(Name: "G4g4r1n", out_Result: new DynamicColumn
|
||||
{
|
||||
Schema = new DynamicSchemaColumn
|
||||
{
|
||||
Size = 256,
|
||||
},
|
||||
}, ret_Return: 0);
|
||||
var res6 = db.Procedures.sp_Exp_SomeInputAndOutput<string, sp_Exp_SomeInputAndOutput_Result>(Name: "G4g4r1n", out_Result: new DynamicSchemaColumn
|
||||
{
|
||||
Size = 256,
|
||||
}, ret_Return: 0);
|
||||
|
||||
db.Execute(@"CREATE OR ALTER PROCEDURE sp_Exp_SomeInputAndOutputWithDataAndReturn
|
||||
@Name nvarchar(50),
|
||||
@Result nvarchar(256) OUTPUT
|
||||
AS
|
||||
SELECT @Result = 'Hi, ' + @Name + ' your lucky number is 42!'
|
||||
|
||||
SELECT 1 Id, 'Some Name 1' [Name], 'Some Desc 1' [Desc], GETDATE() [Date]
|
||||
UNION ALL SELECT 2 Id, 'Some Name 2', 'Some Desc 2', GETDATE() [Date]
|
||||
|
||||
RETURN 42;");
|
||||
var res7 = db.Procedures.sp_Exp_SomeInputAndOutputWithDataAndReturn<List<sp_Exp_SomeInputAndOutputWithDataAndReturn_Result.Data>, sp_Exp_SomeInputAndOutputWithDataAndReturn_Result>(Name: "G4g4r1n", out_Result: new DynamicColumn
|
||||
{
|
||||
Schema = new DynamicSchemaColumn
|
||||
{
|
||||
Size = 256,
|
||||
},
|
||||
}, ret_Return: 0);
|
||||
var res8 = db.Procedures.sp_Exp_SomeInputAndOutputWithDataAndReturn<List<sp_Exp_SomeInputAndOutputWithDataAndReturn_Result.Data>, sp_Exp_SomeInputAndOutputWithDataAndReturn_Result>(Name: "G4g4r1n", out_Result: new DynamicSchemaColumn
|
||||
{
|
||||
Size = 256,
|
||||
}, ret_Return: 0);
|
||||
|
||||
//try
|
||||
//{
|
||||
// db.Execute("DROP TABLE Experiments ");
|
||||
//}
|
||||
//catch { }
|
||||
|
||||
//db.Execute("CREATE TABLE Experiments (t1 nvarchar(50) NOT NULL DEFAULT N'', t2 varchar(50) NOT NULL DEFAULT '');");
|
||||
|
||||
//var q = db.From(x => x.Experiments.As(x.e1));
|
||||
//q
|
||||
// .Where(x => x.t2 = "Dupa")
|
||||
// .Where(x => x.Exists(
|
||||
// q.SubQuery()
|
||||
// .From(y => y.Experiments.As(x.e2))
|
||||
// .Where(y => y.e2.t1 == y.e1.t1)))
|
||||
// .Execute().ToList();
|
||||
|
||||
//db.Execute("DROP TABLE Experiments ");
|
||||
|
||||
//IDataReader rdr = db.Procedures.sp_getdate<IDataReader>();
|
||||
//var dt = rdr.ToDataTable();
|
||||
//var dt2 = db.Procedures.sp_getdate<DataTable>();
|
||||
|
||||
//db.Procedures.usp_API_Generate_Doc_Number<string>(key: Guid.NewGuid(), mdn_id: "ZZ");
|
||||
|
||||
//var resL = (db.Procedures.GetProductDesc<IList<GetProductDesc_Result>>() as IEnumerable<dynamic>)
|
||||
// .Cast<GetProductDesc_Result>()
|
||||
// .ToArray();
|
||||
//var res = db.Procedures.GetProductDesc_withparameters<GetProductDesc_Result>(PID: 707);
|
||||
//res = db.Procedures.GetProductDesc_withDefaultparameters<GetProductDesc_Result>();
|
||||
|
||||
//int id = -1;
|
||||
//var resD = db.Procedures.ins_NewEmp_with_outputparamaters(Ename: "Test2", out_EId: id);
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
db.Execute("CREATE TABLE Experiments (t1 nvarchar(50) NOT NULL DEFAULT N'', t2 varchar(50) NOT NULL DEFAULT '');");
|
||||
private class sp_Exp_SomeData_Result
|
||||
{
|
||||
public virtual int Id { get; set; }
|
||||
public virtual string Name { get; set; }
|
||||
public virtual string Desc { get; set; }
|
||||
public virtual DateTime Date { get; set; }
|
||||
}
|
||||
|
||||
var q = db.From(x => x.Experiments.As(x.e1));
|
||||
q
|
||||
.Where(x => x.t2 = "Dupą")
|
||||
.Where(x => x.Exists(
|
||||
q.SubQuery()
|
||||
.From(y => y.Experiments.As(x.e2))
|
||||
.Where(y => y.e2.t1 == y.e1.t1)))
|
||||
.Execute().ToList();
|
||||
private class sp_Exp_SomeInputAndOutput_Result
|
||||
{
|
||||
public virtual string Result { get; set; }
|
||||
public virtual string Return { get; set; }
|
||||
}
|
||||
|
||||
db.Execute("DROP TABLE Experiments ");
|
||||
private class sp_Exp_SomeInputAndOutputWithDataAndReturn_Result
|
||||
{
|
||||
public class Data
|
||||
{
|
||||
public virtual int Id { get; set; }
|
||||
public virtual string Name { get; set; }
|
||||
public virtual string Desc { get; set; }
|
||||
public virtual DateTime Date { get; set; }
|
||||
}
|
||||
|
||||
public virtual List<Data> sp_Exp_SomeInputAndOutputWithDataAndReturn { get; set; }
|
||||
public virtual string Result { get; set; }
|
||||
public virtual string Return { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
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("Tester")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Microsoft")]
|
||||
[assembly: AssemblyProduct("Tester")]
|
||||
[assembly: AssemblyCopyright("Copyright © Microsoft 2014")]
|
||||
[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("dbff9475-06f5-400e-bc17-57c14d9d9cb9")]
|
||||
|
||||
// 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.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
@@ -1,71 +1,32 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
|
||||
<ProductVersion>8.0.30703</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{F747AA57-BEA7-4FB8-B371-546296789AEF}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Tester</RootNamespace>
|
||||
<AssemblyName>Tester</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Externalconsole>true</Externalconsole>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Externalconsole>true</Externalconsole>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Data.SQLite, Version=1.0.94.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=AMD64">
|
||||
<HintPath>C:\Program Files\System.Data.SQLite\2010\bin\System.Data.SQLite.dll</HintPath>
|
||||
</Reference>
|
||||
<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>
|
||||
<Content Include="ProfilingSessions\Session20141128_203722.sdps" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\DynamORM\DynamORM.csproj">
|
||||
<Project>{63963ED7-9C78-4672-A4D4-339B6E825503}</Project>
|
||||
<Name>DynamORM</Name>
|
||||
</ProjectReference>
|
||||
</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>
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<Copyright>Copyright © RUSSEK Software 2012-2022</Copyright>
|
||||
<Company>RUSSEK Software</Company>
|
||||
<Authors>Grzegorz Russek</Authors>
|
||||
<VersionPrefix>1.2.1</VersionPrefix>
|
||||
<RepositoryUrl>https://svn.dr4cul4.pl/svn/DynamORM/</RepositoryUrl>
|
||||
<PackageProjectUrl>https://dr4cul4.pl</PackageProjectUrl>
|
||||
<Product>DynamORM</Product>
|
||||
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
||||
<OutputType>Exe</OutputType>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
|
||||
<PackageReference Include="System.Data.Common" Version="4.3.0" />
|
||||
<PackageReference Include="System.Data.SqlClient" Version="4.8.6" />
|
||||
</ItemGroup>
|
||||
<ItemGroup Condition="$(TargetFramework.StartsWith('net4')) AND '$(MSBuildRuntimeType)' == 'Core' AND '$(OS)' != 'Windows_NT'">
|
||||
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" PrivateAssets="All" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\DynamORM\DynamORM.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Properties\" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
// <autogenerated />
|
||||
using System;
|
||||
using System.Reflection;
|
||||
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v3.1", FrameworkDisplayName = "")]
|
||||
25
Tester/obj/Debug/netcoreapp3.1/Tester.AssemblyInfo.cs
Normal file
25
Tester/obj/Debug/netcoreapp3.1/Tester.AssemblyInfo.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
|
||||
[assembly: System.Reflection.AssemblyCompanyAttribute("RUSSEK Software")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||
[assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © RUSSEK Software 2012-2022")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.2.1.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.2.1")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("DynamORM")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("Tester")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.2.1.0")]
|
||||
[assembly: System.Reflection.AssemblyMetadataAttribute("RepositoryUrl", "https://svn.dr4cul4.pl/svn/DynamORM/")]
|
||||
|
||||
// Generated by the MSBuild WriteCodeFragment class.
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
782bb48d5e52ed18c98c3f55de3e3a89004a0c4b
|
||||
@@ -0,0 +1,3 @@
|
||||
is_global = true
|
||||
build_property.RootNamespace = Tester
|
||||
build_property.ProjectDir = D:\Source\.NET\DynamORM\Tester\
|
||||
BIN
Tester/obj/Debug/netcoreapp3.1/Tester.assets.cache
Normal file
BIN
Tester/obj/Debug/netcoreapp3.1/Tester.assets.cache
Normal file
Binary file not shown.
Binary file not shown.
207
Tester/obj/Tester.csproj.nuget.dgspec.json
Normal file
207
Tester/obj/Tester.csproj.nuget.dgspec.json
Normal file
@@ -0,0 +1,207 @@
|
||||
{
|
||||
"format": 1,
|
||||
"restore": {
|
||||
"D:\\Source\\.NET\\DynamORM\\Tester\\Tester.csproj": {}
|
||||
},
|
||||
"projects": {
|
||||
"D:\\Source\\.NET\\DynamORM\\DynamORM\\DynamORM.csproj": {
|
||||
"version": "1.3.0",
|
||||
"restore": {
|
||||
"projectUniqueName": "D:\\Source\\.NET\\DynamORM\\DynamORM\\DynamORM.csproj",
|
||||
"projectName": "DynamORM",
|
||||
"projectPath": "D:\\Source\\.NET\\DynamORM\\DynamORM\\DynamORM.csproj",
|
||||
"packagesPath": "C:\\Users\\gruss\\.nuget\\packages\\",
|
||||
"outputPath": "D:\\Source\\.NET\\DynamORM\\DynamORM\\obj\\",
|
||||
"projectStyle": "PackageReference",
|
||||
"crossTargeting": true,
|
||||
"fallbackFolders": [
|
||||
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"
|
||||
],
|
||||
"configFilePaths": [
|
||||
"C:\\Users\\gruss\\AppData\\Roaming\\NuGet\\NuGet.Config",
|
||||
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config",
|
||||
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
|
||||
],
|
||||
"originalTargetFrameworks": [
|
||||
"net472",
|
||||
"net6.0",
|
||||
"netstandard2.0"
|
||||
],
|
||||
"sources": {
|
||||
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
|
||||
"https://api.nuget.org/v3/index.json": {}
|
||||
},
|
||||
"frameworks": {
|
||||
"net6.0": {
|
||||
"targetAlias": "net6.0",
|
||||
"projectReferences": {}
|
||||
},
|
||||
"net472": {
|
||||
"targetAlias": "net472",
|
||||
"projectReferences": {}
|
||||
},
|
||||
"netstandard2.0": {
|
||||
"targetAlias": "netstandard2.0",
|
||||
"projectReferences": {}
|
||||
}
|
||||
},
|
||||
"warningProperties": {
|
||||
"warnAsError": [
|
||||
"NU1605"
|
||||
]
|
||||
}
|
||||
},
|
||||
"frameworks": {
|
||||
"net6.0": {
|
||||
"targetAlias": "net6.0",
|
||||
"dependencies": {
|
||||
"Microsoft.CSharp": {
|
||||
"target": "Package",
|
||||
"version": "[4.7.0, )"
|
||||
},
|
||||
"System.Data.Common": {
|
||||
"target": "Package",
|
||||
"version": "[4.3.0, )"
|
||||
}
|
||||
},
|
||||
"imports": [
|
||||
"net461",
|
||||
"net462",
|
||||
"net47",
|
||||
"net471",
|
||||
"net472",
|
||||
"net48"
|
||||
],
|
||||
"assetTargetFallback": true,
|
||||
"warn": true,
|
||||
"frameworkReferences": {
|
||||
"Microsoft.NETCore.App": {
|
||||
"privateAssets": "all"
|
||||
}
|
||||
},
|
||||
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\6.0.201\\RuntimeIdentifierGraph.json"
|
||||
},
|
||||
"net472": {
|
||||
"targetAlias": "net472",
|
||||
"dependencies": {
|
||||
"Microsoft.CSharp": {
|
||||
"target": "Package",
|
||||
"version": "[4.7.0, )"
|
||||
},
|
||||
"System.Data.Common": {
|
||||
"target": "Package",
|
||||
"version": "[4.3.0, )"
|
||||
}
|
||||
},
|
||||
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\6.0.201\\RuntimeIdentifierGraph.json"
|
||||
},
|
||||
"netstandard2.0": {
|
||||
"targetAlias": "netstandard2.0",
|
||||
"dependencies": {
|
||||
"Microsoft.CSharp": {
|
||||
"target": "Package",
|
||||
"version": "[4.7.0, )"
|
||||
},
|
||||
"NETStandard.Library": {
|
||||
"suppressParent": "All",
|
||||
"target": "Package",
|
||||
"version": "[2.0.3, )",
|
||||
"autoReferenced": true
|
||||
},
|
||||
"System.Data.Common": {
|
||||
"target": "Package",
|
||||
"version": "[4.3.0, )"
|
||||
}
|
||||
},
|
||||
"imports": [
|
||||
"net461",
|
||||
"net462",
|
||||
"net47",
|
||||
"net471",
|
||||
"net472",
|
||||
"net48"
|
||||
],
|
||||
"assetTargetFallback": true,
|
||||
"warn": true,
|
||||
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\6.0.201\\RuntimeIdentifierGraph.json"
|
||||
}
|
||||
}
|
||||
},
|
||||
"D:\\Source\\.NET\\DynamORM\\Tester\\Tester.csproj": {
|
||||
"version": "1.2.1",
|
||||
"restore": {
|
||||
"projectUniqueName": "D:\\Source\\.NET\\DynamORM\\Tester\\Tester.csproj",
|
||||
"projectName": "Tester",
|
||||
"projectPath": "D:\\Source\\.NET\\DynamORM\\Tester\\Tester.csproj",
|
||||
"packagesPath": "C:\\Users\\gruss\\.nuget\\packages\\",
|
||||
"outputPath": "D:\\Source\\.NET\\DynamORM\\Tester\\obj\\",
|
||||
"projectStyle": "PackageReference",
|
||||
"fallbackFolders": [
|
||||
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"
|
||||
],
|
||||
"configFilePaths": [
|
||||
"C:\\Users\\gruss\\AppData\\Roaming\\NuGet\\NuGet.Config",
|
||||
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config",
|
||||
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
|
||||
],
|
||||
"originalTargetFrameworks": [
|
||||
"netcoreapp3.1"
|
||||
],
|
||||
"sources": {
|
||||
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
|
||||
"https://api.nuget.org/v3/index.json": {}
|
||||
},
|
||||
"frameworks": {
|
||||
"netcoreapp3.1": {
|
||||
"targetAlias": "netcoreapp3.1",
|
||||
"projectReferences": {
|
||||
"D:\\Source\\.NET\\DynamORM\\DynamORM\\DynamORM.csproj": {
|
||||
"projectPath": "D:\\Source\\.NET\\DynamORM\\DynamORM\\DynamORM.csproj"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"warningProperties": {
|
||||
"warnAsError": [
|
||||
"NU1605"
|
||||
]
|
||||
}
|
||||
},
|
||||
"frameworks": {
|
||||
"netcoreapp3.1": {
|
||||
"targetAlias": "netcoreapp3.1",
|
||||
"dependencies": {
|
||||
"Microsoft.CSharp": {
|
||||
"target": "Package",
|
||||
"version": "[4.7.0, )"
|
||||
},
|
||||
"System.Data.Common": {
|
||||
"target": "Package",
|
||||
"version": "[4.3.0, )"
|
||||
},
|
||||
"System.Data.SqlClient": {
|
||||
"target": "Package",
|
||||
"version": "[4.8.3, )"
|
||||
}
|
||||
},
|
||||
"imports": [
|
||||
"net461",
|
||||
"net462",
|
||||
"net47",
|
||||
"net471",
|
||||
"net472",
|
||||
"net48"
|
||||
],
|
||||
"assetTargetFallback": true,
|
||||
"warn": true,
|
||||
"frameworkReferences": {
|
||||
"Microsoft.NETCore.App": {
|
||||
"privateAssets": "all"
|
||||
}
|
||||
},
|
||||
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\6.0.201\\RuntimeIdentifierGraph.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
16
Tester/obj/Tester.csproj.nuget.g.props
Normal file
16
Tester/obj/Tester.csproj.nuget.g.props
Normal file
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
|
||||
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
|
||||
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
|
||||
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
|
||||
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\gruss\.nuget\packages\;C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages</NuGetPackageFolders>
|
||||
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
|
||||
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.1.0</NuGetToolVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||
<SourceRoot Include="C:\Users\gruss\.nuget\packages\" />
|
||||
<SourceRoot Include="C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages\" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
2
Tester/obj/Tester.csproj.nuget.g.targets
Normal file
2
Tester/obj/Tester.csproj.nuget.g.targets
Normal file
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" />
|
||||
1662
Tester/obj/project.assets.json
Normal file
1662
Tester/obj/project.assets.json
Normal file
File diff suppressed because it is too large
Load Diff
32
Tester/obj/project.nuget.cache
Normal file
32
Tester/obj/project.nuget.cache
Normal file
@@ -0,0 +1,32 @@
|
||||
{
|
||||
"version": 2,
|
||||
"dgSpecHash": "iTUnpCnHx6mmHyBOTQ18HO6L0kWB789OUUQXR34t0JvwDrvTs0VKOMZQRlmU4qKGCm57a3gzW9YJjYSkn9r4vw==",
|
||||
"success": true,
|
||||
"projectFilePath": "D:\\Source\\.NET\\DynamORM\\Tester\\Tester.csproj",
|
||||
"expectedPackageFiles": [
|
||||
"C:\\Users\\gruss\\.nuget\\packages\\microsoft.csharp\\4.7.0\\microsoft.csharp.4.7.0.nupkg.sha512",
|
||||
"C:\\Users\\gruss\\.nuget\\packages\\microsoft.netcore.platforms\\3.1.0\\microsoft.netcore.platforms.3.1.0.nupkg.sha512",
|
||||
"C:\\Users\\gruss\\.nuget\\packages\\microsoft.netcore.targets\\1.1.0\\microsoft.netcore.targets.1.1.0.nupkg.sha512",
|
||||
"C:\\Users\\gruss\\.nuget\\packages\\microsoft.win32.registry\\4.7.0\\microsoft.win32.registry.4.7.0.nupkg.sha512",
|
||||
"C:\\Users\\gruss\\.nuget\\packages\\runtime.native.system.data.sqlclient.sni\\4.7.0\\runtime.native.system.data.sqlclient.sni.4.7.0.nupkg.sha512",
|
||||
"C:\\Users\\gruss\\.nuget\\packages\\runtime.win-arm64.runtime.native.system.data.sqlclient.sni\\4.4.0\\runtime.win-arm64.runtime.native.system.data.sqlclient.sni.4.4.0.nupkg.sha512",
|
||||
"C:\\Users\\gruss\\.nuget\\packages\\runtime.win-x64.runtime.native.system.data.sqlclient.sni\\4.4.0\\runtime.win-x64.runtime.native.system.data.sqlclient.sni.4.4.0.nupkg.sha512",
|
||||
"C:\\Users\\gruss\\.nuget\\packages\\runtime.win-x86.runtime.native.system.data.sqlclient.sni\\4.4.0\\runtime.win-x86.runtime.native.system.data.sqlclient.sni.4.4.0.nupkg.sha512",
|
||||
"C:\\Users\\gruss\\.nuget\\packages\\system.collections\\4.3.0\\system.collections.4.3.0.nupkg.sha512",
|
||||
"C:\\Users\\gruss\\.nuget\\packages\\system.data.common\\4.3.0\\system.data.common.4.3.0.nupkg.sha512",
|
||||
"C:\\Users\\gruss\\.nuget\\packages\\system.data.sqlclient\\4.8.3\\system.data.sqlclient.4.8.3.nupkg.sha512",
|
||||
"C:\\Users\\gruss\\.nuget\\packages\\system.globalization\\4.3.0\\system.globalization.4.3.0.nupkg.sha512",
|
||||
"C:\\Users\\gruss\\.nuget\\packages\\system.io\\4.3.0\\system.io.4.3.0.nupkg.sha512",
|
||||
"C:\\Users\\gruss\\.nuget\\packages\\system.reflection\\4.3.0\\system.reflection.4.3.0.nupkg.sha512",
|
||||
"C:\\Users\\gruss\\.nuget\\packages\\system.reflection.primitives\\4.3.0\\system.reflection.primitives.4.3.0.nupkg.sha512",
|
||||
"C:\\Users\\gruss\\.nuget\\packages\\system.resources.resourcemanager\\4.3.0\\system.resources.resourcemanager.4.3.0.nupkg.sha512",
|
||||
"C:\\Users\\gruss\\.nuget\\packages\\system.runtime\\4.3.0\\system.runtime.4.3.0.nupkg.sha512",
|
||||
"C:\\Users\\gruss\\.nuget\\packages\\system.runtime.extensions\\4.3.0\\system.runtime.extensions.4.3.0.nupkg.sha512",
|
||||
"C:\\Users\\gruss\\.nuget\\packages\\system.security.accesscontrol\\4.7.0\\system.security.accesscontrol.4.7.0.nupkg.sha512",
|
||||
"C:\\Users\\gruss\\.nuget\\packages\\system.security.principal.windows\\4.7.0\\system.security.principal.windows.4.7.0.nupkg.sha512",
|
||||
"C:\\Users\\gruss\\.nuget\\packages\\system.text.encoding\\4.3.0\\system.text.encoding.4.3.0.nupkg.sha512",
|
||||
"C:\\Users\\gruss\\.nuget\\packages\\system.text.regularexpressions\\4.3.0\\system.text.regularexpressions.4.3.0.nupkg.sha512",
|
||||
"C:\\Users\\gruss\\.nuget\\packages\\system.threading.tasks\\4.3.0\\system.threading.tasks.4.3.0.nupkg.sha512"
|
||||
],
|
||||
"logs": []
|
||||
}
|
||||
Reference in New Issue
Block a user