Guest User

Untitled

a guest
Jun 16th, 2013
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. repository.GetById[[IMyInterface]](id);
  2.  
  3. class AggRoot1 : IInterface1, IInterface2 {}
  4. class AggRoot2 : IInterface1, IInterface2 {}
  5.  
  6. repository.GetById<IInterface1>(idFromAggRoot1);
  7.  
  8. public class MyAggregateFactory : IConstructAggregates
  9. {
  10. public IAggregate Build(Type type, Guid id, IMemento snapshot)
  11. {
  12. if (type == typeof(IMyInterface))
  13. return new MyAggregate();
  14. else
  15. return Activator.CreateInstance(type) as IAggregate;
  16. }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment