Example #1
0
 public void UpdatePoco(MyPoco poco)
 {
     if (_dictionary.ContainsKey(poco.Id))
         _dictionary[poco.Id] = poco;
     else
         _dictionary.Add(poco.Id, poco);
 }
Example #2
0
        public MyPoco CreatePoco(Guid id, string name)
        {
            if (name == null)
                throw new ArgumentNullException("name");

            if (_dictionary.ContainsKey(id))
                throw new InvalidOperationException("Duplicate value for id not allowed.");

            var result = new MyPoco() { Id = id, Name = name };
            _dictionary.Add(id, result);
            return result;
        }