public override MyEntityResponse <bool> DeleteById(int id)
        {
            var myEntityResponse = GetById(id);

            //   db.Set<T>().Attach(myEntityResponse.Single);

            //  db.Entry(myEntityResponse.Single).State = EntityState.Deleted;
            //  db.SaveChanges();

            var em = GetQuery().First(e => e.Id == id);

            var l = GetQuery().ToList();

            l.Remove(em);
            MockDb.SetNewList <T>(l);


            return(new MyEntityResponse <bool>
            {
                Single = true
            });
        }
        public override MyEntityResponse <int> Save(T model)
        {
            var entities = GetQuery().ToList();

            T newEntity;

            if (model.Id == 0)
            {
                model.Id = new Random().Next();
                entities.Add(model);
                newEntity = model;
            }
            else
            {
                var entity = entities.FirstOrDefault(e => e.Id == model.Id);
                if (entity == null)
                {
                    throw new Exception("رکورد یافت نشد");
                }


                entities.Remove(entity);
                entities.Add(model);
                //db.Entry(entity).CurrentValues.SetValues(model);
            }

            MockDb.SetNewList <T>(entities);


            //  db.SaveChanges();
            //  db.Entry(model).State = EntityState.Detached;

            return(new MyEntityResponse <int>
            {
                Single = model.Id
            });
        }