public async Task <ActivityItem> AddActivityAsync(ActivityItem item) { var resCount = await mConnection.InsertAsync(item); if (resCount == 0) { return(null); } return(await mConnection.Table <ActivityItem> () .Where(i => i.Name == item.Name) .FirstAsync()); }
public async Task <int> DeleteActivityAsync(ActivityItem item) { int resCount = await mConnection.DeleteAsync(item); if (resCount == 0) { return(0); } var detailItems = await mConnection.Table <ActivityDateItem> () .Where(d => d.ActivityId == item.Id) .ToListAsync(); foreach (var d in detailItems) { resCount += await mConnection.DeleteAsync(d); } return(resCount); }
public async Task <int> UpdateActivityAsync(ActivityItem item) { return(await mConnection.UpdateAsync(item)); }