Snapshots

One test failed but it's unrelated to these changes, so I think it was being flaky.
Internally it uses injection. The problem I want to avoid by using pure
injection is making the end user understand how to build a potentially
complex object graph of potentially shifting types. This is also why I
didn't modify the event sourced repository constructors to support
snapshotting, for now.

On Thu, Dec 18, 2014 at 1:28 PM, Nathan Black <notifications@github.com>
wrote:
>
> In Domain/ConfigurationExtensions.cs
> <https://github.com/jonsequitur/Its.Cqrs/pull/10#discussion-diff-22072762>
> :
>
> > +        /// Gets an <see cref="IEventSourcedRepository{TAggregate}" />.
> > +        /// </summary>
> > +        public static IEventSourcedRepository<TAggregate> Repository<TAggregate>(this Configuration configuration)
> > +            where TAggregate : class, IEventSourced
> > +        {
> > +            return configuration.Container.Resolve<IEventSourcedRepository<TAggregate>>();
> > +        }
> > +
> > +        /// <summary>
> > +        /// Gets an <see cref="ICommandScheduler{TAggregate}" />.
> > +        /// </summary>
> > +        public static ICommandScheduler<TAggregate> CommandScheduler<TAggregate>(this Configuration configuration)
> > +            where TAggregate : class, IEventSourced
> > +        {
> > +            return configuration.Container.Resolve<ICommandScheduler<TAggregate>>();
> > +        }
>
> Seems a little towards the service locator, but each configuration object
> is self-contained, and the Configuration.Current already exists. Also
> getting the IEventSourcedRepository is very common, but I'd prefer
> injection wherever possible.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/jonsequitur/Its.Cqrs/pull/10/files#r22072762>.
>