public static testSapce spaceModel(this TestSpace _testSpace) { var md = new testSapce(); md.id = _testSpace.Id; md.steps = JsonConvert.DeserializeObject <List <spaceStep> >(_testSpace.SapceData); return(md); }
/// <summary> /// 将space对象转成可用的 step对象 /// </summary> public static List <step> toSteplList(this testSapce _testSpaceModel) { var str = new List <step>(); foreach (var s in _testSpaceModel.steps) { var m = new step(); m.name = s.name; m.spaceID = _testSpaceModel.id; m.describe = s.describe; m.attrs = s.attrs.ToDictionary(key => key.name, value => value.defValue); str.Add(m); } return(str); }