public static DraftTenderDTO ToDTO(this DraftTender source) { return(source == null ? null : new DraftTenderDTO(source) { Lots = source.Lots?.Select(x => x.ToDTO()).ToList(), Items = source.Items?.Select(x => x.ToDTO()).ToList(), Features = source.Features?.Where(m => m.FeatureType == FeatureType.Tender).Select(x => x.ToDTO()).ToList(), Documents = source.Documents?.Where(m => m.DocumentOf == RelatedTo.Tender).Select(x => x.ToDTO()).ToList(), ProcuringEntity = source.ProcuringEntity.ToDTO(), Contacts = source.ContactPointRefs.Select(m => m.ContactPoint.ToDTO()) }); }
public static Rest.Tender ToRest(this DraftTender source) { if (source == null) { return(null); } var tender = new Rest.Tender(source) { ProcuringEntity = source.ProcuringEntity.ToRest(), Lots = source.Lots?.Select(x => x.ToRest()).ToArray(), Items = source.Items?.Select(x => x.ToRest()).ToArray(), Features = source.Features?.Select(x => x.ToRest()).ToArray(), Documents = source.Documents?.Select(x => x.ToRest()).ToArray() }.DropComplexProperties(); return(tender); }