Пример #1
0
        public bool Update(Dummy dummy)
        {
            if (dummy == null) { throw new ArgumentNullException("dummy"); }

            if(!_dummies.ContainsKey(dummy.Id))
                return false;

            _dummies[dummy.Id] = dummy;
            return true;
        }
Пример #2
0
        public Dummy Add(Dummy dummy)
        {
            if (dummy == null) { throw new ArgumentNullException("dummy"); }

            var guid = Guid.NewGuid();
            dummy.Id = guid;
            _dummies.Add(guid, dummy);

            return dummy;
        }