Exemplo n.º 1
0
        private DigikalaProduct ConvertProductDTOToEntity(DigikalaProductDTO dto)
        {
            DigikalaProduct m = new DigikalaProduct();

            m.AvrageRate = dto.AvrageRate;
            m.Brand      = dto.Brand;
            m.Categories = dto.Categories;
            m.Category   = dto.Category;
            m.Colors     = dto.Colors;
            m.DKP        = dto.DKP;
            m.Features   = dto.Features == null ? null : dto.Features.Select(x => new ProductFeatures {
                Title = x.Title, Features = x.Features
            }).ToList();
            m.MaxRate                = dto.MaxRate;
            m.Price                  = dto.Price;
            m.RatingItems            = dto.RatingItems;
            m.Title                  = dto.Title;
            m.TitleEN                = dto.TitleEN;
            m.TotalParticipantsCount = dto.TotalParticipantsCount;
            m.Url        = dto.Url;
            m.Guaranteed = dto.Guaranteed;
            if (dto.Comments != null && dto.Comments.Count() > 0)
            {
                m.Comments = dto.Comments.Select(x => ConvertCommentDTOToEntity(x)).ToList();
            }
            return(m);
        }
 public void AddDigikalaProduct(DigikalaProduct dto)
 {
     digikalaProducts.Insert(dto);
 }