/// <summary> /// Saves a domain object to the Data Relay infrastructure. /// </summary> /// <typeparam name="T">The domain type of the object to save, this type is inferred from the paramter passed in.</typeparam> /// <param name="key">The key of the object.</param> /// <param name="putObject">The object to save.</param> /// <returns>A <see cref="Future{T}"/> of the <see cref="RelayOutcome"/> of the save operation. Will have a Value if successful, an error otherwise.</returns> public Future <RelayOutcome> PutObject <T>(string key, T putObject) { byte[] extendedId = RelayMessage.GetStringBytes(key); int primaryId = GetIntFromBytes(extendedId); return(PutObject(primaryId, extendedId, putObject)); }
/// <summary> /// Gets a domain object from the Data Relay infrastructure. /// </summary> /// <typeparam name="T">The domain object type to get.</typeparam> /// <param name="key">The object key.</param> /// <returns>A <see cref="Future{T}"/> that will contain the object when it has been returned from Data Relay.</returns> public Future <CacheResult <T> > GetObject <T>(string key) { byte[] byteKey = RelayMessage.GetStringBytes(key); return(GetObject <T>(GetIntFromBytes(byteKey), byteKey)); }
/// <summary> /// Deletes a domain object in the Data Relay infrastructure. /// </summary> /// <typeparam name="T">The domain type of the object to delete, this type is inferred from the paramter passed in.</typeparam> /// <param name="key">The key.</param> /// <returns>A <see cref="Future{T}"/> of the <see cref="RelayOutcome"/> of the delete operation. Will have a Value if successful, an error otherwise.</returns> public Future <RelayOutcome> DeleteObject <T>(string key) { byte[] byteKey = RelayMessage.GetStringBytes(key); return(DeleteObject <T>(GetIntFromBytes(byteKey), byteKey)); }