/**********************************************************************************/ /// <summary> /// Convert crate to DTO /// </summary> /// <param name="crate"></param> /// <returns></returns> public CrateDTO ConvertToDto(Crate crate) { IManifestSerializer serializer = GetSerializer(crate.ManifestType); CrateDTO crateDto = new CrateDTO { Id = crate.Id, Label = crate.Label, ManifestId = crate.ManifestType.Id, ManifestType = crate.ManifestType.Type, Availability = crate.Availability, SourceActivityId = crate.SourceActivityId }; if (serializer != null) { crateDto.Contents = serializer.Serialize(crate.Get <object>()); } else { crateDto.Contents = crate.GetRaw(); } return(crateDto); }
public Crate(Crate crate) : base(crate.ManifestType, crate.Id, crate.Availability) { Label = crate.Label; KnownContent = crate.Get <T>(); }