public static PostConditionViewModel FromModel(UseCasePostCondition model) { return(new PostConditionViewModel { Contents = model.Contents.Select(PostConditionContentViewModel.FromModel) }); }
private PostConditionData FromModel(UseCasePostCondition postCondition) { return(new PostConditionData { Contents = postCondition.Contents.Select(c => new PostConditionContentItem { Description = c.Description, Locale = c.Locale }) }); }
private void PersistPostCondition(UseCase useCaseEntity, PostConditionData postCondition) { var postConditionEntity = new UseCasePostCondition(); postConditionEntity.Id = Guid.NewGuid(); postConditionEntity.UseCase = useCaseEntity; foreach (var postConditionContent in postCondition.Contents) { var postConditionContentEntity = new UseCasePostConditionContent(); postConditionContentEntity.Locale = postConditionContent.Locale; postConditionContentEntity.Description = postConditionContent.Description; postConditionContentEntity.Id = Guid.NewGuid(); postConditionContentEntity.UseCasePostCondition = postConditionEntity; _postConditionContentRepository.Add(postConditionContentEntity); } _postConditionRepository.Add(postConditionEntity); }