├── .github
├── FUNDING.yml
└── ISSUE_TEMPLATE.md
├── .gitignore
├── CHANGELOG.md
├── EntityFrameworkExtras.EF5.Net40
├── App.config
├── EntityFrameworkExtras.EF5.Net40.csproj
├── Key.snk
├── Properties
│ └── AssemblyInfo.cs
└── packages.config
├── EntityFrameworkExtras.EF5.Net45
├── App.config
├── EntityFrameworkExtras.EF5.Net45.csproj
├── Key.snk
├── Properties
│ └── AssemblyInfo.cs
└── packages.config
├── EntityFrameworkExtras.EF5.Tests
├── App.config
├── EntityFrameworkExtras.EF5.Tests.csproj
├── Properties
│ └── AssemblyInfo.cs
└── packages.config
├── EntityFrameworkExtras.EF6.Net40
├── App.config
├── EntityFrameworkExtras.EF6.Net40.csproj
├── Key.snk
├── Properties
│ └── AssemblyInfo.cs
└── packages.config
├── EntityFrameworkExtras.EF6.Net45
├── App.config
├── EntityFrameworkExtras.EF6.Net45.csproj
├── Key.snk
├── Properties
│ └── AssemblyInfo.cs
└── packages.config
├── EntityFrameworkExtras.EF6.NetStandard
├── EntityFrameworkExtras.EF6.NetStandard.csproj
└── Key.snk
├── EntityFrameworkExtras.EF6.Tests
├── App.config
├── EntityFrameworkExtras.EF6.Tests.csproj
├── Properties
│ └── AssemblyInfo.cs
└── packages.config
├── EntityFrameworkExtras.EFCore.sln
├── EntityFrameworkExtras.EFCore2.NetStandard20
├── EntityFrameworkExtras.EFCore2.NetStandard20.csproj
└── Key.snk
├── EntityFrameworkExtras.EFCore3.NetStandard20
├── EntityFrameworkExtras.EFCore3.NetStandard20.csproj
└── Key.snk
├── EntityFrameworkExtras.EFCore3.NetStandard21
├── EntityFrameworkExtras.EFCore3.NetStandard21.csproj
└── Key.snk
├── EntityFrameworkExtras.EFCore3.Tests
├── App.config
├── EntityFrameworkExtras.EFCore3.Tests.csproj
├── Properties
│ └── AssemblyInfo.cs
└── packages.config
├── EntityFrameworkExtras.EFCore3.lab
├── My.cs
├── Program.cs
├── Request_Async.cs
├── Request_TimeOut.cs
├── Request_storeProcedure_Transaction.cs
└── Z.EntityFrameworkExtras.Lab.EFCore30.csproj
├── EntityFrameworkExtras.EFCore5
├── EntityFrameworkExtras.EFCore5.csproj
└── Key.snk
├── EntityFrameworkExtras.EFCore6
├── EntityFrameworkExtras.EFCore6.csproj
└── Key.snk
├── EntityFrameworkExtras.EFCore7
├── EntityFrameworkExtras.EFCore7.csproj
└── Key.snk
├── EntityFrameworkExtras.EFCore8
├── EntityFrameworkExtras.EFCore8.csproj
└── Key.snk
├── EntityFrameworkExtras.EFCore9
├── EntityFrameworkExtras.EFCore9.csproj
└── Key.snk
├── EntityFrameworkExtras.Shared
├── Attributes.cs
├── ColumnInformation.cs
├── DatabaseExtensions.EFCore2x.cs
├── DatabaseExtensions.EFCore3x.cs
├── DatabaseExtensions.NetFramework.cs
├── DatabaseExtensions.cs
├── EntityFrameworkExtras.Shared.projitems
├── EntityFrameworkExtras.Shared.shproj
├── ObjectContextExtentions.cs
├── StoredProcedureAttribute.cs
├── StoredProcedureInfo.cs
├── StoredProcedureParameterAttribute.cs
├── StoredProcedureParameterInfo.cs
├── StoredProcedureParameterOptions.cs
├── StoredProcedureParser.cs
├── StoredProcedureParserHelper.cs
├── UserDefinedTableGenerator.cs
├── UserDefinedTableTypeAttribute.cs
└── UserDefinedTableTypeColumnAttribute.cs
├── EntityFrameworkExtras.Tests.Shared
├── EntityFrameworkExtras.Tests.Shared.projitems
├── EntityFrameworkExtras.Tests.Shared.shproj
└── Integration
│ ├── DatabaseIntegrationTests.cs
│ ├── IntegrationSqlScript.sql
│ ├── ParameteUniqueIdentifierTests.cs
│ ├── ParameterBigIntTests.cs
│ ├── ParameterBinaryTests.cs
│ ├── ParameterBitTests.cs
│ ├── ParameterCharTests.cs
│ ├── ParameterDateTests.cs
│ ├── ParameterDateTime2Tests.cs
│ ├── ParameterDateTimeOffsetTests.cs
│ ├── ParameterDateTimeTests.cs
│ ├── ParameterDecimalTests.cs
│ ├── ParameterDirectionTests.DirectionDefault.cs
│ ├── ParameterDirectionTests.DirectionInput.cs
│ ├── ParameterDirectionTests.DirectionInputOutput.cs
│ ├── ParameterDirectionTests.DirectionOutput.cs
│ ├── ParameterDirectionTests.DirectionReturn.cs
│ ├── ParameterFloatTests.cs
│ ├── ParameterImageTests.cs
│ ├── ParameterIntTests.cs
│ ├── ParameterMoneyTests.cs
│ ├── ParameterNCharTests.cs
│ ├── ParameterNTextTests.cs
│ ├── ParameterNvarCharTests.cs
│ ├── ParameterRealTests.cs
│ ├── ParameterSizeTests.OutputParameters.cs
│ ├── ParameterSizeTests.cs
│ ├── ParameterSmallDateTimeTests.cs
│ ├── ParameterSmallIntTests.cs
│ ├── ParameterSmallMoneyTests.cs
│ ├── ParameterTextTests.cs
│ ├── ParameterTimeTests.cs
│ ├── ParameterTinyIntTests.cs
│ ├── ParameterVarBinaryTests.cs
│ ├── ParameterVarCharTests.cs
│ ├── ParameterXmlTests.cs
│ ├── StoredProcedureTests.cs
│ ├── StoredProcedures
│ ├── AllTypesParameterOutputStoredProcedure.cs
│ ├── AllTypesStoredProcedure.cs
│ ├── AllTypesStoredProcedureReturn.cs
│ ├── AllTypesUserDefinedTable.cs
│ ├── ExplicitySetColumnNamesUserDefinedTable.cs
│ ├── InvalidColumnCountUserDefinedTable.cs
│ ├── NoParametersStoredProcedure.cs
│ ├── NoneExistingStoredProcedure.cs
│ ├── OutputParameterSizeNotSetStoredProcedure.cs
│ ├── OutputParameterSizeSetStoredProcedure.cs
│ ├── ParameterDirectionStoredProcedure.cs
│ ├── ParameterDirectionStoredProcedureReturn.cs
│ ├── ParameterSizeStoredProcedure.cs
│ ├── ParameterSizeStoredProcedureReturn.cs
│ ├── UserDefinedTableExplicitlySetColumnNameStoredProcedure.cs
│ ├── UserDefinedTableInvalidColumnCountStoredProcedure.cs
│ ├── UserDefinedTableStoredProcedure.cs
│ └── UserDefinedTableStoredProcedureReturn.cs
│ ├── UserDefinedTableParameterTests.cs
│ └── UserDefinedTableTypeColumnTests.cs
├── EntityFrameworkExtras.Tests
├── App.config
├── EntityFrameworkExtras.Tests.csproj
├── Properties
│ └── AssemblyInfo.cs
└── packages.config
├── EntityFrameworkExtras.sln
├── EntityFrameworkExtras.vsmdi
├── EntityFrameworkExtras
├── App.config
├── EntityFrameworkExtras.csproj
├── Key.snk
├── Properties
│ └── AssemblyInfo.cs
└── packages.config
├── Local.testsettings
├── README.md
├── TraceAndTestImpact.testsettings
├── Z.EntityFrameworkExtras.Lab.EFCore9
├── My.cs
├── Program.cs
├── Request_storeProcedure_Transaction.cs
└── Z.EntityFrameworkExtras.Lab.EFCore9.csproj
├── Z.EntityFrameworkExtras.labEF6
├── App.config
├── My.cs
├── Program.cs
├── Properties
│ └── AssemblyInfo.cs
├── Request_Async.cs
├── Request_Enumerable.cs
├── Request_OutputParam.cs
├── Request_storeProcedure_Transaction.cs
├── Template.cs
├── Z.EntityFrameworkExtras.labEF6.csproj
└── packages.config
├── dapper-plus-sponsor.png
├── entity-framework-extensions-sponsor.png
├── icon.png
├── licence.txt
└── packages
├── EntityFramework.4.3.1
├── Content
│ ├── App.config.transform
│ └── Web.config.transform
├── EntityFramework.4.3.1.nupkg
├── lib
│ └── net40
│ │ ├── EntityFramework.dll
│ │ └── EntityFramework.xml
└── tools
│ ├── EF4.3on.NET4.5Readme.txt
│ ├── EntityFramework.PowerShell.dll
│ ├── EntityFramework.psd1
│ ├── EntityFramework.psm1
│ ├── init.ps1
│ ├── install.ps1
│ └── migrate.exe
├── EntityFramework.5.0.0
├── Content
│ ├── App.config.transform
│ └── Web.config.transform
├── EntityFramework.5.0.0.nupkg
├── lib
│ ├── net40
│ │ ├── EntityFramework.dll
│ │ └── EntityFramework.xml
│ └── net45
│ │ ├── EntityFramework.dll
│ │ └── EntityFramework.xml
└── tools
│ ├── EntityFramework.PS3.psd1
│ ├── EntityFramework.PowerShell.Utility.dll
│ ├── EntityFramework.PowerShell.dll
│ ├── EntityFramework.psd1
│ ├── EntityFramework.psm1
│ ├── Redirect.VS11.config
│ ├── Redirect.config
│ ├── about_EntityFramework.help.txt
│ ├── init.ps1
│ ├── install.ps1
│ └── migrate.exe
├── EntityFramework.6.0.0
├── Content
│ ├── App.config.transform
│ └── Web.config.transform
├── EntityFramework.6.0.0.nupkg
├── lib
│ ├── net40
│ │ ├── EntityFramework.SqlServer.dll
│ │ ├── EntityFramework.SqlServer.xml
│ │ ├── EntityFramework.dll
│ │ └── EntityFramework.xml
│ └── net45
│ │ ├── EntityFramework.SqlServer.dll
│ │ ├── EntityFramework.SqlServer.xml
│ │ ├── EntityFramework.dll
│ │ └── EntityFramework.xml
└── tools
│ ├── EntityFramework.PowerShell.Utility.dll
│ ├── EntityFramework.PowerShell.dll
│ ├── EntityFramework.psd1
│ ├── EntityFramework.psm1
│ ├── about_EntityFramework.help.txt
│ ├── init.ps1
│ ├── install.ps1
│ └── migrate.exe
├── NUnit.2.6.3
├── NUnit.2.6.3.nupkg
├── lib
│ ├── nunit.framework.dll
│ └── nunit.framework.xml
└── license.txt
└── repositories.config
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | github: [zzzprojects]
2 | custom: ["https://zzzprojects.com/contribute"]
3 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | Here is what to include in your request to make sure we implement a solution as quickly as possible.
2 |
3 | ## 1. Description
4 | Describe the issue or propose a feature.
5 |
6 | ## 2. Exception
7 | If you are seeing an exception, include the full exception details (message and stack trace).
8 |
9 | ```
10 | Exception message:
11 | Stack trace:
12 | ```
13 |
14 | ## 3. Fiddle or Project
15 | If you are able,
16 |
17 | Provide a Fiddle that reproduce the issue: https://dotnetfiddle.net/25Vjsn
18 |
19 | Or provide a project/solution that we can run to reproduce the issue.
20 | - Make sure the project compile
21 | - Make sure to provide only the code that is required to reproduce the issue, not the whole project
22 | - You can send private code here: info@zzzprojects.com
23 |
24 | Otherwise, make sure to include as much information as possible to help our team to reproduce the issue.
25 |
26 | ## 4. Any further technical details
27 | Add any relevant detail that can help us.
28 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .vs/
2 | packages/
3 | #################
4 | ## Eclipse
5 | #################
6 |
7 | *.pydevproject
8 | .project
9 | .metadata
10 | bin/
11 | tmp/
12 | *.tmp
13 | *.bak
14 | *.swp
15 | *~.nib
16 | local.properties
17 | .classpath
18 | .settings/
19 | .loadpath
20 |
21 | # External tool builders
22 | .externalToolBuilders/
23 |
24 | # Locally stored "Eclipse launch configurations"
25 | *.launch
26 |
27 | # CDT-specific
28 | .cproject
29 |
30 | # PDT-specific
31 | .buildpath
32 |
33 |
34 | #################
35 | ## Visual Studio
36 | #################
37 |
38 | ## Ignore Visual Studio temporary files, build results, and
39 | ## files generated by popular Visual Studio add-ons.
40 |
41 | # User-specific files
42 | *.suo
43 | *.user
44 | *.sln.docstates
45 |
46 | # Build results
47 | [Dd]ebug/
48 | [Rr]elease/
49 | *_i.c
50 | *_p.c
51 | *.ilk
52 | *.meta
53 | *.obj
54 | *.pch
55 | *.pdb
56 | *.pgc
57 | *.pgd
58 | *.rsp
59 | *.sbr
60 | *.tlb
61 | *.tli
62 | *.tlh
63 | *.tmp
64 | *.vspscc
65 | .builds
66 | *.dotCover
67 |
68 | ## TODO: If you have NuGet Package Restore enabled, uncomment this
69 | #packages/
70 |
71 | # Visual C++ cache files
72 | ipch/
73 | *.aps
74 | *.ncb
75 | *.opensdf
76 | *.sdf
77 |
78 | # Visual Studio profiler
79 | *.psess
80 | *.vsp
81 |
82 | # ReSharper is a .NET coding add-in
83 | _ReSharper*
84 |
85 | # Installshield output folder
86 | [Ee]xpress
87 |
88 | # DocProject is a documentation generator add-in
89 | DocProject/buildhelp/
90 | DocProject/Help/*.HxT
91 | DocProject/Help/*.HxC
92 | DocProject/Help/*.hhc
93 | DocProject/Help/*.hhk
94 | DocProject/Help/*.hhp
95 | DocProject/Help/Html2
96 | DocProject/Help/html
97 |
98 | # Click-Once directory
99 | publish
100 |
101 | # Others
102 | [Bb]in
103 | [Oo]bj
104 | sql
105 | TestResults
106 | *.Cache
107 | ClientBin
108 | stylecop.*
109 | ~$*
110 | *.dbmdl
111 | Generated_Code #added for RIA/Silverlight projects
112 |
113 | # Backup & report files from converting an old project file to a newer
114 | # Visual Studio version. Backup files are not needed, because we have git ;-)
115 | _UpgradeReport_Files/
116 | Backup*/
117 | UpgradeLog*.XML
118 |
119 |
120 |
121 | ############
122 | ## Windows
123 | ############
124 |
125 | # Windows image file caches
126 | Thumbs.db
127 |
128 | # Folder config file
129 | Desktop.ini
130 |
131 |
132 | #############
133 | ## Python
134 | #############
135 |
136 | *.py[co]
137 |
138 | # Packages
139 | *.egg
140 | *.egg-info
141 | dist
142 | build
143 | eggs
144 | parts
145 | bin
146 | var
147 | sdist
148 | develop-eggs
149 | .installed.cfg
150 |
151 | # Installer logs
152 | pip-log.txt
153 |
154 | # Unit test / coverage reports
155 | .coverage
156 | .tox
157 |
158 | #Translations
159 | *.mo
160 |
161 | #Mr Developer
162 | .mr.developer.cfg
163 |
164 | # Mac crap
165 | .DS_Store
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | EntityFrameworkExtras Nuget Package
2 | ===================================
3 |
4 | The Nuget package for EntityFrameworkExtras is located at: http://www.nuget.org/packages/EntityFrameworkExtras/
5 |
6 | ## 1.2.1 (also EF5 1.0.0 and EF6 1.0.0)
7 |
8 | - A major overhaul of the structure of the project. The changes are to deal with the changes in different versions of EntityFramework.
9 | - There are now versions of the project for EF1-EF4.3.1, EF5 and EF6+ (these are for the nuget packages, including net40 & net45 versions)
10 | - I'll be looking to restructure the code into a core project and specific items for each of the changes for the different EntityFramework projects to avoid repeated code
11 |
12 |
13 | ## 1.2.0
14 |
15 | - Fixed "String[1]: the Size property has an invalid size of 0." exception on output parameters. The Size parameter on StoredProcedureParameterAttribute is defaulted to -1 if the parameter is an output parameter and the size is 0, this is the equivalent to MAX.
--------------------------------------------------------------------------------
/EntityFrameworkExtras.EF5.Net40/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/EntityFrameworkExtras.EF5.Net40/EntityFrameworkExtras.EF5.Net40.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {357C473A-D606-4A9B-8C5F-17DEB6FFB005}
8 | Library
9 | Properties
10 | EntityFrameworkExtras.EF5
11 | EntityFrameworkExtras.EF5
12 | v4.0
13 | 512
14 |
15 |
16 |
17 | true
18 | full
19 | false
20 | bin\Debug\
21 | TRACE;DEBUG;EF5
22 | prompt
23 | 4
24 | false
25 |
26 |
27 | pdbonly
28 | true
29 | bin\Release\
30 | TRACE;EF5 NET40
31 | prompt
32 | 4
33 | false
34 | bin\Release\EntityFrameworkExtras.EF5.xml
35 |
36 |
37 | true
38 |
39 |
40 | Key.snk
41 |
42 |
43 |
44 | False
45 | ..\packages\EntityFramework.5.0.0\lib\net40\EntityFramework.dll
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
74 |
--------------------------------------------------------------------------------
/EntityFrameworkExtras.EF5.Net40/Key.snk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzzprojects/EntityFrameworkExtras/ff66b31e2aa04116739c23bfb92e55d9192d68fa/EntityFrameworkExtras.EF5.Net40/Key.snk
--------------------------------------------------------------------------------
/EntityFrameworkExtras.EF5.Net40/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("EntityFrameworkExtras")]
9 | [assembly: AssemblyDescription("EntityFrameworkExtras provides some useful additions to EntityFramework such as executing Stored Procedures with User-Defined Table Types and Output Parameters.")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("ZZZ Projects & Michael Rodda & Craig Bovis")]
12 | [assembly: AssemblyProduct("EntityFrameworkExtras.EF5")]
13 | [assembly: AssemblyCopyright("Copyright © ZZZ Projects Inc.")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("52fa590e-f879-4875-b106-2178043ff15a")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("3.0.5")]
36 | [assembly: AssemblyFileVersion("3.0.5")]
--------------------------------------------------------------------------------
/EntityFrameworkExtras.EF5.Net40/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/EntityFrameworkExtras.EF5.Net45/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/EntityFrameworkExtras.EF5.Net45/EntityFrameworkExtras.EF5.Net45.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {357C473A-D606-4A9B-8C5F-17DEB6FFB006}
8 | Library
9 | Properties
10 | EntityFrameworkExtras.EF5
11 | EntityFrameworkExtras.EF5
12 | v4.5
13 | 512
14 |
15 |
16 |
17 | true
18 | full
19 | false
20 | bin\Debug\
21 | TRACE;DEBUG;EF5
22 | prompt
23 | 4
24 | false
25 |
26 |
27 | pdbonly
28 | true
29 | bin\Release\
30 | TRACE;EF5
31 | prompt
32 | 4
33 | false
34 | bin\Release\EntityFrameworkExtras.EF5.xml
35 |
36 |
37 | true
38 |
39 |
40 | Key.snk
41 |
42 |
43 |
44 | False
45 | ..\packages\EntityFramework.5.0.0\lib\net45\EntityFramework.dll
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
74 |
--------------------------------------------------------------------------------
/EntityFrameworkExtras.EF5.Net45/Key.snk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzzprojects/EntityFrameworkExtras/ff66b31e2aa04116739c23bfb92e55d9192d68fa/EntityFrameworkExtras.EF5.Net45/Key.snk
--------------------------------------------------------------------------------
/EntityFrameworkExtras.EF5.Net45/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("EntityFrameworkExtras")]
9 | [assembly: AssemblyDescription("EntityFrameworkExtras provides some useful additions to EntityFramework such as executing Stored Procedures with User-Defined Table Types and Output Parameters.")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("ZZZ Projects & Michael Rodda & Craig Bovis")]
12 | [assembly: AssemblyProduct("EntityFrameworkExtras.EF5")]
13 | [assembly: AssemblyCopyright("Copyright © ZZZ Projects Inc.")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("52fa590e-f879-4875-b106-2178043ff15a")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("3.0.5")]
36 | [assembly: AssemblyFileVersion("3.0.5")]
--------------------------------------------------------------------------------
/EntityFrameworkExtras.EF5.Net45/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/EntityFrameworkExtras.EF5.Tests/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/EntityFrameworkExtras.EF5.Tests/EntityFrameworkExtras.EF5.Tests.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {44BA0CDB-A85D-4657-A935-7D57D6F0EEF9}
8 | Library
9 | Properties
10 | EntityFrameworkExtras.EF5.Tests
11 | EntityFrameworkExtras.EF5.Tests
12 | v4.5
13 | 512
14 |
15 |
16 |
17 | true
18 | full
19 | false
20 | bin\Debug\
21 | TRACE;DEBUG;EF5
22 | prompt
23 | 4
24 | false
25 |
26 |
27 | pdbonly
28 | true
29 | bin\Release\
30 | TRACE;EF5
31 | prompt
32 | 4
33 | false
34 |
35 |
36 |
37 | False
38 | ..\packages\EntityFramework.5.0.0\lib\net45\EntityFramework.dll
39 |
40 |
41 | ..\packages\NUnit.2.6.3\lib\nunit.framework.dll
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 | {357c473a-d606-4a9b-8c5f-17deb6ffb006}
63 | EntityFrameworkExtras.EF5
64 |
65 |
66 |
67 |
68 |
75 |
--------------------------------------------------------------------------------
/EntityFrameworkExtras.EF5.Tests/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("EntityFrameworkExtras.EF5.Tests")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("EntityFrameworkExtras.EF5.Tests")]
13 | [assembly: AssemblyCopyright("Copyright © 2014")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("2539a657-e4e4-4a3c-a6e5-fa66cc9d7e55")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/EntityFrameworkExtras.EF5.Tests/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/EntityFrameworkExtras.EF6.Net40/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/EntityFrameworkExtras.EF6.Net40/Key.snk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzzprojects/EntityFrameworkExtras/ff66b31e2aa04116739c23bfb92e55d9192d68fa/EntityFrameworkExtras.EF6.Net40/Key.snk
--------------------------------------------------------------------------------
/EntityFrameworkExtras.EF6.Net40/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("EntityFrameworkExtras")]
9 | [assembly: AssemblyDescription("EntityFrameworkExtras provides some useful additions to EntityFramework such as executing Stored Procedures with User-Defined Table Types and Output Parameters.")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("ZZZ Projects & Michael Rodda & Craig Bovis")]
12 | [assembly: AssemblyProduct("EntityFrameworkExtras")]
13 | [assembly: AssemblyCopyright("Copyright © ZZZ Projects Inc.")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("3ddaa72c-3011-4d9a-9941-bee13bdcadda")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("3.0.5")]
36 | [assembly: AssemblyFileVersion("3.0.5")]
--------------------------------------------------------------------------------
/EntityFrameworkExtras.EF6.Net40/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/EntityFrameworkExtras.EF6.Net45/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/EntityFrameworkExtras.EF6.Net45/Key.snk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzzprojects/EntityFrameworkExtras/ff66b31e2aa04116739c23bfb92e55d9192d68fa/EntityFrameworkExtras.EF6.Net45/Key.snk
--------------------------------------------------------------------------------
/EntityFrameworkExtras.EF6.Net45/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("EntityFrameworkExtras")]
9 | [assembly: AssemblyDescription("EntityFrameworkExtras provides some useful additions to EntityFramework such as executing Stored Procedures with User-Defined Table Types and Output Parameters.")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("ZZZ Projects & Michael Rodda & Craig Bovis")]
12 | [assembly: AssemblyProduct("EntityFrameworkExtras")]
13 | [assembly: AssemblyCopyright("Copyright © ZZZ Projects Inc.")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("3ddaa72c-3011-4d9a-9941-bee13bdcadda")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("3.0.5")]
36 | [assembly: AssemblyFileVersion("3.0.5")]
--------------------------------------------------------------------------------
/EntityFrameworkExtras.EF6.Net45/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/EntityFrameworkExtras.EF6.NetStandard/EntityFrameworkExtras.EF6.NetStandard.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netstandard2.1
5 | true
6 | Key.snk
7 | 3.0.5
8 | ZZZ Projects & Michael Rodda & Craig Bovis
9 | EntityFrameworkExtras.EF6
10 | EntityFrameworkExtras.EF6
11 | EntityFrameworkExtras provides some useful additions to EntityFramework such as executing Stored Procedures with User-Defined Table Types and Output Parameters.
12 | EntityFrameworkExtras.EF6
13 | EntityFrameworkExtras.EF6
14 |
15 |
16 |
17 | TRACE;EF6 NET45
18 |
19 |
20 |
21 | TRACE;EF6 NET45
22 | bin\Release\netstandard2.1\EntityFrameworkExtras.EF6.xml
23 | bin\Release\
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/EntityFrameworkExtras.EF6.NetStandard/Key.snk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzzprojects/EntityFrameworkExtras/ff66b31e2aa04116739c23bfb92e55d9192d68fa/EntityFrameworkExtras.EF6.NetStandard/Key.snk
--------------------------------------------------------------------------------
/EntityFrameworkExtras.EF6.Tests/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/EntityFrameworkExtras.EF6.Tests/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("EntityFrameworkExtras.EF6.Tests")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("EntityFrameworkExtras.EF6.Tests")]
13 | [assembly: AssemblyCopyright("Copyright © 2014")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("d1aee2ff-6bc8-48c2-b063-a288c6d79135")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/EntityFrameworkExtras.EF6.Tests/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/EntityFrameworkExtras.EFCore.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 16
4 | VisualStudioVersion = 16.0.29709.97
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Utils", "Utils", "{A1210DB1-1B13-47B4-B21B-9C08300DCD23}"
7 | ProjectSection(SolutionItems) = preProject
8 | icon.png = icon.png
9 | EndProjectSection
10 | EndProject
11 | Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "EntityFrameworkExtras.Shared", "EntityFrameworkExtras.Shared\EntityFrameworkExtras.Shared.shproj", "{770FA648-FA98-455D-8BF7-9832C9EDE9C6}"
12 | EndProject
13 | Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "EntityFrameworkExtras.Tests.Shared", "EntityFrameworkExtras.Tests.Shared\EntityFrameworkExtras.Tests.Shared.shproj", "{8189D203-89F3-4D02-B028-F76CE37C9FDB}"
14 | EndProject
15 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "EFCore", "EFCore", "{9E15663E-75C8-43B6-8236-4847A2685D42}"
16 | EndProject
17 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EntityFrameworkExtras.EFCore3.Tests", "EntityFrameworkExtras.EFCore3.Tests\EntityFrameworkExtras.EFCore3.Tests.csproj", "{59943B99-772A-47E4-AA70-6D758312C00C}"
18 | EndProject
19 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EntityFrameworkExtras.EFCore3.NetStandard21", "EntityFrameworkExtras.EFCore3.NetStandard21\EntityFrameworkExtras.EFCore3.NetStandard21.csproj", "{94101B83-CD6B-4F8A-9AB9-93A0D3371D07}"
20 | EndProject
21 | Global
22 | GlobalSection(SharedMSBuildProjectFiles) = preSolution
23 | EntityFrameworkExtras.Tests.Shared\EntityFrameworkExtras.Tests.Shared.projitems*{59943b99-772a-47e4-aa70-6d758312c00c}*SharedItemsImports = 4
24 | EntityFrameworkExtras.Shared\EntityFrameworkExtras.Shared.projitems*{770fa648-fa98-455d-8bf7-9832c9ede9c6}*SharedItemsImports = 13
25 | EntityFrameworkExtras.Tests.Shared\EntityFrameworkExtras.Tests.Shared.projitems*{8189d203-89f3-4d02-b028-f76ce37c9fdb}*SharedItemsImports = 13
26 | EntityFrameworkExtras.Shared\EntityFrameworkExtras.Shared.projitems*{94101b83-cd6b-4f8a-9ab9-93a0d3371d07}*SharedItemsImports = 5
27 | EndGlobalSection
28 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
29 | Debug|Any CPU = Debug|Any CPU
30 | Release|Any CPU = Release|Any CPU
31 | EndGlobalSection
32 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
33 | {59943B99-772A-47E4-AA70-6D758312C00C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
34 | {59943B99-772A-47E4-AA70-6D758312C00C}.Debug|Any CPU.Build.0 = Debug|Any CPU
35 | {59943B99-772A-47E4-AA70-6D758312C00C}.Release|Any CPU.ActiveCfg = Release|Any CPU
36 | {59943B99-772A-47E4-AA70-6D758312C00C}.Release|Any CPU.Build.0 = Release|Any CPU
37 | {94101B83-CD6B-4F8A-9AB9-93A0D3371D07}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
38 | {94101B83-CD6B-4F8A-9AB9-93A0D3371D07}.Debug|Any CPU.Build.0 = Debug|Any CPU
39 | {94101B83-CD6B-4F8A-9AB9-93A0D3371D07}.Release|Any CPU.ActiveCfg = Release|Any CPU
40 | {94101B83-CD6B-4F8A-9AB9-93A0D3371D07}.Release|Any CPU.Build.0 = Release|Any CPU
41 | EndGlobalSection
42 | GlobalSection(SolutionProperties) = preSolution
43 | HideSolutionNode = FALSE
44 | EndGlobalSection
45 | GlobalSection(NestedProjects) = preSolution
46 | {59943B99-772A-47E4-AA70-6D758312C00C} = {9E15663E-75C8-43B6-8236-4847A2685D42}
47 | EndGlobalSection
48 | GlobalSection(ExtensibilityGlobals) = postSolution
49 | SolutionGuid = {8FEFCD82-1FCB-4477-90F7-A935BF59298B}
50 | EndGlobalSection
51 | GlobalSection(SubversionScc) = preSolution
52 | Svn-Managed = True
53 | Manager = AnkhSVN - Subversion Support for Visual Studio
54 | EndGlobalSection
55 | EndGlobal
56 |
--------------------------------------------------------------------------------
/EntityFrameworkExtras.EFCore2.NetStandard20/EntityFrameworkExtras.EFCore2.NetStandard20.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netstandard2.0
5 | EntityFrameworkExtras.EFCore
6 | true
7 | Key.snk
8 | 2.0.7
9 | EntityFrameworkExtras provides some useful additions to EntityFramework such as executing Stored Procedures with User-Defined Table Types and Output Parameters.
10 | EntityFrameworkExtras.EFCore
11 | ZZZ Projects & Michael Rodda & Craig Bovis
12 | EntityFrameworkExtras.EFCore
13 |
14 |
15 |
16 | TRACE;EFCORE EFCORE_2X
17 |
18 |
19 |
20 | TRACE;EFCORE EFCORE_2X
21 | bin\Release\
22 | bin\Release\netstandard2.0\EntityFrameworkExtras.EFCore.xml
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/EntityFrameworkExtras.EFCore2.NetStandard20/Key.snk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzzprojects/EntityFrameworkExtras/ff66b31e2aa04116739c23bfb92e55d9192d68fa/EntityFrameworkExtras.EFCore2.NetStandard20/Key.snk
--------------------------------------------------------------------------------
/EntityFrameworkExtras.EFCore3.NetStandard20/EntityFrameworkExtras.EFCore3.NetStandard20.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netstandard2.0
5 | EntityFrameworkExtras.EFCore
6 | true
7 | Key.snk
8 | 3.0.7
9 | EntityFrameworkExtras provides some useful additions to EntityFramework such as executing Stored Procedures with User-Defined Table Types and Output Parameters.
10 | EntityFrameworkExtras.EFCore
11 | ZZZ Projects & Michael Rodda & Craig Bovis
12 | EntityFrameworkExtras.EFCore
13 |
14 |
15 |
16 | TRACE;EFCORE
17 |
18 |
19 |
20 | TRACE;EFCORE
21 | bin\Release\
22 | bin\Release\netstandard2.0\EntityFrameworkExtras.EFCore.xml
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/EntityFrameworkExtras.EFCore3.NetStandard20/Key.snk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzzprojects/EntityFrameworkExtras/ff66b31e2aa04116739c23bfb92e55d9192d68fa/EntityFrameworkExtras.EFCore3.NetStandard20/Key.snk
--------------------------------------------------------------------------------
/EntityFrameworkExtras.EFCore3.NetStandard21/EntityFrameworkExtras.EFCore3.NetStandard21.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netstandard2.1
5 | EntityFrameworkExtras.EFCore
6 | true
7 | Key.snk
8 | 3.0.7
9 | EntityFrameworkExtras provides some useful additions to EntityFramework such as executing Stored Procedures with User-Defined Table Types and Output Parameters.
10 | EntityFrameworkExtras.EFCore
11 | EntityFrameworkExtras.EFCore
12 | EntityFrameworkExtras.EFCore
13 | ZZZ Projects & Michael Rodda & Craig Bovis
14 |
15 |
16 |
17 | TRACE;EFCORE
18 |
19 |
20 |
21 | TRACE;EFCORE
22 | bin\Release\
23 | bin\Release\netstandard2.1\EntityFrameworkExtras.EFCore.xml
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/EntityFrameworkExtras.EFCore3.NetStandard21/Key.snk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzzprojects/EntityFrameworkExtras/ff66b31e2aa04116739c23bfb92e55d9192d68fa/EntityFrameworkExtras.EFCore3.NetStandard21/Key.snk
--------------------------------------------------------------------------------
/EntityFrameworkExtras.EFCore3.Tests/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("EntityFrameworkExtras.EF6.Tests")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("EntityFrameworkExtras.EF6.Tests")]
13 | [assembly: AssemblyCopyright("Copyright © 2014")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("d1aee2ff-6bc8-48c2-b063-a288c6d79135")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/EntityFrameworkExtras.EFCore3.lab/My.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Data.SqlClient;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using Microsoft.Data.SqlClient;
8 | using Microsoft.EntityFrameworkCore;
9 |
10 | namespace Z.EntityFrameworkExtras.Lab.EFCore30
11 | {
12 | class My
13 | {
14 | public static string DataBaseName = "LabExtra";
15 |
16 | public static string ConnectionString =
17 | ("Server=[REPLACE];Initial Catalog = [BD]; Integrated Security = true; Connection Timeout = 300; Persist Security Info=True").Replace("[REPLACE]", Environment.MachineName).Replace("[BD]", DataBaseName);
18 | public static string ConnectionStringTimeOut =
19 | ("Server=[REPLACE];Initial Catalog = [BD]; Integrated Security = true; Connection Timeout = 5; Persist Security Info=True").Replace("[REPLACE]", Environment.MachineName).Replace("[BD]", DataBaseName);
20 |
21 | public static void DeleteBD(DbContext context)
22 | {
23 | context.Database.EnsureDeleted();
24 | }
25 |
26 | public static void CreateBD(DbContext context)
27 | {
28 | context.Database.EnsureDeleted();
29 | context.Database.EnsureCreated();
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/EntityFrameworkExtras.EFCore3.lab/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Z.EntityFrameworkExtras.Lab.EFCore30
4 | {
5 | class Program
6 | {
7 | static void Main(string[] args)
8 | {
9 | Request_storeProcedure_Transaction.Execute();
10 | Request_TimeOut.Execute();
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/EntityFrameworkExtras.EFCore3.lab/Request_TimeOut.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Data;
4 | using System.Linq;
5 | using System.Reflection;
6 | using System.Text;
7 | using System.Transactions;
8 | using EntityFrameworkExtras.EFCore;
9 | using Microsoft.Data.SqlClient;
10 | using Microsoft.EntityFrameworkCore;
11 |
12 | namespace Z.EntityFrameworkExtras.Lab.EFCore30
13 | {
14 | class Request_TimeOut
15 | {
16 | public static void Execute()
17 | {
18 | // Create BD
19 | using (var context = new EntityContext())
20 | {
21 | My.CreateBD(context);
22 | }
23 |
24 | // CLEAN
25 | using (var context = new EntityContext())
26 | {
27 | context.EntitySimples.RemoveRange(context.EntitySimples);
28 |
29 | context.SaveChanges();
30 | }
31 |
32 | // SEED
33 | using (var context = new EntityContext())
34 | {
35 | for (int i = 0; i < 3; i++)
36 | {
37 | context.EntitySimples.Add(new EntitySimple { ColumnInt = i });
38 | }
39 |
40 | context.SaveChanges();
41 | }
42 |
43 |
44 |
45 | // TEST
46 | using (var context = new EntityContext())
47 | {
48 | var connection = context.Database.GetDbConnection();
49 | connection.Open();
50 | using (var commande = connection.CreateCommand())
51 | {
52 | commande.CommandText = @"
53 | if exists (select 1 from sys.procedures where name = 'PROC_Get_EntitySimple')
54 | BEGIN
55 | DROP PROCEDURE [dbo].[PROC_Get_EntitySimple]
56 | END
57 | ";
58 | commande.ExecuteNonQuery();
59 | }
60 |
61 | using (var commande = connection.CreateCommand())
62 | {
63 | commande.CommandText = @"
64 | CREATE PROCEDURE [dbo].[PROC_Get_EntitySimple]
65 |
66 | @ParameterID INT ,
67 | @ParameterInt INT = NULL OUTPUT
68 |
69 |
70 | AS
71 | BEGIN
72 | WAITFOR DELAY '00:00:08';
73 | select * from EntitySimples ;
74 | END
75 | ";
76 | commande.ExecuteNonQuery();
77 | }
78 |
79 | }
80 |
81 | // TEST
82 | using (var ctx = new EntityContext())
83 | {
84 |
85 | var proc_Get_EntitySimple = new Proc_Get_EntitySimple() { ParameterID = 2 };
86 | ctx.Database.SetCommandTimeout(5);
87 |
88 |
89 |
90 | var t = ctx.Database.ExecuteStoredProcedure(proc_Get_EntitySimple);
91 | ctx.Database.ExecuteStoredProcedure(proc_Get_EntitySimple);
92 | // var list = context.EntitySimples.ToList();
93 | }
94 | }
95 |
96 | public class EntityContext : DbContext
97 | {
98 | public EntityContext() : base()
99 | {
100 | }
101 |
102 | public DbSet EntitySimples { get; set; }
103 | protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
104 | {
105 | optionsBuilder.UseSqlServer(new SqlConnection(My.ConnectionStringTimeOut));
106 |
107 | base.OnConfiguring(optionsBuilder);
108 | }
109 |
110 | }
111 |
112 | [StoredProcedure("PROC_Get_EntitySimple")]
113 | public class Proc_Get_EntitySimple
114 | {
115 | [StoredProcedureParameter(SqlDbType.Int, Direction = ParameterDirection.Output)]
116 | public int ParameterInt { get; set; }
117 |
118 | [StoredProcedureParameter(SqlDbType.Int, Direction = ParameterDirection.Input)]
119 | public int ParameterID { get; set; }
120 | }
121 |
122 |
123 | public class EntitySimple
124 | {
125 | public int ID { get; set; }
126 | public int ColumnInt { get; set; }
127 | public String ColumnString { get; set; }
128 | }
129 | }
130 | }
--------------------------------------------------------------------------------
/EntityFrameworkExtras.EFCore3.lab/Z.EntityFrameworkExtras.Lab.EFCore30.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | netcoreapp3.1
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/EntityFrameworkExtras.EFCore5/EntityFrameworkExtras.EFCore5.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net5.0
5 | EntityFrameworkExtras.EFCore
6 | EntityFrameworkExtras.EFCore
7 | True
8 | bin\Release\net5.0\EntityFrameworkExtras.EFCore.xml
9 | True
10 | Key.snk
11 | 5.0.7
12 | ZZZ Projects & Michael Rodda & Craig Bovis
13 | EntityFrameworkExtras.EFCore
14 | EntityFrameworkExtras.EFCore
15 | EntityFrameworkExtras provides some useful additions to EntityFramework such as executing Stored Procedures with User-Defined Table Types and Output Parameters.
16 |
17 |
18 |
19 | TRACE;EFCORE
20 |
21 |
22 |
23 | TRACE;EFCORE
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/EntityFrameworkExtras.EFCore5/Key.snk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzzprojects/EntityFrameworkExtras/ff66b31e2aa04116739c23bfb92e55d9192d68fa/EntityFrameworkExtras.EFCore5/Key.snk
--------------------------------------------------------------------------------
/EntityFrameworkExtras.EFCore6/EntityFrameworkExtras.EFCore6.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net6.0
5 | enable
6 | enable
7 | EntityFrameworkExtras.EFCore
8 | EntityFrameworkExtras.EFCore
9 | True
10 | bin\Release\net6.0\EntityFrameworkExtras.EFCore.xml
11 | True
12 | Key.snk
13 | 6.0.7
14 | ZZZ Projects & Michael Rodda & Craig Bovis
15 | EntityFrameworkExtras.EFCore
16 | EntityFrameworkExtras.EFCore
17 | EntityFrameworkExtras provides some useful additions to EntityFramework such as executing Stored Procedures with User-Defined Table Types and Output Parameters.
18 |
19 |
20 |
21 | TRACE;EFCORE
22 |
23 |
24 |
25 | TRACE;EFCORE
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/EntityFrameworkExtras.EFCore6/Key.snk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzzprojects/EntityFrameworkExtras/ff66b31e2aa04116739c23bfb92e55d9192d68fa/EntityFrameworkExtras.EFCore6/Key.snk
--------------------------------------------------------------------------------
/EntityFrameworkExtras.EFCore7/EntityFrameworkExtras.EFCore7.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net6.0
5 | enable
6 | enable
7 | EntityFrameworkExtras.EFCore
8 | EntityFrameworkExtras.EFCore
9 | True
10 | bin\Release\net6.0\EntityFrameworkExtras.EFCore.xml
11 | True
12 | Key.snk
13 | 7.0.7
14 | ZZZ Projects & Michael Rodda & Craig Bovis
15 | EntityFrameworkExtras.EFCore
16 | EntityFrameworkExtras.EFCore
17 | EntityFrameworkExtras provides some useful additions to EntityFramework such as executing Stored Procedures with User-Defined Table Types and Output Parameters.
18 |
19 |
20 |
21 | TRACE;EFCORE
22 |
23 |
24 |
25 | TRACE;EFCORE
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/EntityFrameworkExtras.EFCore7/Key.snk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzzprojects/EntityFrameworkExtras/ff66b31e2aa04116739c23bfb92e55d9192d68fa/EntityFrameworkExtras.EFCore7/Key.snk
--------------------------------------------------------------------------------
/EntityFrameworkExtras.EFCore8/EntityFrameworkExtras.EFCore8.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net8.0
5 | enable
6 | enable
7 | EntityFrameworkExtras.EFCore
8 | EntityFrameworkExtras.EFCore
9 | True
10 | bin\Release\net6.0\EntityFrameworkExtras.EFCore.xml
11 | True
12 | Key.snk
13 | 8.0.7
14 | ZZZ Projects & Michael Rodda & Craig Bovis
15 | EntityFrameworkExtras.EFCore
16 | EntityFrameworkExtras.EFCore
17 | EntityFrameworkExtras provides some useful additions to EntityFramework such as executing Stored Procedures with User-Defined Table Types and Output Parameters.
18 |
19 |
20 |
21 | TRACE;EFCORE
22 |
23 |
24 |
25 | TRACE;EFCORE
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/EntityFrameworkExtras.EFCore8/Key.snk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzzprojects/EntityFrameworkExtras/ff66b31e2aa04116739c23bfb92e55d9192d68fa/EntityFrameworkExtras.EFCore8/Key.snk
--------------------------------------------------------------------------------
/EntityFrameworkExtras.EFCore9/EntityFrameworkExtras.EFCore9.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net8.0
5 | enable
6 | enable
7 | EntityFrameworkExtras.EFCore
8 | EntityFrameworkExtras.EFCore
9 | True
10 | bin\Release\net6.0\EntityFrameworkExtras.EFCore.xml
11 | True
12 | Key.snk
13 | 9.0.7
14 | ZZZ Projects & Michael Rodda & Craig Bovis
15 | EntityFrameworkExtras.EFCore
16 | EntityFrameworkExtras.EFCore
17 | EntityFrameworkExtras provides some useful additions to EntityFramework such as executing Stored Procedures with User-Defined Table Types and Output Parameters.
18 |
19 |
20 |
21 | TRACE;EFCORE
22 |
23 |
24 |
25 | TRACE;EFCORE
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/EntityFrameworkExtras.EFCore9/Key.snk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzzprojects/EntityFrameworkExtras/ff66b31e2aa04116739c23bfb92e55d9192d68fa/EntityFrameworkExtras.EFCore9/Key.snk
--------------------------------------------------------------------------------
/EntityFrameworkExtras.Shared/Attributes.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using System.Reflection;
4 |
5 | #if EF4
6 | namespace EntityFrameworkExtras
7 | #elif EF5
8 | namespace EntityFrameworkExtras.EF5
9 | #elif EF6
10 | namespace EntityFrameworkExtras.EF6
11 | #elif EFCORE
12 | namespace EntityFrameworkExtras.EFCore
13 | #endif
14 | {
15 | internal static class Attributes
16 | {
17 | public static T GetAttribute(Type fromType) where T : Attribute
18 | {
19 | object[] attributes = fromType.GetCustomAttributes(typeof(T), false);
20 |
21 | return GetAttribute(attributes);
22 | }
23 |
24 | public static T GetAttribute(PropertyInfo propertyInfo) where T : Attribute
25 | {
26 | object[] attributes = propertyInfo.GetCustomAttributes(typeof(T), false);
27 |
28 | return GetAttribute(attributes);
29 | }
30 |
31 | public static bool HasAttribute(this PropertyInfo propertyInfo) where T : Attribute
32 | {
33 | var attr = GetAttribute(propertyInfo);
34 |
35 | return attr != null;
36 | }
37 |
38 | private static T GetAttribute(object[] attributes) where T : Attribute
39 | {
40 | if (!attributes.Any())
41 | return null;
42 |
43 | var attribute = (T)attributes.First();
44 |
45 | return attribute;
46 | }
47 |
48 | }
49 | }
--------------------------------------------------------------------------------
/EntityFrameworkExtras.Shared/ColumnInformation.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 |
3 | #if EF4
4 | namespace EntityFrameworkExtras
5 | #elif EF5
6 | namespace EntityFrameworkExtras.EF5
7 | #elif EF6
8 | namespace EntityFrameworkExtras.EF6
9 | #elif EFCORE
10 | namespace EntityFrameworkExtras.EFCore
11 | #endif
12 | {
13 | internal class ColumnInformation
14 | {
15 | public string Name { get; set; }
16 | public int Order { get; set; }
17 | public PropertyInfo Property { get; set; }
18 | }
19 | }
--------------------------------------------------------------------------------
/EntityFrameworkExtras.Shared/DatabaseExtensions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Data;
4 | using System.Data.Common;
5 | using System.Linq;
6 | using System.Reflection;
7 | #if EF4 || EF5 || EF6
8 | using System.Data.Entity;
9 | using System.Data.SqlClient;
10 | #elif EFCORE_2X
11 | using System.Threading;
12 | using System.Threading.Tasks;
13 | using System.Data.Common;
14 | using System.Data.SqlClient;
15 | using Microsoft.EntityFrameworkCore;
16 | using Microsoft.EntityFrameworkCore.Storage;
17 | using Microsoft.EntityFrameworkCore.Infrastructure;
18 | #elif EFCORE
19 | using System.Threading;
20 | using System.Threading.Tasks;
21 | using System.Data.Common;
22 | using Microsoft.Data.SqlClient;
23 | using Microsoft.EntityFrameworkCore;
24 | using Microsoft.EntityFrameworkCore.Storage;
25 | using Microsoft.EntityFrameworkCore.Infrastructure;
26 | #endif
27 |
28 |
29 | #if NET45
30 | using System.Threading.Tasks;
31 | using System.Threading;
32 | #endif
33 |
34 | #if EF4
35 | namespace EntityFrameworkExtras
36 | #elif EF5
37 | namespace EntityFrameworkExtras.EF5
38 | #elif EF6
39 | namespace EntityFrameworkExtras.EF6
40 | #elif EFCORE
41 | namespace EntityFrameworkExtras.EFCore
42 | #endif
43 | {
44 | ///
45 | /// Extension methods for the Entity Framework Database class.
46 | ///
47 | public static partial class DatabaseExtensions
48 | {
49 | // from : https://github.com/Fodsuk/EntityFrameworkExtras/pull/23/commits/dce354304aa9a95750f7d2559d1b002444ac46f7
50 | private static object GetValue(this DbDataReader reader, string name)
51 | {
52 | object val = DBNull.Value;
53 |
54 | try
55 | {
56 | val = reader[name];
57 | }
58 | catch (Exception) { }
59 | return val;
60 | }
61 |
62 | private static void SetOutputParameterValues(IEnumerable sqlParameters, object storedProcedure)
63 | {
64 | foreach (SqlParameter sqlParameter in sqlParameters.Where(p => p.Direction != ParameterDirection.Input))
65 | {
66 | PropertyInfo propertyInfo = GetMatchingProperty(storedProcedure, sqlParameter);
67 |
68 | if (propertyInfo != null)
69 | {
70 | propertyInfo.SetValue(storedProcedure,
71 | (sqlParameter.Value == DBNull.Value) ?
72 | GetDefault(propertyInfo.PropertyType) :
73 | sqlParameter.Value, null);
74 | }
75 | }
76 | }
77 |
78 | private static PropertyInfo GetMatchingProperty(object storedProcedure, SqlParameter parameter)
79 | {
80 | foreach (PropertyInfo propertyInfo in storedProcedure.GetType().GetProperties().Where(p => p.HasAttribute()))
81 | {
82 | var helper = new StoredProcedureParserHelper();
83 |
84 | var name = helper.GetParameterName(propertyInfo);
85 |
86 | if (parameter.ParameterName.Substring(1) == name)
87 | return propertyInfo;
88 | }
89 |
90 | return null;
91 | }
92 |
93 | private static object GetDefault(Type type)
94 | {
95 | if (type.IsValueType)
96 | {
97 | return Activator.CreateInstance(type);
98 | }
99 | return null;
100 | }
101 | }
102 | }
--------------------------------------------------------------------------------
/EntityFrameworkExtras.Shared/EntityFrameworkExtras.Shared.projitems:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath)
5 | true
6 | 770fa648-fa98-455d-8bf7-9832c9ede9c6
7 |
8 |
9 | EntityFrameworkExtras.Shared
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/EntityFrameworkExtras.Shared/EntityFrameworkExtras.Shared.shproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 770fa648-fa98-455d-8bf7-9832c9ede9c6
5 | 14.0
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/EntityFrameworkExtras.Shared/StoredProcedureAttribute.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | #if EF4
4 | namespace EntityFrameworkExtras
5 | #elif EF5
6 | namespace EntityFrameworkExtras.EF5
7 | #elif EF6
8 | namespace EntityFrameworkExtras.EF6
9 | #elif EFCORE
10 | namespace EntityFrameworkExtras.EFCore
11 | #endif
12 | {
13 | [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
14 | public class StoredProcedureAttribute : Attribute
15 | {
16 | public StoredProcedureAttribute(string name)
17 | {
18 | if (String.IsNullOrEmpty(name))
19 | throw new ArgumentException("Cannot be null or empty.", "name");
20 |
21 | Name = name;
22 | }
23 |
24 | public string Name { get; set; }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/EntityFrameworkExtras.Shared/StoredProcedureInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.ObjectModel;
2 |
3 | #if EF4 || EF5 || EF6 || EFCORE_2X
4 | using System.Data.SqlClient;
5 | #elif EFCORE
6 | using Microsoft.Data.SqlClient;
7 | #endif
8 |
9 | #if EF4
10 | namespace EntityFrameworkExtras
11 | #elif EF5
12 | namespace EntityFrameworkExtras.EF5
13 | #elif EF6
14 | namespace EntityFrameworkExtras.EF6
15 | #elif EFCORE
16 | namespace EntityFrameworkExtras.EFCore
17 | #endif
18 | {
19 | internal class StoredProcedureInfo
20 | {
21 | internal string Sql { get; set; }
22 | internal SqlParameter[] SqlParameters { get; set; }
23 | }
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/EntityFrameworkExtras.Shared/StoredProcedureParameterAttribute.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Data;
3 |
4 | #if EF4
5 | namespace EntityFrameworkExtras
6 | #elif EF5
7 | namespace EntityFrameworkExtras.EF5
8 | #elif EF6
9 | namespace EntityFrameworkExtras.EF6
10 | #elif EFCORE
11 | namespace EntityFrameworkExtras.EFCore
12 | #endif
13 | {
14 | [AttributeUsage(AttributeTargets.Property, AllowMultiple = false)]
15 | public class StoredProcedureParameterAttribute : Attribute
16 | {
17 | public StoredProcedureParameterAttribute(SqlDbType dataType)
18 | {
19 | DataType = dataType;
20 | Direction = ParameterDirection.Input;
21 | }
22 |
23 | public StoredProcedureParameterAttribute(SqlDbType dataType, StoredProcedureParameterOptions options)
24 | {
25 | DataType = dataType;
26 | Options = options;
27 | Direction = ParameterDirection.Input;
28 | }
29 |
30 | public StoredProcedureParameterAttribute(SqlDbType dataType, int size)
31 | {
32 | DataType = dataType;
33 | Direction = ParameterDirection.Input;
34 | Size = size;
35 | }
36 |
37 | public StoredProcedureParameterAttribute(SqlDbType dataType, StoredProcedureParameterOptions options, int size)
38 | {
39 | DataType = dataType;
40 | Options = options;
41 | Direction = ParameterDirection.Input;
42 | Size = size;
43 | }
44 |
45 | public SqlDbType DataType { get; set; }
46 |
47 | public StoredProcedureParameterOptions Options { get; set; }
48 |
49 | ///
50 | /// Size of the parameter, typically used for output parameters. If an output parameter has a size of 0 then its default to -1 (equivalent to MAX)
51 | ///
52 | public int Size { get; set; }
53 |
54 | ///
55 | /// Specifies the name of the Procedure parameter, if different than the property name.
56 | ///
57 | public string ParameterName { get; set; }
58 |
59 | /// Gets or sets the direction.
60 | public ParameterDirection Direction { get; set; }
61 |
62 | /// Gets or sets the parameter precision.
63 | public byte Precision { get; set; }
64 |
65 | /// Gets or sets the parameter scale.
66 | public byte Scale { get; set; }
67 | }
68 | }
--------------------------------------------------------------------------------
/EntityFrameworkExtras.Shared/StoredProcedureParameterInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Data;
2 | using System.Reflection;
3 |
4 | #if EF4
5 | namespace EntityFrameworkExtras
6 | #elif EF5
7 | namespace EntityFrameworkExtras.EF5
8 | #elif EF6
9 | namespace EntityFrameworkExtras.EF6
10 | #elif EFCORE
11 | namespace EntityFrameworkExtras.EFCore
12 | #endif
13 | {
14 | internal class StoredProcedureParameterInfo
15 | {
16 | internal ParameterDirection Direction { get; set; }
17 | internal string Name { get; set; }
18 | internal SqlDbType SqlDataType { get; set; }
19 | internal bool IsMandatory { get; set; }
20 | internal bool IsUserDefinedTable { get; set; }
21 | internal int Size { get; set; }
22 | internal byte Precision { get; set; }
23 | internal byte Scale { get; set; }
24 | internal PropertyInfo PropertyInfo { get; set; }
25 | }
26 | }
--------------------------------------------------------------------------------
/EntityFrameworkExtras.Shared/StoredProcedureParameterOptions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | #if EF4
4 | namespace EntityFrameworkExtras
5 | #elif EF5
6 | namespace EntityFrameworkExtras.EF5
7 | #elif EF6
8 | namespace EntityFrameworkExtras.EF6
9 | #elif EFCORE
10 | namespace EntityFrameworkExtras.EFCore
11 | #endif
12 | {
13 | [Flags]
14 | public enum StoredProcedureParameterOptions
15 | {
16 | Mandatory = 1
17 | }
18 | }
--------------------------------------------------------------------------------
/EntityFrameworkExtras.Shared/StoredProcedureParserHelper.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Data;
4 | using System.Linq;
5 | using System.Reflection;
6 |
7 | #if EF4
8 | namespace EntityFrameworkExtras
9 | #elif EF5
10 | namespace EntityFrameworkExtras.EF5
11 | #elif EF6
12 | namespace EntityFrameworkExtras.EF6
13 | #elif EFCORE
14 | namespace EntityFrameworkExtras.EFCore
15 | #endif
16 | {
17 | internal class StoredProcedureParserHelper
18 | {
19 | public string GetParameterName(PropertyInfo propertyInfo)
20 | {
21 | var rValue = propertyInfo.Name;
22 |
23 | // grab the name of the parameter from the attribute, if it's defined.
24 | var attribute = Attributes.GetAttribute(propertyInfo);
25 | if (attribute != null && !string.IsNullOrEmpty(attribute.ParameterName))
26 | rValue = attribute.ParameterName;
27 |
28 | return rValue;
29 | }
30 |
31 | public string GetUserDefinedTableType(PropertyInfo propertyInfo)
32 | {
33 | Type collectionType = GetCollectionType(propertyInfo.PropertyType);
34 | var attribute = Attributes.GetAttribute(collectionType);
35 |
36 | if (attribute == null)
37 | throw new InvalidOperationException(
38 | String.Format("{0} has not been decorated with UserDefinedTableTypeAttribute.",
39 | propertyInfo.PropertyType));
40 |
41 | return attribute.Name;
42 | }
43 |
44 | public Type GetCollectionType(Type type)
45 | {
46 | Type returnType = null;
47 | if (type.IsGenericType)
48 | {
49 | if (type.IsInterface && type.GetGenericTypeDefinition() == typeof(IEnumerable<>))
50 | {
51 | returnType = type.GetGenericArguments().FirstOrDefault();
52 | }
53 | else
54 | {
55 | returnType = type.GetInterfaces()
56 | .Where(x => x.IsGenericType)
57 | .FirstOrDefault(x => x.GetGenericTypeDefinition() == typeof(IEnumerable<>))?.GetGenericArguments().FirstOrDefault();
58 | }
59 | }
60 |
61 | return returnType;
62 |
63 | }
64 |
65 | public object GetUserDefinedTableValue(PropertyInfo propertyInfo, object storedProcedure)
66 | {
67 | Type enumerableType = GetCollectionType(propertyInfo.PropertyType);
68 | object propertyValue = propertyInfo.GetValue(storedProcedure, null);
69 |
70 | var generator = new UserDefinedTableGenerator(enumerableType, propertyValue);
71 |
72 | DataTable table = generator.GenerateTable();
73 |
74 | return table;
75 | }
76 |
77 | public bool IsUserDefinedTableParameter(PropertyInfo propertyInfo)
78 | {
79 | Type collectionType = GetCollectionType(propertyInfo.PropertyType);
80 |
81 | return collectionType != null;
82 | }
83 |
84 | public bool ParameterIsMandatory(StoredProcedureParameterOptions options)
85 | {
86 | return (options & StoredProcedureParameterOptions.Mandatory) ==
87 | StoredProcedureParameterOptions.Mandatory;
88 | }
89 | }
90 | }
--------------------------------------------------------------------------------
/EntityFrameworkExtras.Shared/UserDefinedTableGenerator.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections;
3 | using System.Collections.Generic;
4 | using System.Data;
5 | using System.Linq;
6 | using System.Reflection;
7 |
8 | #if EF4
9 | namespace EntityFrameworkExtras
10 | #elif EF5
11 | namespace EntityFrameworkExtras.EF5
12 | #elif EF6
13 | namespace EntityFrameworkExtras.EF6
14 | #elif EFCORE
15 | namespace EntityFrameworkExtras.EFCore
16 | #endif
17 | {
18 | public class UserDefinedTableGenerator
19 | {
20 | private readonly Type _type;
21 | private readonly object _value;
22 |
23 | public UserDefinedTableGenerator(Type type, object value)
24 | {
25 | if (type == null)
26 | throw new ArgumentNullException("type");
27 |
28 | if (value == null)
29 | throw new ArgumentNullException("value");
30 |
31 | _type = type;
32 | _value = value;
33 | }
34 |
35 |
36 | public DataTable GenerateTable()
37 | {
38 | var dt = new DataTable();
39 |
40 | List columns = GetColumnInformation();
41 |
42 | AddColumns(columns, dt);
43 | AddRows(columns, dt);
44 |
45 | return dt;
46 | }
47 |
48 | internal void AddColumns(List columns, DataTable dt)
49 | {
50 | foreach (ColumnInformation column in columns)
51 | {
52 | Type type = column.Property.PropertyType;
53 |
54 | if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof (Nullable<>))
55 | {
56 | type = type.GetGenericArguments()[0];
57 | }
58 |
59 | dt.Columns.Add(column.Name, type);
60 | }
61 | }
62 |
63 | internal void AddRows(List columns, DataTable dt)
64 | {
65 | foreach (object o in (IEnumerable)_value)
66 | {
67 | DataRow row = dt.NewRow();
68 | dt.Rows.Add(row);
69 |
70 | foreach (ColumnInformation column in columns)
71 | {
72 | object value = column.Property.GetValue(o, null);
73 | row[column.Name] = (object)value ?? DBNull.Value;
74 | }
75 | }
76 | }
77 |
78 | private List GetColumnInformation()
79 | {
80 | var columns = new List();
81 |
82 | foreach (PropertyInfo propertyInfo in _type.GetProperties())
83 | {
84 | var attribute = Attributes.GetAttribute(propertyInfo);
85 |
86 | if (attribute != null)
87 | {
88 | var column = new ColumnInformation();
89 | column.Name = attribute.Name ?? propertyInfo.Name;
90 | column.Property = propertyInfo;
91 | column.Order = attribute.Order;
92 |
93 | columns.Add(column);
94 | }
95 | }
96 |
97 | return columns.OrderBy(info => info.Order).ToList();
98 |
99 | }
100 | }
101 | }
--------------------------------------------------------------------------------
/EntityFrameworkExtras.Shared/UserDefinedTableTypeAttribute.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | #if EF4
4 | namespace EntityFrameworkExtras
5 | #elif EF5
6 | namespace EntityFrameworkExtras.EF5
7 | #elif EF6
8 | namespace EntityFrameworkExtras.EF6
9 | #elif EFCORE
10 | namespace EntityFrameworkExtras.EFCore
11 | #endif
12 | {
13 | public class UserDefinedTableTypeAttribute : Attribute
14 | {
15 | public UserDefinedTableTypeAttribute(string name)
16 | {
17 | if (String.IsNullOrEmpty(name))
18 | throw new ArgumentException("Cannot be null or empty.", "name");
19 |
20 | Name = name;
21 | }
22 |
23 | public string Name { get; set; }
24 | }
25 | }
--------------------------------------------------------------------------------
/EntityFrameworkExtras.Shared/UserDefinedTableTypeColumnAttribute.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | #if EF4
4 | namespace EntityFrameworkExtras
5 | #elif EF5
6 | namespace EntityFrameworkExtras.EF5
7 | #elif EF6
8 | namespace EntityFrameworkExtras.EF6
9 | #elif EFCORE
10 | namespace EntityFrameworkExtras.EFCore
11 | #endif
12 | {
13 | public class UserDefinedTableTypeColumnAttribute : Attribute
14 | {
15 | public UserDefinedTableTypeColumnAttribute(int order)
16 | {
17 | Order = order;
18 | }
19 |
20 | public UserDefinedTableTypeColumnAttribute(int order, string name)
21 | {
22 | Order = order;
23 | Name = name;
24 | }
25 |
26 | public int Order { get; set; }
27 |
28 | public string Name { get; set; }
29 | }
30 | }
--------------------------------------------------------------------------------
/EntityFrameworkExtras.Tests.Shared/EntityFrameworkExtras.Tests.Shared.shproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 8189d203-89f3-4d02-b028-f76ce37c9fdb
5 | 14.0
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/EntityFrameworkExtras.Tests.Shared/Integration/DatabaseIntegrationTests.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Configuration;
3 | using System.Linq;
4 | using NUnit.Framework;
5 |
6 | #if EFCORE
7 | using Microsoft.EntityFrameworkCore;
8 | #else
9 | using System.Data.Entity;
10 | #endif
11 |
12 | #if EF5
13 | using EntityFrameworkExtras.EF5;
14 | #elif EF6
15 | using EntityFrameworkExtras.EF6;
16 | #elif EFCORE
17 | using EntityFrameworkExtras.EFCore;
18 | #endif
19 |
20 | namespace EntityFrameworkExtras.Tests.Integration
21 | {
22 | public class DatabaseIntegrationTests
23 | {
24 |
25 | DbContext context;
26 |
27 | [SetUp]
28 | public void Setup()
29 | {
30 | #if EFCORE
31 | var contextOptions = new DbContextOptionsBuilder();
32 | contextOptions.UseSqlServer(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
33 | context = new DbContext(contextOptions.Options);
34 | #else
35 | context = new DbContext("ConnectionString");
36 | #endif
37 | }
38 | public void ExecuteStoredProcedure(object storedProcedure)
39 | {
40 | context.Database.ExecuteStoredProcedure(storedProcedure);
41 | }
42 |
43 | public IEnumerable ExecuteStoredProcedure(object storedProcedure) where T : class
44 | {
45 | return context.Database.ExecuteStoredProcedure(storedProcedure);
46 | }
47 |
48 | public T ExecuteStoredProcedureSingle(object storedProcedure) where T : class
49 | {
50 | return context.Database.ExecuteStoredProcedure(storedProcedure).FirstOrDefault();
51 | }
52 |
53 |
54 | //helper methods
55 | public byte[] GetBytes(string str)
56 | {
57 | return str.Select(e => (byte)e).ToArray();
58 |
59 | // byte[] bytes = new byte[str.Length * sizeof(char)];
60 | // System.Buffer.BlockCopy(str.ToCharArray(), 0, bytes, 0, bytes.Length);
61 | // return bytes;
62 | }
63 | }
64 | }
--------------------------------------------------------------------------------
/EntityFrameworkExtras.Tests.Shared/Integration/ParameteUniqueIdentifierTests.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using EntityFrameworkExtras.Tests.Integration.StoredProcedures;
3 | using NUnit.Framework;
4 |
5 | namespace EntityFrameworkExtras.Tests.Integration
6 | {
7 | [TestFixture]
8 | public class ParameteUniqueIdentifierTests : DatabaseIntegrationTests
9 | {
10 |
11 | [Test]
12 | public void Parameter_Execute_NoErrors()
13 | {
14 | var procedure = new AllTypesStoredProcedure();
15 |
16 | procedure.ParameterUniqueIdentifier = new Guid();
17 |
18 | Assert.DoesNotThrow(() => ExecuteStoredProcedure(procedure));
19 | }
20 |
21 | [Test]
22 | public void Parameter_ExecuteAsNull_NoErrors()
23 | {
24 | var procedure = new AllTypesStoredProcedure();
25 | procedure.ParameterUniqueIdentifier = null;
26 |
27 | Assert.DoesNotThrow(() => ExecuteStoredProcedure(procedure));
28 | }
29 |
30 | [Test]
31 | public void Parameter_Execute_CorrectValueSet()
32 | {
33 | Guid guid = Guid.NewGuid();
34 | var procedure = new AllTypesStoredProcedure();
35 | procedure.ParameterUniqueIdentifier = guid;
36 |
37 | var result = ExecuteStoredProcedureSingle(procedure);
38 |
39 | Assert.AreEqual(guid, result.ParameterUniqueIdentifier);
40 | }
41 | }
42 | }
--------------------------------------------------------------------------------
/EntityFrameworkExtras.Tests.Shared/Integration/ParameterBigIntTests.cs:
--------------------------------------------------------------------------------
1 | using EntityFrameworkExtras.Tests.Integration.StoredProcedures;
2 | using NUnit.Framework;
3 |
4 | namespace EntityFrameworkExtras.Tests.Integration
5 | {
6 | [TestFixture]
7 | public class ParameterBigIntTests : DatabaseIntegrationTests
8 | {
9 | [Test]
10 | public void Parameter_Execute_NoErrors()
11 | {
12 | var procedure = new AllTypesStoredProcedure();
13 |
14 | procedure.ParameterBigInt = 123456789;
15 |
16 | Assert.DoesNotThrow(() => ExecuteStoredProcedure(procedure));
17 | }
18 |
19 | [Test]
20 | public void Parameter_ExecuteAsNull_NoErrors()
21 | {
22 | var procedure = new AllTypesStoredProcedure();
23 | procedure.ParameterBigInt = null;
24 |
25 | Assert.DoesNotThrow(() => ExecuteStoredProcedure(procedure));
26 | }
27 |
28 | [Test]
29 | public void Parameter_Execute_CorrectValueSet()
30 | {
31 | var procedure = new AllTypesStoredProcedure();
32 | procedure.ParameterBigInt = 679;
33 |
34 | var result = ExecuteStoredProcedureSingle(procedure);
35 |
36 | Assert.AreEqual(679, result.ParameterBigInt);
37 | }
38 | }
39 | }
--------------------------------------------------------------------------------
/EntityFrameworkExtras.Tests.Shared/Integration/ParameterBinaryTests.cs:
--------------------------------------------------------------------------------
1 | using EntityFrameworkExtras.Tests.Integration.StoredProcedures;
2 | using NUnit.Framework;
3 |
4 | namespace EntityFrameworkExtras.Tests.Integration
5 | {
6 | [TestFixture]
7 | public class ParameterBinaryTests : DatabaseIntegrationTests
8 | {
9 | [Test]
10 | public void Parameter_Execute_NoErrors()
11 | {
12 | var procedure = new AllTypesStoredProcedure();
13 |
14 | procedure.ParameterBinary = new byte[100];
15 |
16 | Assert.DoesNotThrow(() => ExecuteStoredProcedure(procedure));
17 | }
18 |
19 | [Test]
20 | public void Parameter_ExecuteAsNull_NoErrors()
21 | {
22 | var procedure = new AllTypesStoredProcedure();
23 | procedure.ParameterBinary = null;
24 |
25 | Assert.DoesNotThrow(() => ExecuteStoredProcedure(procedure));
26 | }
27 |
28 | [Test]
29 | public void Parameter_Execute_CorrectValueSet()
30 | {
31 | var procedure = new AllTypesStoredProcedure();
32 | procedure.ParameterBinary = GetBytes("michael rodda");
33 |
34 | var result = ExecuteStoredProcedureSingle(procedure);
35 |
36 | Assert.AreEqual(GetBytes("michael rodda"), result.ParameterBinary);
37 | }
38 | }
39 | }
--------------------------------------------------------------------------------
/EntityFrameworkExtras.Tests.Shared/Integration/ParameterBitTests.cs:
--------------------------------------------------------------------------------
1 | using EntityFrameworkExtras.Tests.Integration.StoredProcedures;
2 | using NUnit.Framework;
3 |
4 | namespace EntityFrameworkExtras.Tests.Integration
5 | {
6 | [TestFixture]
7 | public class ParameterBitTests : DatabaseIntegrationTests
8 | {
9 | [Test]
10 | public void Parameter_Execute_NoErrors()
11 | {
12 | var procedure = new AllTypesStoredProcedure();
13 |
14 | procedure.ParameterBit = true;
15 |
16 | Assert.DoesNotThrow(() => ExecuteStoredProcedure(procedure));
17 | }
18 |
19 | [Test]
20 | public void Parameter_ExecuteAsNull_NoErrors()
21 | {
22 | var procedure = new AllTypesStoredProcedure();
23 | procedure.ParameterBit = null;
24 |
25 | Assert.DoesNotThrow(() => ExecuteStoredProcedure(procedure));
26 | }
27 |
28 | [Test]
29 | public void Parameter_Execute_CorrectValueSet()
30 | {
31 | var procedure = new AllTypesStoredProcedure();
32 | procedure.ParameterBit = true;
33 |
34 | var result = ExecuteStoredProcedureSingle(procedure);
35 |
36 | Assert.AreEqual(true, result.ParameterBit);
37 | }
38 | }
39 | }
--------------------------------------------------------------------------------
/EntityFrameworkExtras.Tests.Shared/Integration/ParameterCharTests.cs:
--------------------------------------------------------------------------------
1 | using EntityFrameworkExtras.Tests.Integration.StoredProcedures;
2 | using NUnit.Framework;
3 |
4 | namespace EntityFrameworkExtras.Tests.Integration
5 | {
6 | [TestFixture]
7 | public class ParameterCharTests : DatabaseIntegrationTests
8 | {
9 | [Test]
10 | public void Parameter_Execute_NoErrors()
11 | {
12 | var procedure = new AllTypesStoredProcedure();
13 |
14 | procedure.ParameterChar = "A";
15 |
16 | Assert.DoesNotThrow(() => ExecuteStoredProcedure(procedure));
17 | }
18 |
19 | [Test]
20 | public void Parameter_ExecuteAsNull_NoErrors()
21 | {
22 | var procedure = new AllTypesStoredProcedure();
23 | procedure.ParameterChar = null;
24 |
25 | Assert.DoesNotThrow(() => ExecuteStoredProcedure(procedure));
26 | }
27 |
28 | [Test]
29 | public void Parameter_Execute_CorrectValueSet()
30 | {
31 | var procedure = new AllTypesStoredProcedure();
32 | procedure.ParameterChar = "Michael";
33 |
34 | var result = ExecuteStoredProcedureSingle(procedure);
35 |
36 | Assert.AreEqual("Michael " /* CHAR(10) */, result.ParameterChar);
37 | }
38 | }
39 | }
--------------------------------------------------------------------------------
/EntityFrameworkExtras.Tests.Shared/Integration/ParameterDateTests.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using EntityFrameworkExtras.Tests.Integration.StoredProcedures;
3 | using NUnit.Framework;
4 |
5 | namespace EntityFrameworkExtras.Tests.Integration
6 | {
7 | [TestFixture]
8 | public class ParameterDateTests : DatabaseIntegrationTests
9 | {
10 |
11 | [Test]
12 | public void Parameter_Execute_NoErrors()
13 | {
14 | var procedure = new AllTypesStoredProcedure();
15 |
16 | procedure.ParameterDate = new DateTime(1983, 11, 10);
17 |
18 | Assert.DoesNotThrow(() => ExecuteStoredProcedure(procedure));
19 | }
20 |
21 | [Test]
22 | public void Parameter_ExecuteAsNull_NoErrors()
23 | {
24 | var procedure = new AllTypesStoredProcedure();
25 | procedure.ParameterDate = null;
26 |
27 | Assert.DoesNotThrow(() => ExecuteStoredProcedure(procedure));
28 | }
29 |
30 | [Test]
31 | public void Parameter_Execute_CorrectValueSet()
32 | {
33 | var procedure = new AllTypesStoredProcedure();
34 | procedure.ParameterDate = new DateTime(1983, 11, 10);
35 |
36 | var result = ExecuteStoredProcedureSingle(procedure);
37 |
38 | Assert.AreEqual(new DateTime(1983, 11, 10), result.ParameterDate);
39 | }
40 |
41 | [Test]
42 | public void Parameter_Execute_NoTimeSet()
43 | {
44 | var procedure = new AllTypesStoredProcedure();
45 | procedure.ParameterDate = new DateTime(1983, 11, 10, 16, 30, 15);
46 |
47 | var result = ExecuteStoredProcedureSingle(procedure);
48 |
49 | Assert.AreEqual(new DateTime(1983, 11, 10, 0, 0, 0), result.ParameterDate);
50 | }
51 | }
52 | }
--------------------------------------------------------------------------------
/EntityFrameworkExtras.Tests.Shared/Integration/ParameterDateTime2Tests.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using EntityFrameworkExtras.Tests.Integration.StoredProcedures;
3 | using NUnit.Framework;
4 |
5 | namespace EntityFrameworkExtras.Tests.Integration
6 | {
7 | [TestFixture]
8 | public class ParameterDateTime2Tests : DatabaseIntegrationTests
9 | {
10 |
11 | [Test]
12 | public void Parameter_Execute_NoErrors()
13 | {
14 | var procedure = new AllTypesStoredProcedure();
15 |
16 | procedure.ParameterDateTime2 = new DateTime(1983, 11, 10);
17 |
18 | Assert.DoesNotThrow(() => ExecuteStoredProcedure(procedure));
19 | }
20 |
21 | [Test]
22 | public void Parameter_ExecuteAsNull_NoErrors()
23 | {
24 | var procedure = new AllTypesStoredProcedure();
25 | procedure.ParameterDateTime2 = null;
26 |
27 | Assert.DoesNotThrow(() => ExecuteStoredProcedure(procedure));
28 | }
29 |
30 | [Test]
31 | public void Parameter_Execute_CorrectValueSet()
32 | {
33 | var procedure = new AllTypesStoredProcedure();
34 | procedure.ParameterDateTime2 = new DateTime(1983, 11, 10);
35 |
36 | var result = ExecuteStoredProcedureSingle(procedure);
37 |
38 | Assert.AreEqual(new DateTime(1983, 11, 10), result.ParameterDateTime2);
39 | }
40 |
41 | [Test]
42 | public void Parameter_Execute_TimeSet()
43 | {
44 | var procedure = new AllTypesStoredProcedure();
45 | procedure.ParameterDateTime2 = new DateTime(1983, 11, 10, 16, 30, 15);
46 |
47 | var result = ExecuteStoredProcedureSingle(procedure);
48 |
49 | Assert.AreEqual(new DateTime(1983, 11, 10, 16, 30, 15), result.ParameterDateTime2);
50 | }
51 | }
52 | }
--------------------------------------------------------------------------------
/EntityFrameworkExtras.Tests.Shared/Integration/ParameterDateTimeOffsetTests.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using EntityFrameworkExtras.Tests.Integration.StoredProcedures;
3 | using NUnit.Framework;
4 |
5 | namespace EntityFrameworkExtras.Tests.Integration
6 | {
7 | [TestFixture]
8 | public class ParameterDateTimeOffsetTests : DatabaseIntegrationTests
9 | {
10 |
11 | [Test]
12 | public void Parameter_Execute_NoErrors()
13 | {
14 | var procedure = new AllTypesStoredProcedure();
15 |
16 | procedure.ParameterDateTimeOffset = new DateTime(1983, 11, 10);
17 |
18 | Assert.DoesNotThrow(() => ExecuteStoredProcedure(procedure));
19 | }
20 |
21 | [Test]
22 | public void Parameter_ExecuteAsNull_NoErrors()
23 | {
24 | var procedure = new AllTypesStoredProcedure();
25 | procedure.ParameterDateTimeOffset = null;
26 |
27 | Assert.DoesNotThrow(() => ExecuteStoredProcedure(procedure));
28 | }
29 |
30 | [Test]
31 | public void Parameter_Execute_CorrectValueSet()
32 | {
33 | var procedure = new AllTypesStoredProcedure();
34 | procedure.ParameterDateTimeOffset = new DateTimeOffset(1983, 11, 11, 13, 45, 59, new TimeSpan(0, 2, 10, 0));
35 |
36 | var result = ExecuteStoredProcedureSingle(procedure);
37 |
38 | Assert.AreEqual(new DateTimeOffset(1983, 11, 11, 13, 45, 59, new TimeSpan(0, 2, 10, 0)), result.ParameterDateTimeOffset);
39 | }
40 |
41 | }
42 | }
--------------------------------------------------------------------------------
/EntityFrameworkExtras.Tests.Shared/Integration/ParameterDateTimeTests.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using EntityFrameworkExtras.Tests.Integration.StoredProcedures;
3 | using NUnit.Framework;
4 |
5 | namespace EntityFrameworkExtras.Tests.Integration
6 | {
7 | [TestFixture]
8 | public class ParameterDateTimeTests : DatabaseIntegrationTests
9 | {
10 |
11 | [Test]
12 | public void Parameter_Execute_NoErrors()
13 | {
14 | var procedure = new AllTypesStoredProcedure();
15 |
16 | procedure.ParameterDateTime = new DateTime(1983, 11, 10);
17 |
18 | Assert.DoesNotThrow(() => ExecuteStoredProcedure(procedure));
19 | }
20 |
21 | [Test]
22 | public void Parameter_ExecuteAsNull_NoErrors()
23 | {
24 | var procedure = new AllTypesStoredProcedure();
25 | procedure.ParameterDateTime = null;
26 |
27 | Assert.DoesNotThrow(() => ExecuteStoredProcedure(procedure));
28 | }
29 |
30 | [Test]
31 | public void Parameter_Execute_CorrectValueSet()
32 | {
33 | var procedure = new AllTypesStoredProcedure();
34 | procedure.ParameterDateTime = new DateTime(1983, 11, 10);
35 |
36 | var result = ExecuteStoredProcedureSingle(procedure);
37 |
38 | Assert.AreEqual(new DateTime(1983, 11, 10), result.ParameterDateTime);
39 | }
40 |
41 | [Test]
42 | public void Parameter_Execute_TimeSet()
43 | {
44 | var procedure = new AllTypesStoredProcedure();
45 | procedure.ParameterDateTime = new DateTime(1983, 11, 10, 16, 30, 15);
46 |
47 | var result = ExecuteStoredProcedureSingle(procedure);
48 |
49 | Assert.AreEqual(new DateTime(1983, 11, 10, 16, 30, 15), result.ParameterDateTime);
50 | }
51 | }
52 | }
--------------------------------------------------------------------------------
/EntityFrameworkExtras.Tests.Shared/Integration/ParameterDecimalTests.cs:
--------------------------------------------------------------------------------
1 | using EntityFrameworkExtras.Tests.Integration.StoredProcedures;
2 | using NUnit.Framework;
3 |
4 | namespace EntityFrameworkExtras.Tests.Integration
5 | {
6 | [TestFixture]
7 | public class ParameterDecimalTests : DatabaseIntegrationTests
8 | {
9 |
10 | [Test]
11 | public void Parameter_Execute_NoErrors()
12 | {
13 | var procedure = new AllTypesStoredProcedure();
14 |
15 | procedure.ParameterDecimal = 555.01m;
16 |
17 | Assert.DoesNotThrow(() => ExecuteStoredProcedure(procedure));
18 | }
19 |
20 | [Test]
21 | public void Parameter_ExecuteAsNull_NoErrors()
22 | {
23 | var procedure = new AllTypesStoredProcedure();
24 | procedure.ParameterDecimal = null;
25 |
26 | Assert.DoesNotThrow(() => ExecuteStoredProcedure(procedure));
27 | }
28 |
29 | [Test]
30 | public void Parameter_Execute_CorrectValueSet()
31 | {
32 | var procedure = new AllTypesStoredProcedure();
33 | procedure.ParameterDecimal = 56m;
34 |
35 | var result = ExecuteStoredProcedureSingle(procedure);
36 |
37 | Assert.AreEqual(56m, result.ParameterDecimal);
38 | }
39 |
40 | }
41 | }
--------------------------------------------------------------------------------
/EntityFrameworkExtras.Tests.Shared/Integration/ParameterDirectionTests.DirectionDefault.cs:
--------------------------------------------------------------------------------
1 | using EntityFrameworkExtras.Tests.Integration.StoredProcedures;
2 | using NUnit.Framework;
3 |
4 | namespace EntityFrameworkExtras.Tests.Integration
5 | {
6 | [TestFixture]
7 | public partial class ParameterDirectionTests : DatabaseIntegrationTests
8 | {
9 |
10 | [Test]
11 | public void Execute_DirectionDefault_CorrectValueSet()
12 | {
13 | var procedure = new ParameterDirectionStoredProcedure();
14 |
15 | procedure.ParameterDirectionDefault = "ParameterDirectionDefault";
16 |
17 | var result = ExecuteStoredProcedureSingle(procedure);
18 |
19 | Assert.AreEqual("ParameterDirectionDefault", result.ParameterDirectionDefault);
20 | }
21 |
22 | [Test]
23 | public void Execute_DirectionDefault_NoOutputParameterSet()
24 | {
25 | var procedure = new ParameterDirectionStoredProcedure();
26 |
27 | procedure.ParameterDirectionDefault = "ParameterDirectionDefault";
28 |
29 | ExecuteStoredProcedureSingle(procedure);
30 |
31 | Assert.AreEqual("ParameterDirectionDefault", procedure.ParameterDirectionDefault);
32 | }
33 |
34 | }
35 |
36 | }
--------------------------------------------------------------------------------
/EntityFrameworkExtras.Tests.Shared/Integration/ParameterDirectionTests.DirectionInput.cs:
--------------------------------------------------------------------------------
1 | using EntityFrameworkExtras.Tests.Integration.StoredProcedures;
2 | using NUnit.Framework;
3 |
4 | namespace EntityFrameworkExtras.Tests.Integration
5 | {
6 | [TestFixture]
7 | public partial class ParameterDirectionTests
8 | {
9 |
10 | [Test]
11 | public void Execute_DirectionInput_CorrectValueSet()
12 | {
13 | var procedure = new ParameterDirectionStoredProcedure();
14 |
15 | procedure.ParameterDirectionInput = "ParameterDirectionInput";
16 |
17 | var result = ExecuteStoredProcedureSingle(procedure);
18 |
19 | Assert.AreEqual("ParameterDirectionInput", result.ParameterDirectionInput);
20 | }
21 |
22 | [Test]
23 | public void Execute_DirectionInput_NoOutputParameterSet()
24 | {
25 | var procedure = new ParameterDirectionStoredProcedure();
26 |
27 | procedure.ParameterDirectionInput = "ParameterDirectionInput";
28 |
29 | ExecuteStoredProcedureSingle(procedure);
30 |
31 | Assert.AreEqual("ParameterDirectionInput", procedure.ParameterDirectionInput);
32 | }
33 |
34 | }
35 | }
--------------------------------------------------------------------------------
/EntityFrameworkExtras.Tests.Shared/Integration/ParameterDirectionTests.DirectionInputOutput.cs:
--------------------------------------------------------------------------------
1 | using EntityFrameworkExtras.Tests.Integration.StoredProcedures;
2 | using NUnit.Framework;
3 |
4 | namespace EntityFrameworkExtras.Tests.Integration
5 | {
6 | [TestFixture]
7 | public partial class ParameterDirectionTests
8 | {
9 |
10 | [Test]
11 | public void Execute_DirectionInputOutput_CorrectValueSet()
12 | {
13 | var procedure = new ParameterDirectionStoredProcedure();
14 |
15 | procedure.ParameterDirectionInputOutput = "ParameterDirectionInputOutput";
16 |
17 | var result = ExecuteStoredProcedureSingle(procedure);
18 |
19 | Assert.AreEqual("ParameterDirectionInputOutput", result.ParameterDirectionInputOutput);
20 | }
21 |
22 | [Test]
23 | public void Execute_DirectionInputOutput_OutputParameterSet()
24 | {
25 | var procedure = new ParameterDirectionStoredProcedure();
26 |
27 | procedure.ParameterDirectionInputOutput = "ParameterDirectionInput";
28 |
29 | ExecuteStoredProcedureSingle(procedure);
30 |
31 | Assert.AreEqual("DirectionInputOutputValue", procedure.ParameterDirectionInputOutput);
32 | }
33 |
34 | [Test]
35 | public void Execute_DirectionInputOutputParameterSizeLessThenValueSet_ValueReturnedShouldBeTrimmed()
36 | {
37 | var procedure = new OutputParameterSizeSetStoredProcedure();
38 |
39 | // procedure.ParameterDirectionInputOutput - This parameters size is set to 10
40 |
41 | ExecuteStoredProcedureSingle(procedure);
42 |
43 | Assert.AreEqual("DirectionI", procedure.ParameterDirectionInputOutput);
44 | }
45 |
46 | [Test]
47 | public void Execute_DirectionInputOutputParameterSizeNotSet_DefaultsToMaximumSize()
48 | {
49 | var procedure = new OutputParameterSizeNotSetStoredProcedure();
50 |
51 | // procedure.ParameterDirectionInputOutput - No size set
52 |
53 | ExecuteStoredProcedureSingle(procedure);
54 |
55 | Assert.AreEqual("DirectionInputOutputValue", procedure.ParameterDirectionInputOutput);
56 | }
57 | }
58 | }
--------------------------------------------------------------------------------
/EntityFrameworkExtras.Tests.Shared/Integration/ParameterDirectionTests.DirectionOutput.cs:
--------------------------------------------------------------------------------
1 | using EntityFrameworkExtras.Tests.Integration.StoredProcedures;
2 | using NUnit.Framework;
3 |
4 | namespace EntityFrameworkExtras.Tests.Integration
5 | {
6 | [TestFixture]
7 | public partial class ParameterDirectionTests
8 | {
9 |
10 | [Test]
11 | public void Execute_DirectionOutput_NoValueSet()
12 | {
13 | var procedure = new ParameterDirectionStoredProcedure();
14 |
15 | procedure.ParameterDirectionOutput = "ParameterDirectionOutput";
16 |
17 | var result = ExecuteStoredProcedureSingle(procedure);
18 |
19 | Assert.AreEqual(null, result.ParameterDirectionOutput);
20 | }
21 |
22 | [Test]
23 | public void Execute_DirectionOutput_OutputParameterSet()
24 | {
25 | var procedure = new ParameterDirectionStoredProcedure();
26 |
27 | procedure.ParameterDirectionOutput = "ParameterDirectionOutput";
28 |
29 | ExecuteStoredProcedureSingle(procedure);
30 |
31 | Assert.AreEqual("DirectionOutputValue", procedure.ParameterDirectionOutput);
32 | }
33 |
34 | [Test]
35 | public void Execute_DirectionOutputParameterSizeLessThenValueSet_ValueReturnedShouldBeTrimmed()
36 | {
37 | var procedure = new OutputParameterSizeSetStoredProcedure();
38 |
39 | // procedure.ParameterDirectionOutput This parameters size is set to 10
40 |
41 | ExecuteStoredProcedureSingle(procedure);
42 |
43 | Assert.AreEqual("DirectionO", procedure.ParameterDirectionOutput);
44 | }
45 |
46 | [Test]
47 | public void Execute_DirectionOutputParameterSizeNotet_DefaultsToMaximumSize()
48 | {
49 | var procedure = new OutputParameterSizeNotSetStoredProcedure();
50 |
51 | // procedure.ParameterDirectionOutput This parameters has no size set
52 |
53 | ExecuteStoredProcedureSingle(procedure);
54 |
55 | Assert.AreEqual("DirectionOutputValue", procedure.ParameterDirectionOutput);
56 | }
57 | }
58 | }
--------------------------------------------------------------------------------
/EntityFrameworkExtras.Tests.Shared/Integration/ParameterDirectionTests.DirectionReturn.cs:
--------------------------------------------------------------------------------
1 | using EntityFrameworkExtras.Tests.Integration.StoredProcedures;
2 | using NUnit.Framework;
3 |
4 | namespace EntityFrameworkExtras.Tests.Integration
5 | {
6 | [TestFixture]
7 | public partial class ParameterDirectionTests
8 | {
9 |
10 | //Need to fix code for ReturnValue to work (use Direction.Output for now)
11 |
12 | // [Test]
13 | // public void Execute_DirectionReturn_CorrectValueSet()
14 | // {
15 | // var procedure = new ParameterDirectionStoredProcedure();
16 | //
17 | // procedure.ParameterDirectionReturnValue = "ParameterDirectionReturnValue";
18 | //
19 | // var result = ExecuteStoredProcedureSingle(procedure);
20 | //
21 | // Assert.AreEqual("ParameterDirectionReturnValue", result.ParameterDirectionReturnValue);
22 | // }
23 | //
24 | // [Test]
25 | // public void Execute_DirectionReturn_OutputParameterSet()
26 | // {
27 | // var procedure = new ParameterDirectionStoredProcedure();
28 | //
29 | // procedure.ParameterDirectionReturnValue = "ParameterDirectionReturnValue";
30 | //
31 | // ExecuteStoredProcedureSingle(procedure);
32 | //
33 | // Assert.AreEqual("DirectionReturnValue", procedure.ParameterDirectionReturnValue);
34 | // }
35 | }
36 | }
--------------------------------------------------------------------------------
/EntityFrameworkExtras.Tests.Shared/Integration/ParameterFloatTests.cs:
--------------------------------------------------------------------------------
1 | using EntityFrameworkExtras.Tests.Integration.StoredProcedures;
2 | using NUnit.Framework;
3 |
4 | namespace EntityFrameworkExtras.Tests.Integration
5 | {
6 | [TestFixture]
7 | public class ParameterFloatTests : DatabaseIntegrationTests
8 | {
9 |
10 | [Test]
11 | public void Parameter_Execute_NoErrors()
12 | {
13 | var procedure = new AllTypesStoredProcedure();
14 |
15 | procedure.ParameterFloat = 653;
16 |
17 | Assert.DoesNotThrow(() => ExecuteStoredProcedure(procedure));
18 | }
19 |
20 | [Test]
21 | public void Parameter_ExecuteAsNull_NoErrors()
22 | {
23 | var procedure = new AllTypesStoredProcedure();
24 | procedure.ParameterFloat = null;
25 |
26 | Assert.DoesNotThrow(() => ExecuteStoredProcedure(procedure));
27 | }
28 |
29 | [Test]
30 | public void Parameter_Execute_CorrectValueSet()
31 | {
32 | var procedure = new AllTypesStoredProcedure();
33 | procedure.ParameterFloat = 349d;
34 |
35 | var result = ExecuteStoredProcedureSingle(procedure);
36 |
37 | Assert.AreEqual(349d, result.ParameterFloat);
38 | }
39 |
40 | }
41 | }
--------------------------------------------------------------------------------
/EntityFrameworkExtras.Tests.Shared/Integration/ParameterImageTests.cs:
--------------------------------------------------------------------------------
1 | using EntityFrameworkExtras.Tests.Integration.StoredProcedures;
2 | using NUnit.Framework;
3 |
4 | namespace EntityFrameworkExtras.Tests.Integration
5 | {
6 | [TestFixture]
7 | public class ParameterImageTests : DatabaseIntegrationTests
8 | {
9 | [Test]
10 | public void Parameter_Execute_NoErrors()
11 | {
12 | var procedure = new AllTypesStoredProcedure();
13 |
14 | procedure.ParameterImage = new byte[100];
15 |
16 | Assert.DoesNotThrow(() => ExecuteStoredProcedure(procedure));
17 | }
18 |
19 | [Test]
20 | public void Parameter_ExecuteAsNull_NoErrors()
21 | {
22 | var procedure = new AllTypesStoredProcedure();
23 | procedure.ParameterImage = null;
24 |
25 | Assert.DoesNotThrow(() => ExecuteStoredProcedure(procedure));
26 | }
27 |
28 | [Test]
29 | public void Parameter_Execute_CorrectValueSet()
30 | {
31 | var procedure = new AllTypesStoredProcedure();
32 | procedure.ParameterImage = GetBytes("michael rodda");
33 |
34 | var result = ExecuteStoredProcedureSingle(procedure);
35 |
36 | Assert.AreEqual(GetBytes("michael rodda"), result.ParameterImage);
37 | }
38 |
39 | }
40 | }
--------------------------------------------------------------------------------
/EntityFrameworkExtras.Tests.Shared/Integration/ParameterIntTests.cs:
--------------------------------------------------------------------------------
1 | using EntityFrameworkExtras.Tests.Integration.StoredProcedures;
2 | using NUnit.Framework;
3 |
4 | namespace EntityFrameworkExtras.Tests.Integration
5 | {
6 | [TestFixture]
7 | public class ParameterIntTests : DatabaseIntegrationTests
8 | {
9 |
10 | [Test]
11 | public void Parameter_Execute_NoErrors()
12 | {
13 | var procedure = new AllTypesStoredProcedure();
14 |
15 | procedure.ParameterInt = 653;
16 |
17 | Assert.DoesNotThrow(() => ExecuteStoredProcedure(procedure));
18 | }
19 |
20 | [Test]
21 | public void Parameter_ExecuteAsNull_NoErrors()
22 | {
23 | var procedure = new AllTypesStoredProcedure();
24 | procedure.ParameterInt = null;
25 |
26 | Assert.DoesNotThrow(() => ExecuteStoredProcedure(procedure));
27 | }
28 |
29 | [Test]
30 | public void Parameter_Execute_CorrectValueSet()
31 | {
32 | var procedure = new AllTypesStoredProcedure();
33 | procedure.ParameterInt = 777;
34 |
35 | var result = ExecuteStoredProcedureSingle(procedure);
36 |
37 | Assert.AreEqual(777, result.ParameterInt);
38 | }
39 |
40 | }
41 | }
--------------------------------------------------------------------------------
/EntityFrameworkExtras.Tests.Shared/Integration/ParameterMoneyTests.cs:
--------------------------------------------------------------------------------
1 | using EntityFrameworkExtras.Tests.Integration.StoredProcedures;
2 | using NUnit.Framework;
3 |
4 | namespace EntityFrameworkExtras.Tests.Integration
5 | {
6 | [TestFixture]
7 | public class ParameterMoneyTests : DatabaseIntegrationTests
8 | {
9 |
10 | [Test]
11 | public void Parameter_Execute_NoErrors()
12 | {
13 | var procedure = new AllTypesStoredProcedure();
14 |
15 | procedure.ParameterMoney = 653m;
16 |
17 | Assert.DoesNotThrow(() => ExecuteStoredProcedure(procedure));
18 | }
19 |
20 | [Test]
21 | public void Parameter_ExecuteAsNull_NoErrors()
22 | {
23 | var procedure = new AllTypesStoredProcedure();
24 | procedure.ParameterMoney = null;
25 |
26 | Assert.DoesNotThrow(() => ExecuteStoredProcedure(procedure));
27 | }
28 |
29 | [Test]
30 | public void Parameter_Execute_CorrectValueSet()
31 | {
32 | var procedure = new AllTypesStoredProcedure();
33 | procedure.ParameterMoney = 777;
34 |
35 | var result = ExecuteStoredProcedureSingle(procedure);
36 |
37 | Assert.AreEqual(777, result.ParameterMoney);
38 | }
39 |
40 | }
41 | }
--------------------------------------------------------------------------------
/EntityFrameworkExtras.Tests.Shared/Integration/ParameterNCharTests.cs:
--------------------------------------------------------------------------------
1 | using EntityFrameworkExtras.Tests.Integration.StoredProcedures;
2 | using NUnit.Framework;
3 |
4 | namespace EntityFrameworkExtras.Tests.Integration
5 | {
6 | [TestFixture]
7 | public class ParameterNCharTests : DatabaseIntegrationTests
8 | {
9 |
10 | [Test]
11 | public void Parameter_Execute_NoErrors()
12 | {
13 | var procedure = new AllTypesStoredProcedure();
14 |
15 | procedure.ParameterNChar = "Michael";
16 |
17 | Assert.DoesNotThrow(() => ExecuteStoredProcedure(procedure));
18 | }
19 |
20 | [Test]
21 | public void Parameter_ExecuteAsNull_NoErrors()
22 | {
23 | var procedure = new AllTypesStoredProcedure();
24 | procedure.ParameterNChar = null;
25 |
26 | Assert.DoesNotThrow(() => ExecuteStoredProcedure(procedure));
27 | }
28 |
29 | [Test]
30 | public void Parameter_Execute_CorrectValueSet()
31 | {
32 | var procedure = new AllTypesStoredProcedure();
33 | procedure.ParameterNChar = "Michael";
34 |
35 | var result = ExecuteStoredProcedureSingle(procedure);
36 |
37 | Assert.AreEqual("Michael " /* NCHAR(10) */, result.ParameterNChar);
38 | }
39 | }
40 | }
--------------------------------------------------------------------------------
/EntityFrameworkExtras.Tests.Shared/Integration/ParameterNTextTests.cs:
--------------------------------------------------------------------------------
1 | using EntityFrameworkExtras.Tests.Integration.StoredProcedures;
2 | using NUnit.Framework;
3 |
4 | namespace EntityFrameworkExtras.Tests.Integration
5 | {
6 | [TestFixture]
7 | public class ParameterNTextTests : DatabaseIntegrationTests
8 | {
9 |
10 | [Test]
11 | public void Parameter_Execute_NoErrors()
12 | {
13 | var procedure = new AllTypesStoredProcedure();
14 |
15 | procedure.ParameterNText = "Michael";
16 |
17 | Assert.DoesNotThrow(() => ExecuteStoredProcedure(procedure));
18 | }
19 |
20 | [Test]
21 | public void Parameter_ExecuteAsNull_NoErrors()
22 | {
23 | var procedure = new AllTypesStoredProcedure();
24 | procedure.ParameterNText = null;
25 |
26 | Assert.DoesNotThrow(() => ExecuteStoredProcedure(procedure));
27 | }
28 |
29 | [Test]
30 | public void Parameter_Execute_CorrectValueSet()
31 | {
32 | var procedure = new AllTypesStoredProcedure();
33 | procedure.ParameterNText = "michael";
34 |
35 | var result = ExecuteStoredProcedureSingle(procedure);
36 |
37 | Assert.AreEqual("michael", result.ParameterNText);
38 | }
39 | }
40 | }
--------------------------------------------------------------------------------
/EntityFrameworkExtras.Tests.Shared/Integration/ParameterNvarCharTests.cs:
--------------------------------------------------------------------------------
1 | using EntityFrameworkExtras.Tests.Integration.StoredProcedures;
2 | using NUnit.Framework;
3 |
4 | namespace EntityFrameworkExtras.Tests.Integration
5 | {
6 | [TestFixture]
7 | public class ParameterNvarCharTests : DatabaseIntegrationTests
8 | {
9 |
10 | [Test]
11 | public void Parameter_Execute_NoErrors()
12 | {
13 | var procedure = new AllTypesStoredProcedure();
14 |
15 | procedure.ParameterNvarChar = "Michael";
16 |
17 | Assert.DoesNotThrow(() => ExecuteStoredProcedure(procedure));
18 | }
19 |
20 | [Test]
21 | public void Parameter_ExecuteAsNull_NoErrors()
22 | {
23 | var procedure = new AllTypesStoredProcedure();
24 | procedure.ParameterNvarChar = null;
25 |
26 | Assert.DoesNotThrow(() => ExecuteStoredProcedure(procedure));
27 | }
28 |
29 | [Test]
30 | public void Parameter_Execute_CorrectValueSet()
31 | {
32 | var procedure = new AllTypesStoredProcedure();
33 | procedure.ParameterNvarChar = "michael";
34 |
35 | var result = ExecuteStoredProcedureSingle(procedure);
36 |
37 | Assert.AreEqual("michael", result.ParameterNvarChar);
38 | }
39 | }
40 | }
--------------------------------------------------------------------------------
/EntityFrameworkExtras.Tests.Shared/Integration/ParameterRealTests.cs:
--------------------------------------------------------------------------------
1 | using EntityFrameworkExtras.Tests.Integration.StoredProcedures;
2 | using NUnit.Framework;
3 |
4 | namespace EntityFrameworkExtras.Tests.Integration
5 | {
6 | [TestFixture]
7 | public class ParameterRealTests : DatabaseIntegrationTests
8 | {
9 |
10 | [Test]
11 | public void Parameter_Execute_NoErrors()
12 | {
13 | var procedure = new AllTypesStoredProcedure();
14 |
15 | procedure.ParameterReal = 653;
16 |
17 | Assert.DoesNotThrow(() => ExecuteStoredProcedure(procedure));
18 | }
19 |
20 | [Test]
21 | public void Parameter_ExecuteAsNull_NoErrors()
22 | {
23 | var procedure = new AllTypesStoredProcedure();
24 | procedure.ParameterReal = null;
25 |
26 | Assert.DoesNotThrow(() => ExecuteStoredProcedure(procedure));
27 | }
28 |
29 | [Test]
30 | public void Parameter_Execute_CorrectValueSet()
31 | {
32 | var procedure = new AllTypesStoredProcedure();
33 | procedure.ParameterReal = 656;
34 |
35 | var result = ExecuteStoredProcedureSingle(procedure);
36 |
37 | Assert.AreEqual(656, result.ParameterReal);
38 | }
39 |
40 | }
41 | }
--------------------------------------------------------------------------------
/EntityFrameworkExtras.Tests.Shared/Integration/ParameterSizeTests.cs:
--------------------------------------------------------------------------------
1 | using EntityFrameworkExtras.Tests.Integration.StoredProcedures;
2 | using NUnit.Framework;
3 |
4 | namespace EntityFrameworkExtras.Tests.Integration
5 | {
6 | [TestFixture]
7 | public partial class ParameterSizeTests : DatabaseIntegrationTests
8 | {
9 | [Test]
10 | public void Execute_SizeNotSet_CorrectValueReturned()
11 | {
12 | var proc = new ParameterSizeStoredProcedure();
13 | proc.ParameterSizeNotSet = "12345679";
14 |
15 | var result = ExecuteStoredProcedureSingle(proc);
16 |
17 | Assert.AreEqual("12345679", result.ParameterSizeNotSet);
18 | }
19 |
20 | [Test]
21 | public void Execute_CorrectSizeSet_CorrectValueReturned()
22 | {
23 | var proc = new ParameterSizeStoredProcedure();
24 | proc.ParameterSizeSetTo10 = "1234567891";
25 |
26 | var result = ExecuteStoredProcedureSingle(proc);
27 |
28 | Assert.AreEqual("1234567891", result.ParameterSizeSetTo10);
29 | }
30 |
31 | [Test]
32 | public void Execute_LesserSizeSet_CorrectValueReturned()
33 | {
34 | var proc = new ParameterSizeStoredProcedure();
35 | proc.ParameterSizeSetTo5 = "12345";
36 |
37 | var result = ExecuteStoredProcedureSingle(proc);
38 |
39 | Assert.AreEqual("12345", result.ParameterSizeSetTo5);
40 | }
41 |
42 | [Test]
43 | public void Execute_HigherSizeSet_CorrectValueReturned()
44 | {
45 | var proc = new ParameterSizeStoredProcedure();
46 | proc.ParameterSizeSetTo20 = "12345678911234567891";
47 |
48 | var result = ExecuteStoredProcedureSingle(proc);
49 |
50 | Assert.AreEqual("1234567891", result.ParameterSizeSetTo20);
51 | }
52 |
53 | }
54 |
55 |
56 | }
--------------------------------------------------------------------------------
/EntityFrameworkExtras.Tests.Shared/Integration/ParameterSmallDateTimeTests.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using EntityFrameworkExtras.Tests.Integration.StoredProcedures;
3 | using NUnit.Framework;
4 |
5 | namespace EntityFrameworkExtras.Tests.Integration
6 | {
7 | [TestFixture]
8 | public class ParameterSmallDateTimeTests : DatabaseIntegrationTests
9 | {
10 |
11 | [Test]
12 | public void Parameter_Execute_NoErrors()
13 | {
14 | var procedure = new AllTypesStoredProcedure();
15 |
16 | procedure.ParameterSmallDateTime = new DateTime(1983, 11, 10);
17 |
18 | Assert.DoesNotThrow(() => ExecuteStoredProcedure(procedure));
19 | }
20 |
21 | [Test]
22 | public void Parameter_ExecuteAsNull_NoErrors()
23 | {
24 | var procedure = new AllTypesStoredProcedure();
25 | procedure.ParameterSmallDateTime = null;
26 |
27 | Assert.DoesNotThrow(() => ExecuteStoredProcedure(procedure));
28 | }
29 |
30 | [Test]
31 | public void Parameter_Execute_CorrectValueSet()
32 | {
33 | var procedure = new AllTypesStoredProcedure();
34 | procedure.ParameterSmallDateTime = new DateTime(1983, 11, 10);
35 |
36 | var result = ExecuteStoredProcedureSingle(procedure);
37 |
38 | Assert.AreEqual(new DateTime(1983, 11, 10), result.ParameterSmallDateTime);
39 | }
40 |
41 |
42 | [Test]
43 | public void Parameter_Execute_MinutesRoundedDown()
44 | {
45 | var procedure = new AllTypesStoredProcedure();
46 | procedure.ParameterSmallDateTime = new DateTime(1983, 11, 10, 16, 35, 29);
47 |
48 | var result = ExecuteStoredProcedureSingle(procedure);
49 |
50 | Assert.AreEqual(new DateTime(1983, 11, 10, 16, 35 /* rounded as seconds passed < 30 */, 0), result.ParameterSmallDateTime);
51 | }
52 |
53 | [Test]
54 | public void Parameter_Execute_MinutesRoundedUp()
55 | {
56 | var procedure = new AllTypesStoredProcedure();
57 | procedure.ParameterSmallDateTime = new DateTime(1983, 11, 10, 16, 35, 30);
58 |
59 | var result = ExecuteStoredProcedureSingle(procedure);
60 |
61 | Assert.AreEqual(new DateTime(1983, 11, 10, 16, 36 /* rounded up as seconds passed => 30 */, 0), result.ParameterSmallDateTime);
62 | }
63 | }
64 | }
--------------------------------------------------------------------------------
/EntityFrameworkExtras.Tests.Shared/Integration/ParameterSmallIntTests.cs:
--------------------------------------------------------------------------------
1 | using EntityFrameworkExtras.Tests.Integration.StoredProcedures;
2 | using NUnit.Framework;
3 |
4 | namespace EntityFrameworkExtras.Tests.Integration
5 | {
6 | [TestFixture]
7 | public class ParameterSmallIntTests : DatabaseIntegrationTests
8 | {
9 |
10 | [Test]
11 | public void Parameter_Execute_NoErrors()
12 | {
13 | var procedure = new AllTypesStoredProcedure();
14 |
15 | procedure.ParameterSmallInt = 653;
16 |
17 | Assert.DoesNotThrow(() => ExecuteStoredProcedure(procedure));
18 | }
19 |
20 | [Test]
21 | public void Parameter_ExecuteAsNull_NoErrors()
22 | {
23 | var procedure = new AllTypesStoredProcedure();
24 | procedure.ParameterSmallInt = null;
25 |
26 | Assert.DoesNotThrow(() => ExecuteStoredProcedure(procedure));
27 | }
28 |
29 | [Test]
30 | public void Parameter_Execute_CorrectValueSet()
31 | {
32 | var procedure = new AllTypesStoredProcedure();
33 | procedure.ParameterSmallInt = 777;
34 |
35 | var result = ExecuteStoredProcedureSingle(procedure);
36 |
37 | Assert.AreEqual(777, result.ParameterSmallInt);
38 | }
39 |
40 | }
41 | }
--------------------------------------------------------------------------------
/EntityFrameworkExtras.Tests.Shared/Integration/ParameterSmallMoneyTests.cs:
--------------------------------------------------------------------------------
1 | using EntityFrameworkExtras.Tests.Integration.StoredProcedures;
2 | using NUnit.Framework;
3 |
4 | namespace EntityFrameworkExtras.Tests.Integration
5 | {
6 | [TestFixture]
7 | public class ParameterSmallMoneyTests : DatabaseIntegrationTests
8 | {
9 |
10 | [Test]
11 | public void Parameter_Execute_NoErrors()
12 | {
13 | var procedure = new AllTypesStoredProcedure();
14 |
15 | procedure.ParameterSmallMoney = 653m;
16 |
17 | Assert.DoesNotThrow(() => ExecuteStoredProcedure(procedure));
18 | }
19 |
20 | [Test]
21 | public void Parameter_ExecuteAsNull_NoErrors()
22 | {
23 | var procedure = new AllTypesStoredProcedure();
24 | procedure.ParameterSmallMoney = null;
25 |
26 | Assert.DoesNotThrow(() => ExecuteStoredProcedure(procedure));
27 | }
28 |
29 | [Test]
30 | public void Parameter_Execute_CorrectValueSet()
31 | {
32 | var procedure = new AllTypesStoredProcedure();
33 | procedure.ParameterSmallMoney = 777;
34 |
35 | var result = ExecuteStoredProcedureSingle(procedure);
36 |
37 | Assert.AreEqual(777, result.ParameterSmallMoney);
38 | }
39 |
40 | }
41 | }
--------------------------------------------------------------------------------
/EntityFrameworkExtras.Tests.Shared/Integration/ParameterTextTests.cs:
--------------------------------------------------------------------------------
1 | using EntityFrameworkExtras.Tests.Integration.StoredProcedures;
2 | using NUnit.Framework;
3 |
4 | namespace EntityFrameworkExtras.Tests.Integration
5 | {
6 | [TestFixture]
7 | public class ParameterTextTests : DatabaseIntegrationTests
8 | {
9 |
10 | [Test]
11 | public void Parameter_Execute_NoErrors()
12 | {
13 | var procedure = new AllTypesStoredProcedure();
14 |
15 | procedure.ParameterText = "Michael";
16 |
17 | Assert.DoesNotThrow(() => ExecuteStoredProcedure(procedure));
18 | }
19 |
20 | [Test]
21 | public void Parameter_ExecuteAsNull_NoErrors()
22 | {
23 | var procedure = new AllTypesStoredProcedure();
24 | procedure.ParameterText = null;
25 |
26 | Assert.DoesNotThrow(() => ExecuteStoredProcedure(procedure));
27 | }
28 |
29 | [Test]
30 | public void Parameter_Execute_CorrectValueSet()
31 | {
32 | var procedure = new AllTypesStoredProcedure();
33 | procedure.ParameterText = "michael";
34 |
35 | var result = ExecuteStoredProcedureSingle(procedure);
36 |
37 | Assert.AreEqual("michael", result.ParameterText);
38 | }
39 | }
40 | }
--------------------------------------------------------------------------------
/EntityFrameworkExtras.Tests.Shared/Integration/ParameterTimeTests.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using EntityFrameworkExtras.Tests.Integration.StoredProcedures;
3 | using NUnit.Framework;
4 |
5 | namespace EntityFrameworkExtras.Tests.Integration
6 | {
7 | [TestFixture]
8 | public class ParameterTimeTests : DatabaseIntegrationTests
9 | {
10 |
11 | [Test]
12 | public void Parameter_Execute_NoErrors()
13 | {
14 | var procedure = new AllTypesStoredProcedure();
15 |
16 | procedure.ParameterTime = new TimeSpan(0, 11, 6, 10, 44);
17 |
18 | Assert.DoesNotThrow(() => ExecuteStoredProcedure(procedure));
19 | }
20 |
21 | [Test]
22 | public void Parameter_ExecuteAsNull_NoErrors()
23 | {
24 | var procedure = new AllTypesStoredProcedure();
25 | procedure.ParameterTime = null;
26 |
27 | Assert.DoesNotThrow(() => ExecuteStoredProcedure(procedure));
28 | }
29 |
30 | [Test]
31 | public void Parameter_Execute_CorrectValueSet()
32 | {
33 | var procedure = new AllTypesStoredProcedure();
34 | procedure.ParameterTime = new TimeSpan(0, 4, 13, 10, 44);
35 |
36 | var result = ExecuteStoredProcedureSingle(procedure);
37 |
38 | Assert.AreEqual(new TimeSpan(0, 4, 13, 10, 44), result.ParameterTime);
39 | }
40 |
41 | }
42 | }
--------------------------------------------------------------------------------
/EntityFrameworkExtras.Tests.Shared/Integration/ParameterTinyIntTests.cs:
--------------------------------------------------------------------------------
1 | using EntityFrameworkExtras.Tests.Integration.StoredProcedures;
2 | using NUnit.Framework;
3 |
4 | namespace EntityFrameworkExtras.Tests.Integration
5 | {
6 | [TestFixture]
7 | public class ParameterTinyIntTests : DatabaseIntegrationTests
8 | {
9 |
10 | [Test]
11 | public void Parameter_Execute_NoErrors()
12 | {
13 | var procedure = new AllTypesStoredProcedure();
14 |
15 | procedure.ParameterTinyInt = 8;
16 |
17 | Assert.DoesNotThrow(() => ExecuteStoredProcedure(procedure));
18 | }
19 |
20 | [Test]
21 | public void Parameter_ExecuteAsNull_NoErrors()
22 | {
23 | var procedure = new AllTypesStoredProcedure();
24 | procedure.ParameterTinyInt = null;
25 |
26 | Assert.DoesNotThrow(() => ExecuteStoredProcedure(procedure));
27 | }
28 |
29 | [Test]
30 | public void Parameter_Execute_CorrectValueSet()
31 | {
32 | var procedure = new AllTypesStoredProcedure();
33 | procedure.ParameterTinyInt = 255;
34 |
35 | var result = ExecuteStoredProcedureSingle(procedure);
36 |
37 | Assert.AreEqual(255, result.ParameterTinyInt);
38 | }
39 |
40 | }
41 | }
--------------------------------------------------------------------------------
/EntityFrameworkExtras.Tests.Shared/Integration/ParameterVarBinaryTests.cs:
--------------------------------------------------------------------------------
1 | using EntityFrameworkExtras.Tests.Integration.StoredProcedures;
2 | using NUnit.Framework;
3 |
4 | namespace EntityFrameworkExtras.Tests.Integration
5 | {
6 | [TestFixture]
7 | public class ParameterVarBinaryTests : DatabaseIntegrationTests
8 | {
9 | [Test]
10 | public void Parameter_Execute_NoErrors()
11 | {
12 | var procedure = new AllTypesStoredProcedure();
13 |
14 | procedure.ParameterVarBinary = new byte[100];
15 |
16 | Assert.DoesNotThrow(() => ExecuteStoredProcedure(procedure));
17 | }
18 |
19 | [Test]
20 | public void Parameter_ExecuteAsNull_NoErrors()
21 | {
22 | var procedure = new AllTypesStoredProcedure();
23 | procedure.ParameterVarBinary = null;
24 |
25 | Assert.DoesNotThrow(() => ExecuteStoredProcedure(procedure));
26 | }
27 |
28 | [Test]
29 | public void Parameter_Execute_CorrectValueSet()
30 | {
31 | var procedure = new AllTypesStoredProcedure();
32 | procedure.ParameterVarBinary = GetBytes("michael rodda");
33 |
34 | var result = ExecuteStoredProcedureSingle(procedure);
35 |
36 | Assert.AreEqual(GetBytes("michael rodda"), result.ParameterVarBinary);
37 | }
38 | }
39 | }
--------------------------------------------------------------------------------
/EntityFrameworkExtras.Tests.Shared/Integration/ParameterVarCharTests.cs:
--------------------------------------------------------------------------------
1 | using EntityFrameworkExtras.Tests.Integration.StoredProcedures;
2 | using NUnit.Framework;
3 |
4 | namespace EntityFrameworkExtras.Tests.Integration
5 | {
6 | [TestFixture]
7 | public class ParameterVarCharTests : DatabaseIntegrationTests
8 | {
9 |
10 | [Test]
11 | public void Parameter_Execute_NoErrors()
12 | {
13 | var procedure = new AllTypesStoredProcedure();
14 |
15 | procedure.ParameterVarChar = "Michael";
16 |
17 | Assert.DoesNotThrow(() => ExecuteStoredProcedure(procedure));
18 | }
19 |
20 | [Test]
21 | public void Parameter_ExecuteAsNull_NoErrors()
22 | {
23 | var procedure = new AllTypesStoredProcedure();
24 | procedure.ParameterVarChar = null;
25 |
26 | Assert.DoesNotThrow(() => ExecuteStoredProcedure(procedure));
27 | }
28 |
29 | [Test]
30 | public void Parameter_Execute_CorrectValueSet()
31 | {
32 | var procedure = new AllTypesStoredProcedure();
33 | procedure.ParameterVarChar = "michael";
34 |
35 | var result = ExecuteStoredProcedureSingle(procedure);
36 |
37 | Assert.AreEqual("michael", result.ParameterVarChar);
38 | }
39 | }
40 | }
--------------------------------------------------------------------------------
/EntityFrameworkExtras.Tests.Shared/Integration/ParameterXmlTests.cs:
--------------------------------------------------------------------------------
1 | using EntityFrameworkExtras.Tests.Integration.StoredProcedures;
2 | using NUnit.Framework;
3 |
4 | namespace EntityFrameworkExtras.Tests.Integration
5 | {
6 | [TestFixture]
7 | public class ParameterXmlTests : DatabaseIntegrationTests
8 | {
9 |
10 | [Test]
11 | public void Parameter_Execute_NoErrors()
12 | {
13 | var procedure = new AllTypesStoredProcedure();
14 |
15 | procedure.ParameterXml = "";
16 |
17 | Assert.DoesNotThrow(() => ExecuteStoredProcedure(procedure));
18 | }
19 |
20 | [Test]
21 | public void Parameter_ExecuteAsNull_NoErrors()
22 | {
23 | var procedure = new AllTypesStoredProcedure();
24 | procedure.ParameterXml = null;
25 |
26 | Assert.DoesNotThrow(() => ExecuteStoredProcedure(procedure));
27 | }
28 |
29 | [Test]
30 | public void Parameter_Execute_CorrectValueSet()
31 | {
32 | var procedure = new AllTypesStoredProcedure();
33 | procedure.ParameterXml = "";
34 |
35 | var result = ExecuteStoredProcedureSingle(procedure);
36 |
37 | Assert.AreEqual("", result.ParameterXml);
38 | }
39 | }
40 | }
--------------------------------------------------------------------------------
/EntityFrameworkExtras.Tests.Shared/Integration/StoredProcedureTests.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using EntityFrameworkExtras.Tests.Integration.StoredProcedures;
3 | using NUnit.Framework;
4 |
5 | namespace EntityFrameworkExtras.Tests.Integration
6 | {
7 | [TestFixture]
8 | public class StoredProcedureTests : DatabaseIntegrationTests
9 | {
10 | [Test]
11 | public void ExecuteStoredProcedure_NoParameters_NoErrors()
12 | {
13 | var procedure = new NoParametersStoredProcedure();
14 |
15 | Assert.DoesNotThrow(() => ExecuteStoredProcedure(procedure));
16 | }
17 |
18 | [Test]
19 | public void ExecuteStoredProcedure_NoneExistingProcedure_CorrectException()
20 | {
21 | var procedure = new NoneExistingStoredProcedure();
22 |
23 | #if EFCORE
24 | Assert.Throws(() => ExecuteStoredProcedure(procedure), "Could not find stored procedure 'NoneExistingStoredProcedure'.");
25 | #else
26 | Assert.Throws(() => ExecuteStoredProcedure(procedure), "Could not find stored procedure 'NoneExistingStoredProcedure'.");
27 | #endif
28 | }
29 |
30 | [Test]
31 | public void ExecuteStoredProcedure_NoneExistingProcedure_CorrectExceptionMessage()
32 | {
33 | try
34 | {
35 | var procedure = new NoneExistingStoredProcedure();
36 |
37 | ExecuteStoredProcedure(procedure);
38 | }
39 | #if EFCORE
40 | catch (Microsoft.Data.SqlClient.SqlException exception)
41 | #else
42 | catch (System.Data.SqlClient.SqlException exception)
43 | #endif
44 | {
45 | Assert.AreEqual("Could not find stored procedure 'NoneExistingStoredProcedure'.", exception.Message);
46 | }
47 | }
48 |
49 |
50 | [Test]
51 | public void ExecuteStoredProcedure_WithNull_CorrectException()
52 | {
53 | Assert.Throws(() => ExecuteStoredProcedure(null), "storedProceduree");
54 | }
55 |
56 | [Test]
57 | public void ExecuteStoredProcedure_WithNull_CorrectExceptionMessage()
58 | {
59 | try
60 | {
61 | ExecuteStoredProcedure(null);
62 | }
63 | catch (ArgumentNullException exception)
64 | {
65 | Assert.AreEqual("Value cannot be null.\r\nParameter name: storedProcedure", exception.Message);
66 | }
67 | }
68 |
69 | }
70 | }
--------------------------------------------------------------------------------
/EntityFrameworkExtras.Tests.Shared/Integration/StoredProcedures/AllTypesStoredProcedure.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Data;
3 |
4 | #if EF5
5 | using EntityFrameworkExtras.EF5;
6 | #elif EF6
7 | using EntityFrameworkExtras.EF6;
8 | #elif EFCORE
9 | using EntityFrameworkExtras.EFCore;
10 | #endif
11 |
12 | namespace EntityFrameworkExtras.Tests.Integration.StoredProcedures
13 | {
14 | [StoredProcedure("AllTypesStoredProcedure")]
15 | public class AllTypesStoredProcedure
16 | {
17 | [StoredProcedureParameter(SqlDbType.NVarChar)]
18 | public String ParameterNvarChar { get; set; }
19 |
20 | [StoredProcedureParameter(SqlDbType.BigInt)]
21 | public Int64? ParameterBigInt { get; set; }
22 |
23 | [StoredProcedureParameter(SqlDbType.Binary)]
24 | public Byte[] ParameterBinary { get; set; }
25 |
26 | [StoredProcedureParameter(SqlDbType.Bit)]
27 | public Boolean? ParameterBit { get; set; }
28 |
29 | [StoredProcedureParameter(SqlDbType.Char)]
30 | public String ParameterChar { get; set; }
31 |
32 | [StoredProcedureParameter(SqlDbType.Date)]
33 | public DateTime? ParameterDate { get; set; }
34 |
35 | [StoredProcedureParameter(SqlDbType.DateTime)]
36 | public DateTime? ParameterDateTime { get; set; }
37 |
38 | [StoredProcedureParameter(SqlDbType.DateTime2)]
39 | public DateTime? ParameterDateTime2 { get; set; }
40 |
41 | [StoredProcedureParameter(SqlDbType.DateTimeOffset)]
42 | public DateTimeOffset? ParameterDateTimeOffset { get; set; }
43 |
44 | [StoredProcedureParameter(SqlDbType.Decimal, Precision = 5, Scale = 2)]
45 | public Decimal? ParameterDecimal { get; set; }
46 |
47 | [StoredProcedureParameter(SqlDbType.Float)]
48 | public Double? ParameterFloat { get; set; }
49 |
50 | [StoredProcedureParameter(SqlDbType.Image)]
51 | public Byte[] ParameterImage { get; set; }
52 |
53 | [StoredProcedureParameter(SqlDbType.Int)]
54 | public Int32? ParameterInt { get; set; }
55 |
56 | [StoredProcedureParameter(SqlDbType.Decimal)]
57 | public Decimal? ParameterMoney { get; set; }
58 |
59 | [StoredProcedureParameter(SqlDbType.NChar)]
60 | public String ParameterNChar { get; set; }
61 |
62 | [StoredProcedureParameter(SqlDbType.NText)]
63 | public String ParameterNText { get; set; }
64 |
65 | [StoredProcedureParameter(SqlDbType.Real)]
66 | public Single? ParameterReal { get; set; }
67 |
68 | [StoredProcedureParameter(SqlDbType.SmallDateTime)]
69 | public DateTime? ParameterSmallDateTime { get; set; }
70 |
71 | [StoredProcedureParameter(SqlDbType.SmallInt)]
72 | public Int16? ParameterSmallInt { get; set; }
73 |
74 | [StoredProcedureParameter(SqlDbType.SmallMoney)]
75 | public Decimal? ParameterSmallMoney { get; set; }
76 |
77 | [StoredProcedureParameter(SqlDbType.Text)]
78 | public String ParameterText { get; set; }
79 |
80 | [StoredProcedureParameter(SqlDbType.Time)]
81 | public TimeSpan? ParameterTime { get; set; }
82 |
83 | [StoredProcedureParameter(SqlDbType.TinyInt)]
84 | public Byte? ParameterTinyInt { get; set; }
85 |
86 | [StoredProcedureParameter(SqlDbType.UniqueIdentifier)]
87 | public Guid? ParameterUniqueIdentifier { get; set; }
88 |
89 | [StoredProcedureParameter(SqlDbType.VarBinary)]
90 | public Byte[] ParameterVarBinary { get; set; }
91 |
92 | [StoredProcedureParameter(SqlDbType.VarChar)]
93 | public String ParameterVarChar { get; set; }
94 |
95 | [StoredProcedureParameter(SqlDbType.Xml)]
96 | public String ParameterXml { get; set; }
97 | }
98 | }
--------------------------------------------------------------------------------
/EntityFrameworkExtras.Tests.Shared/Integration/StoredProcedures/AllTypesStoredProcedureReturn.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace EntityFrameworkExtras.Tests.Integration.StoredProcedures
4 | {
5 | public class AllTypesStoredProcedureReturn
6 | {
7 | public String ParameterNvarChar { get; set; }
8 | public Int64? ParameterBigInt { get; set; }
9 | public Byte[] ParameterBinary { get; set; }
10 | public Boolean? ParameterBit { get; set; }
11 | public String ParameterChar { get; set; }
12 | public DateTime? ParameterDate { get; set; }
13 | public DateTime? ParameterDateTime { get; set; }
14 | public DateTime? ParameterDateTime2 { get; set; }
15 | public DateTimeOffset? ParameterDateTimeOffset { get; set; }
16 | public Decimal? ParameterDecimal { get; set; }
17 | public Double? ParameterFloat { get; set; }
18 | public Byte[] ParameterImage { get; set; }
19 | public Int32? ParameterInt { get; set; }
20 | public Decimal? ParameterMoney { get; set; }
21 | public String ParameterNChar { get; set; }
22 | public String ParameterNText { get; set; }
23 | public Single? ParameterReal { get; set; }
24 | public DateTime? ParameterSmallDateTime { get; set; }
25 | public Int16? ParameterSmallInt { get; set; }
26 | public Decimal? ParameterSmallMoney { get; set; }
27 | public String ParameterText { get; set; }
28 | public TimeSpan? ParameterTime { get; set; }
29 | public Byte? ParameterTinyInt { get; set; }
30 | public Guid? ParameterUniqueIdentifier { get; set; }
31 | public Byte[] ParameterVarBinary { get; set; }
32 | public String ParameterVarChar { get; set; }
33 | public String ParameterXml { get; set; }
34 | }
35 | }
--------------------------------------------------------------------------------
/EntityFrameworkExtras.Tests.Shared/Integration/StoredProcedures/AllTypesUserDefinedTable.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Data;
3 |
4 | #if EF5
5 | using EntityFrameworkExtras.EF5;
6 | #elif EF6
7 | using EntityFrameworkExtras.EF6;
8 | #elif EFCORE
9 | using EntityFrameworkExtras.EFCore;
10 | #endif
11 |
12 | namespace EntityFrameworkExtras.Tests.Integration.StoredProcedures
13 | {
14 | [UserDefinedTableType("AllTypesUDT")]
15 | public class AllTypesUserDefinedTable
16 | {
17 |
18 | [UserDefinedTableTypeColumn(1)]
19 | public String ParameterNvarChar { get; set; }
20 |
21 | [UserDefinedTableTypeColumn(2)]
22 | public Int64? ParameterBigInt { get; set; }
23 |
24 | [UserDefinedTableTypeColumn(3)]
25 | public Byte[] ParameterBinary { get; set; }
26 |
27 | [UserDefinedTableTypeColumn(4)]
28 | public Boolean? ParameterBit { get; set; }
29 |
30 | [UserDefinedTableTypeColumn(5)]
31 | public String ParameterChar { get; set; }
32 |
33 | [UserDefinedTableTypeColumn(6)]
34 | public DateTime? ParameterDate { get; set; }
35 |
36 | [UserDefinedTableTypeColumn(7)]
37 | public DateTime? ParameterDateTime { get; set; }
38 |
39 | [UserDefinedTableTypeColumn(8)]
40 | public DateTime? ParameterDateTime2 { get; set; }
41 |
42 | [UserDefinedTableTypeColumn(9)]
43 | public DateTimeOffset? ParameterDateTimeOffset { get; set; }
44 |
45 | [UserDefinedTableTypeColumn(10)]
46 | public Decimal? ParameterDecimal { get; set; }
47 |
48 | [UserDefinedTableTypeColumn(11)]
49 | public Double? ParameterFloat { get; set; }
50 |
51 | [UserDefinedTableTypeColumn(12)]
52 | public Byte[] ParameterImage { get; set; }
53 |
54 | [UserDefinedTableTypeColumn(13)]
55 | public Int32? ParameterInt { get; set; }
56 |
57 | [UserDefinedTableTypeColumn(14)]
58 | public Decimal? ParameterMoney { get; set; }
59 |
60 | [UserDefinedTableTypeColumn(15)]
61 | public String ParameterNChar { get; set; }
62 |
63 | [UserDefinedTableTypeColumn(16)]
64 | public String ParameterNText { get; set; }
65 |
66 | [UserDefinedTableTypeColumn(17)]
67 | public Single? ParameterReal { get; set; }
68 |
69 | [UserDefinedTableTypeColumn(18)]
70 | public DateTime? ParameterSmallDateTime { get; set; }
71 |
72 | [UserDefinedTableTypeColumn(19)]
73 | public Int16? ParameterSmallInt { get; set; }
74 |
75 | [UserDefinedTableTypeColumn(20)]
76 | public Decimal? ParameterSmallMoney { get; set; }
77 |
78 | [UserDefinedTableTypeColumn(21)]
79 | public String ParameterText { get; set; }
80 |
81 | [UserDefinedTableTypeColumn(22)]
82 | public TimeSpan? ParameterTime { get; set; }
83 |
84 | [UserDefinedTableTypeColumn(23)]
85 | public Byte? ParameterTinyInt { get; set; }
86 |
87 | [UserDefinedTableTypeColumn(24)]
88 | public Guid? ParameterUniqueIdentifier { get; set; }
89 |
90 | [UserDefinedTableTypeColumn(25)]
91 | public Byte[] ParameterVarBinary { get; set; }
92 |
93 | [UserDefinedTableTypeColumn(26)]
94 | public String ParameterVarChar { get; set; }
95 |
96 | [UserDefinedTableTypeColumn(27)]
97 | public String ParameterXml { get; set; }
98 | }
99 |
100 |
101 | }
--------------------------------------------------------------------------------
/EntityFrameworkExtras.Tests.Shared/Integration/StoredProcedures/InvalidColumnCountUserDefinedTable.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | #if EF5
4 | using EntityFrameworkExtras.EF5;
5 | #elif EF6
6 | using EntityFrameworkExtras.EF6;
7 | #elif EFCORE
8 | using EntityFrameworkExtras.EFCore;
9 | #endif
10 |
11 | namespace EntityFrameworkExtras.Tests.Integration.StoredProcedures
12 | {
13 | [UserDefinedTableType("AllTypesUDT")]
14 | public class InvalidColumnCountUserDefinedTable
15 | {
16 |
17 | [UserDefinedTableTypeColumn(1)]
18 | public String ParameterNvarChar { get; set; }
19 |
20 | [UserDefinedTableTypeColumn(2)]
21 | public Int64? ParameterBigInt { get; set; }
22 |
23 | [UserDefinedTableTypeColumn(3)]
24 | public Byte[] ParameterBinary { get; set; }
25 |
26 | [UserDefinedTableTypeColumn(4)]
27 | public Boolean? ParameterBit { get; set; }
28 |
29 | }
30 | }
--------------------------------------------------------------------------------
/EntityFrameworkExtras.Tests.Shared/Integration/StoredProcedures/NoParametersStoredProcedure.cs:
--------------------------------------------------------------------------------
1 | #if EF5
2 | using EntityFrameworkExtras.EF5;
3 | #elif EF6
4 | using EntityFrameworkExtras.EF6;
5 | #elif EFCORE
6 | using EntityFrameworkExtras.EFCore;
7 | #endif
8 |
9 | namespace EntityFrameworkExtras.Tests.Integration.StoredProcedures
10 | {
11 | [StoredProcedure("NoParametersStoredProcedure")]
12 | public class NoParametersStoredProcedure {}
13 | }
--------------------------------------------------------------------------------
/EntityFrameworkExtras.Tests.Shared/Integration/StoredProcedures/NoneExistingStoredProcedure.cs:
--------------------------------------------------------------------------------
1 | #if EF5
2 | using EntityFrameworkExtras.EF5;
3 | #elif EF6
4 | using EntityFrameworkExtras.EF6;
5 | #elif EFCORE
6 | using EntityFrameworkExtras.EFCore;
7 | #endif
8 |
9 | namespace EntityFrameworkExtras.Tests.Integration.StoredProcedures
10 | {
11 | [StoredProcedure("NoneExistingStoredProcedure")]
12 | public class NoneExistingStoredProcedure { }
13 | }
--------------------------------------------------------------------------------
/EntityFrameworkExtras.Tests.Shared/Integration/StoredProcedures/OutputParameterSizeNotSetStoredProcedure.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Data;
3 |
4 | #if EF5
5 | using EntityFrameworkExtras.EF5;
6 | #elif EF6
7 | using EntityFrameworkExtras.EF6;
8 | #elif EFCORE
9 | using EntityFrameworkExtras.EFCore;
10 | #endif
11 |
12 | namespace EntityFrameworkExtras.Tests.Integration.StoredProcedures
13 | {
14 | [StoredProcedure("ParameterDirectionStoredProcedure")]
15 | public class OutputParameterSizeNotSetStoredProcedure
16 | {
17 |
18 | [StoredProcedureParameter(SqlDbType.NVarChar, Direction = ParameterDirection.InputOutput)]
19 | public String ParameterDirectionInputOutput { get; set; }
20 |
21 | [StoredProcedureParameter(SqlDbType.NVarChar, Direction = ParameterDirection.Output)]
22 | public String ParameterDirectionOutput { get; set; }
23 | }
24 | }
--------------------------------------------------------------------------------
/EntityFrameworkExtras.Tests.Shared/Integration/StoredProcedures/OutputParameterSizeSetStoredProcedure.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Data;
3 |
4 | #if EF5
5 | using EntityFrameworkExtras.EF5;
6 | #elif EF6
7 | using EntityFrameworkExtras.EF6;
8 | #elif EFCORE
9 | using EntityFrameworkExtras.EFCore;
10 | #endif
11 |
12 | namespace EntityFrameworkExtras.Tests.Integration.StoredProcedures
13 | {
14 | [StoredProcedure("ParameterDirectionStoredProcedure")]
15 | public class OutputParameterSizeSetStoredProcedure
16 | {
17 |
18 | [StoredProcedureParameter(SqlDbType.NVarChar, Direction = ParameterDirection.InputOutput, Size = 10)]
19 | public String ParameterDirectionInputOutput { get; set; }
20 |
21 | [StoredProcedureParameter(SqlDbType.NVarChar, Direction = ParameterDirection.Output, Size = 10)]
22 | public String ParameterDirectionOutput { get; set; }
23 | }
24 | }
--------------------------------------------------------------------------------
/EntityFrameworkExtras.Tests.Shared/Integration/StoredProcedures/ParameterDirectionStoredProcedure.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Data;
3 |
4 | #if EF5
5 | using EntityFrameworkExtras.EF5;
6 | #elif EF6
7 | using EntityFrameworkExtras.EF6;
8 | #elif EFCORE
9 | using EntityFrameworkExtras.EFCore;
10 | #endif
11 |
12 | namespace EntityFrameworkExtras.Tests.Integration.StoredProcedures
13 | {
14 | [StoredProcedure("ParameterDirectionStoredProcedure")]
15 | public class ParameterDirectionStoredProcedure
16 | {
17 | [StoredProcedureParameter(SqlDbType.NVarChar)]
18 | public String ParameterDirectionDefault { get; set; }
19 |
20 | [StoredProcedureParameter(SqlDbType.NVarChar, Direction = ParameterDirection.Input)]
21 | public String ParameterDirectionInput { get; set; }
22 |
23 | [StoredProcedureParameter(SqlDbType.NVarChar, Direction = ParameterDirection.InputOutput, Size = 30)]
24 | public String ParameterDirectionInputOutput { get; set; }
25 |
26 | [StoredProcedureParameter(SqlDbType.NVarChar, Direction = ParameterDirection.Output, Size = 30)]
27 | public String ParameterDirectionOutput { get; set; }
28 |
29 | // [StoredProcedureParameter(SqlDbType.NVarChar, Direction = ParameterDirection.ReturnValue)]
30 | // public String ParameterDirectionReturnValue { get; set; }
31 | }
32 | }
--------------------------------------------------------------------------------
/EntityFrameworkExtras.Tests.Shared/Integration/StoredProcedures/ParameterDirectionStoredProcedureReturn.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace EntityFrameworkExtras.Tests.Integration.StoredProcedures
4 | {
5 | public class ParameterDirectionStoredProcedureReturn
6 | {
7 | public String ParameterDirectionDefault { get; set; }
8 |
9 | public String ParameterDirectionInput { get; set; }
10 |
11 | public String ParameterDirectionInputOutput { get; set; }
12 |
13 | public String ParameterDirectionOutput { get; set; }
14 |
15 | public String ParameterDirectionReturnValue { get; set; }
16 |
17 | }
18 | }
--------------------------------------------------------------------------------
/EntityFrameworkExtras.Tests.Shared/Integration/StoredProcedures/ParameterSizeStoredProcedure.cs:
--------------------------------------------------------------------------------
1 | using System.Data;
2 |
3 | #if EF5
4 | using EntityFrameworkExtras.EF5;
5 | #elif EF6
6 | using EntityFrameworkExtras.EF6;
7 | #elif EFCORE
8 | using EntityFrameworkExtras.EFCore;
9 | #endif
10 |
11 | namespace EntityFrameworkExtras.Tests.Integration.StoredProcedures
12 | {
13 | ///
14 | /// All parameters in the stored procedure are set to 10 e.g. ParameterSizeNotSet NVARCHAR(10)
15 | ///
16 | [StoredProcedure("ParameterSizeStoredProcedure")]
17 | public class ParameterSizeStoredProcedure
18 | {
19 | [StoredProcedureParameter(SqlDbType.NVarChar)]
20 | public string ParameterSizeNotSet { get; set; }
21 |
22 | [StoredProcedureParameter(SqlDbType.NVarChar, Size = 5)]
23 | public string ParameterSizeSetTo5 { get; set; }
24 |
25 | [StoredProcedureParameter(SqlDbType.NVarChar, Size = 10)]
26 | public string ParameterSizeSetTo10 { get; set; }
27 |
28 | [StoredProcedureParameter(SqlDbType.NVarChar, Size = 20)]
29 | public string ParameterSizeSetTo20 { get; set; }
30 |
31 | }
32 | }
--------------------------------------------------------------------------------
/EntityFrameworkExtras.Tests.Shared/Integration/StoredProcedures/ParameterSizeStoredProcedureReturn.cs:
--------------------------------------------------------------------------------
1 | namespace EntityFrameworkExtras.Tests.Integration.StoredProcedures
2 | {
3 | public class ParameterSizeStoredProcedureReturn
4 | {
5 | public string ParameterSizeNotSet { get; set; }
6 | public string ParameterSizeSetTo5 { get; set; }
7 | public string ParameterSizeSetTo10 { get; set; }
8 | public string ParameterSizeSetTo20 { get; set; }
9 | }
10 | }
--------------------------------------------------------------------------------
/EntityFrameworkExtras.Tests.Shared/Integration/StoredProcedures/UserDefinedTableExplicitlySetColumnNameStoredProcedure.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Data;
3 |
4 | #if EF5
5 | using EntityFrameworkExtras.EF5;
6 | #elif EF6
7 | using EntityFrameworkExtras.EF6;
8 | #elif EFCORE
9 | using EntityFrameworkExtras.EFCore;
10 | #endif
11 |
12 | namespace EntityFrameworkExtras.Tests.Integration.StoredProcedures
13 | {
14 | [StoredProcedure("UserDefinedTableStoredProcedure")]
15 | public class UserDefinedTableExplicitlySetColumnNameStoredProcedure
16 | {
17 | [StoredProcedureParameter(SqlDbType.Udt)]
18 | public IEnumerable UserDefinedTableParameter { get; set; }
19 | }
20 |
21 | [StoredProcedure("UserDefinedTableStoredProcedure")]
22 | public class UserDefinedTableExplicitlySetColumnNameStoredProcedure2
23 | {
24 | [StoredProcedureParameter(SqlDbType.Udt)]
25 | public List UserDefinedTableParameter { get; set; }
26 | }
27 | }
--------------------------------------------------------------------------------
/EntityFrameworkExtras.Tests.Shared/Integration/StoredProcedures/UserDefinedTableInvalidColumnCountStoredProcedure.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Data;
3 |
4 | #if EF5
5 | using EntityFrameworkExtras.EF5;
6 | #elif EF6
7 | using EntityFrameworkExtras.EF6;
8 | #elif EFCORE
9 | using EntityFrameworkExtras.EFCore;
10 | #endif
11 |
12 | namespace EntityFrameworkExtras.Tests.Integration.StoredProcedures
13 | {
14 | [StoredProcedure("UserDefinedTableStoredProcedure")]
15 | public class UserDefinedTableInvalidColumnCountStoredProcedure
16 | {
17 | [StoredProcedureParameter(SqlDbType.Udt)]
18 | public List UserDefinedTableParameter { get; set; }
19 | }
20 | }
--------------------------------------------------------------------------------
/EntityFrameworkExtras.Tests.Shared/Integration/StoredProcedures/UserDefinedTableStoredProcedure.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Data;
4 |
5 | #if EF5
6 | using EntityFrameworkExtras.EF5;
7 | #elif EF6
8 | using EntityFrameworkExtras.EF6;
9 | #elif EFCORE
10 | using EntityFrameworkExtras.EFCore;
11 | #endif
12 |
13 | namespace EntityFrameworkExtras.Tests.Integration.StoredProcedures
14 | {
15 | [StoredProcedure("UserDefinedTableStoredProcedure")]
16 | public class UserDefinedTableStoredProcedure
17 | {
18 | [StoredProcedureParameter(SqlDbType.Udt)]
19 | public List UserDefinedTableParameter { get; set; }
20 | }
21 | }
--------------------------------------------------------------------------------
/EntityFrameworkExtras.Tests.Shared/Integration/StoredProcedures/UserDefinedTableStoredProcedureReturn.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace EntityFrameworkExtras.Tests.Integration.StoredProcedures
4 | {
5 | public class UserDefinedTableStoredProcedureReturn
6 | {
7 | public String ParameterNvarChar { get; set; }
8 | public Int64? ParameterBigInt { get; set; }
9 | public Byte[] ParameterBinary { get; set; }
10 | public Boolean? ParameterBit { get; set; }
11 | public String ParameterChar { get; set; }
12 | public DateTime? ParameterDate { get; set; }
13 | public DateTime? ParameterDateTime { get; set; }
14 | public DateTime? ParameterDateTime2 { get; set; }
15 | public DateTimeOffset? ParameterDateTimeOffset { get; set; }
16 | public Decimal? ParameterDecimal { get; set; }
17 | public Double? ParameterFloat { get; set; }
18 | public Byte[] ParameterImage { get; set; }
19 | public Int32? ParameterInt { get; set; }
20 | public Decimal? ParameterMoney { get; set; }
21 | public String ParameterNChar { get; set; }
22 | public String ParameterNText { get; set; }
23 | public Single? ParameterReal { get; set; }
24 | public DateTime? ParameterSmallDateTime { get; set; }
25 | public Int16? ParameterSmallInt { get; set; }
26 | public Decimal? ParameterSmallMoney { get; set; }
27 | public String ParameterText { get; set; }
28 | public TimeSpan? ParameterTime { get; set; }
29 | public Byte[] ParameterTimestamp { get; set; }
30 | public Byte? ParameterTinyInt { get; set; }
31 | public Guid? ParameterUniqueIdentifier { get; set; }
32 | public Byte[] ParameterVarBinary { get; set; }
33 | public String ParameterVarChar { get; set; }
34 | public String ParameterXml { get; set; }
35 | }
36 | }
--------------------------------------------------------------------------------
/EntityFrameworkExtras.Tests/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/EntityFrameworkExtras.Tests/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("EntityFrameworkExtras.Tests")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("EntityFrameworkExtras.Tests")]
13 | [assembly: AssemblyCopyright("Copyright © 2012")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("69eb4350-77ec-44ac-b56f-ae58df84eae3")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | [assembly: AssemblyVersion("1.0.0.0")]
35 | [assembly: AssemblyFileVersion("1.0.0.0")]
36 |
--------------------------------------------------------------------------------
/EntityFrameworkExtras.Tests/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/EntityFrameworkExtras.vsmdi:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/EntityFrameworkExtras/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/EntityFrameworkExtras/EntityFrameworkExtras.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | AnyCPU
6 | 8.0.30703
7 | 2.0
8 | {7A59AE4F-751F-4BE0-BA70-020072F1409E}
9 | Library
10 | Properties
11 | EntityFrameworkExtras
12 | EntityFrameworkExtras
13 | v4.0
14 | 512
15 |
16 |
17 |
18 | true
19 | full
20 | false
21 | bin\Debug\
22 | TRACE;DEBUG;EF4
23 | prompt
24 | 4
25 | false
26 |
27 |
28 | pdbonly
29 | true
30 | bin\Release\
31 | TRACE;EF4 NET40
32 | prompt
33 | 4
34 | false
35 | bin\Release\EntityFrameworkExtras.xml
36 |
37 |
38 | true
39 |
40 |
41 | Key.snk
42 |
43 |
44 |
45 | False
46 | ..\packages\EntityFramework.4.3.1\lib\net40\EntityFramework.dll
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
75 |
--------------------------------------------------------------------------------
/EntityFrameworkExtras/Key.snk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzzprojects/EntityFrameworkExtras/ff66b31e2aa04116739c23bfb92e55d9192d68fa/EntityFrameworkExtras/Key.snk
--------------------------------------------------------------------------------
/EntityFrameworkExtras/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("EntityFrameworkExtras")]
9 | [assembly: AssemblyDescription("EntityFrameworkExtras provides some useful additions to EntityFramework such as executing Stored Procedures with User-Defined Table Types and Output Parameters.")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("ZZZ Projects & Michael Rodda & Craig Bovis")]
12 | [assembly: AssemblyProduct("EntityFrameworkExtras")]
13 | [assembly: AssemblyCopyright("Copyright © ZZZ Projects Inc.")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("a28591c6-0138-4fde-bde1-5cf510a05b06")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("3.0.5")]
36 | [assembly: AssemblyFileVersion("3.0.5")]
--------------------------------------------------------------------------------
/EntityFrameworkExtras/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Local.testsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 | These are default test settings for a local test run.
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | What's EntityFrameworkExtras?
2 | =====================
3 |
4 | EntityFrameworkExtras provides some useful additions to EntityFramework, such as executing Stored Procedures with User-Defined Table Types and Output Parameters.
5 |
6 | Read more on our [Website](https://entityframework-extras.net/overview).
7 |
8 | ## Downloads
9 |
10 | ### EF Core
11 |
12 | [](https://www.nuget.org/packages/EntityFrameworkExtras.EFCore)
13 | [](https://www.nuget.org/packages/EntityFrameworkExtras.EFCore)
14 |
15 | ```
16 | PM> NuGet\Install-Package EntityFrameworkExtras.EFCore
17 | ```
18 |
19 | ```
20 | > dotnet add package EntityFrameworkExtras.EFCore
21 | ```
22 |
23 | ### EF6
24 |
25 | [](https://www.nuget.org/packages/EntityFrameworkExtras.EF6)
26 | [](https://www.nuget.org/packages/EntityFrameworkExtras.EF6)
27 |
28 | ```
29 | PM> NuGet\Install-Package EntityFrameworkExtras.EF6
30 | ```
31 |
32 | ```
33 | > dotnet add package EntityFrameworkExtras.EF6
34 | ```
35 |
36 | ## Sponsors
37 |
38 | ZZZ Projects owns and maintains **EntityFrameworkExtras** as part of our [mission](https://zzzprojects.com/mission) to add value to the .NET community
39 |
40 | Through [Entity Framework Extensions](https://entityframework-extensions.net/?utm_source=zzzprojects&utm_medium=entityframeworkextras) and [Dapper Plus](https://dapper-plus.net/?utm_source=zzzprojects&utm_medium=entityframeworkextras), we actively sponsor and help key open-source libraries grow.
41 |
42 | [](https://entityframework-extensions.net/bulk-insert?utm_source=zzzprojects&utm_medium=entityframeworkextras)
43 |
44 | [](https://dapper-plus.net/bulk-insert?utm_source=zzzprojects&utm_medium=entityframeworkextras)
45 |
46 | ## More Projects
47 |
48 | - Projects:
49 | - [EntityFramework Extensions](https://entityframework-extensions.net/)
50 | - [Dapper Plus](https://dapper-plus.net/)
51 | - [C# Eval Expression](https://eval-expression.net/)
52 | - Learn Websites
53 | - [Learn EF Core](https://www.learnentityframeworkcore.com/)
54 | - [Learn Dapper](https://www.learndapper.com/)
55 | - Online Tools:
56 | - [.NET Fiddle](https://dotnetfiddle.net/)
57 | - [SQL Fiddle](https://sqlfiddle.com/)
58 | - [ZZZ Code AI](https://zzzcode.ai/)
59 | - and much more!
60 |
61 | To view all our free and paid projects, visit our website [ZZZ Projects](https://zzzprojects.com/).
62 |
63 | To view all our free and paid projects, visit our website [ZZZ Projects](https://zzzprojects.com/).
64 |
--------------------------------------------------------------------------------
/TraceAndTestImpact.testsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 | These are test settings for Trace and Test Impact.
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Z.EntityFrameworkExtras.Lab.EFCore9/My.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Data.SqlClient;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using Microsoft.Data.SqlClient;
8 | using Microsoft.EntityFrameworkCore;
9 |
10 | namespace Z.EntityFrameworkExtras.Lab.EFCore9
11 | {
12 | class My
13 | {
14 | public static string DataBaseName = "LabExtra";
15 |
16 | public static string ConnectionString =
17 | ("Server=[REPLACE];Initial Catalog = [BD]; Integrated Security = true; Connection Timeout = 300; Persist Security Info=True;TrustServerCertificate=True;").Replace("[REPLACE]", Environment.MachineName).Replace("[BD]", DataBaseName);
18 | public static string ConnectionStringTimeOut =
19 | ("Server=[REPLACE];Initial Catalog = [BD]; Integrated Security = true; Connection Timeout = 5; Persist Security Info=True;TrustServerCertificate=True;").Replace("[REPLACE]", Environment.MachineName).Replace("[BD]", DataBaseName);
20 |
21 | public static void DeleteBD(DbContext context)
22 | {
23 | context.Database.EnsureDeleted();
24 | }
25 |
26 | public static void CreateBD(DbContext context)
27 | {
28 | context.Database.EnsureDeleted();
29 | context.Database.EnsureCreated();
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/Z.EntityFrameworkExtras.Lab.EFCore9/Program.cs:
--------------------------------------------------------------------------------
1 | namespace Z.EntityFrameworkExtras.Lab.EFCore9
2 | {
3 | internal class Program
4 | {
5 | static void Main(string[] args)
6 | {
7 | Request_storeProcedure_Transaction.Execute();
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/Z.EntityFrameworkExtras.Lab.EFCore9/Z.EntityFrameworkExtras.Lab.EFCore9.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net9.0
6 | enable
7 | enable
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/Z.EntityFrameworkExtras.labEF6/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/Z.EntityFrameworkExtras.labEF6/My.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Data.Entity;
4 | using System.Data.SqlClient;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 |
9 | namespace Z.EntityFrameworkExtras.labEF6
10 | {
11 | class My
12 | {
13 | public static string DataBaseName = "LabExtra";
14 |
15 | public static string ConnectionString =
16 | ("Server=[REPLACE];Initial Catalog = [BD]; Integrated Security = true; Connection Timeout = 300; Persist Security Info=True").Replace("[REPLACE]", Environment.MachineName).Replace("[BD]", DataBaseName);
17 |
18 | public static void DeleteBD(DbContext context)
19 | {
20 | context.Database.Delete();
21 | }
22 |
23 | public static void CreateBD(DbContext context)
24 | {
25 | try
26 | {
27 | context.Database.CreateIfNotExists();
28 | if (!context.Database.CompatibleWithModel(throwIfNoMetadata: true))
29 | {
30 | throw new Exception("Delete and Create DataBase");
31 | }
32 | }
33 | catch
34 | {
35 | try
36 | {
37 | My.DeleteBD(context);
38 | }
39 | catch (Exception e)
40 | {
41 | using (var commande = new SqlCommand("ALTER DATABASE " + DataBaseName + " SET SINGLE_USER WITH ROLLBACK IMMEDIATE;DROP DATABASE " + DataBaseName + " ;", new SqlConnection(My.ConnectionString)))
42 | {
43 | commande.Connection.Open();
44 | commande.ExecuteNonQuery();
45 | }
46 | }
47 | context.Database.CreateIfNotExists();
48 | }
49 | }
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/Z.EntityFrameworkExtras.labEF6/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace Z.EntityFrameworkExtras.labEF6
8 | {
9 | class Program
10 | {
11 | static void Main(string[] args)
12 | {
13 | Request_Async.Execute();
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/Z.EntityFrameworkExtras.labEF6/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // Les informations générales relatives à un assembly dépendent de
6 | // l'ensemble d'attributs suivant. Changez les valeurs de ces attributs pour modifier les informations
7 | // associées à un assembly.
8 | [assembly: AssemblyTitle("Z.EntityFrameworkExtras.labEF6")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("Z.EntityFrameworkExtras.labEF6")]
13 | [assembly: AssemblyCopyright("Copyright © 2020")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // L'affectation de la valeur false à ComVisible rend les types invisibles dans cet assembly
18 | // aux composants COM. Si vous devez accéder à un type dans cet assembly à partir de
19 | // COM, affectez la valeur true à l'attribut ComVisible sur ce type.
20 | [assembly: ComVisible(false)]
21 |
22 | // Le GUID suivant est pour l'ID de la typelib si ce projet est exposé à COM
23 | [assembly: Guid("e23ebde9-6863-4260-95f2-a99c73ce48cc")]
24 |
25 | // Les informations de version pour un assembly se composent des quatre valeurs suivantes :
26 | //
27 | // Version principale
28 | // Version secondaire
29 | // Numéro de build
30 | // Révision
31 | //
32 | // Vous pouvez spécifier toutes les valeurs ou indiquer les numéros de build et de révision par défaut
33 | // en utilisant '*', comme indiqué ci-dessous :
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/Z.EntityFrameworkExtras.labEF6/Request_Enumerable.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Data;
4 | using System.Data.Entity;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 | using EntityFrameworkExtras.EF6;
9 |
10 | namespace Z.EntityFrameworkExtras.labEF6
11 | {
12 | public static class Request_Enumerable
13 | {
14 | public static void Execute()
15 | {
16 | //// Create BD
17 | //using (var context = new EntityContext())
18 | //{
19 | // My.CreateBD(context);
20 | //}
21 |
22 | // CLEAN
23 | using (var context = new EntityContext())
24 | {
25 | context.EntitySimples.RemoveRange(context.EntitySimples);
26 |
27 | context.SaveChanges();
28 | }
29 |
30 | // SEED
31 | using (var context = new EntityContext())
32 | {
33 | for (int i = 0; i < 3; i++)
34 | {
35 | context.EntitySimples.Add(new EntitySimple { ColumnInt = i });
36 | }
37 |
38 | context.SaveChanges();
39 | }
40 |
41 |
42 |
43 | // TEST
44 | using (var context = new EntityContext())
45 | {
46 | var connection = context.Database.Connection;
47 | connection.Open();
48 | using (var commande = connection.CreateCommand())
49 | {
50 | commande.CommandText = @"
51 | if exists (select 1 from sys.procedures where name = 'PROC_Get_EntitySimple')
52 | BEGIN
53 | DROP PROCEDURE [dbo].[PROC_Get_EntitySimple]
54 | END
55 | ";
56 | commande.ExecuteNonQuery();
57 | }
58 |
59 | using (var commande = connection.CreateCommand())
60 | {
61 | commande.CommandText = @"
62 | CREATE PROCEDURE [dbo].[PROC_Get_EntitySimple]
63 |
64 | @ParameterID INT ,
65 | @ParameterInt INT = NULL OUTPUT
66 |
67 |
68 | AS
69 | BEGIN
70 | Select * from EntitySimples
71 | Where ColumnInt = @ParameterID
72 |
73 | Set @ParameterInt = @ParameterID +1
74 | END
75 | ";
76 | commande.ExecuteNonQuery();
77 | }
78 |
79 | }
80 |
81 | // TEST
82 | using (var context = new EntityContext())
83 | {
84 | var proc_Get_EntitySimple = new Proc_Get_EntitySimple() { ParameterID = 2 };
85 | var list = context.Database.ExecuteStoredProcedure(proc_Get_EntitySimple);
86 | var list2 = list.ToList();
87 | }
88 | }
89 |
90 | public class EntityContext : DbContext
91 | {
92 | public EntityContext() : base(My.ConnectionString)
93 | {
94 | }
95 |
96 | public DbSet EntitySimples { get; set; }
97 |
98 | protected override void OnModelCreating(DbModelBuilder modelBuilder)
99 | {
100 | base.OnModelCreating(modelBuilder);
101 | }
102 | }
103 |
104 | [StoredProcedure("PROC_Get_EntitySimple")]
105 | public class Proc_Get_EntitySimple
106 | {
107 | [StoredProcedureParameter(SqlDbType.Int, Direction = ParameterDirection.Output)]
108 | public int ParameterInt { get; set; }
109 |
110 | [StoredProcedureParameter(SqlDbType.Int, Direction = ParameterDirection.Input)]
111 | public int ParameterID { get; set; }
112 | }
113 |
114 | public class EntitySimple
115 | {
116 | public int ID { get; set; }
117 | public int ColumnInt { get; set; }
118 | public String ColumnString { get; set; }
119 | }
120 | }
121 | }
--------------------------------------------------------------------------------
/Z.EntityFrameworkExtras.labEF6/Template.cs:
--------------------------------------------------------------------------------
1 | using EntityFrameworkExtras.EF6;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Data;
5 | using System.Data.Entity;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 |
10 | namespace Z.EntityFrameworkExtras.labEF6
11 | {
12 | public class Template
13 | {
14 | public static void Execute()
15 | {
16 | // Create BD
17 | using (var context = new EntityContext())
18 | {
19 | My.CreateBD(context);
20 | }
21 |
22 | // CLEAN
23 | using (var context = new EntityContext())
24 | {
25 | context.EntitySimples.RemoveRange(context.EntitySimples);
26 |
27 | context.SaveChanges();
28 | }
29 |
30 | // SEED
31 | using (var context = new EntityContext())
32 | {
33 | for (int i = 0; i < 3; i++)
34 | {
35 | context.EntitySimples.Add(new EntitySimple { ColumnInt = i });
36 | }
37 |
38 | context.SaveChanges();
39 | }
40 |
41 |
42 |
43 | // TEST
44 | using (var context = new EntityContext())
45 | {
46 | var connection = context.Database.Connection;
47 | connection.Open();
48 | using (var commande = connection.CreateCommand())
49 | {
50 | commande.CommandText = @"
51 | if exists (select 1 from sys.procedures where name = 'PROC_Get_EntitySimple')
52 | BEGIN
53 | DROP PROCEDURE [dbo].[PROC_Get_EntitySimple]
54 | END
55 | ";
56 | commande.ExecuteNonQuery();
57 | }
58 |
59 | using (var commande = connection.CreateCommand())
60 | {
61 | commande.CommandText = @"
62 | CREATE PROCEDURE [dbo].[PROC_Get_EntitySimple]
63 |
64 | @ParameterID INT ,
65 | @ParameterInt INT = NULL OUTPUT
66 |
67 |
68 | AS
69 | BEGIN
70 | Select * from EntitySimples
71 | Where ColumnInt = @ParameterID
72 |
73 | Set @ParameterInt = @ParameterID +1
74 | END
75 | ";
76 | commande.ExecuteNonQuery();
77 | }
78 |
79 | }
80 |
81 | // TEST
82 | using (var context = new EntityContext())
83 | {
84 | var proc_Get_EntitySimple = new Proc_Get_EntitySimple() { ParameterID =2};
85 | var entity = context.Database.ExecuteStoredProcedure(proc_Get_EntitySimple);
86 | }
87 | }
88 |
89 | public class EntityContext : DbContext
90 | {
91 | public EntityContext() : base(My.ConnectionString)
92 | {
93 | }
94 |
95 | public DbSet EntitySimples { get; set; }
96 |
97 | protected override void OnModelCreating(DbModelBuilder modelBuilder)
98 | {
99 | base.OnModelCreating(modelBuilder);
100 | }
101 | }
102 |
103 | [StoredProcedure("PROC_Get_EntitySimple")]
104 | public class Proc_Get_EntitySimple
105 | {
106 | [StoredProcedureParameter(SqlDbType.Int, Direction = ParameterDirection.Output)]
107 | public int ParameterInt { get; set; }
108 |
109 | [StoredProcedureParameter(SqlDbType.Int, Direction = ParameterDirection.Input)]
110 | public int ParameterID { get; set; }
111 | }
112 |
113 | public class EntitySimple
114 | {
115 | public int ID { get; set; }
116 | public int ColumnInt { get; set; }
117 | public String ColumnString { get; set; }
118 | }
119 | }
120 | }
--------------------------------------------------------------------------------
/Z.EntityFrameworkExtras.labEF6/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/dapper-plus-sponsor.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzzprojects/EntityFrameworkExtras/ff66b31e2aa04116739c23bfb92e55d9192d68fa/dapper-plus-sponsor.png
--------------------------------------------------------------------------------
/entity-framework-extensions-sponsor.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzzprojects/EntityFrameworkExtras/ff66b31e2aa04116739c23bfb92e55d9192d68fa/entity-framework-extensions-sponsor.png
--------------------------------------------------------------------------------
/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzzprojects/EntityFrameworkExtras/ff66b31e2aa04116739c23bfb92e55d9192d68fa/icon.png
--------------------------------------------------------------------------------
/licence.txt:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2014 Mike Rodda
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/packages/EntityFramework.4.3.1/Content/App.config.transform:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/packages/EntityFramework.4.3.1/Content/Web.config.transform:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/packages/EntityFramework.4.3.1/EntityFramework.4.3.1.nupkg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzzprojects/EntityFrameworkExtras/ff66b31e2aa04116739c23bfb92e55d9192d68fa/packages/EntityFramework.4.3.1/EntityFramework.4.3.1.nupkg
--------------------------------------------------------------------------------
/packages/EntityFramework.4.3.1/lib/net40/EntityFramework.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzzprojects/EntityFrameworkExtras/ff66b31e2aa04116739c23bfb92e55d9192d68fa/packages/EntityFramework.4.3.1/lib/net40/EntityFramework.dll
--------------------------------------------------------------------------------
/packages/EntityFramework.4.3.1/tools/EF4.3on.NET4.5Readme.txt:
--------------------------------------------------------------------------------
1 | -----------------------------------------------------------------------------------------
2 | Entity Framework 5 Recommended for .NET Framework 4.5 Projects
3 | -----------------------------------------------------------------------------------------
4 |
5 |
6 | You have installed EF 4.3 in a project that targets .NET Framework 4.5.
7 |
8 | There are some known issues using EF 4.x in a .NET 4.5 project.
9 |
10 |
11 | We recommend installing a pre-release version of EF 5, which is designed to work with .NET 4.5
12 |
13 | 1) Open package manager console
14 | Tools -> Library Package Manager -> Package Manager Console
15 |
16 | 2) Use the following command to install the latest pre-release package
17 | Install-Package EntityFramework -IncludePreRelease
18 |
19 |
20 |
21 | -----------------------------------------------------------------------------------------
22 | Known Issues with Entity Framework 4.x and .NET Framework 4.5
23 | -----------------------------------------------------------------------------------------
24 |
25 | Entity Framework 4.1 thru 4.3 included additional data annotations in the
26 | System.ComponentModel.DataAnnotations namespace in the EntityFramework assembly.
27 | In .NET 4.5 these annotations were moved to be part of the .NET Framework in the
28 | System.ComponentModel.DataAnnotations.Schema namespace of the
29 | System.ComponentModel.DataAnnotations.dll assembly. If you are using EF 4.x and targeting
30 | .NET 4.5 this results in two data annotations with the same name in different assemblies.
31 | Because the annotations in the .NET Framework are in a different namespace we were not
32 | able to use type forwarding to avoid this conflict.
33 |
34 | It is possible to use EF 4.x on .NET 4.5 but we recommend using the latest pre-release
35 | version of EF 5. If you are not using the affected data annotations there is no impact
36 | on your code. If you are using the data annotations in a C# project you can use the extern
37 | modifier to ensure your code uses the annotations from EntityFramework.dll
38 | (http://msdn.microsoft.com/en-us/library/e59b22c5(v=VS.80).aspx). If you use the new
39 | annotations from the System.ComponentModel.DataAnnotations.dll assembly in .NET 4.5
40 | they will not be processed by Code First.
41 |
42 | The affected annotations are:
43 | - Column
44 | - ComplexType
45 | - DatabaseGenerated
46 | - DatabaseGeneratedOption
47 | - ForeignKey
48 | - InverseProperty
49 | - MaxLength
50 | - MinLength
51 | - NotMapped
52 | - Table
53 |
--------------------------------------------------------------------------------
/packages/EntityFramework.4.3.1/tools/EntityFramework.PowerShell.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzzprojects/EntityFrameworkExtras/ff66b31e2aa04116739c23bfb92e55d9192d68fa/packages/EntityFramework.4.3.1/tools/EntityFramework.PowerShell.dll
--------------------------------------------------------------------------------
/packages/EntityFramework.4.3.1/tools/EntityFramework.psd1:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzzprojects/EntityFrameworkExtras/ff66b31e2aa04116739c23bfb92e55d9192d68fa/packages/EntityFramework.4.3.1/tools/EntityFramework.psd1
--------------------------------------------------------------------------------
/packages/EntityFramework.4.3.1/tools/init.ps1:
--------------------------------------------------------------------------------
1 | param($installPath, $toolsPath, $package, $project)
2 |
3 | if ([System.AppDomain]::CurrentDomain.GetAssemblies() | ?{ $_.GetName().Name -eq 'EntityFramework' })
4 | {
5 | Write-Warning 'There is already a version of EntityFramework.dll loaded. You may need to restart Visual Studio for the commands to work properly.'
6 | }
7 |
8 | if (Get-Module | ?{ $_.Name -eq 'EntityFramework' })
9 | {
10 | Remove-Module 'EntityFramework'
11 | }
12 |
13 | Import-Module (Join-Path $toolsPath 'EntityFramework.psd1') -ArgumentList $installPath
14 |
--------------------------------------------------------------------------------
/packages/EntityFramework.4.3.1/tools/install.ps1:
--------------------------------------------------------------------------------
1 | param($installPath, $toolsPath, $package, $project)
2 |
3 | $invoker = @"
4 | public class ConnectionFactoryConfiguratorInvoker
5 | {
6 | public static void Invoke(string assemblyPath, object project)
7 | {
8 | var appDomain = System.AppDomain.CreateDomain(
9 | "EntityFramework.PowerShell",
10 | null,
11 | new System.AppDomainSetup { ShadowCopyFiles = "true" });
12 |
13 | appDomain.CreateInstanceFrom(
14 | assemblyPath,
15 | "System.Data.Entity.ConnectionFactoryConfig.ConnectionFactoryConfigurator",
16 | false,
17 | 0,
18 | null,
19 | new object[] { project },
20 | null,
21 | null);
22 |
23 | System.AppDomain.Unload(appDomain);
24 | }
25 | }
26 | "@
27 |
28 | $version = (new-object System.Runtime.Versioning.FrameworkName($project.Properties.Item("TargetFrameworkMoniker").Value)).Version
29 |
30 | if ($version -ge (new-object System.Version(4, 5)))
31 | {
32 | $dte.ItemOperations.OpenFile((Join-Path $toolsPath 'EF4.3on.NET4.5Readme.txt'))
33 | }
34 |
35 | Add-Type -TypeDefinition $invoker
36 | [ConnectionFactoryConfiguratorInvoker]::Invoke((Join-Path $toolsPath "EntityFramework.PowerShell.dll"), $project)
37 |
--------------------------------------------------------------------------------
/packages/EntityFramework.4.3.1/tools/migrate.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzzprojects/EntityFrameworkExtras/ff66b31e2aa04116739c23bfb92e55d9192d68fa/packages/EntityFramework.4.3.1/tools/migrate.exe
--------------------------------------------------------------------------------
/packages/EntityFramework.5.0.0/Content/App.config.transform:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/packages/EntityFramework.5.0.0/Content/Web.config.transform:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/packages/EntityFramework.5.0.0/EntityFramework.5.0.0.nupkg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzzprojects/EntityFrameworkExtras/ff66b31e2aa04116739c23bfb92e55d9192d68fa/packages/EntityFramework.5.0.0/EntityFramework.5.0.0.nupkg
--------------------------------------------------------------------------------
/packages/EntityFramework.5.0.0/lib/net40/EntityFramework.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzzprojects/EntityFrameworkExtras/ff66b31e2aa04116739c23bfb92e55d9192d68fa/packages/EntityFramework.5.0.0/lib/net40/EntityFramework.dll
--------------------------------------------------------------------------------
/packages/EntityFramework.5.0.0/lib/net45/EntityFramework.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzzprojects/EntityFrameworkExtras/ff66b31e2aa04116739c23bfb92e55d9192d68fa/packages/EntityFramework.5.0.0/lib/net45/EntityFramework.dll
--------------------------------------------------------------------------------
/packages/EntityFramework.5.0.0/tools/EntityFramework.PS3.psd1:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzzprojects/EntityFrameworkExtras/ff66b31e2aa04116739c23bfb92e55d9192d68fa/packages/EntityFramework.5.0.0/tools/EntityFramework.PS3.psd1
--------------------------------------------------------------------------------
/packages/EntityFramework.5.0.0/tools/EntityFramework.PowerShell.Utility.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzzprojects/EntityFrameworkExtras/ff66b31e2aa04116739c23bfb92e55d9192d68fa/packages/EntityFramework.5.0.0/tools/EntityFramework.PowerShell.Utility.dll
--------------------------------------------------------------------------------
/packages/EntityFramework.5.0.0/tools/EntityFramework.PowerShell.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzzprojects/EntityFrameworkExtras/ff66b31e2aa04116739c23bfb92e55d9192d68fa/packages/EntityFramework.5.0.0/tools/EntityFramework.PowerShell.dll
--------------------------------------------------------------------------------
/packages/EntityFramework.5.0.0/tools/EntityFramework.psd1:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzzprojects/EntityFrameworkExtras/ff66b31e2aa04116739c23bfb92e55d9192d68fa/packages/EntityFramework.5.0.0/tools/EntityFramework.psd1
--------------------------------------------------------------------------------
/packages/EntityFramework.5.0.0/tools/Redirect.VS11.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
9 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/packages/EntityFramework.5.0.0/tools/Redirect.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
9 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/packages/EntityFramework.5.0.0/tools/about_EntityFramework.help.txt:
--------------------------------------------------------------------------------
1 | TOPIC
2 | about_EntityFramework
3 |
4 | SHORT DESCRIPTION
5 | Provides information about Entity Framework commands.
6 |
7 | LONG DESCRIPTION
8 | This topic describes the Entity Framework commands. Entity Framework is
9 | Microsoft's recommended data access technology for new applications.
10 |
11 |
12 | The following Entity Framework cmdlets are included.
13 |
14 | Cmdlet Description
15 | ----------------- ---------------------------------------------------
16 | Enable-Migrations Enables Code First Migrations in a project.
17 |
18 | Add-Migration Scaffolds a migration script for any pending model
19 | changes.
20 |
21 | Update-Database Applies any pending migrations to the database.
22 |
23 | Get-Migrations Displays the migrations that have been applied to
24 | the target database.
25 |
26 | SEE ALSO
27 | Enable-Migrations
28 | Add-Migration
29 | Update-Database
30 | Get-Migrations
31 |
--------------------------------------------------------------------------------
/packages/EntityFramework.5.0.0/tools/migrate.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzzprojects/EntityFrameworkExtras/ff66b31e2aa04116739c23bfb92e55d9192d68fa/packages/EntityFramework.5.0.0/tools/migrate.exe
--------------------------------------------------------------------------------
/packages/EntityFramework.6.0.0/Content/App.config.transform:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/packages/EntityFramework.6.0.0/Content/Web.config.transform:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/packages/EntityFramework.6.0.0/EntityFramework.6.0.0.nupkg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzzprojects/EntityFrameworkExtras/ff66b31e2aa04116739c23bfb92e55d9192d68fa/packages/EntityFramework.6.0.0/EntityFramework.6.0.0.nupkg
--------------------------------------------------------------------------------
/packages/EntityFramework.6.0.0/lib/net40/EntityFramework.SqlServer.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzzprojects/EntityFrameworkExtras/ff66b31e2aa04116739c23bfb92e55d9192d68fa/packages/EntityFramework.6.0.0/lib/net40/EntityFramework.SqlServer.dll
--------------------------------------------------------------------------------
/packages/EntityFramework.6.0.0/lib/net40/EntityFramework.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzzprojects/EntityFrameworkExtras/ff66b31e2aa04116739c23bfb92e55d9192d68fa/packages/EntityFramework.6.0.0/lib/net40/EntityFramework.dll
--------------------------------------------------------------------------------
/packages/EntityFramework.6.0.0/lib/net45/EntityFramework.SqlServer.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzzprojects/EntityFrameworkExtras/ff66b31e2aa04116739c23bfb92e55d9192d68fa/packages/EntityFramework.6.0.0/lib/net45/EntityFramework.SqlServer.dll
--------------------------------------------------------------------------------
/packages/EntityFramework.6.0.0/lib/net45/EntityFramework.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzzprojects/EntityFrameworkExtras/ff66b31e2aa04116739c23bfb92e55d9192d68fa/packages/EntityFramework.6.0.0/lib/net45/EntityFramework.dll
--------------------------------------------------------------------------------
/packages/EntityFramework.6.0.0/tools/EntityFramework.PowerShell.Utility.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzzprojects/EntityFrameworkExtras/ff66b31e2aa04116739c23bfb92e55d9192d68fa/packages/EntityFramework.6.0.0/tools/EntityFramework.PowerShell.Utility.dll
--------------------------------------------------------------------------------
/packages/EntityFramework.6.0.0/tools/EntityFramework.PowerShell.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzzprojects/EntityFrameworkExtras/ff66b31e2aa04116739c23bfb92e55d9192d68fa/packages/EntityFramework.6.0.0/tools/EntityFramework.PowerShell.dll
--------------------------------------------------------------------------------
/packages/EntityFramework.6.0.0/tools/EntityFramework.psd1:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzzprojects/EntityFrameworkExtras/ff66b31e2aa04116739c23bfb92e55d9192d68fa/packages/EntityFramework.6.0.0/tools/EntityFramework.psd1
--------------------------------------------------------------------------------
/packages/EntityFramework.6.0.0/tools/about_EntityFramework.help.txt:
--------------------------------------------------------------------------------
1 | TOPIC
2 | about_EntityFramework
3 |
4 | SHORT DESCRIPTION
5 | Provides information about Entity Framework commands.
6 |
7 | LONG DESCRIPTION
8 | This topic describes the Entity Framework commands. Entity Framework is
9 | Microsoft's recommended data access technology for new applications.
10 |
11 | The following Entity Framework cmdlets are used with Entity Framework
12 | Migrations.
13 |
14 | Cmdlet Description
15 | ----------------- ---------------------------------------------------
16 | Enable-Migrations Enables Code First Migrations in a project.
17 |
18 | Add-Migration Scaffolds a migration script for any pending model
19 | changes.
20 |
21 | Update-Database Applies any pending migrations to the database.
22 |
23 | Get-Migrations Displays the migrations that have been applied to
24 | the target database.
25 |
26 | The following Entity Framework cmdlets are used by NuGet packages that
27 | install Entity Framework providers. These commands are not usually used as
28 | part of normal application development.
29 |
30 | Cmdlet Description
31 | ------------------------------ ---------------------------------------
32 | Add-EFProvider Adds or updates an Entity Framework
33 | provider entry in the project config
34 | file.
35 |
36 | Add-EFDefaultConnectionFactory Adds or updates an Entity Framework
37 | default connection factory in the
38 | project config file.
39 |
40 | Initialize-EFConfiguration Initializes the Entity Framework
41 | section in the project config file and
42 | sets defaults.
43 |
44 | SEE ALSO
45 | Enable-Migrations
46 | Add-Migration
47 | Update-Database
48 | Get-Migrations
49 |
--------------------------------------------------------------------------------
/packages/EntityFramework.6.0.0/tools/migrate.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzzprojects/EntityFrameworkExtras/ff66b31e2aa04116739c23bfb92e55d9192d68fa/packages/EntityFramework.6.0.0/tools/migrate.exe
--------------------------------------------------------------------------------
/packages/NUnit.2.6.3/NUnit.2.6.3.nupkg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzzprojects/EntityFrameworkExtras/ff66b31e2aa04116739c23bfb92e55d9192d68fa/packages/NUnit.2.6.3/NUnit.2.6.3.nupkg
--------------------------------------------------------------------------------
/packages/NUnit.2.6.3/lib/nunit.framework.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzzprojects/EntityFrameworkExtras/ff66b31e2aa04116739c23bfb92e55d9192d68fa/packages/NUnit.2.6.3/lib/nunit.framework.dll
--------------------------------------------------------------------------------
/packages/NUnit.2.6.3/license.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzzprojects/EntityFrameworkExtras/ff66b31e2aa04116739c23bfb92e55d9192d68fa/packages/NUnit.2.6.3/license.txt
--------------------------------------------------------------------------------
/packages/repositories.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------