()
35 | .NameStartsWith("Peter")
36 | .OlderThan(18)
37 | .ToResult()
38 | .Take(3)
39 | .ToList();
40 | ```
41 |
42 | # CRUD and DRY
43 | Don't repeat yourself. GenericRepository provides implementation of repository patter, so you can focus on your domain model and business rules, instead of fighting with specific data mapper technology (some knowledge is still required for doing mapping configuration). You can start loading and saving data to the data storage extremly fast. If the Generic repository does not support requested functionalit natively, you can still very easily use underlying data mapper.
44 |
45 |
46 | # Abstraction of data mappers
47 | Nice sideeffect is that it is very easy to switch between several data mappers, for example from Entity Framework to NHibernate and so on.
48 |
49 | # Learning resource
50 | Last but not least: great learning resource. By implementing generic repository with various data mappers, it is very easy to see the design and architecture differences between the libraries. For example, GetById method differs in LinqToSql and NHibernate, because NHibernate accepts type Object as ID, in comparing to LinqToSql that is strongly typed. This small difference makes it more complex to implement base class for LinqToSql repositories as you can see in the sources. Note that IGenericRepository and it's methods are all strongly typed, the difference is just under the hood. So that was one example. Other can be found in the source codes.
51 |
52 |
53 | # Unit tested
54 | Ships with unit tests.
55 | Note: when running tests, make sure to adapt connection strings in config directory (or data mapper configuration). There is a plan to make default data provider some file based database like sql ce, so the unit tests would work on of the box.
56 |
57 | # Well documented
58 | Source codes fully documented.
59 | External documentation and pattern explanation can be found at my [blog](http://besnikgeek.blogspot.com/search/label/generic%20repository).
60 |
61 | # Feedback
62 | I would really like to get feedback what features are missing for your project. The layer is very thin and it is easy to extend and add new features. Contributors are welcome.
63 |
64 | # Dependencies
65 | The solution file is for Visual Studio 2010 and projects are targeting CLR 4.0 (.NET 4.0);
66 | If there is a need for older version of CLR, it is no problem to build it for CLR 2.0 (.NET 2.0, 3.0, 3.5). Some of the linked libraries may still be compiled for CLR 2.0, the plan is to migrate everything to CLR 4.0.
67 | Unit tests are using NUnit and Mock frameworks.
68 |
69 |
70 | # Licence
71 | Open to use in commerce and non-commerce projects.
72 |
73 | # Supported data mappers
74 | * NHibernate
75 | * Linq2Sql
76 | * Entity Framework
77 |
78 | Plan is to implement suppport for
79 | * NoSql data mappers like Mongo, RavenDb, CouchDB, etc.
80 | * Anything the community requests
81 |
82 | You can always implement IGenericRepository interface for your favourite data mapper and push the implementation.
--------------------------------------------------------------------------------
/packages/Autofac.2.6.1.841/Autofac.2.6.1.841.nupkg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/besnik/generic-repository/0a5407ca84cdec49a57fc55da8d323bf5495edc5/packages/Autofac.2.6.1.841/Autofac.2.6.1.841.nupkg
--------------------------------------------------------------------------------
/packages/Autofac.2.6.1.841/lib/NET35/Autofac.Configuration.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/besnik/generic-repository/0a5407ca84cdec49a57fc55da8d323bf5495edc5/packages/Autofac.2.6.1.841/lib/NET35/Autofac.Configuration.dll
--------------------------------------------------------------------------------
/packages/Autofac.2.6.1.841/lib/NET35/Autofac.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/besnik/generic-repository/0a5407ca84cdec49a57fc55da8d323bf5495edc5/packages/Autofac.2.6.1.841/lib/NET35/Autofac.dll
--------------------------------------------------------------------------------
/packages/Autofac.2.6.1.841/lib/NET40/Autofac.Configuration.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/besnik/generic-repository/0a5407ca84cdec49a57fc55da8d323bf5495edc5/packages/Autofac.2.6.1.841/lib/NET40/Autofac.Configuration.dll
--------------------------------------------------------------------------------
/packages/Autofac.2.6.1.841/lib/NET40/Autofac.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/besnik/generic-repository/0a5407ca84cdec49a57fc55da8d323bf5495edc5/packages/Autofac.2.6.1.841/lib/NET40/Autofac.dll
--------------------------------------------------------------------------------
/packages/Autofac.2.6.1.841/lib/SL3-WP/Autofac.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/besnik/generic-repository/0a5407ca84cdec49a57fc55da8d323bf5495edc5/packages/Autofac.2.6.1.841/lib/SL3-WP/Autofac.dll
--------------------------------------------------------------------------------
/packages/Autofac.2.6.1.841/lib/SL4-WindowsPhone/Autofac.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/besnik/generic-repository/0a5407ca84cdec49a57fc55da8d323bf5495edc5/packages/Autofac.2.6.1.841/lib/SL4-WindowsPhone/Autofac.dll
--------------------------------------------------------------------------------
/packages/Autofac.2.6.1.841/lib/SL4-WindowsPhone71/Autofac.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/besnik/generic-repository/0a5407ca84cdec49a57fc55da8d323bf5495edc5/packages/Autofac.2.6.1.841/lib/SL4-WindowsPhone71/Autofac.dll
--------------------------------------------------------------------------------
/packages/Autofac.2.6.1.841/lib/SL4/Autofac.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/besnik/generic-repository/0a5407ca84cdec49a57fc55da8d323bf5495edc5/packages/Autofac.2.6.1.841/lib/SL4/Autofac.dll
--------------------------------------------------------------------------------
/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/besnik/generic-repository/0a5407ca84cdec49a57fc55da8d323bf5495edc5/packages/EntityFramework.4.3.1/EntityFramework.4.3.1.nupkg
--------------------------------------------------------------------------------
/packages/EntityFramework.4.3.1/lib/net40/EntityFramework.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/besnik/generic-repository/0a5407ca84cdec49a57fc55da8d323bf5495edc5/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/besnik/generic-repository/0a5407ca84cdec49a57fc55da8d323bf5495edc5/packages/EntityFramework.4.3.1/tools/EntityFramework.PowerShell.dll
--------------------------------------------------------------------------------
/packages/EntityFramework.4.3.1/tools/EntityFramework.psd1:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/besnik/generic-repository/0a5407ca84cdec49a57fc55da8d323bf5495edc5/packages/EntityFramework.4.3.1/tools/EntityFramework.psd1
--------------------------------------------------------------------------------
/packages/EntityFramework.4.3.1/tools/EntityFramework.psm1:
--------------------------------------------------------------------------------
1 | # Copyright (c) Microsoft Corporation. All rights reserved.
2 |
3 | $InitialDatabase = '0'
4 |
5 | $installPath = $args[0]
6 | $knownExceptions = @(
7 | 'System.Data.Entity.Migrations.Infrastructure.MigrationsException',
8 | 'System.Data.Entity.Migrations.Infrastructure.AutomaticMigrationsDisabledException',
9 | 'System.Data.Entity.Migrations.Infrastructure.AutomaticDataLossException'
10 | )
11 |
12 | <#
13 | .SYNOPSIS
14 | Enables Code First Migrations in a project.
15 |
16 | .DESCRIPTION
17 | Enables Migrations by scaffolding a migrations configuration class in the project. If the
18 | target database was created by an initializer, an initial migration will be created (unless
19 | automatic migrations are enabled via the EnableAutomaticMigrations parameter).
20 |
21 | .PARAMETER EnableAutomaticMigrations
22 | Specifies whether automatic migrations will be enabled in the scaffolded migrations configuration.
23 | If ommitted, automatic migrations will be disabled.
24 |
25 | .PARAMETER ProjectName
26 | Specifies the project that the scaffolded migrations configuration class will
27 | be added to. If omitted, the default project selected in package manager
28 | console is used.
29 |
30 | .PARAMETER Force
31 | Specifies that the migrations configuration be overwritten when running more
32 | than once for a given project.
33 | #>
34 | function Enable-Migrations
35 | {
36 | [CmdletBinding(DefaultParameterSetName = 'ProjectName')]
37 | param (
38 | [alias("Auto")]
39 | [switch] $EnableAutomaticMigrations,
40 | [string] $ProjectName,
41 | [switch] $Force
42 | )
43 |
44 | try
45 | {
46 | $commands = New-MigrationsCommandsNoConfiguration $ProjectName
47 | $commands.EnableMigrations($EnableAutomaticMigrations, $Force)
48 | }
49 | catch [Exception]
50 | {
51 | $exception = $_.Exception
52 | $exceptionType = $exception.GetType()
53 |
54 | if ($exceptionType.FullName -eq 'System.Data.Entity.Migrations.Design.ToolingException')
55 | {
56 | if ($knownExceptions -notcontains $exception.InnerType)
57 | {
58 | Write-Host $exception.InnerStackTrace
59 | }
60 | }
61 | elseif (!(Test-TypeInherits $exceptionType 'System.Data.Entity.Migrations.Infrastructure.MigrationsException'))
62 | {
63 | Write-Host $exception
64 | }
65 |
66 | throw $exception.Message
67 | }
68 | }
69 |
70 | <#
71 | .SYNOPSIS
72 | Scaffolds a migration script for any pending model changes.
73 |
74 | .DESCRIPTION
75 | Scaffolds a new migration script and adds it to the project.
76 |
77 | .PARAMETER Name
78 | Specifies the name of the custom script.
79 |
80 | .PARAMETER Force
81 | Specifies that the migration user code be overwritten when re-scaffolding an
82 | existing migration.
83 |
84 | .PARAMETER ProjectName
85 | Specifies the project that contains the migration configuration type to be
86 | used. If ommitted, the default project selected in package manager console
87 | is used.
88 |
89 | .PARAMETER StartUpProjectName
90 | Specifies the configuration file to use for named connection strings. If
91 | omitted, the specified project's configuration file is used.
92 |
93 | .PARAMETER ConfigurationTypeName
94 | Specifies the migrations configuration to use. If omitted, migrations will
95 | attempt to locate a single migrations configuration type in the target
96 | project.
97 |
98 | .PARAMETER ConnectionStringName
99 | Specifies the name of a connection string to use from the application's
100 | configuration file.
101 |
102 | .PARAMETER ConnectionString
103 | Specifies the the connection string to use. If omitted, the context's
104 | default connection will be used.
105 |
106 | .PARAMETER ConnectionProviderName
107 | Specifies the provider invariant name of the connection string.
108 |
109 | .PARAMETER IgnoreChanges
110 | Scaffolds an empty migration ignoring any pending changes detected in the current model.
111 | This can be used to create an initial, empty migration to enable Migrations for an existing
112 | database. N.B. Doing this assumes that the target database schema is compatible with the
113 | current model.
114 |
115 | #>
116 | function Add-Migration
117 | {
118 | [CmdletBinding(DefaultParameterSetName = 'ConnectionStringName')]
119 | param (
120 | [parameter(Position = 0,
121 | Mandatory = $true)]
122 | [string] $Name,
123 | [switch] $Force,
124 | [string] $ProjectName,
125 | [string] $StartUpProjectName,
126 | [string] $ConfigurationTypeName,
127 | [parameter(ParameterSetName = 'ConnectionStringName')]
128 | [string] $ConnectionStringName,
129 | [parameter(ParameterSetName = 'ConnectionStringAndProviderName',
130 | Mandatory = $true)]
131 | [string] $ConnectionString,
132 | [parameter(ParameterSetName = 'ConnectionStringAndProviderName',
133 | Mandatory = $true)]
134 | [string] $ConnectionProviderName,
135 | [switch] $IgnoreChanges)
136 |
137 | try
138 | {
139 | $commands = New-MigrationsCommands $ProjectName $StartUpProjectName $ConfigurationTypeName $ConnectionStringName $ConnectionString $ConnectionProviderName
140 | $commands.AddMigration($Name, $Force, $IgnoreChanges)
141 | }
142 | catch [Exception]
143 | {
144 | $exception = $_.Exception
145 | $exceptionType = $exception.GetType()
146 |
147 | if ($exceptionType.FullName -eq 'System.Data.Entity.Migrations.Design.ToolingException')
148 | {
149 | if ($knownExceptions -notcontains $exception.InnerType)
150 | {
151 | Write-Host $exception.InnerStackTrace
152 | }
153 | }
154 | elseif (!(Test-TypeInherits $exceptionType 'System.Data.Entity.Migrations.Infrastructure.MigrationsException'))
155 | {
156 | Write-Host $exception
157 | }
158 |
159 | throw $exception.Message
160 | }
161 | }
162 |
163 | <#
164 | .SYNOPSIS
165 | Applies any pending migrations to the database.
166 |
167 | .DESCRIPTION
168 | Updates the database to the current model by applying pending migrations.
169 |
170 | .PARAMETER SourceMigration
171 | Only valid with -Script. Specifies the name of a particular migration to use
172 | as the update's starting point. If ommitted, the last applied migration in
173 | the database will be used.
174 |
175 | .PARAMETER TargetMigration
176 | Specifies the name of a particular migration to update the database to. If
177 | ommitted, the current model will be used.
178 |
179 | .PARAMETER Script
180 | Generate a SQL script rather than executing the pending changes directly.
181 |
182 | .PARAMETER Force
183 | Specifies that data loss is acceptable during automatic migration of the
184 | database.
185 |
186 | .PARAMETER ProjectName
187 | Specifies the project that contains the migration configuration type to be
188 | used. If ommitted, the default project selected in package manager console
189 | is used.
190 |
191 | .PARAMETER StartUpProjectName
192 | Specifies the configuration file to use for named connection strings. If
193 | omitted, the specified project's configuration file is used.
194 |
195 | .PARAMETER ConfigurationTypeName
196 | Specifies the migrations configuration to use. If omitted, migrations will
197 | attempt to locate a single migrations configuration type in the target
198 | project.
199 |
200 | .PARAMETER ConnectionStringName
201 | Specifies the name of a connection string to use from the application's
202 | configuration file.
203 |
204 | .PARAMETER ConnectionString
205 | Specifies the the connection string to use. If omitted, the context's
206 | default connection will be used.
207 |
208 | .PARAMETER ConnectionProviderName
209 | Specifies the provider invariant name of the connection string.
210 | #>
211 | function Update-Database
212 | {
213 | [CmdletBinding(DefaultParameterSetName = 'ConnectionStringName')]
214 | param (
215 | [string] $SourceMigration,
216 | [string] $TargetMigration,
217 | [switch] $Script,
218 | [switch] $Force,
219 | [string] $ProjectName,
220 | [string] $StartUpProjectName,
221 | [string] $ConfigurationTypeName,
222 | [parameter(ParameterSetName = 'ConnectionStringName')]
223 | [string] $ConnectionStringName,
224 | [parameter(ParameterSetName = 'ConnectionStringAndProviderName',
225 | Mandatory = $true)]
226 | [string] $ConnectionString,
227 | [parameter(ParameterSetName = 'ConnectionStringAndProviderName',
228 | Mandatory = $true)]
229 | [string] $ConnectionProviderName)
230 |
231 | # TODO: If possible, convert this to a ParameterSet
232 | if ($SourceMigration -and !$script)
233 | {
234 | throw '-SourceMigration can only be specified with -Script.'
235 | }
236 |
237 | try
238 | {
239 | $commands = New-MigrationsCommands $ProjectName $StartUpProjectName $ConfigurationTypeName $ConnectionStringName $ConnectionString $ConnectionProviderName
240 | $commands.UpdateDatabase($SourceMigration, $TargetMigration, $Script, $Force)
241 | }
242 | catch [Exception]
243 | {
244 | $exception = $_.Exception
245 | $exceptionType = $exception.GetType()
246 |
247 | if ($exceptionType.FullName -eq 'System.Data.Entity.Migrations.Design.ToolingException')
248 | {
249 | if ($knownExceptions -notcontains $exception.InnerType)
250 | {
251 | Write-Host $exception.InnerStackTrace
252 | }
253 | }
254 | elseif (!(Test-TypeInherits $exceptionType 'System.Data.Entity.Migrations.Infrastructure.MigrationsException'))
255 | {
256 | Write-Host $exception
257 | }
258 |
259 | throw $exception.Message
260 | }
261 | }
262 |
263 | <#
264 | .SYNOPSIS
265 | Displays the migrations that have been applied to the target database.
266 |
267 | .DESCRIPTION
268 | Displays the migrations that have been applied to the target database.
269 |
270 | .PARAMETER ProjectName
271 | Specifies the project that contains the migration configuration type to be
272 | used. If ommitted, the default project selected in package manager console
273 | is used.
274 |
275 | .PARAMETER StartUpProjectName
276 | Specifies the configuration file to use for named connection strings. If
277 | omitted, the specified project's configuration file is used.
278 |
279 | .PARAMETER ConfigurationTypeName
280 | Specifies the migrations configuration to use. If omitted, migrations will
281 | attempt to locate a single migrations configuration type in the target
282 | project.
283 |
284 | .PARAMETER ConnectionStringName
285 | Specifies the name of a connection string to use from the application's
286 | configuration file.
287 |
288 | .PARAMETER ConnectionString
289 | Specifies the the connection string to use. If omitted, the context's
290 | default connection will be used.
291 |
292 | .PARAMETER ConnectionProviderName
293 | Specifies the provider invariant name of the connection string.
294 | #>
295 | function Get-Migrations
296 | {
297 | [CmdletBinding(DefaultParameterSetName = 'ConnectionStringName')]
298 | param (
299 | [string] $ProjectName,
300 | [string] $StartUpProjectName,
301 | [string] $ConfigurationTypeName,
302 | [parameter(ParameterSetName = 'ConnectionStringName')]
303 | [string] $ConnectionStringName,
304 | [parameter(ParameterSetName = 'ConnectionStringAndProviderName',
305 | Mandatory = $true)]
306 | [string] $ConnectionString,
307 | [parameter(ParameterSetName = 'ConnectionStringAndProviderName',
308 | Mandatory = $true)]
309 | [string] $ConnectionProviderName)
310 |
311 | try
312 | {
313 | $commands = New-MigrationsCommands $ProjectName $StartUpProjectName $ConfigurationTypeName $ConnectionStringName $ConnectionString $ConnectionProviderName
314 | $commands.GetMigrations()
315 | }
316 | catch [Exception]
317 | {
318 | $exception = $_.Exception
319 | $exceptionType = $exception.GetType()
320 |
321 | if ($exceptionType.FullName -eq 'System.Data.Entity.Migrations.Design.ToolingException')
322 | {
323 | if ($knownExceptions -notcontains $exception.InnerType)
324 | {
325 | Write-Host $exception.InnerStackTrace
326 | }
327 | }
328 | elseif (!(Test-TypeInherits $exceptionType 'System.Data.Entity.Migrations.Infrastructure.MigrationsException'))
329 | {
330 | Write-Host $exception
331 | }
332 |
333 | throw $exception.Message
334 | }
335 | }
336 |
337 | function New-MigrationsCommandsNoConfiguration($ProjectName)
338 | {
339 | $project = Get-MigrationsProject $ProjectName
340 |
341 | Build-Project $project
342 |
343 | Load-EntityFramework
344 |
345 | try
346 | {
347 | return New-Object 'System.Data.Entity.Migrations.MigrationsCommands' @(
348 | $project,
349 | $project,
350 | $null,
351 | $null,
352 | $null,
353 | $null,
354 | $PSCmdlet )
355 | }
356 | catch [System.Management.Automation.MethodInvocationException]
357 | {
358 | throw $_.Exception.InnerException
359 | }
360 | }
361 |
362 | function New-MigrationsCommands($ProjectName, $StartUpProjectName, $ConfigurationTypeName, $ConnectionStringName, $ConnectionString, $ConnectionProviderName)
363 | {
364 | $project = Get-MigrationsProject $ProjectName
365 | $startUpProject = Get-MigrationsStartUpProject $StartUpProjectName
366 |
367 | Build-Project $project
368 | Build-Project $startUpProject
369 |
370 | Load-EntityFramework
371 |
372 | try
373 | {
374 | return New-Object 'System.Data.Entity.Migrations.MigrationsCommands' @(
375 | $project,
376 | $startUpProject,
377 | $ConfigurationTypeName,
378 | $ConnectionStringName,
379 | $ConnectionString,
380 | $ConnectionProviderName,
381 | $PSCmdlet )
382 | }
383 | catch [System.Management.Automation.MethodInvocationException]
384 | {
385 | throw $_.Exception.InnerException
386 | }
387 | }
388 |
389 | function Get-MigrationsProject($name)
390 | {
391 | if ($name)
392 | {
393 | return Get-SingleProject $name
394 | }
395 |
396 | $project = Get-Project
397 |
398 | Write-Verbose ('Using NuGet project ''' + $project.Name + '''.')
399 |
400 | return $project
401 | }
402 |
403 | function Get-MigrationsStartUpProject($name)
404 | {
405 | if ($name)
406 | {
407 | return Get-SingleProject $name
408 | }
409 |
410 | $startupProjectPaths = $DTE.Solution.SolutionBuild.StartupProjects
411 |
412 | if (!$startupProjectPaths)
413 | {
414 | throw 'No start-up project found. Please use the -StartupProject parameter.'
415 | }
416 | if ($startupProjectPaths.Length -gt 1)
417 | {
418 | throw 'More than one start-up project found. Please use the -StartUpProject parameter.'
419 | }
420 |
421 | $startupProjectPath = $startupProjectPaths[0]
422 |
423 | if (!(Split-Path -IsAbsolute $startupProjectPath))
424 | {
425 | $solutionPath = Split-Path $DTE.Solution.Properties.Item('Path').Value
426 | $startupProjectPath = Join-Path $solutionPath $startupProjectPath -Resolve
427 | }
428 |
429 | $startupProject = $DTE.Solution.Projects | ?{
430 | $fullName = $_.FullName
431 |
432 | if ($fullName -and $fullName.EndsWith('\'))
433 | {
434 | $fullName = $fullName.Substring(0, $fullName.Length - 1)
435 | }
436 |
437 | return $fullName -eq $startupProjectPath
438 | }
439 |
440 | Write-Verbose ('Using StartUp project ''' + $startupProject.Name + '''.')
441 |
442 | return $startupProject
443 | }
444 |
445 | function Get-SingleProject($name)
446 | {
447 | $project = Get-Project $name
448 |
449 | if ($project -is [array])
450 | {
451 | throw "More than one project '$name' was found. Specify the full name of the one to use."
452 | }
453 |
454 | return $project
455 | }
456 |
457 | function Load-EntityFramework()
458 | {
459 | [System.AppDomain]::CurrentDomain.SetShadowCopyFiles()
460 | [System.Reflection.Assembly]::LoadFrom((Join-Path $installPath 'lib\net40\EntityFramework.dll')) | Out-Null
461 | [System.Reflection.Assembly]::LoadFrom((Join-Path $installPath 'tools\EntityFramework.PowerShell.dll')) | Out-Null
462 | }
463 |
464 | function Build-Project($project)
465 | {
466 | $configuration = $DTE.Solution.SolutionBuild.ActiveConfiguration.Name
467 |
468 | $DTE.Solution.SolutionBuild.BuildProject($configuration, $project.UniqueName, $true)
469 |
470 | if ($DTE.Solution.SolutionBuild.LastBuildInfo)
471 | {
472 | throw 'The project ''' + $project.Name + ''' failed to build.'
473 | }
474 | }
475 |
476 | function Test-TypeInherits($type, $baseTypeName)
477 | {
478 | if ($type.FullName -eq $baseTypeName)
479 | {
480 | return $true
481 | }
482 |
483 | $baseType = $type.BaseType
484 |
485 | if ($baseType)
486 | {
487 | return Test-TypeInherits $baseType $baseTypeName
488 | }
489 |
490 | return $false
491 | }
492 |
493 | Export-ModuleMember @( 'Enable-Migrations', 'Add-Migration', 'Update-Database', 'Get-Migrations' ) -Variable 'InitialDatabase'
494 |
--------------------------------------------------------------------------------
/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/besnik/generic-repository/0a5407ca84cdec49a57fc55da8d323bf5495edc5/packages/EntityFramework.4.3.1/tools/migrate.exe
--------------------------------------------------------------------------------
/packages/Iesi.Collections.3.2.0.4000/Iesi.Collections.3.2.0.4000.nupkg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/besnik/generic-repository/0a5407ca84cdec49a57fc55da8d323bf5495edc5/packages/Iesi.Collections.3.2.0.4000/Iesi.Collections.3.2.0.4000.nupkg
--------------------------------------------------------------------------------
/packages/Iesi.Collections.3.2.0.4000/lib/Net35/Iesi.Collections.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/besnik/generic-repository/0a5407ca84cdec49a57fc55da8d323bf5495edc5/packages/Iesi.Collections.3.2.0.4000/lib/Net35/Iesi.Collections.dll
--------------------------------------------------------------------------------
/packages/NHibernate.3.3.0.4000/ConfigurationTemplates/FireBird.cfg.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
17 |
18 |
19 | NHibernate.Driver.FirebirdClientDriver
20 |
21 | Server=localhost;
22 | Database=C:\nhibernate.fdb;
23 | User=SYSDBA;Password=masterkey
24 |
25 | false
26 | NHibernate.Dialect.FirebirdDialect
27 | 60
28 | true 1, false 0, yes 1, no 0
29 |
30 |
31 |
--------------------------------------------------------------------------------
/packages/NHibernate.3.3.0.4000/ConfigurationTemplates/MSSQL.cfg.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 | NHibernate.Driver.SqlClientDriver
11 |
12 | Server=(local);initial catalog=nhibernate;Integrated Security=SSPI
13 |
14 | NHibernate.Dialect.MsSql2008Dialect
15 |
16 |
--------------------------------------------------------------------------------
/packages/NHibernate.3.3.0.4000/ConfigurationTemplates/MySql.cfg.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 | NHibernate.Driver.MySqlDataDriver
11 |
12 | Database=test;Data Source=someip;User Id=blah;Password=blah
13 |
14 | NHibernate.Dialect.MySQLDialect
15 |
16 |
--------------------------------------------------------------------------------
/packages/NHibernate.3.3.0.4000/ConfigurationTemplates/Oracle.cfg.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 | NHibernate.Driver.OracleClientDriver
11 |
12 | User ID=nhibernate;Password=nhibernate;Data Source=localhost
13 |
14 | false
15 | NHibernate.Dialect.OracleDialect
16 | true 1, false 0, yes 'Y', no 'N'
17 |
18 |
--------------------------------------------------------------------------------
/packages/NHibernate.3.3.0.4000/ConfigurationTemplates/PostgreSQL.cfg.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 | NHibernate.Driver.NpgsqlDriver
10 |
11 | Server=localhost;Database=nhibernate;User ID=nhibernate;Password=nhibernate;
12 |
13 | NHibernate.Dialect.PostgreSQL82Dialect
14 |
15 |
--------------------------------------------------------------------------------
/packages/NHibernate.3.3.0.4000/ConfigurationTemplates/SQLite.cfg.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 | NHibernate.Driver.SQLite20Driver
10 |
11 | Data Source=nhibernate.db
12 |
13 | NHibernate.Dialect.SQLiteDialect
14 |
15 |
--------------------------------------------------------------------------------
/packages/NHibernate.3.3.0.4000/ConfigurationTemplates/SybaseASE.cfg.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 | NHibernate.Driver.SybaseAseClientDriver
10 |
11 | Data Source=10.0.0.1;Port=5000;Database=nhibernate;User ID=nhibernate;Password=password
12 |
13 | NHibernate.Dialect.SybaseASE15Dialect
14 | true=1;false=0
15 |
16 |
--------------------------------------------------------------------------------
/packages/NHibernate.3.3.0.4000/ConfigurationTemplates/SybaseSQLAnywhere.cfg.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 | NHibernate.Driver.SybaseSQLAnywhereDriver
10 |
11 | UID=DBA;PWD=sql;Server=localhost;DBN=nhibernate;DBF=c:\nhibernate.db;ASTOP=No
12 |
13 | NHibernate.Dialect.SybaseSQLAnywhere12Dialect
14 | true=1;false=0
15 |
16 |
--------------------------------------------------------------------------------
/packages/NHibernate.3.3.0.4000/NHibernate.3.3.0.4000.nupkg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/besnik/generic-repository/0a5407ca84cdec49a57fc55da8d323bf5495edc5/packages/NHibernate.3.3.0.4000/NHibernate.3.3.0.4000.nupkg
--------------------------------------------------------------------------------
/packages/NHibernate.3.3.0.4000/NHibernate.readme.html:
--------------------------------------------------------------------------------
1 | Welcome to NHibernate
2 |
3 | NHibernate is a mature, open source object-relational mapper for the .NET framework. It is actively developed,
4 | fully featured and used in thousands of successful projects.
5 |
6 | The NHibernate community website - http://www.nhforge.org - has a range of resources to help you get started,
7 | including wikis, blogs and reference documentation.
8 |
9 | Latest Version
10 |
11 | The quickest way to get the latest release of NHibernate is to add it to your project using
12 | NuGet (http://nuget.org/List/Packages/NHibernate).
13 |
14 | Alternatively binaries are available from SourceForge at http://sourceforge.net/projects/nhibernate.
15 |
16 | You are encouraged to review the release notes (releasenotes.txt), particularly when upgrading to a
17 | later version. The release notes will generally document any breaking changes.
18 |
19 |
20 |
21 | There are two official NHibernate community forums:
22 |
23 |
27 |
28 | Bug Reports
29 |
30 | If you find any bugs, please report them using the JIRA bug tracker. A
31 | test-case that demonstrates the issue is usually required. Instructions on providing a test-case
32 | can be found here.
33 |
34 | Licenses
35 |
36 | This software is distributed under the terms of the Free Software Foundation Lesser GNU Public License (LGPL), version 2.1 (see lgpl.txt).
37 |
38 | Credits
39 |
40 | Many thanks to the following individuals, organisations and projects whose work is so important to the success
41 | of NHibernate (in no particular order):
42 |
43 |
--------------------------------------------------------------------------------
/packages/NHibernate.3.3.0.4000/NHibernate.releasenotes.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/besnik/generic-repository/0a5407ca84cdec49a57fc55da8d323bf5495edc5/packages/NHibernate.3.3.0.4000/NHibernate.releasenotes.txt
--------------------------------------------------------------------------------
/packages/NHibernate.3.3.0.4000/lib/Net35/NHibernate.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/besnik/generic-repository/0a5407ca84cdec49a57fc55da8d323bf5495edc5/packages/NHibernate.3.3.0.4000/lib/Net35/NHibernate.dll
--------------------------------------------------------------------------------
/packages/NHibernate.3.3.0.4000/nhibernate-configuration.xsd:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | -- This schema was automatically generated by Syntext Dtd2Schema and changed for NH use --
5 | -- conversion tool (from file: hibernate-configuration-3.0.dtd) --
6 | -- Copyright (C) 2002, 2003 Syntext Inc. See http://www.syntext.com for updates. --
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | There are 3 default short-cut values
17 | - lcg : default for .NET2.0 and higher.
18 | - codedom : CodeDOM-based bytecode provider (mostly for .NET1.1).
19 | - null : Disable the reflection optimization completely.
20 | In addition you can specify the AssemblyQualifiedName of your custom bytecode-provider (implementation of IBytecodeProvider).
21 | Note: the bytecode-provider will be tooks in account only when specified in the app.config or web.config.
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 | There are 3 possible combinations of mapping attributes
57 | 1 - resource & assembly: NHibernate will read the mapping resource from the specified assembly
58 | 2 - file only: NHibernate will read the mapping from the file.
59 | 3 - assembly only: NHibernate will find all the resources ending in hbm.xml from the assembly.
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 |
225 |
226 |
--------------------------------------------------------------------------------
/packages/NHibernate.Linq.1.0/NHibernate.Linq.1.0.nupkg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/besnik/generic-repository/0a5407ca84cdec49a57fc55da8d323bf5495edc5/packages/NHibernate.Linq.1.0/NHibernate.Linq.1.0.nupkg
--------------------------------------------------------------------------------
/packages/NHibernate.Linq.1.0/lib/NHibernate.Linq.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/besnik/generic-repository/0a5407ca84cdec49a57fc55da8d323bf5495edc5/packages/NHibernate.Linq.1.0/lib/NHibernate.Linq.dll
--------------------------------------------------------------------------------
/packages/NUnit.2.6.0.12054/NUnit.2.6.0.12054.nupkg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/besnik/generic-repository/0a5407ca84cdec49a57fc55da8d323bf5495edc5/packages/NUnit.2.6.0.12054/NUnit.2.6.0.12054.nupkg
--------------------------------------------------------------------------------
/packages/NUnit.2.6.0.12054/lib/nunit.framework.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/besnik/generic-repository/0a5407ca84cdec49a57fc55da8d323bf5495edc5/packages/NUnit.2.6.0.12054/lib/nunit.framework.dll
--------------------------------------------------------------------------------
/packages/NUnit.2.6.0.12054/license.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/besnik/generic-repository/0a5407ca84cdec49a57fc55da8d323bf5495edc5/packages/NUnit.2.6.0.12054/license.txt
--------------------------------------------------------------------------------
/packages/System.Data.SQLite.1.0.80.0/System.Data.SQLite.1.0.80.0.nupkg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/besnik/generic-repository/0a5407ca84cdec49a57fc55da8d323bf5495edc5/packages/System.Data.SQLite.1.0.80.0/System.Data.SQLite.1.0.80.0.nupkg
--------------------------------------------------------------------------------
/packages/System.Data.SQLite.1.0.80.0/lib/net20/System.Data.SQLite.Linq.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/besnik/generic-repository/0a5407ca84cdec49a57fc55da8d323bf5495edc5/packages/System.Data.SQLite.1.0.80.0/lib/net20/System.Data.SQLite.Linq.dll
--------------------------------------------------------------------------------
/packages/System.Data.SQLite.1.0.80.0/lib/net20/System.Data.SQLite.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/besnik/generic-repository/0a5407ca84cdec49a57fc55da8d323bf5495edc5/packages/System.Data.SQLite.1.0.80.0/lib/net20/System.Data.SQLite.dll
--------------------------------------------------------------------------------
/packages/System.Data.SQLite.1.0.80.0/lib/net40/System.Data.SQLite.Linq.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/besnik/generic-repository/0a5407ca84cdec49a57fc55da8d323bf5495edc5/packages/System.Data.SQLite.1.0.80.0/lib/net40/System.Data.SQLite.Linq.dll
--------------------------------------------------------------------------------
/packages/System.Data.SQLite.1.0.80.0/lib/net40/System.Data.SQLite.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/besnik/generic-repository/0a5407ca84cdec49a57fc55da8d323bf5495edc5/packages/System.Data.SQLite.1.0.80.0/lib/net40/System.Data.SQLite.dll
--------------------------------------------------------------------------------
/packages/log4net.2.0.0/lib/net10-full/log4net.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/besnik/generic-repository/0a5407ca84cdec49a57fc55da8d323bf5495edc5/packages/log4net.2.0.0/lib/net10-full/log4net.dll
--------------------------------------------------------------------------------
/packages/log4net.2.0.0/lib/net11-full/log4net.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/besnik/generic-repository/0a5407ca84cdec49a57fc55da8d323bf5495edc5/packages/log4net.2.0.0/lib/net11-full/log4net.dll
--------------------------------------------------------------------------------
/packages/log4net.2.0.0/lib/net20-cf/log4net.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/besnik/generic-repository/0a5407ca84cdec49a57fc55da8d323bf5495edc5/packages/log4net.2.0.0/lib/net20-cf/log4net.dll
--------------------------------------------------------------------------------
/packages/log4net.2.0.0/lib/net20-full/log4net.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/besnik/generic-repository/0a5407ca84cdec49a57fc55da8d323bf5495edc5/packages/log4net.2.0.0/lib/net20-full/log4net.dll
--------------------------------------------------------------------------------
/packages/log4net.2.0.0/lib/net35-client/log4net.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/besnik/generic-repository/0a5407ca84cdec49a57fc55da8d323bf5495edc5/packages/log4net.2.0.0/lib/net35-client/log4net.dll
--------------------------------------------------------------------------------
/packages/log4net.2.0.0/lib/net35-full/log4net.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/besnik/generic-repository/0a5407ca84cdec49a57fc55da8d323bf5495edc5/packages/log4net.2.0.0/lib/net35-full/log4net.dll
--------------------------------------------------------------------------------
/packages/log4net.2.0.0/lib/net40-client/log4net.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/besnik/generic-repository/0a5407ca84cdec49a57fc55da8d323bf5495edc5/packages/log4net.2.0.0/lib/net40-client/log4net.dll
--------------------------------------------------------------------------------
/packages/log4net.2.0.0/lib/net40-full/log4net.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/besnik/generic-repository/0a5407ca84cdec49a57fc55da8d323bf5495edc5/packages/log4net.2.0.0/lib/net40-full/log4net.dll
--------------------------------------------------------------------------------
/packages/log4net.2.0.0/log4net.2.0.0.nupkg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/besnik/generic-repository/0a5407ca84cdec49a57fc55da8d323bf5495edc5/packages/log4net.2.0.0/log4net.2.0.0.nupkg
--------------------------------------------------------------------------------
/packages/repositories.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------