Skip to content

Commit 94edcb2

Browse files
author
Chris Young
committed
Updated to IConfiguration
1 parent 8a95815 commit 94edcb2

File tree

22 files changed

+29
-36
lines changed

22 files changed

+29
-36
lines changed

src/ArchitectNow.Caching/ArchitectNow.Caching.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="2.0.1" />
2727
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="2.0.1" />
2828
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="2.0.1" />
29+
<PackageReference Include="NETStandard.Library" Version="2.0.2" />
2930
</ItemGroup>
3031
<ItemGroup>
3132
<Compile Include="..\..\VersionAssemblyInfo.cs" Link="VersionAssemblyInfo.cs" />

src/ArchitectNow.Caching/CachingModule.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ protected override void Load(ContainerBuilder builder)
1212
builder.RegisterType<CacheMangerFactory>().As<ICacheMangerFactory>().SingleInstance();
1313
builder.RegisterGeneric(typeof(CacheKeeper<>)).As(typeof(ICacheKeeper<>)).SingleInstance();
1414

15-
builder.Register(context => context.Resolve<IConfigurationRoot>().CreateOptions<RedisOptions>("redis")).AsSelf().SingleInstance();
15+
builder.Register(context => context.Resolve<IConfiguration>().CreateOptions<RedisOptions>("redis")).AsSelf().SingleInstance();
1616

17-
builder.Register(context => context.Resolve<IConfigurationRoot>().CreateOptions<CachingOptions>("caching")).AsSelf().SingleInstance();
17+
builder.Register(context => context.Resolve<IConfiguration>().CreateOptions<CachingOptions>("caching")).AsSelf().SingleInstance();
1818

1919
}
2020
}

src/ArchitectNow.Caching/OptionsExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ namespace ArchitectNow.Caching
55
{
66
static class OptionsExtensions
77
{
8-
public static IOptions<TOptions> CreateOptions<TOptions>(this IConfigurationRoot configurationRoot, string section) where TOptions : class, new()
8+
public static IOptions<TOptions> CreateOptions<TOptions>(this IConfiguration configuration, string section) where TOptions : class, new()
99
{
10-
return new OptionsWrapper<TOptions>(configurationRoot.GetSection(section).Get<TOptions>());
10+
return new OptionsWrapper<TOptions>(configuration.GetSection(section).Get<TOptions>());
1111
}
1212
}
1313
}

src/ArchitectNow.FluentValidation/ArchitectNow.FluentValidation.csproj

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/ArchitectNow.FluentValidation/Class1.cs

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/ArchitectNow.Models/ArchitectNow.Models.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="2.0.1" />
2424
<PackageReference Include="Microsoft.Extensions.Options" Version="2.0.1" />
2525
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="2.0.1" />
26-
<PackageReference Include="Microsoft.IdentityModel.Tokens" Version="5.2.1" />
26+
<PackageReference Include="Microsoft.IdentityModel.Tokens" Version="5.2.2" />
27+
<PackageReference Include="NETStandard.Library" Version="2.0.2" />
2728
</ItemGroup>
2829
<ItemGroup>
2930
<Compile Include="..\..\VersionAssemblyInfo.cs" Link="VersionAssemblyInfo.cs" />

src/ArchitectNow.Models/Options/OptionsExtensions.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ namespace ArchitectNow.Models.Options
55
{
66
public static class OptionsExtensions
77
{
8-
public static IOptions<TOptions> CreateOptions<TOptions>(this IConfigurationRoot configurationRoot, string section) where TOptions : class, new()
8+
public static IOptions<TOptions> CreateOptions<TOptions>(this IConfiguration configuration, string section) where TOptions : class, new()
99
{
10-
var options = configurationRoot.GetSection(section).Get<TOptions>();
10+
var options = configuration.GetSection(section).Get<TOptions>();
1111

1212
return new OptionsWrapper<TOptions>(options);
13-
}
13+
}
1414
}
1515
}

src/ArchitectNow.Mongo/ArchitectNow.Mongo.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="2.0.1" />
2626
<PackageReference Include="Microsoft.Extensions.Options" Version="2.0.1" />
2727
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="2.0.1" />
28-
<PackageReference Include="MongoDB.Driver" Version="2.5.1" />
28+
<PackageReference Include="MongoDB.Driver" Version="2.6.0" />
29+
<PackageReference Include="NETStandard.Library" Version="2.0.2" />
2930
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
3031
<PackageReference Include="System.ComponentModel.Annotations" Version="4.4.1" />
3132
</ItemGroup>

src/ArchitectNow.Mongo/MongoModule.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ protected override void Load(ContainerBuilder builder)
1818
builder.RegisterType<MongoDataContextService>().As<IDataContextService<MongoDataContext>>()
1919
.InstancePerLifetimeScope();
2020

21-
builder.Register(context => context.Resolve<IConfigurationRoot>().CreateOptions<MongoOptions>("mongo")).As<IOptions<MongoOptions>>().SingleInstance();
21+
builder.Register(context => context.Resolve<IConfiguration>().CreateOptions<MongoOptions>("mongo")).As<IOptions<MongoOptions>>().SingleInstance();
2222
}
2323
}
2424
}
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFramework>netstandard1.4</TargetFramework>
3+
<TargetFramework>netstandard2.0</TargetFramework>
44
</PropertyGroup>
55
<ItemGroup>
6+
<PackageReference Include="NETStandard.Library" Version="2.0.2" />
67
</ItemGroup>
78
</Project>

0 commit comments

Comments
 (0)