コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }