Example #1
0
        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);
        }
Example #2
0
        private List <MockModel> Create()
        {
            _model.Id = GenerateCounterId();
            var result = new List <MockModel>(_mockSet)
            {
                _model
            };

            Tdb.UpdateSet(result);
            return(result);
        }
Example #3
0
        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);
        }
Example #4
0
 private List <MockModel> Clear()
 {
     Tdb.UpdateSet(null);
     return(Tdb.MockSet);
 }