//SubGroup public static SubGroup ToGRPCModel(this ISubGroup subGroup) { var model = new SubGroup() { Id = subGroup.Id, Name = subGroup.Name }; model.StudyCards.AddRange(subGroup.StudyCards.ToGRPCModels()); return(model); }
private ISubGroup GetSubGroupEntity(ISubGroup subGroup) { if (subGroup is SubGroup) { return(subGroup); } return(new SubGroup() { Id = subGroup.Id, Name = subGroup.Name, GroupId = subGroup.GroupId }); }
public static string GetKeyUse(this ISubGroup group) { if (group == null || group.KeyFields.All(f => f.InputData == null)) { return(null); } var inputDatas = group.KeyFields.Where(f => f.InputData != null).Select(f => f.InputData.GetFullPath()) .ToList(); var pathString = inputDatas .Aggregate((output, path) => string.IsNullOrEmpty(output) ? path : output + $", '|', {path}"); return(inputDatas.Count > 1 ? $"concat({pathString})" : pathString); }