示例#1
0
        private BasketData MapToBasketData(StudentBasketResponse studentBasketRequest)
        {
            if (studentBasketRequest == null)
            {
                return(null);
            }

            var map = new BasketData
            {
                StudentId = studentBasketRequest.Studentid
            };

            studentBasketRequest.Items.ToList().ForEach(item => map.Items.Add(new BasketDataItem
            {
                Id                  = item.Id,
                OldSlotAmount       = (decimal)item.Oldslotamount,
                PictureUrl          = item.Pictureurl,
                ScholarshipItemId   = item.Scholarshipitemid,
                ScholarshipItemName = item.ScholarshipItemname,
                Slots               = item.Slots,
                SlotAmount          = (decimal)item.Slotamount
            }));

            return(map);
        }
示例#2
0
        private StudentBasketResponse MapToStudentBasketResponse(StudentBasket studentBasket)
        {
            var response = new StudentBasketResponse
            {
                Studentid = studentBasket.StudentId
            };

            studentBasket.Items.ForEach(item => response.Items.Add(new BasketItemResponse
            {
                Id                  = item.Id,
                Oldslotamount       = (double)item.OldSlotAmount,
                Pictureurl          = item.PictureUrl,
                Scholarshipitemid   = item.ScholarshipItemId,
                ScholarshipItemname = item.ScholarshipItemName,
                Slots               = item.Slots,
                Slotamount          = (double)item.SlotAmount
            }));

            return(response);
        }