Пример #1
0
        public virtual PromotionUsage ToModel(PromotionUsage usage)
        {
            if (usage == null)
            {
                throw new NullReferenceException(nameof(usage));
            }

            usage.Id           = this.Id;
            usage.CreatedBy    = this.CreatedBy;
            usage.CreatedDate  = this.CreatedDate;
            usage.ModifiedBy   = this.ModifiedBy;
            usage.ModifiedDate = this.ModifiedDate;
            usage.CouponCode   = this.CouponCode;
            usage.ObjectId     = this.ObjectId;
            usage.ObjectType   = this.ObjectType;
            usage.PromotionId  = this.PromotionId;

            return(usage);
        }
        public virtual PromotionUsage ToModel(PromotionUsage usage)
        {
            if (usage == null)
            {
                throw new NullReferenceException(nameof(usage));
            }

            usage.Id           = Id;
            usage.CreatedBy    = CreatedBy;
            usage.CreatedDate  = CreatedDate;
            usage.ModifiedBy   = ModifiedBy;
            usage.ModifiedDate = ModifiedDate;
            usage.CouponCode   = CouponCode;
            usage.ObjectId     = ObjectId;
            usage.ObjectType   = ObjectType;
            usage.PromotionId  = PromotionId;
            usage.UserId       = UserId;
            usage.UserName     = UserName;

            return(usage);
        }
Пример #3
0
        public virtual PromotionUsageEntity FromModel(PromotionUsage usage, PrimaryKeyResolvingMap pkMap)
        {
            if (usage == null)
            {
                throw new NullReferenceException(nameof(usage));
            }

            pkMap.AddPair(usage, this);

            this.Id           = usage.Id;
            this.CreatedBy    = usage.CreatedBy;
            this.CreatedDate  = usage.CreatedDate;
            this.ModifiedBy   = usage.ModifiedBy;
            this.ModifiedDate = usage.ModifiedDate;
            this.CouponCode   = usage.CouponCode;
            this.PromotionId  = usage.PromotionId;
            this.ObjectId     = usage.ObjectId;
            this.ObjectType   = usage.ObjectType;

            return(this);
        }
        public virtual PromotionUsageEntity FromModel(PromotionUsage usage, PrimaryKeyResolvingMap pkMap)
        {
            if (usage == null)
            {
                throw new ArgumentNullException(nameof(usage));
            }

            pkMap.AddPair(usage, this);

            Id           = usage.Id;
            CreatedBy    = usage.CreatedBy;
            CreatedDate  = usage.CreatedDate;
            ModifiedBy   = usage.ModifiedBy;
            ModifiedDate = usage.ModifiedDate;

            CouponCode  = usage.CouponCode;
            PromotionId = usage.PromotionId;
            ObjectId    = usage.ObjectId;
            ObjectType  = usage.ObjectType;
            UserId      = usage.UserId;
            UserName    = usage.UserName;

            return(this);
        }