コード例 #1
0
ファイル: page2.xaml.cs プロジェクト: YasEissa/AI-Riddles
        public Page2(QA qa)
        {
            InitializeComponent();

            this.BindingContext = qa;
            this.qa             = qa;

            if (string.IsNullOrWhiteSpace(qa.PartitionKey))
            {
                ToolbarItems.RemoveAt(1);
                qa.PartitionKey = Guid.NewGuid().ToString();
            }
        }
コード例 #2
0
        public static async Task <bool> DeleteRiddle(QA qa)
        {
            try
            {
                await ConnectToTable();

                var operation = TableOperation.Delete(qa);
                var delete    = await songsTable.ExecuteAsync(operation);

                return(delete.HttpStatusCode == 204);
            }
            catch (Exception ex)
            {
            }

            return(false);
        }
コード例 #3
0
        public static async Task <bool> SaveRiddle(QA qa)
        {
            try
            {
                await ConnectToTable();

                var operation = TableOperation.Insert(qa);
                var upsert    = await songsTable.ExecuteAsync(operation);

                return(upsert.HttpStatusCode == 204);
            }
            catch (Exception ex)
            {
            }

            return(false);
        }