forked from JoergEg/CQRS-Sample
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
JoergEg
committed
Mar 4, 2011
1 parent
d72d758
commit c927246
Showing
7 changed files
with
55 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,22 @@ | ||
using System; | ||
using CQRSSample.Domain; | ||
using System.Collections.Generic; | ||
using CommonDomain; | ||
using CommonDomain.Persistence; | ||
|
||
namespace CQRSSample.Specs | ||
{ | ||
public class FakeRepository<T> : IRepository<T> where T : AggregateRoot, new() | ||
public class FakeRepository : IRepository | ||
{ | ||
public T SavedAggregate { get; set; } | ||
public IAggregate SavedAggregate { get; set; } | ||
|
||
public void Save(T aggregate, int expectedVersion) | ||
public TAggregate GetById<TAggregate>(Guid id, int version) where TAggregate : class, IAggregate | ||
{ | ||
SavedAggregate = aggregate; | ||
return Activator.CreateInstance(typeof(TAggregate), id) as TAggregate; | ||
} | ||
|
||
public T GetById(Guid id) | ||
public void Save(IAggregate aggregate, Guid commitId, Action<IDictionary<string, object>> updateHeaders) | ||
{ | ||
return new T(); | ||
SavedAggregate = aggregate; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters