public override async Task <Molecule> MapToSnapshot(IndividualMolecule molecule) { var snapshot = await SnapshotFrom(molecule, x => { updateMoleculeSpecificPropertiesToSnapshot(x, molecule); x.Type = molecule.MoleculeType; }); snapshot.Expression = await expressionFor(molecule); snapshot.Ontogeny = await _ontogenyMapper.MapToSnapshot(molecule.Ontogeny); return(snapshot); }
public override async Task <SnapshotExpressionProfile> MapToSnapshot(ModelExpressionProfile expressionProfile) { var(molecule, individual) = expressionProfile; //We do not use the base method here as we want to save the name differently using the composite part of the name var snapshot = new SnapshotExpressionProfile { Type = molecule.MoleculeType, Species = individual.Species.Name, Category = expressionProfile.Category, Molecule = molecule.Name, Description = SnapshotValueFor(expressionProfile.Description), Ontogeny = await _ontogenyMapper.MapToSnapshot(molecule.Ontogeny), Expression = await expressionFor(molecule, individual), Parameters = await allParametersChangedByUserFrom(individual) }; updateMoleculeSpecificPropertiesToSnapshot(snapshot, molecule); return(snapshot); }