public ConsumerHabPlanValuedOutcomeViewModel(ConsumerHabPlanValuedOutcome model) { CustomMapper.MapEntity(model, this); if (model.ConsumerHabPlanVOServeActions != null) { this.ServeActions = ConsumerHabPlanVOServeActionViewModel.GetList(model.ConsumerHabPlanVOServeActions.ToList()); } else { this.ServeActions = new List <ConsumerHabPlanVOServeActionViewModel>(); } }
public List <ConsumerHabPlanValuedOutcome> GetOutcomesModel() { List <ConsumerHabPlanValuedOutcome> result = new List <ConsumerHabPlanValuedOutcome>(); if (ValuedOutcomes == null) { return(result); } var fakeId = -1; foreach (var item in ValuedOutcomes) { item.Id = fakeId; foreach (var action in item.ServeActions) { action.Id = 0; action.ValuedOutcomeId = fakeId; } fakeId--; ConsumerHabPlanValuedOutcome model = CustomMapper.MapEntity <ConsumerHabPlanValuedOutcome>(item); result.Add(model); } return(result); }