public static DraftLotDTO ToDTO(this DraftLot source) { return(source == null ? null : new DraftLotDTO(source) { TenderGuid = source.Tender.Guid, Items = source.Items .Select(m => m.ToDTO()) .ToList(), Features = source.Tender.Features .Where(m => m.FeatureType == FeatureType.Lot && m.RelatedItem == source.StringId) .Select(m => m.ToDTO()) .ToList(), Documents = source.Tender.Documents? .Where(m => m.DocumentOf == RelatedTo.Lot && m.RelatedId == source.StringId) .Select(x => x.ToDTO()) .ToList() }); }
public static Rest.Lot ToRest(this DraftLot source) { return(source == null ? null : new Rest.Lot(source).DropComplexProperties()); }