Skip to content

Commit 8e81b07

Browse files
committed
First commit. Projects moved migrated from https://github.com/simpleinjector/SimpleInjector/
0 parents  commit 8e81b07

File tree

46 files changed

+3650
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+3650
-0
lines changed

.gitattributes

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Set the default behavior, in case people don't have core.autocrlf set.
2+
* text=auto
3+
4+
# Declare files that will always have CRLF line endings on checkout.
5+
*.sln eol=crlf
6+
*.cs eol=crlf
7+
*.bat eol=crlf
8+
*.txt eol=crlf
9+
*.csproj eol=crlf

.gitignore

Lines changed: 211 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,211 @@
1+
## Ignore Visual Studio temporary files, build results, and
2+
## files generated by popular Visual Studio add-ons.
3+
4+
# User-specific files
5+
*.suo
6+
*.user
7+
*.userosscache
8+
*.sln.docstates
9+
StyleCop.Cache
10+
*ncrunch*
11+
coverage/
12+
*project.lock.json
13+
14+
# Security
15+
*.snk
16+
!fake.snk
17+
18+
# User-specific files (MonoDevelop/Xamarin Studio)
19+
*.userprefs
20+
21+
# Build results
22+
[Dd]ebug/
23+
[Dd]ebugPublic/
24+
[Rr]elease/
25+
[Rr]eleases/
26+
x64/
27+
x86/
28+
build/
29+
bld/
30+
[Bb]in/
31+
[Oo]bj/
32+
Help/
33+
*.boltdata/
34+
35+
# Visual Studo 2015 cache/options directory
36+
.vs/
37+
38+
# MSTest test Results
39+
[Tt]est[Rr]esult*/
40+
[Bb]uild[Ll]og.*
41+
42+
# NUNIT
43+
*.VisualState.xml
44+
TestResult.xml
45+
46+
# Build Results of an ATL Project
47+
[Dd]ebugPS/
48+
[Rr]eleasePS/
49+
dlldata.c
50+
51+
*_i.c
52+
*_p.c
53+
*_i.h
54+
*.ilk
55+
*.meta
56+
*.obj
57+
*.pch
58+
*.pdb
59+
*.pgc
60+
*.pgd
61+
*.rsp
62+
*.sbr
63+
*.tlb
64+
*.tli
65+
*.tlh
66+
*.tmp
67+
*.tmp_proj
68+
*.log
69+
*.vspscc
70+
*.vssscc
71+
.builds
72+
*.pidb
73+
*.svclog
74+
*.scc
75+
76+
# Chutzpah Test files
77+
_Chutzpah*
78+
79+
# Visual C++ cache files
80+
ipch/
81+
*.aps
82+
*.ncb
83+
*.opensdf
84+
*.sdf
85+
*.cachefile
86+
87+
# Visual Studio profiler
88+
*.psess
89+
*.vsp
90+
*.vspx
91+
92+
# TFS 2012 Local Workspace
93+
$tf/
94+
95+
# Guidance Automation Toolkit
96+
*.gpState
97+
98+
# ReSharper is a .NET coding add-in
99+
_ReSharper*/
100+
*.[Rr]e[Ss]harper
101+
*.DotSettings.user
102+
103+
# JustCode is a .NET coding addin-in
104+
.JustCode
105+
106+
# TeamCity is a build add-in
107+
_TeamCity*
108+
109+
# DotCover is a Code Coverage Tool
110+
*.dotCover
111+
112+
# NCrunch
113+
_NCrunch_*
114+
.*crunch*.local.xml
115+
116+
# MightyMoose
117+
*.mm.*
118+
AutoTest.Net/
119+
120+
# Web workbench (sass)
121+
.sass-cache/
122+
123+
# Installshield output folder
124+
[Ee]xpress/
125+
126+
# DocProject is a documentation generator add-in
127+
DocProject/buildhelp/
128+
DocProject/Help/*.HxT
129+
DocProject/Help/*.HxC
130+
DocProject/Help/*.hhc
131+
DocProject/Help/*.hhk
132+
DocProject/Help/*.hhp
133+
DocProject/Help/Html2
134+
DocProject/Help/html
135+
136+
# Click-Once directory
137+
publish/
138+
139+
# Publish Web Output
140+
*.[Pp]ublish.xml
141+
*.azurePubxml
142+
# TODO: Comment the next line if you want to checkin your web deploy settings
143+
# but database connection strings (with potential passwords) will be unencrypted
144+
*.pubxml
145+
*.publishproj
146+
147+
# NuGet Packages
148+
*.nupkg
149+
# The packages folder can be ignored because of Package Restore
150+
**/packages/*
151+
# except build/, which is used as an MSBuild target.
152+
!**/packages/build/
153+
# Uncomment if necessary however generally it will be regenerated when needed
154+
#!**/packages/repositories.config
155+
156+
# Windows Azure Build Output
157+
csx/
158+
*.build.csdef
159+
160+
# Windows Store app package directory
161+
AppPackages/
162+
163+
# Others
164+
*.[Cc]ache
165+
ClientBin/
166+
[Ss]tyle[Cc]op.Cache
167+
~$*
168+
*~
169+
*.dbmdl
170+
*.dbproj.schemaview
171+
*.pfx
172+
*.publishsettings
173+
node_modules/
174+
bower_components/
175+
176+
# RIA/Silverlight projects
177+
Generated_Code/
178+
179+
# Backup & report files from converting an old project file
180+
# to a newer Visual Studio version. Backup files are not needed,
181+
# because we have git ;-)
182+
_UpgradeReport_Files/
183+
Backup*/
184+
UpgradeLog*.XML
185+
UpgradeLog*.htm
186+
187+
# SQL Server files
188+
*.mdf
189+
*.ldf
190+
191+
# Business Intelligence projects
192+
*.rdl.data
193+
*.bim.layout
194+
*.bim_*.settings
195+
196+
# Microsoft Fakes
197+
FakesAssemblies/
198+
199+
# Node.js Tools for Visual Studio
200+
.ntvs_analysis.dat
201+
202+
# Visual Studio 6 build log
203+
*.plg
204+
205+
# Visual Studio 6 workspace options file
206+
*.opt
207+
208+
# Included stuff
209+
!BuildTools/*.*
210+
!Shared Assemblies/*.*
211+
!Shared Silverlight Assemblies/*.*

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2013 Simple Injector Contributors
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.

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# ASP.NET Core Integrations for Simple Injector
2+
3+
_**To get a high level overview of Simple Injector, please [visit our website](https://simpleinjector.org/)** or dive directly into our [documentation](https://simpleinjector.org/documentation). And did you know there's a [Simple Injector blog](https://simpleinjector.org/blog)?_
4+
5+
Please see [the documentation](https://simpleinjector.org/aspnetcore) to learn how to use the packages in this repository.

src/Graphics/Trademark Policy.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
We, the Simple Injector Contributors, love it when people talk about Simple Injector, build businesses around Simple Injector and produce products that make life better for Simple Injector users and developers. We do, however, have a trademark, which we are obliged to protect. The trademark gives us the exclusive right to use the term to promote websites, services, businesses and products. Although those rights are exclusively ours, we are happy to give people permission to use the term under most circumstances.
2+
3+
The following is a general policy that tells you when you can refer to the Simple Injector name and logo without need of any specific permission from Simple Injector:
4+
5+
First, you must make clear that you are not Simple Injector and that you do not represent Simple Injector. A simple disclaimer on your home page is an excellent way of doing that.
6+
7+
Second, you may not incorporate the Simple Injector name or logo into the name or logo of your website, product, NuGet package, business or service.
8+
9+
Third, you may use the Simple Injector name (but not the Simple Injector logo) only in descriptions of your website, product, business or service to provide accurate information to the public about yourself.
10+
11+
Fourth, you may not use the Simple Injector graphical logo.
12+
13+
If you would like to use the Simple Injector name or logo for any other use, please contact us and we�ll discuss a way to make that happen. We don�t have strong objections to people using the name for their websites and businesses, but we do need the chance to review such use. Generally, we approve your use if you agree to a few things, mainly: (1) our rights to the Simple Injector trademark are valid and superior to yours and (2) you�ll take appropriate steps to make sure people don�t confuse your website, package, or product for ours. In other words, it�s not a big deal, and a short conversation (usually done via email) should clear everything up in short order.
14+
15+
If you currently have a website that is using the Simple Injector name and you have not gotten permission from us, don�t panic. Let us know, and we�ll work it out, as described above.

src/Graphics/simpleinjector.png

3.09 KB
Loading
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
namespace SimpleInjector.Conventions.Tests
2+
{
3+
using System;
4+
using System.Collections.Generic;
5+
using System.Collections.ObjectModel;
6+
using System.IO;
7+
using System.Linq;
8+
using System.Reflection;
9+
using Microsoft.VisualStudio.TestTools.UnitTesting;
10+
using SimpleInjector.Integration.AspNetCore.Mvc;
11+
using SimpleInjector.Integration.ServiceCollection;
12+
13+
public static class ConventionValues
14+
{
15+
public static readonly ReadOnlyCollection<Assembly> AssembliesUnderConvention;
16+
public static readonly ReadOnlyCollection<DirectoryInfo> ProjectsUnderConvention;
17+
18+
static ConventionValues()
19+
{
20+
// Ensure all assemblies are loaded
21+
var types = new[]
22+
{
23+
// SimpleInjector.Integration.GenericHost is excluded here, because requires a higher minimum
24+
// version of MS.Ext.DI.Abstr than all the other packages do. This would cause the tests to
25+
// fail when run from the command line. We skip testing GenericHost (for now).
26+
typeof(SimpleInjectorAddOptions), // SI.Integration.ServiceCollection
27+
typeof(SimpleInjectorAspNetCoreIntegrationExtensions), // SI.Integration.AspNetCore
28+
typeof(SimpleInjectorTagHelperActivator), // SI.Integration.AspNetCore.Mvc
29+
typeof(SimpleInjectorViewComponentActivator), // SI.Integration.AspNetCore.Mvc.Core
30+
};
31+
32+
AssembliesUnderConvention = new ReadOnlyCollection<Assembly>((
33+
from assembly in AppDomain.CurrentDomain.GetAssemblies()
34+
let fileName = Path.GetFileName(assembly.Location)
35+
where fileName.Contains("SimpleInjector")
36+
where !fileName.EndsWith("SimpleInjector.dll")
37+
where !fileName.Contains("Test")
38+
select assembly)
39+
.ToArray());
40+
41+
// Arrange
42+
DirectoryInfo repoDir = GetRepositoryRoot();
43+
44+
ProjectsUnderConvention = new ReadOnlyCollection<DirectoryInfo>((
45+
from assembly in AssembliesUnderConvention
46+
let projectName = Path.GetFileNameWithoutExtension(assembly.Location)
47+
select new DirectoryInfo(Path.Combine(repoDir.FullName, projectName)))
48+
.ToArray());
49+
50+
VerifyProjectsExist(ProjectsUnderConvention);
51+
}
52+
53+
public static DirectoryInfo GetRepositoryRoot()
54+
{
55+
var dir = new DirectoryInfo(AppDomain.CurrentDomain.BaseDirectory);
56+
57+
while (dir.Name != "src")
58+
{
59+
dir = dir.Parent;
60+
}
61+
62+
return dir;
63+
}
64+
65+
private static void VerifyProjectsExist(IEnumerable<DirectoryInfo> projectsUnderConvention)
66+
{
67+
if (projectsUnderConvention.Any(p => !p.Exists))
68+
{
69+
Assert.Fail("Not all assemblies under convention could be mapped to a physical project. " +
70+
"Following project paths are missing:" + Environment.NewLine +
71+
string.Join(Environment.NewLine,
72+
from project in projectsUnderConvention
73+
where !project.Exists
74+
select project.FullName));
75+
}
76+
}
77+
}
78+
}

0 commit comments

Comments
 (0)