async Task AddTag(string name) { if (String.IsNullOrEmpty(name)) { return; } var tag = new AsanaTag() { name = name }; IsBusy = true; var response = await new AsanaRespository().CreateTag(WorkspaceId, tag); if (AsanaClient.ProcessResponse(response)) { response.Data.workspaceid = WorkspaceId; await new StorageService().Insert(response.Data); Tags.Add(response.Data); var selectedTags = SelectedTags; selectedTags.Add(response.Data); SelectedTags = selectedTags; } IsBusy = false; }
public async Task <AsanaResponse <AsanaTag> > UpdateTag(AsanaTag tagToUpdate) { return(await UseRequest <AsanaTag>( string.Format("tags/{0}", tagToUpdate.id), request => { request.AddObject(tagToUpdate); request.Method = Method.PUT; })); }
async Task DeleteTag(AsanaTag tag) { var links = await getDb().GetAsyncConnection().Table <AsanaTagTask>().Where(x => x.TagId == tag.id).ToListAsync(); foreach (var asanaTagTask in links) { await getDb().Delete(asanaTagTask); } await getDb().Delete(tag); }
public async Task <AsanaResponse <AsanaTag> > UpdateTag(AsanaTag tagToUpdate) { return(await UseRequest <AsanaTag>( string.Format("tags/{0}", tagToUpdate.id), (request, container) => { container.AddObject(tagToUpdate); request.Method = HttpMethod.Put; })); }
public async Task <AsanaResponse <AsanaTag> > CreateTag(long workspaceId, AsanaTag newTag) { return(await UseRequest <AsanaTag>( GetWorkspaceTagsUrl(workspaceId), request => { request.Method = Method.POST; var fields = new List <string>(); fields.Add("name"); request.AddObject(newTag, fields.ToArray()); })); }