/// <summary> /// Assigns the temporary profile image to user. /// </summary> /// <param name="imageId">The image id.</param> /// <param name="newFileId">The new file id.</param> /// <returns></returns> public bool AssignTemporaryProfileImageToUser(int imageId, out int newFileId) { newFileId = -1; try { using (IDataStoreContext dataStoreContext = this._DataStore.CreateContext()) { newFileId = dataStoreContext.cms_Files_AssignTemporaryProfileImageToUser(imageId); } } catch (Exception ex) { _Log.Error("Error at cms_Files_MoveTempFile", ex); throw new DataStoreException(ex, true); } if (newFileId <= 0) { _Log.ErrorFormat("Temporary file with id {0} was not moved to the files table (ErrorCode: {1}).", imageId, newFileId); return(false); } return(true); }