public void Create(Project project) { var request = new ProjectCreateRequest(); ModelCopier.CopyModel(project, request); var createdProject = Create(request); project.Api = Api; ModelCopier.CopyModel(createdProject, project); }
public bool Update(ProjectStub project) { object a = "/projects/{0}.json".FormatWith(project.Id); var updatedProject = Api.Put <Project>(a, project); if (updatedProject != null) { ModelCopier.CopyModel(updatedProject, project); return(true); } return(false); }
public bool Update(ToDoListStub list) { var action = "/projects/{0}/todolists/{1}.json".FormatWith(list.ProjectId, list.Id); var content = Api.Put <ToDoList>(action, list); if (content != null) { content.ProjectId = list.ProjectId; ModelCopier.CopyModel(content, list); return(true); } return(false); }