예제 #1
0
        public SaleOff ToModel(SaleOff saleOff = null)
        {
            if (saleOff == null)
            {
                saleOff    = new SaleOff();
                saleOff.Id = Guid.NewGuid();
            }

            saleOff.BeginDate = BeginDate;
            saleOff.EndDate   = EndDate;
            saleOff.Quantity  = Quantity;
            saleOff.ProductId = ProductId;

            return(saleOff);
        }
예제 #2
0
        public SaleOffDto(SaleOff saleOff, params object[] args)
        {
            Id        = saleOff.Id;
            BeginDate = saleOff.BeginDate;
            EndDate   = saleOff.EndDate;
            Quantity  = saleOff.Quantity;
            ProductId = saleOff.ProductId;

            foreach (var arg in args)
            {
                if (arg is Product product)
                {
                    ProductDto = new ProductDto(product);
                }
            }
        }