コード例 #1
0
        private PartModel ConvertPart(IProductPartLink link)
        {
            // No link, no DTO!
            if (link is null || link.Product is null)
            {
                return(null);
            }

            var part = new PartModel
            {
                Id         = link.Id,
                Product    = ConvertProduct(link.Product, true),
                Properties = EntryConvert.EncodeObject(link, ProductSerialization)
            };

            return(part);
        }
コード例 #2
0
 private void UpdateReference(IProductPartLink value, PartModel part)
 {
     EntryConvert.UpdateInstance(value, part.Properties);
     value.Product = part.Product is null ? null : ProductManager.LoadType(part.Product.Id);
 }