private GrpcQuestionsBase GetGrpcQuestions(QuestionsBase <string> questions) { var grpcQuestionsBase = new GrpcQuestionsBase() { Key = questions.Key, Order = questions.Order, Value = questions.Value }; if (questions.QuestionBaseList != null) { grpcQuestionsBase.QuestionBaseList.AddRange(questions.QuestionBaseList.Select(q => GetGrpcQuestion(q))); } return(grpcQuestionsBase); }
private QuestionsBase <string> GetQuestions(GrpcQuestionsBase grpcQuestionsBase) { var questions = new QuestionsBase <string>() { Key = grpcQuestionsBase.Key, Order = grpcQuestionsBase.Order, Value = grpcQuestionsBase.Value }; if (grpcQuestionsBase.QuestionBaseList != null) { var questionsList = new List <QuestionBase <string> >(); questionsList.AddRange(grpcQuestionsBase.QuestionBaseList.Select(q => GetQuestion(q))); questions.QuestionBaseList = questionsList; } return(questions); }