Ejemplo n.º 1
0
 /// <summary>
 /// Update the internal representation of the object with received information.
 /// </summary>
 /// <param name="key">The object identity.</param>
 /// <param name="data">The new data for the object.</param>
 public void UpdateData(ClientUtilities.MatchObjectModel.Key key, ClientUtilities.MatchObjectModel.Data data)
 {
     if (!_storage.ContainsKey(key))
     {
         throw new ArgumentOutOfRangeException("key");
     }
     _storage[key] = data;
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Create a new internal object.
        /// </summary>
        /// <param name="key">The object identity.</param>
        /// <param name="data">The data for the object.</param>
        public string CreateData(ClientUtilities.MatchObjectModel.Key key, ClientUtilities.MatchObjectModel.Data data)
        {
            if (_storage.ContainsKey(key))
            {
                UpdateData(key, data);
                return(key.Value);
            }
            key.Value     = NextId(key.EntityName).ToString();
            _storage[key] = data;

            return(key.Value);
        }