コード例 #1
0
        public async Task <int> InsertCommunityPost(CommunityPostTable post)
        {
            var num = database.Insert(post);

            database.Commit();
            return(num);
        }
コード例 #2
0
        public async Task <bool> CheckIfExists(CommunityPostTable post)
        {
            await SyncAsync(true);

            var check = await azureSyncTable.Where(x => x.HostID == post.HostID).ToListAsync();

            return(check.Any());
        }
コード例 #3
0
        public async Task <int> InsertCommunityPost(CommunityPostTable post)
        {
            await SyncAsync(true); //opens

            await azureSyncTable.InsertAsync(post);

            await SyncAsync(); //closes

            return(1);
        }
コード例 #4
0
        protected override void Seed(CommunityPostTableContext context)
        {
            var post = new CommunityPostTable
            {
                HostID      = "1",
                Description = "postal",
                Image       = "  "
            };

            context.Set <CommunityPostTable>().Add(post);
            base.Seed(context);
        }
コード例 #5
0
        public async Task <bool> CheckIfExists(CommunityPostTable post)
        {
            var exist = database.Table <CommunityPostTable>().Any(x => x.Id == post.Id);

            return(exist);
        }