public async Task <int> InsertCommunityPost(CommunityPostTable post) { var num = database.Insert(post); database.Commit(); return(num); }
public async Task <bool> CheckIfExists(CommunityPostTable post) { await SyncAsync(true); var check = await azureSyncTable.Where(x => x.HostID == post.HostID).ToListAsync(); return(check.Any()); }
public async Task <int> InsertCommunityPost(CommunityPostTable post) { await SyncAsync(true); //opens await azureSyncTable.InsertAsync(post); await SyncAsync(); //closes return(1); }
protected override void Seed(CommunityPostTableContext context) { var post = new CommunityPostTable { HostID = "1", Description = "postal", Image = " " }; context.Set <CommunityPostTable>().Add(post); base.Seed(context); }
public async Task <bool> CheckIfExists(CommunityPostTable post) { var exist = database.Table <CommunityPostTable>().Any(x => x.Id == post.Id); return(exist); }