コード例 #1
0
        private async Task InitializeAsync(string content, DateTimeOffset createTime, bool isSuccessfulCommand, ulong authorId, CollectionReference playerCollection, string docId)
        {
            Content             = content;
            CreateTime          = createTime;
            IsSuccessfulCommand = isSuccessfulCommand;

            RecentMessagesColl = playerCollection.Document(authorId.ToString()).Collection("recent-messages");
            MessageDoc         = RecentMessagesColl.Document(docId);

            if (!(await MessageDoc.GetSnapshotAsync()).Exists)
            {
                await MessageDoc.CreateAsync(new Dictionary <string, object>()
                {
                    { "content", Content },
                    { "create-time", CreateTime },
                    { "is-successful-command", isSuccessfulCommand }
                });
            }
        }
コード例 #2
0
 public async Task DeleteAsync()
 {
     await MessageDoc.DeleteAsync();
 }