Ejemplo n.º 1
0
        /// <summary>
        /// The Insert.
        /// </summary>
        /// <param name="entity">The entity<see cref="Seller"/>.</param>
        /// <returns>The <see cref="IList{ValidationResult}"/>.</returns>
        public IList <ValidationResult> Insert(Seller entity)
        {
            var results = EntityValidator.IsEntityValid(entity);

            if (results.Count == 0)
            {
                this.sellerRepository.Insert(entity);
            }
            else
            {
                Logger.Info("Person insertion failed");
            }

            return(results);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// The Insert.
        /// </summary>
        /// <param name="entity">The entity<see cref="Bidder"/>.</param>
        /// <returns>The <see cref="IList{ValidationResult}"/>.</returns>
        public IList <ValidationResult> Insert(Bidder entity)
        {
            var results = EntityValidator.IsEntityValid(entity);

            if (results.Count == 0)
            {
                this.bidderRepository.Insert(entity);
            }
            else
            {
                Logger.Info("Entity insertion failed!");
            }

            return(results);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// The Insert.
        /// </summary>
        /// <param name="entity">The entity<see cref="Bid"/>.</param>
        /// <returns>The <see cref="IList{ValidationResult}"/>.</returns>
        public IList <ValidationResult> Insert(Bid entity)
        {
            var results = EntityValidator.IsEntityValid(entity);

            if (!results.Any())
            {
                results = results.Concat(ApplyAdditionalRules(entity)).ToList();
            }

            if (results.Count == 0)
            {
                this.bidRepository.Insert(entity);
            }
            else
            {
                Logger.Info("Bid insertion failed!");
            }

            return(results);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// The Insert.
        /// </summary>
        /// <param name="entity">The entity<see cref="Auction"/>.</param>
        /// <returns>The <see cref="IList{ValidationResult}"/>.</returns>
        public IList <ValidationResult> Insert(Auction entity)
        {
            SetAuctionStatus(entity);
            var results = EntityValidator.IsEntityValid(entity);

            if (!results.Any())
            {
                results = results.Concat(ApplyAdditionalInsertRules(entity)).ToList();
            }

            if (results.Count == 0)
            {
                this.auctionRepository.Insert(entity);
            }
            else
            {
                Logger.Info("Entity insertion failed!");
            }

            return(results);
        }