GetKey() public method

Returns a unique (or as unique as the original object's IDs anyway) single key.
public GetKey ( ) : string
return string
Exemplo n.º 1
0
 /// <summary>
 /// Inserts a data object record using the "table" and a list of column/value pairs.
 /// </summary>
 /// <param name="transaction">The transaction to do this as part of.</param>
 /// <param name="mapping">The mapping of the table or other data container we're dealing with.</param>
 /// <param name="propValues">A dictionary of "column"/value pairs for the object to insert.</param>
 /// <returns>The number of records affected.</returns>
 public override int Insert(ITransaction transaction, ClassMapping mapping, IDictionary<string, object> propValues)
 {
     IDictionary<string, MemoryObject> table = GetTable(mapping);
     foreach (string colName in mapping.IdDataColsByObjAttrs.Values)
     {
         propValues[colName] = GetNextAutoGeneratedId(mapping, colName);
     }
     MemoryObject obj = new MemoryObject(mapping, propValues);
     lock (table)
     {
         table[obj.GetKey()] = obj;
     }
     return 1;
 }