Skip to content

Commit eb11844

Browse files
author
Jeff Treuting
committed
Ioc cleanup
added NotImplementedException to the Ioc containers where the extension methods aren't done found bug in Windsor where it wasn't registering the IRepository<,> correctly
1 parent a863020 commit eb11844

3 files changed

Lines changed: 10 additions & 8 deletions

File tree

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using Autofac;
1+
using System;
2+
using Autofac;
23
using SharpRepository.Repository.Configuration;
34

45
namespace SharpRepository.Ioc.Autofac
@@ -7,12 +8,12 @@ public static class AutofacExtensions
78
{
89
public static void RegisterSharpRepository(this ContainerBuilder container, string repositoryName = null)
910
{
10-
11+
throw new NotImplementedException();
1112
}
1213

1314
public static void RegisterSharpRepository(this ContainerBuilder container, ISharpRepositoryConfiguration configuration)
1415
{
15-
16+
throw new NotImplementedException();
1617
}
1718
}
1819
}

SharpRepository.Ioc.Unity/UnityExtensions.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
using Microsoft.Practices.Unity;
2-
using SharpRepository.Repository;
1+
using System;
2+
using Microsoft.Practices.Unity;
33
using SharpRepository.Repository.Configuration;
44

55
namespace SharpRepository.Ioc.Unity
@@ -8,6 +8,7 @@ public static class UnityExtensions
88
{
99
public static void RegisterSharpRepository(this UnityContainer container, string repositoryName = null)
1010
{
11+
throw new NotImplementedException();
1112
// using InjectionFactory I can get access to the container but I don't seem to ahve access to a context
1213
// in the other Ioc's there is a context where I can get access to the type being resolved and get the generic arguments which is what i need
1314
// container.RegisterType(typeof (IRepository<>), new InjectionFactory(c =>
@@ -18,7 +19,7 @@ public static void RegisterSharpRepository(this UnityContainer container, string
1819

1920
public static void RegisterSharpRepository(this UnityContainer container, ISharpRepositoryConfiguration configuration)
2021
{
21-
22+
throw new NotImplementedException();
2223
}
2324
}
2425
}

SharpRepository.Ioc.Windsor/WindsorRepositoryExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public static void RegisterSharpRepository(this IWindsorContainer container, str
1616
return RepositoryFactory.GetInstance(genericArgs[0], repositoryName);
1717
}));
1818

19-
container.Register(Component.For(typeof(IRepository<>)).UsingFactoryMethod((c, t) =>
19+
container.Register(Component.For(typeof(IRepository<,>)).UsingFactoryMethod((c, t) =>
2020
{
2121
var genericArgs = t.GenericArguments;
2222

@@ -33,7 +33,7 @@ public static void RegisterSharpRepository(this IWindsorContainer container, ISh
3333
return RepositoryFactory.GetInstance(genericArgs[0], configuration);
3434
}));
3535

36-
container.Register(Component.For(typeof(IRepository<>)).UsingFactoryMethod((c, t) =>
36+
container.Register(Component.For(typeof(IRepository<,>)).UsingFactoryMethod((c, t) =>
3737
{
3838
var genericArgs = t.GenericArguments;
3939

0 commit comments

Comments
 (0)