Skip to content

Commit 6e41bff

Browse files
committed
Cruft
1 parent f430bd4 commit 6e41bff

File tree

8 files changed

+65
-78
lines changed

8 files changed

+65
-78
lines changed

NuGet.Config

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
<configuration>
44
<packageSources>
5-
<add key="myget.org xunit" value="https://www.myget.org/F/xunit/api/v3/index.json" />
65
<add key="NuGet" value="https://api.nuget.org/v3/index.json" />
76
</packageSources>
8-
</configuration>
7+
</configuration>

build.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,4 @@ Get-ChildItem -Path .\test -Filter *.xproj -Recurse | ForEach-Object {
4646
Pop-Location
4747
}
4848

49-
Pop-Location
49+
Pop-Location

src/StructureMap.Dnx/ContainerExtensions.cs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,15 @@ public static void Populate(this ConfigurationExpression config, IEnumerable<Ser
3333

3434
private class AspNetConstructorSelector : IConstructorSelector
3535
{
36-
public ConstructorInfo Find(Type pluggedType, DependencyCollection dependencies, PluginGraph graph)
37-
{
38-
return pluggedType.GetTypeInfo()
36+
// ASP.NET expects registered services to be considered when selecting a ctor, SM doesn't by default.
37+
public ConstructorInfo Find(Type pluggedType, DependencyCollection dependencies, PluginGraph graph) =>
38+
pluggedType.GetTypeInfo()
3939
.DeclaredConstructors
40-
.Select(ctor => Tuple.Create(ctor, ctor.GetParameters()))
41-
.Where(tuple => tuple.Item2.All(param => graph.HasFamily(param.ParameterType)))
42-
.OrderByDescending(tuple => tuple.Item2.Length)
43-
.Select(tuple => tuple.Item1)
40+
.Select(ctor => new { Constructor = ctor, Parameters = ctor.GetParameters() })
41+
.Where(x => x.Parameters.All(param => graph.HasFamily(param.ParameterType)))
42+
.OrderByDescending(x => x.Parameters.Length)
43+
.Select(x => x.Constructor)
4444
.FirstOrDefault();
45-
}
4645
}
4746
}
4847
}

src/StructureMap.Dnx/HelperExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ public static GenericFamilyExpression LifecycleIs(this GenericFamilyExpression i
2929
}
3030
}
3131
}
32-
}
32+
}

src/StructureMap.Dnx/ServiceCollectionRegistry.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,4 @@ private static Expression<Func<IContext, object>> CreateFactory(ServiceDescripto
5454
return context => descriptor.ImplementationFactory(context.GetInstance<IServiceProvider>());
5555
}
5656
}
57-
}
57+
}

src/StructureMap.Dnx/project.json

Lines changed: 25 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,35 @@
11
{
2-
"version": "0.5.1-rc2-final",
2+
"version": "1.0.0",
33

4-
"description": "StructureMap.Dnx",
5-
"authors": [ "khellang" ],
4+
"description": "StructureMap.Dnx",
5+
"authors": ["khellang"],
66

7-
"buildOptions": {
8-
"warningsAsErrors": true,
9-
"nowarn": [ "CS1591" ],
10-
"xmlDoc": true
11-
},
7+
"buildOptions": {
8+
"warningsAsErrors": true,
9+
"nowarn": ["CS1591"],
10+
"xmlDoc": true
11+
},
1212

13-
"packOptions": {
14-
"tags": [ "StructureMap", "DNX", "Dependency Injection", "DI", "IoC" ],
13+
"packOptions": {
14+
"tags": ["StructureMap", "DNX", "Dependency Injection", "DI", "IoC"],
1515

16-
"projectUrl": "https://github.com/structuremap/structuremap.dnx",
17-
"licenseUrl": "https://github.com/structuremap/structuremap.dnx/blob/master/LICENSE",
16+
"projectUrl": "https://github.com/structuremap/structuremap.dnx",
17+
"licenseUrl": "https://github.com/structuremap/structuremap.dnx/blob/master/LICENSE",
1818

19-
"repository": {
20-
"type": "git",
21-
"url": "https://github.com/structuremap/structuremap.dnx"
22-
}
23-
},
19+
"repository": {
20+
"type": "git",
21+
"url": "https://github.com/structuremap/structuremap.dnx"
22+
}
23+
},
2424

25-
"dependencies": {
26-
"Microsoft.Extensions.DependencyInjection.Abstractions": "1.0.0",
27-
"structuremap": "4.2.0.402"
28-
},
25+
"dependencies": {
26+
"Microsoft.Extensions.DependencyInjection.Abstractions": "1.0.0",
27+
"structuremap": "4.2.0.402"
28+
},
2929

30-
"frameworks": {
31-
"netstandard1.0": {
32-
"imports": [ "dotnet" ]
33-
},
34-
"netcore50": {
35-
"dependencies": {
36-
"Microsoft.NETCore.Platforms": {
37-
"type": "build",
38-
"version": "1.0.1"
39-
}
40-
}
41-
}
30+
"frameworks": {
31+
"netstandard1.0": {
32+
"imports": ["dotnet"]
4233
}
34+
}
4335
}

test/StructureMap.Dnx.Tests/StructureMapContainerTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ protected override IServiceProvider CreateServiceProvider(IServiceCollection ser
1515
return container.GetInstance<IServiceProvider>();
1616
}
1717
}
18-
}
18+
}
Lines changed: 28 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,33 @@
11
{
2-
"dependencies": {
3-
"dotnet-test-xunit": "2.2.0-preview2-build1029" ,
4-
"Microsoft.Extensions.DependencyInjection.Specification.Tests": "1.0.0",
5-
"Microsoft.NETCore.Platforms": "1.0.1",
6-
"StructureMap.Dnx": { "target": "project" },
7-
"xunit": "2.2.0-beta2-build3300"
8-
},
2+
"dependencies": {
3+
"dotnet-test-xunit": "2.2.0-preview2-build1029",
4+
"Microsoft.Extensions.DependencyInjection.Specification.Tests": "1.0.0",
5+
"Microsoft.NETCore.Platforms": "1.0.1",
6+
"StructureMap.Dnx": { "target": "project" },
7+
"xunit": "2.2.0-beta2-build3300"
8+
},
99

10-
"testRunner": "xunit",
10+
"testRunner": "xunit",
1111

12-
"frameworks": {
13-
"net451": {
14-
"frameworkAssemblies": {
15-
"System.Runtime": {
16-
"type": "build"
17-
}
18-
},
19-
"dependencies": {
20-
"xunit.runner.console": "2.1.0"
21-
}
22-
},
23-
"netcoreapp1.0": {
24-
"imports": [
25-
"dnxcore50",
26-
"portable-net451+win8"
27-
],
28-
"dependencies": {
29-
"Microsoft.NETCore.App": {
30-
"version": "1.0.0",
31-
"type": "platform"
32-
}
33-
}
12+
"frameworks": {
13+
"net451": {
14+
"frameworkAssemblies": {
15+
"System.Runtime": {
16+
"type": "build"
17+
}
18+
},
19+
"dependencies": {
20+
"xunit.runner.console": "2.1.0"
21+
}
22+
},
23+
"netcoreapp1.0": {
24+
"imports": [ "dotnet" ],
25+
"dependencies": {
26+
"Microsoft.NETCore.App": {
27+
"version": "1.0.0",
28+
"type": "platform"
3429
}
30+
}
3531
}
36-
}
32+
}
33+
}

0 commit comments

Comments
 (0)