コード例 #1
0
        public ContactCommandHandlers(IUseRepo <Contact> useRepo, ICommandBus bus, ITimeService timeService, ISecurityPrincipalService principalService)
            : base(useRepo, timeService.UtcNow, principalService.ActiveUserName)
        {
            Name = ContactEvent.AggregateName;

            _subscriptions =
                Seq(new[]
            {
                bus.Subscribe <ReadContact>(Handle),
                bus.Subscribe <CreateContact>(Handle),
                bus.Subscribe <RenameContact>(Handle),
                bus.Subscribe <AddContactPhone>(Handle),
                bus.Subscribe <UpdateContactPhone>(Handle),
            });
        }
コード例 #2
0
        protected CommandHandlers(IUseRepo <T> useRepo, Func <DateTimeOffset> utcNow, Func <string> owner)
        {
            if (useRepo == null)
            {
                throw new ArgumentNullException("useRepo");
            }
            if (utcNow == null)
            {
                throw new ArgumentNullException("utcNow");
            }
            if (owner == null)
            {
                throw new ArgumentNullException("owner");
            }

            UseRepo = useRepo.UseRepo;
            UtcNow  = utcNow;
            Owner   = owner;
        }
コード例 #3
0
ファイル: UnitTest2.cs プロジェクト: klypz/k.facade
 public UnitTest2()
 {
     useRepo2 = Substitute.For <IUseRepo>();
     useRepo2.Name.Returns("2");
 }