public static CommitmentFrequencyApiModel FromCommitmentFrequency(CommitmentFrequency commitmentFrequency) { var model = new CommitmentFrequencyApiModel(); model.CommitmentFrequencyId = commitmentFrequency.CommitmentFrequencyId; model.FrequencyId = commitmentFrequency.FrequencyId; model.Frequency = FrequencyApiModel.FromFrequency(commitmentFrequency.Frequency); return(model); }
public static CommitmentApiModel FromCommitment(Commitment commitment) { var model = new CommitmentApiModel(); model.CommitmentId = commitment.CommitmentId; model.BehaviourId = commitment.BehaviourId; model.ProfileId = commitment.ProfileId; model.CommitmentFrequencies = commitment.CommitmentFrequencies .Select(x => CommitmentFrequencyApiModel.FromCommitmentFrequency(x)).ToList(); return(model); }