/// <summary> /// Updates the story with new values /// </summary> /// <remarks>Uses reflection to iterate properties, so does carry some overhead in terms of performance</remarks> /// <param name="user">The user to get the ApiToken from</param> /// <returns>The updated story instance</returns> public PivotalStory UpdateStory(PivotalUser user) { PivotalStory updatedStory = PivotalStory.UpdateStory(user, ProjectId.GetValueOrDefault().ToString(), this); System.Reflection.PropertyInfo[] properties = this.GetType().GetProperties(); foreach (System.Reflection.PropertyInfo p in properties) { p.SetValue(this, p.GetValue(updatedStory, null), null); } return(this); }
/// <summary> /// Updates the cache of tasks for the story and returns the list /// </summary> /// <param name="user">The user to get the ApiToken from</param> /// <returns></returns> public IList <PivotalTask> LoadTasks(PivotalUser user) { Tasks = PivotalTask.FetchTasks(user, ProjectId.GetValueOrDefault(), Id.GetValueOrDefault(), ""); return(Tasks); }