Skip to content

Commit 3dfdc2d

Browse files
authored
Merge pull request #73 from Ar3sDevelopment/dev
Dev
2 parents 479fe31 + 036505d commit 3dfdc2d

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

UnitOfWork.NET.NUnit/UnitOfWork.NET.NUnit.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
<HintPath>..\packages\Autofac.4.1.1\lib\net45\Autofac.dll</HintPath>
3636
</Reference>
3737
<Reference Include="ClassBuilder">
38-
<HintPath>..\packages\ClassBuilder.4.0.0.75\lib\net45\ClassBuilder.dll</HintPath>
38+
<HintPath>..\packages\ClassBuilder.4.0.0.80\lib\net45\ClassBuilder.dll</HintPath>
3939
</Reference>
4040
</ItemGroup>
4141
<ItemGroup>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
33
<package id="Autofac" version="4.1.1" targetFramework="net45" />
4-
<package id="ClassBuilder" version="4.0.0.75" targetFramework="net45" />
4+
<package id="ClassBuilder" version="4.0.0.80" targetFramework="net45" />
55
<package id="NUnit" version="3.4.1" targetFramework="net45" />
66
</packages>

UnitOfWork.NET/Classes/UnitOfWork.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public UnitOfWork()
2121
var cb = new ContainerBuilder();
2222

2323
cb.Register(t => this).AsImplementedInterfaces().AsSelf().As<UnitOfWork>();
24-
cb.RegisterType<Repository>().AsSelf().As<IRepository>().PreserveExistingDefaults();
24+
cb.RegisterType<Repository>().AsSelf().As<IRepository>();
2525
cb.RegisterGeneric(typeof(Repository<>)).AsSelf().As(typeof(IRepository<>));
2626
cb.RegisterGeneric(typeof(Repository<,>)).AsSelf().As(typeof(IRepository<,>));
2727
cb.RegisterGeneric(typeof(Repository<,,>)).AsSelf().As(typeof(IListRepository<,,>));
@@ -180,11 +180,11 @@ private TRepository GetRepository<TRepository>(bool force = false) where TReposi
180180

181181
public TRepository CustomRepository<TRepository>() where TRepository : IRepository => GetRepository<TRepository>(true);
182182

183-
public IRepository<T> Repository<T>() where T : class, new() => GetRepository<IRepository<T>>();
183+
public IRepository<T> Repository<T>() where T : class, new() => GetRepository<IRepository<T>>() ?? CustomRepository<Repository<T>>();
184184

185-
public IRepository<TSource, TDestination> Repository<TSource, TDestination>() where TSource : class, new() where TDestination : class, new() => GetRepository<IRepository<TSource, TDestination>>();
185+
public IRepository<TSource, TDestination> Repository<TSource, TDestination>() where TSource : class, new() where TDestination : class, new() => GetRepository<IRepository<TSource, TDestination>>() ?? CustomRepository<Repository<TSource, TDestination>>();
186186

187-
public IListRepository<TSource, TDestination, TListDestination> Repository<TSource, TDestination, TListDestination>() where TSource : class, new() where TDestination : class, new() where TListDestination : class, new() => GetRepository<IListRepository<TSource, TDestination, TListDestination>>();
187+
public IListRepository<TSource, TDestination, TListDestination> Repository<TSource, TDestination, TListDestination>() where TSource : class, new() where TDestination : class, new() where TListDestination : class, new() => GetRepository<IListRepository<TSource, TDestination, TListDestination>>() ?? CustomRepository<Repository<TSource, TDestination, TListDestination>>();
188188

189189
public virtual IQueryable<T> Data<T>() where T : class, new() => Enumerable.Empty<T>().AsQueryable();
190190

UnitOfWork.NET/UnitOfWork.NET.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
<HintPath>..\packages\Autofac.4.1.1\lib\net45\Autofac.dll</HintPath>
5151
</Reference>
5252
<Reference Include="ClassBuilder">
53-
<HintPath>..\packages\ClassBuilder.4.0.0.75\lib\net45\ClassBuilder.dll</HintPath>
53+
<HintPath>..\packages\ClassBuilder.4.0.0.80\lib\net45\ClassBuilder.dll</HintPath>
5454
</Reference>
5555
</ItemGroup>
5656
<ItemGroup>

UnitOfWork.NET/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
<packages>
33
<package id="Autofac" version="4.1.1" targetFramework="net45" />
44
<package id="Caelan.DynamicLinq" version="2.0.20.0" targetFramework="net45" />
5-
<package id="ClassBuilder" version="4.0.0.75" targetFramework="net45" />
5+
<package id="ClassBuilder" version="4.0.0.80" targetFramework="net45" />
66
<package id="System.Linq.Dynamic" version="1.0.6" targetFramework="net45" />
77
</packages>

0 commit comments

Comments
 (0)