コード例 #1
0
ファイル: SessionHelper.cs プロジェクト: andfomin/runnymede
        public static async Task <string> SaveMessageAndGetExtId(string message)
        {
            string extId = null;

            // We cannot use a transaction in heterogeneous storage mediums. An orphaned message on Azure Table is not a problem. The main message metadata is in the database anyway.
            if (!String.IsNullOrWhiteSpace(message))
            {
                extId = KeyUtils.GetTwelveBase32Digits();
                var entity = new UserMessageEntity
                {
                    PartitionKey = extId,
                    RowKey       = String.Empty,
                    Text         = message,
                };
                await AzureStorageUtils.InsertEntityAsync(AzureStorageUtils.TableNames.UserMessages, entity);
            }
            return(extId);
        }