private List <MockModel> Update() { var result = new List <MockModel>(); foreach (var mock in _mockSet) { if (mock.Id == _model.Id) { try { if ((_model.Scheme as dynamic).type != null) { } } catch (Exception) { (_model.Scheme as dynamic).type = (mock.Scheme as dynamic).type; } result.Add(_model); } else { result.Add(mock); } } Tdb.UpdateSet(result); return(result); }
private List <MockModel> Create() { _model.Id = GenerateCounterId(); var result = new List <MockModel>(_mockSet) { _model }; Tdb.UpdateSet(result); return(result); }
private List <MockModel> Delete(string id) { var result = new List <MockModel>(); foreach (var mock in _mockSet) { if (mock.Id == id) { continue; } result.Add(mock); } Tdb.UpdateSet(result); return(result); }
private List <MockModel> Clear() { Tdb.UpdateSet(null); return(Tdb.MockSet); }