Skip to content

Commit

Permalink
Fixed metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
Boggin committed Aug 30, 2019
1 parent a1b726d commit adfca5c
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 4,7 @@
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.ComponentModel.Composition" Version="4.5.0" />
<PackageReference Include="System.Composition.AttributedModel" Version="1.2.0" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="4.5.0" />
<PackageReference Include="System.Data.SqlClient" Version="4.6.1" />
Expand Down
4 changes: 3 additions & 1 deletion src/FeatureFlagger.ConfigurationReaders/ConfigReader.cs
Original file line number Diff line number Diff line change
@@ -1,11 1,13 @@
namespace FeatureFlagger.ConfigurationReaders
{
using System.Collections.Generic;
using System.Composition;
using System.Configuration;

using FeatureFlagger.Domain;

[ExportReader(Reader = Constants.Config)]
[Export(typeof(IConfigurationReader))]
[ExportMetadata("Reader", Constants.Config)]
public class ConfigReader : IConfigurationReader
{
public IEnumerable<Feature> ReadAll()
Expand Down
4 changes: 3 additions & 1 deletion src/FeatureFlagger.ConfigurationReaders/StoreReader.cs
Original file line number Diff line number Diff line change
@@ -1,13 1,15 @@
namespace FeatureFlagger.ConfigurationReaders
{
using System.Collections.Generic;
using System.Composition;
using System.Configuration;
using System.Data.SqlClient;
using System.Linq;

using FeatureFlagger.Domain;

[ExportReader(Reader = Constants.Store)]
[Export(typeof(IConfigurationReader))]
[ExportMetadata("Reader", Constants.Store)]
public class StoreReader : IConfigurationReader
{
public IEnumerable<Feature> ReadAll()
Expand Down
3 changes: 2 additions & 1 deletion src/FeatureFlagger.ConfigurationWriters/StoreWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 7,8 @@

using Feature = Domain.Feature;

[ExportWriter(Writer = Constants.Store)]
[Export(typeof(IConfigurationWriter))]
[ExportMetadata("Writer", Constants.Store)]
public class StoreWriter : IConfigurationWriter
{
private readonly string connectionString;
Expand Down
5 changes: 3 additions & 2 deletions src/FeatureFlagger/FeatureFlagger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 71,7 @@ private static IConfigurationWriter SetWriter()
ConfigurationManager.AppSettings["FeatureFlaggerSource"]
?? Constants.Config;

var writer =
var writers =
Writers.ToList()
.Find(
f =>
Expand All @@ -81,7 81,7 @@ private static IConfigurationWriter SetWriter()
.CreateExport()
.Value;

return writer;
return writers;
}

private void SetImports()
Expand All @@ -96,6 96,7 @@ private void SetImports()
container.SatisfyImports(this);
Behaviours = container.GetExports<IBehaviour>();
Readers = container.GetExports<ExportFactory<IConfigurationReader, ExportReaderAttribute>>();
Writers = container.GetExports<ExportFactory<IConfigurationWriter, ExportWriterAttribute>>();
}
}
}

0 comments on commit adfca5c

Please sign in to comment.