Ejemplo n.º 1
0
       public static Guid CreateAuction()
       {
           var createAuctionService = ObjectFactory.GetInstance<CreateAuction>();

           var newAuctionRequest = new NewAuctionRequest();

           newAuctionRequest.StartingPrice = 0.99m;
           newAuctionRequest.EndsAt = DateTime.Now.AddDays(1);

           var auctionId = createAuctionService.Create(newAuctionRequest);

           return auctionId;
       }
        public Guid Create(NewAuctionRequest command)
        {
            var auctionId     = Guid.NewGuid();
            var startingPrice = new Money(command.StartingPrice);

            using (ITransaction transaction = _unitOfWork.BeginTransaction())
            {
                _auctionRepository.Add(new Auction(auctionId, startingPrice, command.EndsAt));

                transaction.Commit();
            }

            return(auctionId);
        }
Ejemplo n.º 3
0
        public Guid Create(NewAuctionRequest command)
        {
            var auctionId = Guid.NewGuid();
            var startingPrice = new Money(command.StartingPrice);

            using (ITransaction transaction = _unitOfWork.BeginTransaction())
            {
                _auctionRepository.Add(new Auction(auctionId, startingPrice, command.EndsAt));

                transaction.Commit();
            }

            return auctionId;
        }